home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cell06d.zip / libcell / cell.h < prev   
C/C++ Source or Header  |  1999-02-05  |  4KB  |  112 lines

  1. /*
  2. ** Module   :CELL.H
  3. ** Abstract :Cell Toolkit constants, data types, function prototypes, etc.
  4. **
  5. ** Copyright (C) Sergey I. Yevtushenko
  6. ** Log: Sun  08/02/98   Created
  7. **
  8. */
  9. #ifndef __CELL_H
  10. #define __CELL_H
  11.  
  12.  
  13. /* Constants */
  14.  
  15. #define TK_VERSION      "0.6d"  /* Toolkit version */
  16. #define CELL_WINDOW     0x000   /* Cell is window */
  17. #define CELL_VSPLIT     0x001   /* Cell is vertically splitted view */
  18. #define CELL_HSPLIT     0x002   /* Cell is horizontally splitted view */
  19. #define CELL_SPLITBAR   0x004   /* Call has a splitbar */
  20. #define CELL_FIXED      0x008   /* Views can't be sized */
  21. #define CELL_SIZE1      0x010   /* */
  22. #define CELL_SIZE2      0x020
  23. #define CELL_HIDE_1     0x040   /* Cell 1 is hidden */
  24. #define CELL_HIDE_2     0x080   /* Cell 2 is hidden */
  25. #define CELL_HIDE       0x0C0   /* Cell 1 or cell 2 is hidden */
  26. #define CELL_SPLIT_MASK 0x03F
  27. #define CELL_SPLIT10x90 0x100   /* Sizes of panels related as 10% and 90% */
  28. #define CELL_SPLIT20x80 0x200   /* Sizes of panels related as 20% and 80% */
  29. #define CELL_SPLIT30x70 0x300   /* Sizes of panels related as 30% and 70% */
  30. #define CELL_SPLIT40x60 0x400   /* Sizes of panels related as 40% and 60% */
  31. #define CELL_SPLIT50x50 0x500   /* Sizes of panels related as 50% and 50% */
  32. #define CELL_SPLIT60x40 0x600   /* Sizes of panels related as 60% and 40% */
  33. #define CELL_SPLIT70x30 0x700   /* Sizes of panels related as 70% and 30% */
  34. #define CELL_SPLIT80x20 0x800   /* Sizes of panels related as 80% and 20% */
  35. #define CELL_SPLIT90x10 0x900   /* Sizes of panels related as 90% and 10% */
  36. #define CELL_SPLIT_REL  0xF00
  37.  
  38. #define TB_BUBBLE       0x0001  /* Toolbar has bubble help */
  39. #define TB_VERTICAL     0x0002  /* Default toolbar view is vertical */
  40. #define TB_FLOATING     0x0004  /* Toolbar not attached */
  41. #define TB_ATTACHED_LT  0x0010  /* Toolbar attached to left side  */
  42. #define TB_ATTACHED_TP  0x0020  /* Toolbar attached to right side */
  43. #define TB_ATTACHED_RT  0x0040  /* Toolbar attached to top side   */
  44. #define TB_ATTACHED_BT  0x0080  /* Toolbar attached to bottom     */
  45. #define TB_ALLOWED      0x00FF  /* */
  46.  
  47. #define TB_SEPARATOR    0x7001  /* Separator Item ID */
  48. #define TB_BUBBLEID     0x7002  /* Separator Item ID */
  49.  
  50. /* Limits */
  51.  
  52. #define SPLITBAR_WIDTH       3
  53. #define HAND_SIZE            8
  54. #define TB_SEP_SIZE          7
  55. #define TB_BUBBLE_SIZE      32
  56. #define CELL_TOP_LIMIT      98
  57. #define CELL_BOTTOM_LIMIT    2
  58.  
  59. /* Window classes */
  60.  
  61. typedef struct stCellDef
  62. {
  63.     LONG lType;    //Cell type flags
  64.     PSZ  pszClass; //if flag CELL_WINDOW is set, this is a Window Class
  65.     PSZ  pszName;  // Caption
  66.     ULONG ulStyle; //if flag CELL_WINDOW is not set, this a Frame creation flags
  67.     ULONG ulID;    // Cell window ID
  68.     struct stCellDef* pPanel1;
  69.     struct stCellDef* pPanel2;
  70.     PFNWP pClassProc;
  71.     PFNWP pClientClassProc;
  72.     LONG  lSize; //Meaningful only if both CELL_SIZE(1|2) and CELL_FIXED is set
  73. } CellDef;
  74.  
  75. typedef struct
  76. {
  77.     LONG  lType;   // Toolbar flags
  78.     ULONG ulID;    // Toolbar window ID
  79.     ULONG *tbItems;
  80. } TbDef;
  81.  
  82. /*
  83. ** Internal cell data, used by ordinary windows.
  84. ** May be useful for user-defined windows
  85. */
  86.  
  87. typedef struct
  88. {
  89.     PFNWP pOldProc;
  90. } WindowCellCtlData;
  91.  
  92. /* Prototypes */
  93.  
  94. void ToolkitInit(HAB hab);
  95.  
  96. HWND CreateCell(CellDef* pCell, HWND hWndParent, HWND hWndOwner);
  97. HWND CellWindowFromID(HWND hwndCell, ULONG ulID);
  98. HWND CellParentWindowFromID(HWND hwndCell, ULONG ulID);
  99. void CreateToolbar(HWND hwndCell, TbDef* pTb);
  100. void GenResIDStr(CHAR *buff, ULONG ulID);
  101.  
  102. /* Some useful additions */
  103.  
  104. LONG GetSplit(HWND, LONG lID);
  105. LONG SetSplit(HWND, LONG lID, LONG lProp);
  106. void SetSplitType(HWND, LONG lID, LONG lType);
  107. LONG GetSplitType(HWND, LONG lID);
  108. void ShowCell(HWND hwnd, LONG lID, BOOL bAction);
  109.  
  110. #endif  /* __CELL_H */
  111.  
  112.