home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / taman002.zip / TASKMANA.ZIP / src / kNotebookBase.h < prev    next >
C/C++ Source or Header  |  2000-04-29  |  3KB  |  78 lines

  1. /* $Id: kNotebookBase.h,v 1.1 2000/04/29 19:06:35 stknut Exp $
  2.  *
  3.  * kNotebook (kClassLib) - kNotebook declarations and definitions.
  4.  *
  5.  * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
  6.  *
  7.  */
  8.  
  9. #ifndef _kNotebookBase_h_
  10. #define _kNotebookBase_h_
  11.  
  12. #ifndef _kNotebookPageBase_h_
  13. class kNotebookPageBase;
  14. #endif
  15.  
  16.  
  17. /**
  18.  * Notebook base class. Inherits from kDlgBase.
  19.  * The implementation is restricted to only one notebook in a dialog.
  20.  * This shouldn't normally cause any problems...
  21.  * @author      knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
  22.  */
  23. class kNotebookBase : public kDlgBase
  24. {
  25. protected:
  26.     /**@cat Data */
  27.     HWND        hwndNtbk;
  28.     USHORT      idNotebook;             /* Id of the Notebook control. */
  29.     unsigned    cPages;                 /* Count of pages in the page table. */
  30.     struct _PageEntry
  31.     {
  32.         ULONG  ulPageId;                /* PageId. */
  33.         HWND   hwnd;                    /* Hwnd of the page. */
  34.         kNotebookPageBase *pPage;       /* Pointer to notebook page object */
  35.     } *paPages;                         /* Pointer to the page table. (malloced!) */
  36.  
  37.     SHORT       cyTitleBar;             /* Size of title. */
  38.     POINTL      ptlBorder;              /* Size of border. */
  39.  
  40.  
  41.     /**@cat Misc Operations */
  42.     kNotebookPageBase * queryPageFromId(ULONG ulPageId);
  43.     kNotebookPageBase * queryPageFromHwnd(HWND hwndPage);
  44.  
  45.     /**@cat overloaded methods */
  46.     virtual ULONG control(USHORT id, USHORT usNotifyCode, ULONG ulControlSpec); //WM_CONTROL
  47.     virtual VOID  size(SHORT cxOld, SHORT cyOld, SHORT cxNew, SHORT cyNew); //WM_SIZE
  48.     virtual BOOL  adjustWindowPos(PSWP pswp); //WM_ADJUSTWINDOWPOS
  49.  
  50.     /**@cat virtual methods */
  51.     virtual VOID  ntbkHelp(ULONG ulPageId);
  52.     virtual VOID  ntbkNewPageSize();
  53.     virtual VOID  ntbkPageDeleted(PDELETENOTIFY pDeleteNotify);
  54.     virtual VOID  ntbkPageSelected(PPAGESELECTNOTIFY pPageSelectNotify);
  55.     virtual VOID  ntbkPageSelectedPending(PPAGESELECTNOTIFY pPageSelectNotify);
  56.  
  57.  
  58. public:
  59.     kNotebookBase(ULONG ulResId, HMODULE hmodRes, ULONG idNotebook,
  60.                   HWND hwndOwner, HWND hwndParent = HWND_DESKTOP) throw (kError);
  61.     kNotebookBase(PCSZ pszTitle, ULONG id, ULONG flDialogStyle, ULONG flDialogCreate,
  62.                   LONG x, LONG y, LONG cx, LONG cy,
  63.                   ULONG flNotebookStyle, HWND hwndOwner, HWND hwndParent = HWND_DESKTOP) throw (kError);
  64.     ~kNotebookBase();
  65.  
  66.     /**@cat operations */
  67.     BOOL    insertPage(kNotebookPageBase *pNtbkPage,
  68.                        USHORT usPageStyle,
  69.                        USHORT usPageOrder,
  70.                        ULONG  ulPageId = 0UL);
  71.     BOOL    queryPageRectangle(PRECTL pRectl, BOOL fPage);
  72.     BOOL    setTabText(ULONG ulPageId, PSZ pszTabText);
  73.  
  74. };
  75.  
  76.  
  77. #endif
  78.