home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool.zip / OOL / source / xnotebk.cpp < prev    next >
C/C++ Source or Header  |  1997-04-05  |  5KB  |  148 lines

  1. #include "xnotebk.h"
  2. #include "XBookPg.h"
  3.  
  4. /*@ 
  5. @class XNoteBook
  6. @parent XControl
  7. @type overview
  8. @symbol _
  9. */
  10.  
  11. /*@ XNoteBook :: XNoteBook(const XWindow * owner, const XRect * rec, const USHORT id, const ULONG style, char *font)
  12. @group constructors/destructors
  13. @remarks Create a notebook
  14. @parameters <t '°' c=2>
  15.                 °XWindow * owner   °the owner-window
  16.             °XRect * rect      °size and position
  17.             °USHORT id         °ID of the window
  18.             °ULONG style       °style of the notebook, valid values are:
  19.                                         <t '°' c=1>
  20.                                  °NB_BACKPAGESBR
  21.                                  °NB_BACKPAGESBL
  22.                                  °NB_BACKPAGESTR
  23.                                  °NB_BACKPAGESTL
  24.                                  °NB_MAJORTABRIGHT
  25.                                  °NB_MAJORTABLEFT
  26.                                  °NB_MAJORTABTOP
  27.                                  °NB_MAJORTABBOTTOM
  28.                                  °NB_SQUARETABS
  29.                                  °NB_ROUNDEDTABS
  30.                                  °NB_POLYGONTABS
  31.                                  °NB_SOLIDBIND
  32.                                  °NB_SPIRALBIND
  33.                                  °NB_STATUSTEXTLEFT
  34.                                  °NB_STATUSTEXTRIGHT
  35.                                  °NB_STATUSTEXTCENTER
  36.                                  °NB_TABTEXTLEFT
  37.                                  °NB_TABTEXTRIGHT
  38.                                  °NB_TABTEXTCENTER
  39.                                             °NB_TABBEDDIALOG    (Warp4 only)
  40.                                         </t>
  41.                               (can be or-ed, default is NB_SOLIDBIND|NB_BACKPAGESBR|NB_SQUARETABS|NB_TABTEXTCENTER|NB_STATUSTEXTLEFT)
  42.             °char * font            °font to use, eg "8.Helv" (default is NULL)
  43.                 </t>
  44. */
  45. XNoteBook :: XNoteBook(const XWindow * owner, const XRect * rec, const USHORT id, const ULONG style, char *font):XControl(rec, style, owner, "", WC_NOTEBOOK, id, font)
  46. {
  47.     color = XColor(COL_WHITE).GetColor();
  48. }
  49.  
  50.  
  51. /*@ XNoteBook::SetMajorTabSize(const SHORT width, const SHORT height)
  52. @group size
  53. @remarks Set the size of major tabs.
  54. @parameters SHORT width<BR>
  55.             SHORT hight
  56. */
  57. void XNoteBook::SetMajorTabSize(const SHORT width, const SHORT height) const
  58. {
  59.     WinSendMsg(winhandle, BKM_SETDIMENSIONS, MPFROM2SHORT(width, height), (MPARAM) BKA_MAJORTAB);
  60. }
  61.  
  62.  
  63. /*@ XNoteBook::SetMinorTabSize(const SHORT width, const SHORT height)
  64. @group size
  65. @remarks Set the size of minor tabs.
  66. @parameters SHORT width<BR>
  67.             SHORT hight
  68. */
  69. void XNoteBook::SetMinorTabSize(const SHORT width, const SHORT height) const
  70. {
  71.     WinSendMsg(winhandle, BKM_SETDIMENSIONS, MPFROM2SHORT(width, height), (MPARAM) BKA_MINORTAB);
  72. }
  73.  
  74.  
  75. /*@ XNoteBook::SetBackgroundColor(const XColor * col)
  76. @group colors
  77. @remarks Set the background color.
  78. @parameters XColor * color    the new color
  79. */
  80. void XNoteBook::SetBackgroundColor(const XColor * col)
  81. {
  82.     color = col->GetColor();
  83.     WinSendMsg(winhandle, BKM_SETNOTEBOOKCOLORS, MPFROMLONG(col->GetColor()), MPFROMLONG(BKA_BACKGROUNDPAGECOLOR));
  84. }
  85.  
  86.  
  87. /*@ XNoteBook::SetMajorBackgroundColor(const XColor * col)
  88. @group colors
  89. @remarks Set the background color of major tabs.
  90. @parameters XColor * theColor
  91. */
  92. void XNoteBook::SetMajorBackgroundColor(const XColor * col) const
  93. {
  94.     WinSendMsg(winhandle, BKM_SETNOTEBOOKCOLORS, MPFROMLONG(col->GetColor()), MPFROMLONG(BKA_BACKGROUNDMAJORCOLOR));
  95. }
  96.  
  97.  
  98. /*@ XNoteBook::SetMajorForegroundColor(const XColor * col)
  99. @group colors
  100. @remarks Set the foreground color of major tabs.
  101. @parameters XColor * theColor
  102. */
  103. void XNoteBook::SetMajorForegroundColor(const XColor * col) const
  104. {
  105.     WinSendMsg(winhandle, BKM_SETNOTEBOOKCOLORS, MPFROMLONG(col->GetColor()), MPFROMLONG(BKA_FOREGROUNDMAJORCOLOR));
  106. }
  107.  
  108.  
  109. /*@ XNoteBook::SetMinorBackgroundColor(const XColor * col)
  110. @group colors
  111. @remarks Set the backgroundcolor of minor tabs.
  112. @parameters XColor * theColor
  113. */
  114. void XNoteBook::SetMinorBackgroundColor(const XColor * col) const
  115. {
  116.     WinSendMsg(winhandle, BKM_SETNOTEBOOKCOLORS, MPFROMLONG(col->GetColor()), MPFROMLONG(BKA_BACKGROUNDMINORCOLOR));
  117. }
  118.  
  119.  
  120. /*@ XNoteBook::SetMinorForegroundColor(const XColor * col)
  121. @group colors
  122. @remarks Set the foreground color of minor tabs.
  123. @parameters XColor * theColor
  124. */
  125. void XNoteBook::SetMinorForegroundColor(const XColor * col) const
  126. {
  127.     WinSendMsg(winhandle, BKM_SETNOTEBOOKCOLORS, MPFROMLONG(col->GetColor()), MPFROMLONG(BKA_FOREGROUNDMINORCOLOR));
  128. }
  129.  
  130.  
  131. /*@ XNoteBook::GetBackgroundColor(XColor*)
  132. @group colors
  133. @remarks Returns the background color.
  134. @parameters XColor * buffer   buffer to hold the data
  135. */
  136.  
  137.  
  138. /*@ XNoteBook::GetPageCount(void)
  139. @group misc
  140. @remarks Returns the count of pages.
  141. @returns SHORT numberOfPages
  142. */
  143. SHORT XNoteBook::GetPageCount(void) const
  144. {
  145.     return SHORT1FROMMR(WinSendMsg(winhandle, BKM_QUERYPAGECOUNT, (MPARAM) 0, (MPARAM) BKA_END));
  146. }
  147.  
  148.