Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

win32dlg.h

Go to the documentation of this file.
00001 /* $Id: win32dlg.h,v 1.14 2001/10/28 10:38:13 sandervl Exp $ */
00002 /*
00003  * Win32 Dialog Code for OS/2
00004  *
00005  *
00006  * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
00007  *
00008  *
00009  * Project Odin Software License can be found in LICENSE.TXT
00010  *
00011  */
00012 #ifndef __WIN32DLG_H__
00013 #define __WIN32DLG_H__
00014 
00015 #include <win32wbase.h>
00016 
00017 #ifdef __cplusplus
00018 
00019 #define DF_END  0x0001
00020 
00021   /* Dialog control information */
00022 typedef struct
00023 {
00024     DWORD      style;
00025     DWORD      exStyle;
00026     DWORD      helpId;
00027     INT        x;
00028     INT        y;
00029     INT        cx;
00030     INT        cy;
00031     UINT       id;
00032     LPCSTR     className;
00033     LPCSTR     windowName;
00034     LPVOID     data;
00035 } DLG_CONTROL_INFO;
00036 
00037 /* Dialog template */
00038 typedef struct
00039 {
00040     DWORD      style;
00041     DWORD      exStyle;
00042     DWORD      helpId;
00043     UINT       nbItems;
00044     INT        x;
00045     INT        y;
00046     INT        cx;
00047     INT        cy;
00048     LPCSTR     menuName;
00049     LPCSTR     className;
00050     LPCSTR     caption;
00051     WORD       pointSize;
00052     WORD       weight;
00053     BOOL       italic;
00054     LPCSTR     faceName;
00055     BOOL       dialogEx;
00056 } DLG_TEMPLATE;
00057 
00058 class Win32Dialog : public Win32BaseWindow
00059 {
00060 public:
00061          Win32Dialog(HINSTANCE hInst, LPCSTR dlgTemplate, HWND owner,
00062                      DLGPROC dlgProc, LPARAM param, BOOL isUnicode);
00063 
00064 virtual ~Win32Dialog();
00065 
00066        LRESULT  DefDlgProcA(UINT Msg, WPARAM wParam, LPARAM lParam);
00067        LRESULT  DefDlgProcW(UINT Msg, WPARAM wParam, LPARAM lParam);
00068 
00069          HWND   getDlgItem(int id) { return FindWindowById(id); };
00070 
00071          BOOL   endDialog(int retval);
00072 
00073          BOOL   MapDialogRect(LPRECT rect);
00074 
00075 virtual  ULONG  MsgCreate(HWND hwndOS2);
00076 
00077 virtual  LONG   SetWindowLong(int index, ULONG value, BOOL fUnicode);
00078 virtual  ULONG  GetWindowLong(int index, BOOL fUnicode);
00079 
00080 static   ULONG  GetDialogBaseUnits()  { return MAKELONG(xBaseUnit, yBaseUnit); };
00081 
00082        INT  doDialogBox();
00083 
00084 protected:
00085     BOOL    DIALOG_Init(void);
00086     BOOL    getCharSizeFromDC( HDC hDC, HFONT hFont, SIZE * pSize );
00087     BOOL    getCharSize( HFONT hFont, SIZE * pSize);
00088     LPCSTR  parseTemplate( LPCSTR dlgtemplate, DLG_TEMPLATE *result);
00089         WORD   *getControl(const WORD *p, DLG_CONTROL_INFO *info, BOOL dialogEx);
00090     BOOL    createControls(LPCSTR dlgtemplate, HINSTANCE hInst);
00091 
00092     LRESULT DefDlg_Proc(UINT msg, WPARAM wParam, LPARAM lParam);
00093         LRESULT DefDlg_Epilog(UINT msg, BOOL fResult);
00094 
00095     BOOL    setDefButton(HWND hwndNew );
00096     HWND    findDefButton();
00097     BOOL    saveFocus();
00098     BOOL    restoreFocus();
00099     void    setFocus(HWND hwndCtrl );
00100 
00101     // values normally contained in the standard dialog words
00102     DLGPROC Win32DlgProc;   //DWL_WNDPROC
00103     ULONG   msgResult;  //DWL_MSGRESULT
00104     ULONG   userDlgData;    //DWL_USER
00105 
00106    DLG_TEMPLATE dlgInfo;
00107     WORD    xUnit;
00108     WORD    yUnit;
00109     HWND    hwndFocus;
00110     HFONT   hUserFont;
00111     HMENU   hMenu;
00112     DWORD   idResult;
00113     DWORD   dialogFlags;
00114     BOOL    fDialogInit;
00115 
00116     DWORD   tmpParam;       //set in ctor, used in MsgCreate method
00117     LPSTR   tmpDlgTemplate; //set in ctor, used in MsgCreate method
00118 
00119 private:
00120  static BOOL    fInitialized;
00121  static int     xBaseUnit;
00122  static int     yBaseUnit;
00123 };
00124 
00125 /* Built-in class names (see _Undocumented_Windows_ p.418) */
00126 #define DIALOG_CLASS_NAMEA    "#32770"  /* Dialog */
00127 #define DIALOG_CLASS_NAMEW   L"#32770"  /* Dialog */
00128 #define DIALOG_CLASS_ATOM       32770   /* Dialog */
00129 
00130 BOOL DIALOG_Register();
00131 BOOL DIALOG_Unregister();
00132 
00133 #endif //__cplusplus
00134 
00135 #endif //__WIN32WND_H__

Generated on Wed Jan 23 23:17:45 2002 for ODIN-user32 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001