2 ******************************************************************
3 ******************************************************************
5 ****** (C) 1988-2010 Tecplot, Inc. *******
7 ******************************************************************
8 ******************************************************************
13 #if defined TECPLOTKERNEL
17 typedef ULONG_PTR Widget
;
18 #define NULLWIDGET ((unsigned long)0)
20 extern BOOL MSWinIsLargeFont
;
21 extern CWnd
*(TPClassArray
[TPNUMCLASSES
]);
27 CRect MinRect
; // Only used for resizable dialogs
28 BOOL MinRectSet
; // Only used for resizable dialogs
31 extern TPDialogRect_s TPDialogRect
[TPNUMCLASSES
];
33 #define WindowIsResizable(wnd) ((wnd)->GetStyle() & WS_THICKFRAME)
36 * NOTE: C = class number in TPClassArray (see C__BASE.h)
39 * O = offset within container
40 * 0 means the container itself
41 * any other number is the offset within control (starting at 1)
42 * I = control number/id
44 * for bitmap button groups, this is the container id
45 * for all other controls, this is the control id
46 * WidgetValue 0 is the NULL widget.
49 //#define MAKEWIDGET(C,I,O) ((Widget)((((C)&0xFFFF)<<16)|(((O)&0xFF)<<8)|((I)&0xFF)))
51 #define CLASS_NUM_BITS 10
52 #define ITEM_ID_BITS 16 /* must be at least 16-bits to fit in the workarea */
53 #define ITEM_OFFSET_BITS 6
55 /* The FILTER is also the maximum value. */
56 #define CLASS_NUM_FILTER ((1<<CLASS_NUM_BITS)-1)
57 #define ITEM_ID_FILTER ((1<<ITEM_ID_BITS)-1)
58 #define ITEM_OFFSET_FILTER ((1<<ITEM_OFFSET_BITS)-1)
60 #define TP_CLASS_NO_CLASS 0
61 #define TP_ITEM_CLASS_ITSELF 0
62 #define TP_OFFSET_ITEM_ITSELF 0
64 #define TP_OFFSET_MENU_CASCADE (ITEM_OFFSET_FILTER-1)
65 #define TP_OFFSET_MENU_OPTION ITEM_OFFSET_FILTER
67 /* MAKEWIDGET must be a define and not an inline function so widget's can be used in case statements. */
68 #define MAKEWIDGET(ClassNum, ItemID, ItemOffset) ((Widget)( ( ( ((ClassNum)<<ITEM_ID_BITS) | (ItemID) ) << ITEM_OFFSET_BITS ) | (ItemOffset) ))
70 inline INT_PTR
GetClassNum(Widget W
)
72 return (W
>> ITEM_ID_BITS
) >> ITEM_OFFSET_BITS
;
74 inline INT_PTR
GetItemID(Widget W
)
76 return (W
>> ITEM_OFFSET_BITS
) & ITEM_ID_FILTER
;
78 inline INT_PTR
GetItemOffset(Widget W
)
80 return W
& ITEM_OFFSET_FILTER
;
84 * We cannot use Boolean_t here because it is not defined yet.
86 extern CWnd
*GetWindowFromWidget(Widget
);
87 extern CWnd
*GetParentWndFromWidget(Widget
);
88 extern Widget
GetWidgetFromWindow(CWnd
*);
89 extern BOOL
WidgetExists(Widget W
);
90 extern BOOL
TPEnableDialog(CWnd
*wnd
,
92 extern void TPEnableAllDialogs(BOOL bEnable
);
93 extern TPDialogRect_s
* GetDialogRectFromWidget(Widget
);
94 extern TPDialogRect_s
* GetDialogRectFromWindow(CWnd
* pWnd
);
97 #endif /* TECPLOTKERNEL */
100 * This is the start of the translated string ID's
101 * in the resource file
103 #define TP_TRANSLATED_STRING_START_ID 20000