home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
ool.zip
/
OOL
/
source
/
xnotebk.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1997-04-05
|
5KB
|
148 lines
#include "xnotebk.h"
#include "XBookPg.h"
/*@
@class XNoteBook
@parent XControl
@type overview
@symbol _
*/
/*@ XNoteBook :: XNoteBook(const XWindow * owner, const XRect * rec, const USHORT id, const ULONG style, char *font)
@group constructors/destructors
@remarks Create a notebook
@parameters <t '°' c=2>
°XWindow * owner °the owner-window
°XRect * rect °size and position
°USHORT id °ID of the window
°ULONG style °style of the notebook, valid values are:
<t '°' c=1>
°NB_BACKPAGESBR
°NB_BACKPAGESBL
°NB_BACKPAGESTR
°NB_BACKPAGESTL
°NB_MAJORTABRIGHT
°NB_MAJORTABLEFT
°NB_MAJORTABTOP
°NB_MAJORTABBOTTOM
°NB_SQUARETABS
°NB_ROUNDEDTABS
°NB_POLYGONTABS
°NB_SOLIDBIND
°NB_SPIRALBIND
°NB_STATUSTEXTLEFT
°NB_STATUSTEXTRIGHT
°NB_STATUSTEXTCENTER
°NB_TABTEXTLEFT
°NB_TABTEXTRIGHT
°NB_TABTEXTCENTER
°NB_TABBEDDIALOG (Warp4 only)
</t>
(can be or-ed, default is NB_SOLIDBIND|NB_BACKPAGESBR|NB_SQUARETABS|NB_TABTEXTCENTER|NB_STATUSTEXTLEFT)
°char * font °font to use, eg "8.Helv" (default is NULL)
</t>
*/
XNoteBook :: XNoteBook(const XWindow * owner, const XRect * rec, const USHORT id, const ULONG style, char *font):XControl(rec, style, owner, "", WC_NOTEBOOK, id, font)
{
color = XColor(COL_WHITE).GetColor();
}
/*@ XNoteBook::SetMajorTabSize(const SHORT width, const SHORT height)
@group size
@remarks Set the size of major tabs.
@parameters SHORT width<BR>
SHORT hight
*/
void XNoteBook::SetMajorTabSize(const SHORT width, const SHORT height) const
{
WinSendMsg(winhandle, BKM_SETDIMENSIONS, MPFROM2SHORT(width, height), (MPARAM) BKA_MAJORTAB);
}
/*@ XNoteBook::SetMinorTabSize(const SHORT width, const SHORT height)
@group size
@remarks Set the size of minor tabs.
@parameters SHORT width<BR>
SHORT hight
*/
void XNoteBook::SetMinorTabSize(const SHORT width, const SHORT height) const
{
WinSendMsg(winhandle, BKM_SETDIMENSIONS, MPFROM2SHORT(width, height), (MPARAM) BKA_MINORTAB);
}
/*@ XNoteBook::SetBackgroundColor(const XColor * col)
@group colors
@remarks Set the background color.
@parameters XColor * color the new color
*/
void XNoteBook::SetBackgroundColor(const XColor * col)
{
color = col->GetColor();
WinSendMsg(winhandle, BKM_SETNOTEBOOKCOLORS, MPFROMLONG(col->GetColor()), MPFROMLONG(BKA_BACKGROUNDPAGECOLOR));
}
/*@ XNoteBook::SetMajorBackgroundColor(const XColor * col)
@group colors
@remarks Set the background color of major tabs.
@parameters XColor * theColor
*/
void XNoteBook::SetMajorBackgroundColor(const XColor * col) const
{
WinSendMsg(winhandle, BKM_SETNOTEBOOKCOLORS, MPFROMLONG(col->GetColor()), MPFROMLONG(BKA_BACKGROUNDMAJORCOLOR));
}
/*@ XNoteBook::SetMajorForegroundColor(const XColor * col)
@group colors
@remarks Set the foreground color of major tabs.
@parameters XColor * theColor
*/
void XNoteBook::SetMajorForegroundColor(const XColor * col) const
{
WinSendMsg(winhandle, BKM_SETNOTEBOOKCOLORS, MPFROMLONG(col->GetColor()), MPFROMLONG(BKA_FOREGROUNDMAJORCOLOR));
}
/*@ XNoteBook::SetMinorBackgroundColor(const XColor * col)
@group colors
@remarks Set the backgroundcolor of minor tabs.
@parameters XColor * theColor
*/
void XNoteBook::SetMinorBackgroundColor(const XColor * col) const
{
WinSendMsg(winhandle, BKM_SETNOTEBOOKCOLORS, MPFROMLONG(col->GetColor()), MPFROMLONG(BKA_BACKGROUNDMINORCOLOR));
}
/*@ XNoteBook::SetMinorForegroundColor(const XColor * col)
@group colors
@remarks Set the foreground color of minor tabs.
@parameters XColor * theColor
*/
void XNoteBook::SetMinorForegroundColor(const XColor * col) const
{
WinSendMsg(winhandle, BKM_SETNOTEBOOKCOLORS, MPFROMLONG(col->GetColor()), MPFROMLONG(BKA_FOREGROUNDMINORCOLOR));
}
/*@ XNoteBook::GetBackgroundColor(XColor*)
@group colors
@remarks Returns the background color.
@parameters XColor * buffer buffer to hold the data
*/
/*@ XNoteBook::GetPageCount(void)
@group misc
@remarks Returns the count of pages.
@returns SHORT numberOfPages
*/
SHORT XNoteBook::GetPageCount(void) const
{
return SHORT1FROMMR(WinSendMsg(winhandle, BKM_QUERYPAGECOUNT, (MPARAM) 0, (MPARAM) BKA_END));
}