source: trunk/src/user32/win32dlg.h@ 1520

Last change on this file since 1520 was 1516, checked in by sandervl, 26 years ago

MapDialogRect fix

File size: 3.4 KB
Line 
1/* $Id: win32dlg.h,v 1.5 1999-10-30 10:55:16 sandervl Exp $ */
2/*
3 * Win32 Dialog Code for OS/2
4 *
5 *
6 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
7 *
8 *
9 * Project Odin Software License can be found in LICENSE.TXT
10 *
11 */
12#ifndef __WIN32DLG_H__
13#define __WIN32DLG_H__
14
15#include <win32wbase.h>
16
17#ifdef __cplusplus
18
19#define DF_END 0x0001
20
21 /* Dialog control information */
22typedef struct
23{
24 DWORD style;
25 DWORD exStyle;
26 DWORD helpId;
27 INT x;
28 INT y;
29 INT cx;
30 INT cy;
31 UINT id;
32 LPCSTR className;
33 LPCSTR windowName;
34 LPVOID data;
35} DLG_CONTROL_INFO;
36
37/* Dialog template */
38typedef struct
39{
40 DWORD style;
41 DWORD exStyle;
42 DWORD helpId;
43 UINT nbItems;
44 INT x;
45 INT y;
46 INT cx;
47 INT cy;
48 LPCSTR menuName;
49 LPCSTR className;
50 LPCSTR caption;
51 WORD pointSize;
52 WORD weight;
53 BOOL italic;
54 LPCSTR faceName;
55 BOOL dialogEx;
56} DLG_TEMPLATE;
57
58class Win32Dialog : public Win32BaseWindow
59{
60public:
61 Win32Dialog(HINSTANCE hInst, LPCSTR dlgTemplate, HWND owner,
62 DLGPROC dlgProc, LPARAM param, BOOL isUnicode);
63
64virtual ~Win32Dialog();
65
66 LRESULT DefDlgProcA(UINT Msg, WPARAM wParam, LPARAM lParam);
67 LRESULT DefDlgProcW(UINT Msg, WPARAM wParam, LPARAM lParam);
68
69Win32BaseWindow *getDlgItem(int id) { return FindWindowById(id); };
70
71 HWND getNextDlgTabItem(HWND hwndCtrl, BOOL fPrevious);
72 HWND getNextDlgGroupItem(HWND hwndCtrl, BOOL fPrevious);
73 BOOL endDialog(int retval);
74
75 BOOL MapDialogRect(LPRECT rect);
76
77virtual ULONG MsgCreate(HWND hwndFrame, HWND hwndClient);
78
79virtual LONG SetWindowLongA(int index, ULONG value);
80virtual ULONG GetWindowLongA(int index);
81
82static ULONG GetDialogBaseUnits() { return MAKELONG(xBaseUnit, yBaseUnit); };
83
84 INT doDialogBox();
85
86protected:
87 BOOL DIALOG_Init(void);
88 BOOL getCharSizeFromDC( HDC hDC, HFONT hFont, SIZE * pSize );
89 BOOL getCharSize( HFONT hFont, SIZE * pSize);
90 LPCSTR parseTemplate( LPCSTR dlgtemplate, DLG_TEMPLATE *result);
91 WORD *getControl(const WORD *p, DLG_CONTROL_INFO *info, BOOL dialogEx);
92 BOOL createControls(LPCSTR dlgtemplate, HINSTANCE hInst);
93
94 LRESULT DefDlg_Proc(UINT msg, WPARAM wParam, LPARAM lParam);
95 LRESULT DefDlg_Epilog(UINT msg, BOOL fResult);
96
97 BOOL setDefButton(HWND hwndNew );
98 HWND findDefButton();
99 BOOL saveFocus();
100 BOOL restoreFocus();
101 void setFocus(HWND hwndCtrl );
102
103 // values normally contained in the standard dialog words
104 DLGPROC Win32DlgProc; //DWL_WNDPROC
105 ULONG msgResult; //DWL_MSGRESULT
106 ULONG userDlgData; //DWL_USER
107
108 DLG_TEMPLATE dlgInfo;
109 WORD xUnit;
110 WORD yUnit;
111 HWND hwndFocus;
112 HFONT hUserFont;
113 HMENU hMenu;
114 DWORD idResult;
115 DWORD dialogFlags;
116
117 DWORD tmpParam; //set in ctor, used in MsgCreate method
118 LPSTR tmpDlgTemplate; //set in ctor, used in MsgCreate method
119private:
120 static BOOL fInitialized;
121 static int xBaseUnit;
122 static int yBaseUnit;
123};
124
125/* Built-in class names (see _Undocumented_Windows_ p.418) */
126#define DIALOG_CLASS_NAMEA "#32770" /* Dialog */
127#define DIALOG_CLASS_NAMEW L"#32770" /* Dialog */
128#define DIALOG_CLASS_ATOM 32770 /* Dialog */
129
130BOOL DIALOG_Register();
131BOOL DIALOG_Unregister();
132
133#endif //__cplusplus
134
135#endif //__WIN32WND_H__
Note: See TracBrowser for help on using the repository browser.