source: trunk/src/user32/new/win32dlg.h@ 833

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

Dialog update

File size: 3.1 KB
Line 
1/* $Id: win32dlg.h,v 1.5 1999-09-05 12:03:33 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);
70
71 HWND getNextDlgTabItem(HWND hwndCtrl, BOOL fPrevious);
72 BOOL endDialog(int retval);
73
74virtual ULONG MsgOS2Create(HWND hwndOS2, ULONG initParam);
75
76virtual LONG SetWindowLongA(int index, ULONG value);
77virtual ULONG GetWindowLongA(int index);
78
79static ULONG GetDialogBaseUnits() { return MAKELONG(xBaseUnit, yBaseUnit); };
80
81protected:
82 BOOL DIALOG_Init(void);
83 BOOL getCharSizeFromDC( HDC hDC, HFONT hFont, SIZE * pSize );
84 BOOL getCharSize( HFONT hFont, SIZE * pSize);
85 LPCSTR parseTemplate( LPCSTR dlgtemplate, DLG_TEMPLATE *result);
86 WORD *getControl(const WORD *p, DLG_CONTROL_INFO *info, BOOL dialogEx);
87 BOOL createControls(LPCSTR dlgtemplate, HINSTANCE hInst);
88
89 LRESULT DefDlg_Proc(UINT msg, WPARAM wParam, LPARAM lParam);
90 LRESULT DefDlg_Epilog(UINT msg, BOOL fResult);
91
92 BOOL setDefButton(HWND hwndNew );
93 HWND findDefButton();
94 BOOL saveFocus();
95 BOOL restoreFocus();
96 void setFocus(HWND hwndCtrl );
97
98 // values normally contained in the standard dialog words
99 DLGPROC Win32DlgProc; //DWL_WNDPROC
100 ULONG msgResult; //DWL_MSGRESULT
101 ULONG userDlgData; //DWL_USER
102
103 DLG_TEMPLATE dlgInfo;
104 WORD xUnit;
105 WORD yUnit;
106 HWND hwndFocus;
107 HFONT hUserFont;
108 HMENU hMenu;
109 DWORD idResult;
110 DWORD dialogFlags;
111
112private:
113 static BOOL fInitialized;
114 static int xBaseUnit;
115 static int yBaseUnit;
116};
117
118/* Built-in class names (see _Undocumented_Windows_ p.418) */
119#define DIALOG_CLASS_NAMEA "#32770" /* Dialog */
120#define DIALOG_CLASS_NAMEW L"#32770" /* Dialog */
121#define DIALOG_CLASS_ATOM 32770 /* Dialog */
122
123BOOL DIALOG_Register();
124BOOL DIALOG_Unregister();
125
126#endif //__cplusplus
127
128#endif //__WIN32WND_H__
Note: See TracBrowser for help on using the repository browser.