| 1 | /*
|
|---|
| 2 | ** Module :CELL.H
|
|---|
| 3 | ** Abstract :Cell Toolkit header file
|
|---|
| 4 | **
|
|---|
| 5 | ** Copyright (C) Sergey I. Yevtushenko
|
|---|
| 6 | ** Log: Sun 08/02/98 Created
|
|---|
| 7 | ** Wed 25/10/2000 Updated to version 0.7b
|
|---|
| 8 | */
|
|---|
| 9 |
|
|---|
| 10 | #ifndef __CELL_H
|
|---|
| 11 | #define __CELL_H
|
|---|
| 12 |
|
|---|
| 13 | #define INCL_WINWORKPLACE
|
|---|
| 14 |
|
|---|
| 15 | #include "os2.h"
|
|---|
| 16 | #include "cwobject.ih"
|
|---|
| 17 |
|
|---|
| 18 | #ifndef BKS_TABBEDDIALOG
|
|---|
| 19 | #define BKS_TABBEDDIALOG 0x00000800 /* Tabbed dialog */
|
|---|
| 20 | #endif
|
|---|
| 21 |
|
|---|
| 22 | #ifndef MLE_INDEX
|
|---|
| 23 | #define MLE_INDEX 0
|
|---|
| 24 | #define MLE_RGB 1
|
|---|
| 25 | #endif
|
|---|
| 26 |
|
|---|
| 27 | /* Constants */
|
|---|
| 28 |
|
|---|
| 29 | #define TK_VERSION "0.7b" /* Toolkit version */
|
|---|
| 30 | #define CELL_WINDOW 0x0000 /* Cell is window */
|
|---|
| 31 | #define CELL_VSPLIT 0x0001 /* Cell is vertically splitted view */
|
|---|
| 32 | #define CELL_HSPLIT 0x0002 /* Cell is horizontally splitted view */
|
|---|
| 33 | #define CELL_SPLITBAR 0x0004 /* Call has a splitbar */
|
|---|
| 34 | #define CELL_FIXED 0x0008 /* Views can't be sized */
|
|---|
| 35 | #define CELL_SIZE1 0x0010 /* */
|
|---|
| 36 | #define CELL_SIZE2 0x0020
|
|---|
| 37 | #define CELL_HIDE_1 0x0040 /* Cell 1 is hidden */
|
|---|
| 38 | #define CELL_HIDE_2 0x0080 /* Cell 2 is hidden */
|
|---|
| 39 | #define CELL_HIDE 0x00C0 /* Cell 1 or cell 2 is hidden */
|
|---|
| 40 | #define CELL_SPLIT_MASK 0x003F
|
|---|
| 41 | #define CELL_SWAP 0x1000 /* Cells are swapped */
|
|---|
| 42 | #define CELL_SPLIT10x90 0x0100 /* Sizes of panels related as 10% and 90% */
|
|---|
| 43 | #define CELL_SPLIT20x80 0x0200 /* Sizes of panels related as 20% and 80% */
|
|---|
| 44 | #define CELL_SPLIT30x70 0x0300 /* Sizes of panels related as 30% and 70% */
|
|---|
| 45 | #define CELL_SPLIT40x60 0x0400 /* Sizes of panels related as 40% and 60% */
|
|---|
| 46 | #define CELL_SPLIT50x50 0x0500 /* Sizes of panels related as 50% and 50% */
|
|---|
| 47 | #define CELL_SPLIT60x40 0x0600 /* Sizes of panels related as 60% and 40% */
|
|---|
| 48 | #define CELL_SPLIT70x30 0x0700 /* Sizes of panels related as 70% and 30% */
|
|---|
| 49 | #define CELL_SPLIT80x20 0x0800 /* Sizes of panels related as 80% and 20% */
|
|---|
| 50 | #define CELL_SPLIT90x10 0x0900 /* Sizes of panels related as 90% and 10% */
|
|---|
| 51 | #define CELL_SPLIT_REL 0x0F00
|
|---|
| 52 |
|
|---|
| 53 | #define TB_BUBBLE 0x0001 /* Toolbar has bubble help */
|
|---|
| 54 | #define TB_VERTICAL 0x0002 /* Default toolbar view is vertical */
|
|---|
| 55 | #define TB_FLOATING 0x0004 /* Toolbar not attached */
|
|---|
| 56 | #define TB_ATTACHED_LT 0x0010 /* Toolbar attached to left side */
|
|---|
| 57 | #define TB_ATTACHED_TP 0x0020 /* Toolbar attached to right side */
|
|---|
| 58 | #define TB_ATTACHED_RT 0x0040 /* Toolbar attached to top side */
|
|---|
| 59 | #define TB_ATTACHED_BT 0x0080 /* Toolbar attached to bottom */
|
|---|
| 60 | #define TB_ALLOWED 0x00FF /* */
|
|---|
| 61 |
|
|---|
| 62 | #define TB_SEPARATOR 0x7001 /* Separator Item ID */
|
|---|
| 63 | #define TB_BUBBLEID 0x7002 /* Bubble help window ID */
|
|---|
| 64 |
|
|---|
| 65 | /* Limits */
|
|---|
| 66 |
|
|---|
| 67 | #define SPLITBAR_WIDTH 2 /* wodth of split bar between cells */
|
|---|
| 68 | #define HAND_SIZE 8 /* toolbar drag 'hand' */
|
|---|
| 69 | #define TB_SEP_SIZE 7 /* width of toolbar separator item */
|
|---|
| 70 | #define TB_BUBBLE_SIZE 32 /* bubble help item size */
|
|---|
| 71 | #define CELL_TOP_LIMIT 98 /* maximal space occupied by one cell (%%) */
|
|---|
| 72 | #define CELL_BOTTOM_LIMIT 2 /* minimal space occupied by one cell (%%) */
|
|---|
| 73 |
|
|---|
| 74 | /* Window classes */
|
|---|
| 75 |
|
|---|
| 76 | typedef struct stCellDef
|
|---|
| 77 | {
|
|---|
| 78 | LONG lType; //Cell type flags
|
|---|
| 79 | PSZ pszClass; //if flag CELL_WINDOW is set, this is a Window Class
|
|---|
| 80 | PSZ pszName; // Caption
|
|---|
| 81 | ULONG ulStyle; //if flag CELL_WINDOW is not set, this a Frame creation flags
|
|---|
| 82 | ULONG ulID; // Cell window ID
|
|---|
| 83 | struct stCellDef* pPanel1;
|
|---|
| 84 | struct stCellDef* pPanel2;
|
|---|
| 85 | PFNWP pClassProc;
|
|---|
| 86 | PFNWP pClientClassProc;
|
|---|
| 87 | LONG lSize; //Meaningful only if both CELL_SIZE(1|2) and CELL_FIXED is set
|
|---|
| 88 | } CellDef;
|
|---|
| 89 |
|
|---|
| 90 | typedef struct
|
|---|
| 91 | {
|
|---|
| 92 | LONG lType; // Toolbar flags
|
|---|
| 93 | ULONG ulID; // Toolbar window ID
|
|---|
| 94 | ULONG *tbItems;
|
|---|
| 95 | } TbDef;
|
|---|
| 96 |
|
|---|
| 97 | /*
|
|---|
| 98 | ** Internal cell data, used by ordinary windows.
|
|---|
| 99 | ** May be useful for user-defined windows
|
|---|
| 100 | */
|
|---|
| 101 |
|
|---|
| 102 | typedef struct
|
|---|
| 103 | {
|
|---|
| 104 | PFNWP pOldProc;
|
|---|
| 105 | HWND hwndFolder;
|
|---|
| 106 | WPObject* wpObject;
|
|---|
| 107 | } WindowCellCtlData;
|
|---|
| 108 |
|
|---|
| 109 | /* Prototypes */
|
|---|
| 110 |
|
|---|
| 111 | void ToolkitInit(HAB hab);
|
|---|
| 112 |
|
|---|
| 113 | HWND CreateCell(CellDef* pCell, HWND hWndParent, HWND hWndOwner);
|
|---|
| 114 | HWND createCellForFolder(CellDef* pCell, HWND hWndParent, HWND hWndOwner, HWND hwndFolder, WPObject * wpObject);
|
|---|
| 115 | HWND CellWindowFromID(HWND hwndCell, ULONG ulID);
|
|---|
| 116 | HWND CellParentWindowFromID(HWND hwndCell, ULONG ulID);
|
|---|
| 117 | void CreateToolbar(HWND hwndCell, TbDef* pTb);
|
|---|
| 118 | void GenResIDStr(CHAR *buff, ULONG ulID);
|
|---|
| 119 |
|
|---|
| 120 | /* Some useful additions */
|
|---|
| 121 |
|
|---|
| 122 | LONG GetSplit(HWND, LONG lID);
|
|---|
| 123 | LONG SetSplit(HWND, LONG lID, LONG lProp);
|
|---|
| 124 | void SetSplitType(HWND, LONG lID, LONG lType);
|
|---|
| 125 | LONG GetSplitType(HWND, LONG lID);
|
|---|
| 126 | void ShowCell(HWND hwnd, LONG lID, BOOL bAction);
|
|---|
| 127 |
|
|---|
| 128 | #endif /* __CELL_H */
|
|---|
| 129 |
|
|---|