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

Last change on this file since 1525 was 1525, checked in by cbratschi, 26 years ago

button, static, scroll and dialog fixes

File size: 3.1 KB
Line 
1/* $Id: win32dlg.h,v 1.6 1999-10-30 18:40:47 cbratschi 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 BOOL endDialog(int retval);
72
73virtual ULONG MsgCreate(HWND hwndFrame, HWND hwndClient);
74
75virtual LONG SetWindowLongA(int index, ULONG value);
76virtual ULONG GetWindowLongA(int index);
77
78 INT doDialogBox();
79
80protected:
81 LPCSTR parseTemplate( LPCSTR dlgtemplate, DLG_TEMPLATE *result);
82 WORD *getControl(const WORD *p, DLG_CONTROL_INFO *info, BOOL dialogEx);
83 BOOL createControls(LPCSTR dlgtemplate, HINSTANCE hInst);
84
85 LRESULT DefDlg_Proc(UINT msg, WPARAM wParam, LPARAM lParam);
86 LRESULT DefDlg_Epilog(UINT msg, BOOL fResult);
87
88 BOOL setDefButton(HWND hwndNew );
89 HWND findDefButton();
90 BOOL saveFocus();
91 BOOL restoreFocus();
92 void setFocus(HWND hwndCtrl );
93
94 // values normally contained in the standard dialog words
95 DLGPROC Win32DlgProc; //DWL_WNDPROC
96 ULONG msgResult; //DWL_MSGRESULT
97 ULONG userDlgData; //DWL_USER
98
99 DLG_TEMPLATE dlgInfo;
100 WORD xUnit;
101 WORD yUnit;
102 HWND hwndFocus;
103 HFONT hUserFont;
104 HMENU hMenu;
105 DWORD idResult;
106 DWORD dialogFlags;
107
108 DWORD tmpParam; //set in ctor, used in MsgCreate method
109 LPSTR tmpDlgTemplate; //set in ctor, used in MsgCreate method
110};
111
112/* Built-in class names (see _Undocumented_Windows_ p.418) */
113#define DIALOG_CLASS_NAMEA "#32770" /* Dialog */
114#define DIALOG_CLASS_NAMEW L"#32770" /* Dialog */
115#define DIALOG_CLASS_ATOM 32770 /* Dialog */
116
117BOOL DIALOG_Register();
118BOOL DIALOG_Unregister();
119
120#endif //__cplusplus
121
122#endif //__WIN32WND_H__
Note: See TracBrowser for help on using the repository browser.