- Timestamp:
- Nov 24, 2000, 11:30:36 AM (25 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32dlg.cpp
r4444 r4686 1 /* $Id: win32dlg.cpp,v 1.5 3 2000-10-06 15:15:00sandervl Exp $ */1 /* $Id: win32dlg.cpp,v 1.54 2000-11-24 10:30:36 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Dialog Code for OS/2 … … 49 49 idResult = 0; 50 50 dialogFlags = 0; 51 fDialogInit = FALSE; 51 52 memset(&dlgInfo, 0, sizeof(dlgInfo)); 52 53 … … 76 77 if (dlgInfo.style & DS_SETFONT) 77 78 { 78 79 80 81 82 83 79 /* The font height must be negative as it is a point size */ 80 /* and must be converted to pixels first */ 81 /* (see CreateFont() documentation in the Windows SDK). */ 82 HDC dc = GetDC(0); 83 int pixels = dlgInfo.pointSize * GetDeviceCaps(dc , LOGPIXELSY)/72; 84 ReleaseDC(0, dc); 84 85 85 86 hUserFont = CreateFontW(-pixels, 0, 0, 0, … … 238 239 dprintf(("dlg ctor: GetNextDlgTabItem returned %x, capture hwnd = %x", hwndFocus, GetCapture())); 239 240 240 HWND hwndPreInitFocus = GetFocus(); 241 fDialogInit = TRUE; //WM_NCCALCSIZE can now be sent to dialog procedure 242 243 HWND hwndPreInitFocus = GetFocus(); 241 244 if(SendInternalMessageA(WM_INITDIALOG, (WPARAM)hwndFocus, param)) { 242 243 244 245 246 247 248 249 250 245 SetFocus(hwndFocus); 246 } 247 else 248 { 249 /* If the dlgproc has returned FALSE (indicating handling of keyboard focus) 250 but the focus has not changed, set the focus where we expect it. */ 251 if ( (getStyle() & WS_VISIBLE) && ( GetFocus() == hwndPreInitFocus ) ) 252 SetFocus( hwndFocus ); 253 } 251 254 252 255 if (dlgInfo.style & WS_VISIBLE && !(getStyle() & WS_VISIBLE)) … … 255 258 UpdateWindow( getWindowHandle() ); 256 259 } 257 SetLastError( 0);260 SetLastError(ERROR_SUCCESS); 258 261 dprintf(("********* DIALOG CREATED ************")); 259 262 return TRUE; … … 858 861 msgResult = 0; 859 862 863 //Dialogs never receive these messages 864 if (Msg == WM_CREATE || Msg == WM_NCCREATE) { 865 return (LRESULT)1; 866 } 867 //Never send a WM_NCCALCSIZE to a dialog before it has received it's WM_INITDIALOG message 868 //(causes problems for sysinf32.exe) 869 if(!fDialogInit && Msg == WM_NCCALCSIZE) { 870 return DefWindowProcA(Msg, wParam, lParam ); 871 } 872 860 873 if (Win32DlgProc) { /* Call dialog procedure */ 861 874 result = Win32DlgProc(getWindowHandle(), Msg, wParam, lParam); … … 902 915 msgResult = 0; 903 916 917 //Dialogs never receive these messages 918 if (Msg == WM_CREATE || Msg == WM_NCCREATE) { 919 return (LRESULT)1; 920 } 921 //Never send a WM_NCCALCSIZE to a dialog before it has received it's WM_INITDIALOG message 922 //(causes problems for sysinf32.exe) 923 if(!fDialogInit && Msg == WM_NCCALCSIZE) { 924 return DefWindowProcW(Msg, wParam, lParam ); 925 } 926 904 927 if (Win32DlgProc) { /* Call dialog procedure */ 905 928 result = Win32DlgProc(getWindowHandle(), Msg, wParam, lParam); … … 1069 1092 case DWL_DLGPROC: 1070 1093 { 1071 1094 //Note: Type of SetWindowLong determines new window proc type 1072 1095 // UNLESS the new window proc has already been registered 1073 1096 // (use the old type in that case) 1074 1097 // (VERIFIED in NT 4, SP6) 1075 1098 WINDOWPROCTYPE type = WINPROC_GetProcType((HWINDOWPROC)value); 1076 1077 1078 1099 if(type == WIN_PROC_INVALID) { 1100 type = (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A; 1101 } 1079 1102 oldval = (LONG)WINPROC_GetProc(Win32DlgProc, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A); 1080 1103 WINPROC_SetProc((HWINDOWPROC *)&Win32DlgProc, (WNDPROC)value, type, WIN_PROC_WINDOW); -
trunk/src/user32/win32dlg.h
r3662 r4686 1 /* $Id: win32dlg.h,v 1.1 1 2000-06-07 14:51:30sandervl Exp $ */1 /* $Id: win32dlg.h,v 1.12 2000-11-24 10:30:36 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Dialog Code for OS/2 … … 75 75 virtual ULONG MsgCreate(HWND hwndOS2); 76 76 77 virtual 78 virtual 77 virtual LONG SetWindowLongA(int index, ULONG value, BOOL fUnicode = FALSE); 78 virtual ULONG GetWindowLongA(int index, BOOL fUnicode = FALSE); 79 79 80 static 80 static ULONG GetDialogBaseUnits() { return MAKELONG(xBaseUnit, yBaseUnit); }; 81 81 82 82 INT doDialogBox(); 83 83 84 84 protected: 85 86 87 88 85 BOOL DIALOG_Init(void); 86 BOOL getCharSizeFromDC( HDC hDC, HFONT hFont, SIZE * pSize ); 87 BOOL getCharSize( HFONT hFont, SIZE * pSize); 88 LPCSTR parseTemplate( LPCSTR dlgtemplate, DLG_TEMPLATE *result); 89 89 WORD *getControl(const WORD *p, DLG_CONTROL_INFO *info, BOOL dialogEx); 90 91 92 90 BOOL createControls(LPCSTR dlgtemplate, HINSTANCE hInst); 91 92 LRESULT DefDlg_Proc(UINT msg, WPARAM wParam, LPARAM lParam); 93 93 LRESULT DefDlg_Epilog(UINT msg, BOOL fResult); 94 94 95 96 97 98 99 95 BOOL setDefButton(HWND hwndNew ); 96 HWND findDefButton(); 97 BOOL saveFocus(); 98 BOOL restoreFocus(); 99 void setFocus(HWND hwndCtrl ); 100 100 101 102 DLGPROC Win32DlgProc;//DWL_WNDPROC103 ULONG msgResult;//DWL_MSGRESULT104 ULONG userDlgData;//DWL_USER101 // values normally contained in the standard dialog words 102 DLGPROC Win32DlgProc; //DWL_WNDPROC 103 ULONG msgResult; //DWL_MSGRESULT 104 ULONG userDlgData; //DWL_USER 105 105 106 106 DLG_TEMPLATE dlgInfo; 107 WORD xUnit; 108 WORD yUnit; 109 HWND hwndFocus; 110 HFONT hUserFont; 111 HMENU hMenu; 112 DWORD idResult; 113 DWORD dialogFlags; 107 WORD xUnit; 108 WORD yUnit; 109 HWND hwndFocus; 110 HFONT hUserFont; 111 HMENU hMenu; 112 DWORD idResult; 113 DWORD dialogFlags; 114 BOOL fDialogInit; 114 115 115 DWORD tmpParam; //set in ctor, used in MsgCreate method 116 LPSTR tmpDlgTemplate; //set in ctor, used in MsgCreate method 116 DWORD tmpParam; //set in ctor, used in MsgCreate method 117 LPSTR tmpDlgTemplate; //set in ctor, used in MsgCreate method 118 117 119 private: 118 120 static BOOL fInitialized;
Note:
See TracChangeset
for help on using the changeset viewer.