changed/centralized window creation code to allow wxTLW work in wxUniv
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11880 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -92,14 +92,15 @@ protected:
|
|||||||
|
|
||||||
virtual wxSize DoGetBestSize() const;
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
// create the control of the given class with the given style, returns FALSE
|
// create the control of the given class with the given style (combination
|
||||||
// if creation failed
|
// of WS_XXX flags, i.e. Windows style, not wxWindows one), returns
|
||||||
|
// FALSE if creation failed
|
||||||
//
|
//
|
||||||
// All parameters except classname and style are optional, if the
|
// All parameters except classname and style are optional, if the
|
||||||
// size/position are not given, they should be set later with SetSize() and,
|
// size/position are not given, they should be set later with SetSize()
|
||||||
// label (the title of the window), of course, is left empty. The extended
|
// and, label (the title of the window), of course, is left empty. The
|
||||||
// style is determined from the style and the app 3D settings automatically
|
// extended style is determined from the style and the app 3D settings
|
||||||
// if it's not specified explicitly.
|
// automatically if it's not specified explicitly.
|
||||||
bool MSWCreateControl(const wxChar *classname,
|
bool MSWCreateControl(const wxChar *classname,
|
||||||
WXDWORD style,
|
WXDWORD style,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
@@ -93,10 +93,6 @@ public:
|
|||||||
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
|
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
|
||||||
bool HandleMenuSelect(WXWORD nItem, WXWORD nFlags, WXHMENU hMenu);
|
bool HandleMenuSelect(WXWORD nItem, WXWORD nFlags, WXHMENU hMenu);
|
||||||
|
|
||||||
bool MSWCreate(int id, wxWindow *parent, const wxChar *wclass,
|
|
||||||
wxWindow *wx_win, const wxChar *title,
|
|
||||||
int x, int y, int width, int height, long style);
|
|
||||||
|
|
||||||
// tooltip management
|
// tooltip management
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
WXHWND GetToolTipCtrl() const { return m_hwndToolTip; }
|
WXHWND GetToolTipCtrl() const { return m_hwndToolTip; }
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#ifdef __WXMICROWIN__
|
#ifdef __WXMICROWIN__
|
||||||
/* Extra prototypes and symbols not defined by MicroWindows */
|
// Extra prototypes and symbols not defined by MicroWindows
|
||||||
#include "wx/msw/microwin.h"
|
#include "wx/msw/microwin.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -36,22 +36,6 @@
|
|||||||
// so there is little advantage to setting it to 1.
|
// so there is little advantage to setting it to 1.
|
||||||
#define WXWIN_COMPATIBILITY 0
|
#define WXWIN_COMPATIBILITY 0
|
||||||
|
|
||||||
// This setting determines the compatibility with 2.0 API: set it to 1 to
|
|
||||||
// enable it
|
|
||||||
//
|
|
||||||
// Default is 0.
|
|
||||||
//
|
|
||||||
// Recommended setting: 0 (please update your code instead!)
|
|
||||||
#define WXWIN_COMPATIBILITY_2 0
|
|
||||||
|
|
||||||
// This setting determines the compatibility with 2.0 API: set it to 1 to
|
|
||||||
// enable it
|
|
||||||
//
|
|
||||||
// Default is 0.
|
|
||||||
//
|
|
||||||
// Recommended setting: 0 (please update your code instead!)
|
|
||||||
#define WXWIN_COMPATIBILITY_2_2 0
|
|
||||||
|
|
||||||
// in wxMSW version 2.1.11 and earlier, wxIcon always derives from wxBitmap,
|
// in wxMSW version 2.1.11 and earlier, wxIcon always derives from wxBitmap,
|
||||||
// but this is very dangerous because you can mistakenly pass an icon instead
|
// but this is very dangerous because you can mistakenly pass an icon instead
|
||||||
// of a bitmap to a function taking "const wxBitmap&" - which will *not* work
|
// of a bitmap to a function taking "const wxBitmap&" - which will *not* work
|
||||||
@@ -104,7 +88,7 @@
|
|||||||
// Default is 1.
|
// Default is 1.
|
||||||
//
|
//
|
||||||
// Recommended setting: 1 but see comment above
|
// Recommended setting: 1 but see comment above
|
||||||
#define wxUSE_DEBUG_CONTEXT 1
|
#define wxUSE_DEBUG_CONTEXT 0
|
||||||
|
|
||||||
// If 1, enables debugging versions of wxObject::new and wxObject::delete *IF*
|
// If 1, enables debugging versions of wxObject::new and wxObject::delete *IF*
|
||||||
// __WXDEBUG__ is also defined.
|
// __WXDEBUG__ is also defined.
|
||||||
@@ -115,7 +99,7 @@
|
|||||||
// Default is 1
|
// Default is 1
|
||||||
//
|
//
|
||||||
// Recommended setting: 1 but see comment in the beginning of this section
|
// Recommended setting: 1 but see comment in the beginning of this section
|
||||||
#define wxUSE_MEMORY_TRACING 1
|
#define wxUSE_MEMORY_TRACING 0
|
||||||
|
|
||||||
// In debug mode, cause new and delete to be redefined globally.
|
// In debug mode, cause new and delete to be redefined globally.
|
||||||
// If this causes problems (e.g. link errors), set this to 0.
|
// If this causes problems (e.g. link errors), set this to 0.
|
||||||
@@ -124,7 +108,7 @@
|
|||||||
// Default is 1
|
// Default is 1
|
||||||
//
|
//
|
||||||
// Recommended setting: 1 but see comment in the beginning of this section
|
// Recommended setting: 1 but see comment in the beginning of this section
|
||||||
#define wxUSE_GLOBAL_MEMORY_OPERATORS 1
|
#define wxUSE_GLOBAL_MEMORY_OPERATORS 0
|
||||||
|
|
||||||
// In debug mode, causes new to be defined to be WXDEBUG_NEW (see object.h). If
|
// In debug mode, causes new to be defined to be WXDEBUG_NEW (see object.h). If
|
||||||
// this causes problems (e.g. link errors), set this to 0. You may need to set
|
// this causes problems (e.g. link errors), set this to 0. You may need to set
|
||||||
@@ -134,7 +118,7 @@
|
|||||||
// Default is 1
|
// Default is 1
|
||||||
//
|
//
|
||||||
// Recommended setting: 1 but see comment in the beginning of this section
|
// Recommended setting: 1 but see comment in the beginning of this section
|
||||||
#define wxUSE_DEBUG_NEW_ALWAYS 1
|
#define wxUSE_DEBUG_NEW_ALWAYS 0
|
||||||
|
|
||||||
// wxHandleFatalExceptions() may be used to catch the program faults at run
|
// wxHandleFatalExceptions() may be used to catch the program faults at run
|
||||||
// time and, instead of terminating the program with a usual GPF message box,
|
// time and, instead of terminating the program with a usual GPF message box,
|
||||||
@@ -193,20 +177,12 @@
|
|||||||
// Recommended setting: 1 (always)
|
// Recommended setting: 1 (always)
|
||||||
#define wxUSE_LOG 1
|
#define wxUSE_LOG 1
|
||||||
|
|
||||||
// Support for command line parsing using wxCmdLineParser class.
|
|
||||||
//
|
|
||||||
// Default is 1
|
|
||||||
//
|
|
||||||
// Recommended setting: 1 (can be set to 0 if you don't use the cmd line)
|
|
||||||
#define wxUSE_CMDLINE_PARSER 1
|
|
||||||
|
|
||||||
// Recommended setting: 1
|
|
||||||
#define wxUSE_LOGWINDOW 1
|
#define wxUSE_LOGWINDOW 1
|
||||||
|
|
||||||
// Recommended setting: 1
|
// Recommended setting: 1 (always)
|
||||||
#define wxUSE_LOGGUI 1
|
#define wxUSE_LOGGUI 1
|
||||||
|
|
||||||
// Recommended setting: 1
|
// Recommended setting: 1 (always)
|
||||||
#define wxUSE_LOG_DIALOG 1
|
#define wxUSE_LOG_DIALOG 1
|
||||||
|
|
||||||
// Support for multithreaded applications: if 1, compile in thread classes
|
// Support for multithreaded applications: if 1, compile in thread classes
|
||||||
@@ -264,7 +240,7 @@
|
|||||||
// i18n support: _() macro, wxLocale class. Requires wxTextFile.
|
// i18n support: _() macro, wxLocale class. Requires wxTextFile.
|
||||||
#define wxUSE_INTL 1
|
#define wxUSE_INTL 1
|
||||||
|
|
||||||
// Set wxUSE_DATETIME to 1 to compile the wxDateTime and related classes which
|
// Set wxUSE_TIMEDATE to 1 to compile the wxDateTime and related classes which
|
||||||
// allow to manipulate dates, times and time intervals. wxDateTime replaces the
|
// allow to manipulate dates, times and time intervals. wxDateTime replaces the
|
||||||
// old wxTime and wxDate classes which are still provided for backwards
|
// old wxTime and wxDate classes which are still provided for backwards
|
||||||
// compatibility (and implemented in terms of wxDateTime).
|
// compatibility (and implemented in terms of wxDateTime).
|
||||||
@@ -276,20 +252,9 @@
|
|||||||
//
|
//
|
||||||
// Requires: wxUSE_LONGLONG
|
// Requires: wxUSE_LONGLONG
|
||||||
//
|
//
|
||||||
// Default is 1
|
|
||||||
//
|
|
||||||
// Recommended setting: 1
|
// Recommended setting: 1
|
||||||
#define wxUSE_DATETIME 1
|
#define wxUSE_DATETIME 1
|
||||||
|
|
||||||
// wxUSE_TIMEDATE enables compilation of the old wxDate and wxTime classes (not
|
|
||||||
// the same as wxDateTime!). These classes are obsolete and shouldn't be used
|
|
||||||
// in new code
|
|
||||||
//
|
|
||||||
// Default is 0
|
|
||||||
//
|
|
||||||
// Recommended setting: 0 unless you have legacy code which uses these classes
|
|
||||||
#define wxUSE_TIMEDATE 0
|
|
||||||
|
|
||||||
// Set wxUSE_TIMER to 1 to compile wxTimer class
|
// Set wxUSE_TIMER to 1 to compile wxTimer class
|
||||||
//
|
//
|
||||||
// Default is 1
|
// Default is 1
|
||||||
@@ -365,6 +330,8 @@
|
|||||||
// wxUSE_LIBPNG.
|
// wxUSE_LIBPNG.
|
||||||
#define wxUSE_ZLIB 1
|
#define wxUSE_ZLIB 1
|
||||||
|
|
||||||
|
#define wxUSE_REGEX 1
|
||||||
|
|
||||||
// If enabled, the code written by Apple will be used to write, in a portable
|
// If enabled, the code written by Apple will be used to write, in a portable
|
||||||
// way, float on the disk. See extended.c for the license which is different
|
// way, float on the disk. See extended.c for the license which is different
|
||||||
// from wxWindows one.
|
// from wxWindows one.
|
||||||
@@ -383,22 +350,6 @@
|
|||||||
// wxMimeTypesManager class
|
// wxMimeTypesManager class
|
||||||
#define wxUSE_MIMETYPE 1
|
#define wxUSE_MIMETYPE 1
|
||||||
|
|
||||||
// wxSystemOptions class
|
|
||||||
#define wxUSE_SYSTEM_OPTIONS 1
|
|
||||||
|
|
||||||
// Support for regular expression matching via wxRegEx class: enable this to
|
|
||||||
// use POSIX regular expressions in your code. You need to compile regex
|
|
||||||
// library from src/regex to use it under Windows.
|
|
||||||
//
|
|
||||||
// Default is 0
|
|
||||||
//
|
|
||||||
// Recommended setting: 1 if your compiler supports it, if it doesn't please
|
|
||||||
// contribute us a makefile for src/regex for it
|
|
||||||
#define wxUSE_REGEX 0
|
|
||||||
|
|
||||||
// wxWave class
|
|
||||||
#define wxUSE_WAVE 1
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Individual GUI controls
|
// Individual GUI controls
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -576,9 +527,6 @@
|
|||||||
// wxValidator class and related methods
|
// wxValidator class and related methods
|
||||||
#define wxUSE_VALIDATORS 1
|
#define wxUSE_VALIDATORS 1
|
||||||
|
|
||||||
// wxDC cacheing implementation
|
|
||||||
#define wxUSE_DC_CACHEING 1
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// common dialogs
|
// common dialogs
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -601,29 +549,6 @@
|
|||||||
// Recommended setting: 1 (unless it really doesn't work)
|
// Recommended setting: 1 (unless it really doesn't work)
|
||||||
#define wxUSE_COMMON_DIALOGS 1
|
#define wxUSE_COMMON_DIALOGS 1
|
||||||
|
|
||||||
// wxBusyInfo displays window with message when app is busy. Works in same way
|
|
||||||
// as wxBusyCursor
|
|
||||||
#define wxUSE_BUSYINFO 1
|
|
||||||
|
|
||||||
// Use single/multiple choice dialogs.
|
|
||||||
//
|
|
||||||
// Default is 1
|
|
||||||
//
|
|
||||||
// Recommended setting: 1 (used in the library itself)
|
|
||||||
#define wxUSE_CHOICEDLG 1
|
|
||||||
|
|
||||||
// Use colour picker dialog
|
|
||||||
//
|
|
||||||
// Default is 1
|
|
||||||
//
|
|
||||||
// Recommended setting: 1
|
|
||||||
#define wxUSE_COLOURDLG 1
|
|
||||||
|
|
||||||
// wxDirDlg class for getting a directory name from user
|
|
||||||
#define wxUSE_DIRDLG 1
|
|
||||||
|
|
||||||
// TODO: setting to choose the generic or native one
|
|
||||||
|
|
||||||
// Use file open/save dialogs.
|
// Use file open/save dialogs.
|
||||||
//
|
//
|
||||||
// Default is 1
|
// Default is 1
|
||||||
@@ -631,11 +556,6 @@
|
|||||||
// Recommended setting: 1 (used in many places in the library itself)
|
// Recommended setting: 1 (used in many places in the library itself)
|
||||||
#define wxUSE_FILEDLG 1
|
#define wxUSE_FILEDLG 1
|
||||||
|
|
||||||
// Use find/replace dialogs.
|
|
||||||
//
|
|
||||||
// Default is 1
|
|
||||||
//
|
|
||||||
// Recommended setting: 1 (but may be safely set to 0)
|
|
||||||
#define wxUSE_FINDREPLDLG 1
|
#define wxUSE_FINDREPLDLG 1
|
||||||
|
|
||||||
// Use font picker dialog
|
// Use font picker dialog
|
||||||
@@ -652,22 +572,38 @@
|
|||||||
// Recommended setting: 1 (used in the library itself)
|
// Recommended setting: 1 (used in the library itself)
|
||||||
#define wxUSE_MSGDLG 1
|
#define wxUSE_MSGDLG 1
|
||||||
|
|
||||||
// progress dialog class for lengthy operations
|
// Use single/multiple choice dialogs.
|
||||||
#define wxUSE_PROGRESSDLG 1
|
//
|
||||||
|
// Default is 1
|
||||||
|
//
|
||||||
|
// Recommended setting: 1 (used in the library itself)
|
||||||
|
#define wxUSE_CHOICEDLG 1
|
||||||
|
|
||||||
// support for startup tips (wxShowTip &c)
|
// Use colour picker dialog
|
||||||
#define wxUSE_STARTUP_TIPS 1
|
//
|
||||||
|
// Default is 1
|
||||||
|
//
|
||||||
|
// Recommended setting: 1
|
||||||
|
#define wxUSE_COLOURDLG 1
|
||||||
|
|
||||||
// text entry dialog and wxGetTextFromUser function
|
// text entry dialog and wxGetTextFromUser function
|
||||||
#define wxUSE_TEXTDLG 1
|
#define wxUSE_TEXTDLG 1
|
||||||
|
|
||||||
// number entry dialog
|
|
||||||
#define wxUSE_NUMBERDLG 1
|
#define wxUSE_NUMBERDLG 1
|
||||||
|
|
||||||
// splash screen class
|
// progress dialog class for lengthy operations
|
||||||
#define wxUSE_SPLASH 1
|
#define wxUSE_PROGRESSDLG 1
|
||||||
|
|
||||||
|
// wxBusyInfo displays window with message when app is busy. Works in same way
|
||||||
|
// as wxBusyCursor
|
||||||
|
#define wxUSE_BUSYINFO 1
|
||||||
|
|
||||||
|
// wxDirDlg class for getting a directory name from user
|
||||||
|
#define wxUSE_DIRDLG 1
|
||||||
|
|
||||||
|
// support for startup tips (wxShowTip &c)
|
||||||
|
#define wxUSE_STARTUP_TIPS 1
|
||||||
|
|
||||||
// wizards
|
|
||||||
#define wxUSE_WIZARDDLG 1
|
#define wxUSE_WIZARDDLG 1
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -768,10 +704,7 @@
|
|||||||
// 0 for no help facility
|
// 0 for no help facility
|
||||||
#define wxUSE_MS_HTML_HELP 0
|
#define wxUSE_MS_HTML_HELP 0
|
||||||
// 0 for no MS HTML Help
|
// 0 for no MS HTML Help
|
||||||
|
|
||||||
// Use wxHTML-based help controller?
|
|
||||||
#define wxUSE_WXHTML_HELP 1
|
#define wxUSE_WXHTML_HELP 1
|
||||||
|
|
||||||
#define wxUSE_RESOURCES 1
|
#define wxUSE_RESOURCES 1
|
||||||
// 0 for no wxGetResource/wxWriteResource
|
// 0 for no wxGetResource/wxWriteResource
|
||||||
#define wxUSE_CONSTRAINTS 1
|
#define wxUSE_CONSTRAINTS 1
|
||||||
@@ -890,7 +823,6 @@
|
|||||||
// Set to 1 for XPM format support
|
// Set to 1 for XPM format support
|
||||||
#define wxUSE_XPM 1
|
#define wxUSE_XPM 1
|
||||||
|
|
||||||
// Set to 1 to compile in wxPalette class
|
|
||||||
#define wxUSE_PALETTE 1
|
#define wxUSE_PALETTE 1
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -1176,7 +1108,7 @@
|
|||||||
// you need to modify setup.h and rebuild everything
|
// you need to modify setup.h and rebuild everything
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#if wxUSE_DATETIME && !wxUSE_LONGLONG
|
#if wxUSE_TIMEDATE && !wxUSE_LONGLONG
|
||||||
#error wxDateTime requires wxLongLong
|
#error wxDateTime requires wxLongLong
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -70,12 +70,30 @@ protected:
|
|||||||
// common part of all ctors
|
// common part of all ctors
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
|
// create a new frame, return FALSE if it couldn't be created
|
||||||
|
bool CreateFrame(const wxString& title,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size);
|
||||||
|
|
||||||
|
// create a new dialog using the given dialog template from resources,
|
||||||
|
// return FALSE if it couldn't be created
|
||||||
|
bool CreateDialog(const wxChar *dlgTemplate,
|
||||||
|
const wxString& title,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size);
|
||||||
|
|
||||||
// common part of Iconize(), Maximize() and Restore()
|
// common part of Iconize(), Maximize() and Restore()
|
||||||
void DoShowWindow(int nShowCmd);
|
void DoShowWindow(int nShowCmd);
|
||||||
|
|
||||||
// implement the geometry-related methods for a top level window
|
// implement the geometry-related methods for a top level window
|
||||||
virtual void DoSetClientSize(int width, int height);
|
virtual void DoSetClientSize(int width, int height);
|
||||||
|
|
||||||
|
// get the MSW window flags corresponding to wxWindows ones
|
||||||
|
//
|
||||||
|
// the functions returns the flags (WS_XXX) directly and puts the ext
|
||||||
|
// (WS_EX_XXX) flags into the provided pointer if not NULL
|
||||||
|
long MSWGetCreateWindowFlags(long *exflags) const;
|
||||||
|
|
||||||
// is the frame currently iconized?
|
// is the frame currently iconized?
|
||||||
bool m_iconized;
|
bool m_iconized;
|
||||||
|
|
||||||
|
@@ -217,16 +217,26 @@ public:
|
|||||||
// MSW only: TRUE if this control is part of the main control
|
// MSW only: TRUE if this control is part of the main control
|
||||||
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
|
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
|
||||||
|
|
||||||
// returns TRUE if the window has been created
|
// translate wxWindows coords into Windows ones suitable to be passed to
|
||||||
bool MSWCreate(int id,
|
// ::CreateWindow()
|
||||||
wxWindow *parent,
|
//
|
||||||
const wxChar *wclass,
|
// returns TRUE if non default coords are returned, FALSE otherwise
|
||||||
wxWindow *wx_win,
|
bool MSWGetCreateWindowCoords(const wxPoint& pos,
|
||||||
const wxChar *title,
|
const wxSize& size,
|
||||||
int x, int y, int width, int height,
|
int& x, int& y,
|
||||||
WXDWORD style,
|
int& w, int& h) const;
|
||||||
const wxChar *dialog_template = NULL,
|
|
||||||
|
// creates the window of specified Windows class with given style, extended
|
||||||
|
// style, title and geometry (default values
|
||||||
|
//
|
||||||
|
// returns TRUE if the window has been created, FALSE if creation failed
|
||||||
|
bool MSWCreate(const wxChar *wclass,
|
||||||
|
const wxChar *title = NULL,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
WXDWORD style = 0,
|
||||||
WXDWORD exendedStyle = 0);
|
WXDWORD exendedStyle = 0);
|
||||||
|
|
||||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||||
|
|
||||||
#if WXWIN_COMPATIBILITY
|
#if WXWIN_COMPATIBILITY
|
||||||
@@ -463,5 +473,15 @@ private:
|
|||||||
WXDLLEXPORT int wxCharCodeMSWToWX(int keySym);
|
WXDLLEXPORT int wxCharCodeMSWToWX(int keySym);
|
||||||
WXDLLEXPORT int wxCharCodeWXToMSW(int id, bool *IsVirtual);
|
WXDLLEXPORT int wxCharCodeWXToMSW(int id, bool *IsVirtual);
|
||||||
|
|
||||||
|
// window creation helper class: before creating a new HWND, instantiate an
|
||||||
|
// object of this class on stack - this allows to process the messages sent to
|
||||||
|
// the window even before CreateWindow() returns
|
||||||
|
class wxWindowCreationHook
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxWindowCreationHook(wxWindowMSW *winBeingCreated);
|
||||||
|
~wxWindowCreationHook();
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// _WX_WINDOW_H_
|
// _WX_WINDOW_H_
|
||||||
|
@@ -25,6 +25,24 @@
|
|||||||
// elsewhere because the functions, unlike the macros, respect the scope.
|
// elsewhere because the functions, unlike the macros, respect the scope.
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// CreateDialog
|
||||||
|
|
||||||
|
#ifdef CreateDialog
|
||||||
|
#undef CreateDialog
|
||||||
|
|
||||||
|
inline HWND CreateDialog(HINSTANCE hInstance,
|
||||||
|
LPCTSTR pTemplate,
|
||||||
|
HWND hwndParent,
|
||||||
|
DLGPROC pDlgProc)
|
||||||
|
{
|
||||||
|
#ifdef _UNICODE
|
||||||
|
return CreateDialogW(hInstance, pTemplate, hwndParent, pDlgProc);
|
||||||
|
#else
|
||||||
|
return CreateDialogA(hInstance, pTemplate, hwndParent, pDlgProc);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// GetCharWidth
|
// GetCharWidth
|
||||||
|
|
||||||
#ifdef GetCharWidth
|
#ifdef GetCharWidth
|
||||||
|
@@ -128,7 +128,7 @@ bool wxControl::MSWCreateControl(const wxChar *classname,
|
|||||||
}
|
}
|
||||||
#endif // wxUSE_CTL3D
|
#endif // wxUSE_CTL3D
|
||||||
|
|
||||||
// subclass again for purposes of dialog editing mode
|
// install wxWindows window proc for this window
|
||||||
SubclassWin(m_hWnd);
|
SubclassWin(m_hWnd);
|
||||||
|
|
||||||
// controls use the same font and colours as their parent dialog by default
|
// controls use the same font and colours as their parent dialog by default
|
||||||
|
@@ -113,86 +113,14 @@ bool wxDialog::Create(wxWindow *parent,
|
|||||||
|
|
||||||
SetExtraStyle(GetExtraStyle() | wxTOPLEVEL_EX_DIALOG);
|
SetExtraStyle(GetExtraStyle() | wxTOPLEVEL_EX_DIALOG);
|
||||||
|
|
||||||
if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) )
|
// save focus before doing anything which can potentially change it
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
m_oldFocus = FindFocus();
|
m_oldFocus = FindFocus();
|
||||||
|
|
||||||
int x = pos.x;
|
|
||||||
int y = pos.y;
|
|
||||||
int width = size.x;
|
|
||||||
int height = size.y;
|
|
||||||
|
|
||||||
if (x < 0)
|
|
||||||
x = wxDIALOG_DEFAULT_X;
|
|
||||||
if (y < 0)
|
|
||||||
y = wxDIALOG_DEFAULT_Y;
|
|
||||||
|
|
||||||
if (width < 0)
|
|
||||||
width = wxDIALOG_DEFAULT_WIDTH;
|
|
||||||
if (height < 0)
|
|
||||||
height = wxDIALOG_DEFAULT_HEIGHT;
|
|
||||||
|
|
||||||
// All dialogs should really have this style
|
// All dialogs should really have this style
|
||||||
m_windowStyle |= wxTAB_TRAVERSAL;
|
style |= wxTAB_TRAVERSAL;
|
||||||
|
|
||||||
WXDWORD extendedStyle = MakeExtendedStyle(m_windowStyle);
|
|
||||||
if (m_windowStyle & wxSTAY_ON_TOP)
|
|
||||||
extendedStyle |= WS_EX_TOPMOST;
|
|
||||||
|
|
||||||
#ifndef __WIN16__
|
|
||||||
if (m_exStyle & wxDIALOG_EX_CONTEXTHELP)
|
|
||||||
extendedStyle |= WS_EX_CONTEXTHELP;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Allows creation of dialogs with & without captions under MSWindows,
|
|
||||||
// resizeable or not (but a resizeable dialog always has caption -
|
|
||||||
// otherwise it would look too strange)
|
|
||||||
const wxChar *dlg;
|
|
||||||
if ( style & wxRESIZE_BORDER )
|
|
||||||
dlg = wxT("wxResizeableDialog");
|
|
||||||
else if ( style & wxCAPTION )
|
|
||||||
dlg = wxT("wxCaptionDialog");
|
|
||||||
else
|
|
||||||
dlg = wxT("wxNoCaptionDialog");
|
|
||||||
|
|
||||||
#ifdef __WXMICROWIN__
|
|
||||||
extern const wxChar *wxFrameClassName;
|
|
||||||
|
|
||||||
int msflags = WS_OVERLAPPED|WS_POPUP;
|
|
||||||
if (style & wxCAPTION)
|
|
||||||
msflags |= WS_CAPTION;
|
|
||||||
if (style & wxCLIP_CHILDREN)
|
|
||||||
msflags |= WS_CLIPCHILDREN;
|
|
||||||
if ((style & wxTHICK_FRAME) == 0)
|
|
||||||
msflags |= WS_BORDER;
|
|
||||||
MSWCreate(m_windowId, parent, wxFrameClassName, this, NULL,
|
|
||||||
x, y, width, height,
|
|
||||||
msflags,
|
|
||||||
NULL,
|
|
||||||
extendedStyle);
|
|
||||||
|
|
||||||
#else
|
|
||||||
MSWCreate(m_windowId, parent, NULL, this, NULL,
|
|
||||||
x, y, width, height,
|
|
||||||
0, // style is not used if we have dlg template
|
|
||||||
dlg,
|
|
||||||
extendedStyle);
|
|
||||||
#endif
|
|
||||||
HWND hwnd = (HWND)GetHWND();
|
|
||||||
|
|
||||||
if ( !hwnd )
|
|
||||||
{
|
|
||||||
wxFAIL_MSG(_("Failed to create dialog. You probably forgot to include wx/msw/wx.rc in your resources."));
|
|
||||||
|
|
||||||
|
if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef __WXMICROWIN__
|
|
||||||
SubclassWin(GetHWND());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SetWindowText(hwnd, title);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@@ -119,9 +119,6 @@ void wxFrameMSW::Init()
|
|||||||
m_fsIsShowing = FALSE;
|
m_fsIsShowing = FALSE;
|
||||||
|
|
||||||
m_winLastFocused = (wxWindow *)NULL;
|
m_winLastFocused = (wxWindow *)NULL;
|
||||||
|
|
||||||
// unlike (almost?) all other windows, frames are created hidden
|
|
||||||
m_isShown = FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxFrameMSW::Create(wxWindow *parent,
|
bool wxFrameMSW::Create(wxWindow *parent,
|
||||||
@@ -135,13 +132,6 @@ bool wxFrameMSW::Create(wxWindow *parent,
|
|||||||
if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) )
|
if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// the frame must have NULL parent HWND or it would be always on top of its
|
|
||||||
// parent which is not what we usually want (in fact, we only want it for
|
|
||||||
// frames with the special wxFRAME_TOOL_WINDOW style handled elsewhere)
|
|
||||||
if ( !MSWCreate(m_windowId, NULL, wxFrameClassName, this, title,
|
|
||||||
pos.x, pos.y, size.x, size.y, style) )
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
|
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
|
||||||
|
|
||||||
wxModelessWindows.Append(this);
|
wxModelessWindows.Append(this);
|
||||||
@@ -469,98 +459,6 @@ bool wxFrameMSW::ShowFullScreen(bool show, long style)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Frame window
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
bool wxFrameMSW::MSWCreate(int id, wxWindow *parent, const wxChar *wclass, wxWindow *wx_win, const wxChar *title,
|
|
||||||
int x, int y, int width, int height, long style)
|
|
||||||
|
|
||||||
{
|
|
||||||
// If child windows aren't properly drawn initially, WS_CLIPCHILDREN
|
|
||||||
// could be the culprit. But without it, you can get a lot of flicker.
|
|
||||||
|
|
||||||
DWORD msflags = 0;
|
|
||||||
if ( style & wxCAPTION )
|
|
||||||
{
|
|
||||||
if ( style & wxFRAME_TOOL_WINDOW )
|
|
||||||
msflags |= WS_POPUPWINDOW;
|
|
||||||
else
|
|
||||||
msflags |= WS_OVERLAPPED;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
msflags |= WS_POPUP;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (style & wxMINIMIZE_BOX)
|
|
||||||
msflags |= WS_MINIMIZEBOX;
|
|
||||||
if (style & wxMAXIMIZE_BOX)
|
|
||||||
msflags |= WS_MAXIMIZEBOX;
|
|
||||||
if (style & wxTHICK_FRAME)
|
|
||||||
msflags |= WS_THICKFRAME;
|
|
||||||
if (style & wxSYSTEM_MENU)
|
|
||||||
msflags |= WS_SYSMENU;
|
|
||||||
if ( style & wxMINIMIZE )
|
|
||||||
msflags |= WS_MINIMIZE;
|
|
||||||
if (style & wxMAXIMIZE)
|
|
||||||
msflags |= WS_MAXIMIZE;
|
|
||||||
if (style & wxCAPTION)
|
|
||||||
msflags |= WS_CAPTION;
|
|
||||||
if (style & wxCLIP_CHILDREN)
|
|
||||||
msflags |= WS_CLIPCHILDREN;
|
|
||||||
|
|
||||||
// Keep this in wxFrameMSW because it saves recoding this function
|
|
||||||
// in wxTinyFrame
|
|
||||||
#if wxUSE_ITSY_BITSY && !defined(__WIN32__)
|
|
||||||
if (style & wxTINY_CAPTION_VERT)
|
|
||||||
msflags |= IBS_VERTCAPTION;
|
|
||||||
if (style & wxTINY_CAPTION_HORIZ)
|
|
||||||
msflags |= IBS_HORZCAPTION;
|
|
||||||
#else
|
|
||||||
if (style & wxTINY_CAPTION_VERT)
|
|
||||||
msflags |= WS_CAPTION;
|
|
||||||
if (style & wxTINY_CAPTION_HORIZ)
|
|
||||||
msflags |= WS_CAPTION;
|
|
||||||
#endif
|
|
||||||
if ((style & wxTHICK_FRAME) == 0)
|
|
||||||
msflags |= WS_BORDER;
|
|
||||||
|
|
||||||
WXDWORD extendedStyle = MakeExtendedStyle(style);
|
|
||||||
|
|
||||||
// make all frames appear in the win9x shell taskbar unless
|
|
||||||
// wxFRAME_TOOL_WINDOW or wxFRAME_NO_TASKBAR is given - without giving them
|
|
||||||
// WS_EX_APPWINDOW style, the child (i.e. owned) frames wouldn't appear in it
|
|
||||||
#if !defined(__WIN16__) && !defined(__SC__)
|
|
||||||
if ( (style & wxFRAME_TOOL_WINDOW) ||
|
|
||||||
(style & wxFRAME_NO_TASKBAR) )
|
|
||||||
extendedStyle |= WS_EX_TOOLWINDOW;
|
|
||||||
else if ( !(style & wxFRAME_NO_TASKBAR) )
|
|
||||||
extendedStyle |= WS_EX_APPWINDOW;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (style & wxSTAY_ON_TOP)
|
|
||||||
extendedStyle |= WS_EX_TOPMOST;
|
|
||||||
|
|
||||||
#ifndef __WIN16__
|
|
||||||
if (m_exStyle & wxFRAME_EX_CONTEXTHELP)
|
|
||||||
extendedStyle |= WS_EX_CONTEXTHELP;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_iconized = FALSE;
|
|
||||||
if ( !wxWindow::MSWCreate(id, parent, wclass, wx_win, title, x, y, width, height,
|
|
||||||
msflags, NULL, extendedStyle) )
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
// Seems to be necessary if we use WS_POPUP
|
|
||||||
// style instead of WS_OVERLAPPED
|
|
||||||
if (width > -1 && height > -1)
|
|
||||||
::PostMessage(GetHwnd(), WM_SIZE, SIZE_RESTORED, MAKELPARAM(width, height));
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Default activation behaviour - set the focus for the first child
|
// Default activation behaviour - set the focus for the first child
|
||||||
// subwindow found.
|
// subwindow found.
|
||||||
void wxFrameMSW::OnActivate(wxActivateEvent& event)
|
void wxFrameMSW::OnActivate(wxActivateEvent& event)
|
||||||
|
@@ -33,7 +33,8 @@
|
|||||||
|
|
||||||
#include <wx/glcanvas.h>
|
#include <wx/glcanvas.h>
|
||||||
|
|
||||||
wxChar wxGLCanvasClassName[] = wxT("wxGLCanvasClass");
|
static const wxChar *wxGLCanvasClassName = wxT("wxGLCanvasClass");
|
||||||
|
static const wxChar *wxGLCanvasClassNameNoRedraw = wxT("wxGLCanvasClassNR");
|
||||||
|
|
||||||
LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message,
|
LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message,
|
||||||
WPARAM wParam, LPARAM lParam);
|
WPARAM wParam, LPARAM lParam);
|
||||||
@@ -213,25 +214,16 @@ wxGLCanvas::~wxGLCanvas()
|
|||||||
::ReleaseDC((HWND) GetHWND(), (HDC) m_hDC);
|
::ReleaseDC((HWND) GetHWND(), (HDC) m_hDC);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replaces wxWindow::Create functionality, since we need to use a different window class
|
// Replaces wxWindow::Create functionality, since we need to use a different
|
||||||
bool wxGLCanvas::Create(wxWindow *parent, wxWindowID id,
|
// window class
|
||||||
const wxPoint& pos, const wxSize& size, long style, const wxString& name)
|
bool wxGLCanvas::Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
long style,
|
||||||
|
const wxString& name)
|
||||||
{
|
{
|
||||||
/*
|
static bool s_registeredGLCanvasClass = FALSE;
|
||||||
Suggestion from Kelly Brock <kbrock@8cs.com> (not yet implemented):
|
|
||||||
|
|
||||||
OpenGL corruption fix is simple assuming it doesn't screw anything else
|
|
||||||
up. Add the following line to the top of the create function:
|
|
||||||
|
|
||||||
wxSize parentSize = GetClientSize();
|
|
||||||
|
|
||||||
All locations within the function that use 'size' are changed to
|
|
||||||
'parentSize'.
|
|
||||||
The above corrects the initial display corruption with the GeForce and
|
|
||||||
TNT2, not sure about other NVidia cards yet.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static bool registeredGLCanvasClass = FALSE;
|
|
||||||
|
|
||||||
// We have to register a special window class because we need
|
// We have to register a special window class because we need
|
||||||
// the CS_OWNDC style for GLCanvas.
|
// the CS_OWNDC style for GLCanvas.
|
||||||
@@ -253,12 +245,10 @@ bool wxGLCanvas::Create(wxWindow *parent, wxWindowID id,
|
|||||||
only way to prevent this, the only reliable means, is to set CS_OWNDC."
|
only way to prevent this, the only reliable means, is to set CS_OWNDC."
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!registeredGLCanvasClass)
|
if (!s_registeredGLCanvasClass)
|
||||||
{
|
{
|
||||||
WNDCLASS wndclass;
|
WNDCLASS wndclass;
|
||||||
|
|
||||||
static const long styleNormal = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_OWNDC;
|
|
||||||
|
|
||||||
// the fields which are common to all classes
|
// the fields which are common to all classes
|
||||||
wndclass.lpfnWndProc = (WNDPROC)wxWndProc;
|
wndclass.lpfnWndProc = (WNDPROC)wxWndProc;
|
||||||
wndclass.cbClsExtra = 0;
|
wndclass.cbClsExtra = 0;
|
||||||
@@ -271,15 +261,29 @@ bool wxGLCanvas::Create(wxWindow *parent, wxWindowID id,
|
|||||||
// Register the GLCanvas class name
|
// Register the GLCanvas class name
|
||||||
wndclass.hbrBackground = (HBRUSH)NULL;
|
wndclass.hbrBackground = (HBRUSH)NULL;
|
||||||
wndclass.lpszClassName = wxGLCanvasClassName;
|
wndclass.lpszClassName = wxGLCanvasClassName;
|
||||||
wndclass.style = styleNormal;
|
wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_OWNDC;
|
||||||
|
|
||||||
if ( !RegisterClass(&wndclass) )
|
if ( !::RegisterClass(&wndclass) )
|
||||||
{
|
{
|
||||||
wxLogLastError(wxT("RegisterClass(wxGLCanvasClass)"));
|
wxLogLastError(wxT("RegisterClass(wxGLCanvasClass)"));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
registeredGLCanvasClass = TRUE;
|
// Register the GLCanvas class name for windows which don't do full repaint
|
||||||
|
// on resize
|
||||||
|
wndclass.lpszClassName = wxGLCanvasClassNameNoRedraw;
|
||||||
|
wndclass.style &= ~(CS_HREDRAW | CS_VREDRAW);
|
||||||
|
|
||||||
|
if ( !::RegisterClass(&wndclass) )
|
||||||
|
{
|
||||||
|
wxLogLastError(wxT("RegisterClass(wxGLCanvasClassNameNoRedraw)"));
|
||||||
|
|
||||||
|
::UnregisterClass(wxGLCanvasClass, wxhInstance());
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
s_registeredGLCanvasClass = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCHECK_MSG( parent, FALSE, wxT("can't create wxWindow without parent") );
|
wxCHECK_MSG( parent, FALSE, wxT("can't create wxWindow without parent") );
|
||||||
@@ -302,10 +306,7 @@ bool wxGLCanvas::Create(wxWindow *parent, wxWindowID id,
|
|||||||
books that contain the wgl function descriptions.
|
books that contain the wgl function descriptions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
msflags |= WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS;
|
msflags |= WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
|
||||||
// if ( style & wxCLIP_CHILDREN )
|
|
||||||
// msflags |= WS_CLIPCHILDREN;
|
|
||||||
msflags |= WS_CLIPCHILDREN;
|
|
||||||
|
|
||||||
bool want3D;
|
bool want3D;
|
||||||
WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D);
|
WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D);
|
||||||
@@ -326,12 +327,7 @@ bool wxGLCanvas::Create(wxWindow *parent, wxWindowID id,
|
|||||||
DLGC_WANTTAB | DLGC_WANTMESSAGE;
|
DLGC_WANTTAB | DLGC_WANTMESSAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
MSWCreate(m_windowId, parent, wxGLCanvasClassName, this, NULL,
|
return MSWCreate(wxGLCanvasClassName, NULL, pos, size, msflags, exStyle);
|
||||||
pos.x, pos.y,
|
|
||||||
WidthDefault(size.x), HeightDefault(size.y),
|
|
||||||
msflags, NULL, exStyle);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AdjustPFDForAttributes(PIXELFORMATDESCRIPTOR& pfd, int *attribList)
|
static void AdjustPFDForAttributes(PIXELFORMATDESCRIPTOR& pfd, int *attribList)
|
||||||
|
@@ -67,8 +67,6 @@ extern const wxChar *wxMDIFrameClassName; // from app.cpp
|
|||||||
extern const wxChar *wxMDIChildFrameClassName;
|
extern const wxChar *wxMDIChildFrameClassName;
|
||||||
extern const wxChar *wxMDIChildFrameClassNameNoRedraw;
|
extern const wxChar *wxMDIChildFrameClassNameNoRedraw;
|
||||||
|
|
||||||
extern wxWindow *wxWndHook; // from window.cpp
|
|
||||||
|
|
||||||
extern void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win);
|
extern void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win);
|
||||||
extern void wxRemoveHandleAssociation(wxWindow *win);
|
extern void wxRemoveHandleAssociation(wxWindow *win);
|
||||||
|
|
||||||
@@ -192,44 +190,22 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
|
|||||||
SetName(name);
|
SetName(name);
|
||||||
m_windowStyle = style;
|
m_windowStyle = style;
|
||||||
|
|
||||||
if (parent) parent->AddChild(this);
|
if ( parent )
|
||||||
|
parent->AddChild(this);
|
||||||
|
|
||||||
if ( id > -1 )
|
if ( id > -1 )
|
||||||
m_windowId = id;
|
m_windowId = id;
|
||||||
else
|
else
|
||||||
m_windowId = (int)NewControlId();
|
m_windowId = NewControlId();
|
||||||
|
|
||||||
int x = pos.x;
|
long exflags;
|
||||||
int y = pos.y;
|
long msflags = MSWGetCreateWindowFlags(&exflags);
|
||||||
int width = size.x;
|
|
||||||
int height = size.y;
|
|
||||||
|
|
||||||
DWORD msflags = WS_OVERLAPPED;
|
if ( !wxWindow::MSWCreate(wxMDIFrameClassName,
|
||||||
if (style & wxMINIMIZE_BOX)
|
|
||||||
msflags |= WS_MINIMIZEBOX;
|
|
||||||
if (style & wxMAXIMIZE_BOX)
|
|
||||||
msflags |= WS_MAXIMIZEBOX;
|
|
||||||
if (style & wxTHICK_FRAME)
|
|
||||||
msflags |= WS_THICKFRAME;
|
|
||||||
if (style & wxSYSTEM_MENU)
|
|
||||||
msflags |= WS_SYSMENU;
|
|
||||||
if ((style & wxMINIMIZE) || (style & wxICONIZE))
|
|
||||||
msflags |= WS_MINIMIZE;
|
|
||||||
if (style & wxMAXIMIZE)
|
|
||||||
msflags |= WS_MAXIMIZE;
|
|
||||||
if (style & wxCAPTION)
|
|
||||||
msflags |= WS_CAPTION;
|
|
||||||
|
|
||||||
if (style & wxCLIP_CHILDREN)
|
|
||||||
msflags |= WS_CLIPCHILDREN;
|
|
||||||
|
|
||||||
if ( !wxWindow::MSWCreate(m_windowId,
|
|
||||||
parent,
|
|
||||||
wxMDIFrameClassName,
|
|
||||||
this,
|
|
||||||
title,
|
title,
|
||||||
x, y, width, height,
|
pos, size,
|
||||||
msflags) )
|
msflags,
|
||||||
|
exflags) )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -662,8 +638,6 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
|
|||||||
parent->AddChild(this);
|
parent->AddChild(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWndHook = this;
|
|
||||||
|
|
||||||
int x = pos.x;
|
int x = pos.x;
|
||||||
int y = pos.y;
|
int y = pos.y;
|
||||||
int width = size.x;
|
int width = size.x;
|
||||||
@@ -716,15 +690,13 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
|
|||||||
|
|
||||||
mcs.lParam = 0;
|
mcs.lParam = 0;
|
||||||
|
|
||||||
|
wxWindowCreationHook hook(this);
|
||||||
|
|
||||||
m_hWnd = (WXHWND)::SendMessage(GetWinHwnd(parent->GetClientWindow()),
|
m_hWnd = (WXHWND)::SendMessage(GetWinHwnd(parent->GetClientWindow()),
|
||||||
WM_MDICREATE, 0, (LONG)(LPSTR)&mcs);
|
WM_MDICREATE, 0, (LONG)(LPSTR)&mcs);
|
||||||
|
|
||||||
wxWndHook = NULL;
|
|
||||||
wxAssociateWinWithHandle((HWND) GetHWND(), this);
|
wxAssociateWinWithHandle((HWND) GetHWND(), this);
|
||||||
|
|
||||||
// VZ: what's this? an act of piracy?
|
|
||||||
//SetWindowLong(GetHwnd(), 0, (long)this);
|
|
||||||
|
|
||||||
wxModelessWindows.Append(this);
|
wxModelessWindows.Append(this);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -1195,7 +1167,7 @@ bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style)
|
|||||||
DWORD exStyle = 0;
|
DWORD exStyle = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxWndHook = this;
|
wxWindowCreationHook hook(this);
|
||||||
m_hWnd = (WXHWND)::CreateWindowEx
|
m_hWnd = (WXHWND)::CreateWindowEx
|
||||||
(
|
(
|
||||||
exStyle,
|
exStyle,
|
||||||
@@ -1215,7 +1187,6 @@ bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SubclassWin(m_hWnd);
|
SubclassWin(m_hWnd);
|
||||||
wxWndHook = NULL;
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@@ -43,7 +43,6 @@
|
|||||||
// global functions
|
// global functions
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
extern wxWindow *wxWndHook;
|
|
||||||
extern LONG APIENTRY _EXPORT wxDlgProc(HWND hWnd, UINT message,
|
extern LONG APIENTRY _EXPORT wxDlgProc(HWND hWnd, UINT message,
|
||||||
WPARAM wParam, LPARAM lParam);
|
WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
@@ -54,12 +53,12 @@ extern LONG APIENTRY _EXPORT wxDlgProc(HWND hWnd, UINT message,
|
|||||||
bool wxWindow::LoadNativeDialog(wxWindow* parent, wxWindowID& id)
|
bool wxWindow::LoadNativeDialog(wxWindow* parent, wxWindowID& id)
|
||||||
{
|
{
|
||||||
m_windowId = id;
|
m_windowId = id;
|
||||||
wxWndHook = this;
|
|
||||||
|
wxWindowCreationHook hook(this);
|
||||||
m_hWnd = (WXHWND)::CreateDialog((HINSTANCE)wxGetInstance(),
|
m_hWnd = (WXHWND)::CreateDialog((HINSTANCE)wxGetInstance(),
|
||||||
MAKEINTRESOURCE(id),
|
MAKEINTRESOURCE(id),
|
||||||
parent ? (HWND)parent->GetHWND() : 0,
|
parent ? (HWND)parent->GetHWND() : 0,
|
||||||
(DLGPROC) wxDlgProc);
|
(DLGPROC) wxDlgProc);
|
||||||
wxWndHook = NULL;
|
|
||||||
|
|
||||||
if ( !m_hWnd )
|
if ( !m_hWnd )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -93,12 +92,11 @@ bool wxWindow::LoadNativeDialog(wxWindow* parent, const wxString& name)
|
|||||||
{
|
{
|
||||||
SetName(name);
|
SetName(name);
|
||||||
|
|
||||||
wxWndHook = this;
|
wxWindowCreationHook hook(this);
|
||||||
m_hWnd = (WXHWND)::CreateDialog((HINSTANCE) wxGetInstance(),
|
m_hWnd = (WXHWND)::CreateDialog((HINSTANCE) wxGetInstance(),
|
||||||
name.c_str(),
|
name.c_str(),
|
||||||
parent ? (HWND)parent->GetHWND() : 0,
|
parent ? (HWND)parent->GetHWND() : 0,
|
||||||
(DLGPROC)wxDlgProc);
|
(DLGPROC)wxDlgProc);
|
||||||
wxWndHook = NULL;
|
|
||||||
|
|
||||||
if ( !m_hWnd )
|
if ( !m_hWnd )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@@ -172,9 +172,7 @@ bool wxNotebook::Create(wxWindow *parent,
|
|||||||
tabStyle |= TCS_VERTICAL|TCS_RIGHT;
|
tabStyle |= TCS_VERTICAL|TCS_RIGHT;
|
||||||
|
|
||||||
|
|
||||||
if ( !MSWCreate(GetId(), GetParent(), WC_TABCONTROL,
|
if ( !MSWCreateControl(WC_TABCONTROL, tabStyle, pos, size) )
|
||||||
this, NULL, pos.x, pos.y, size.x, size.y,
|
|
||||||
tabStyle, NULL, 0) )
|
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@@ -56,10 +56,31 @@ static inline bool IsZoomed(HWND WXUNUSED(hwnd)) { return FALSE; }
|
|||||||
// list of all frames and modeless dialogs
|
// list of all frames and modeless dialogs
|
||||||
wxWindowList wxModelessWindows;
|
wxWindowList wxModelessWindows;
|
||||||
|
|
||||||
|
// the name of the default wxWindows class
|
||||||
|
extern const wxChar *wxCanvasClassName;
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// wxTopLevelWindowMSW implementation
|
// wxTopLevelWindowMSW implementation
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
|
// Dialog window proc
|
||||||
|
LONG APIENTRY _EXPORT
|
||||||
|
wxDlgProc(HWND WXUNUSED(hWnd), UINT message, WPARAM WXUNUSED(wParam), LPARAM WXUNUSED(lParam))
|
||||||
|
{
|
||||||
|
if ( message == WM_INITDIALOG )
|
||||||
|
{
|
||||||
|
// for this message, returning TRUE tells system to set focus to the
|
||||||
|
// first control in the dialog box
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// for all the other ones, FALSE means that we didn't process the
|
||||||
|
// message
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxTopLevelWindowMSW creation
|
// wxTopLevelWindowMSW creation
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -68,6 +89,180 @@ void wxTopLevelWindowMSW::Init()
|
|||||||
{
|
{
|
||||||
m_iconized =
|
m_iconized =
|
||||||
m_maximizeOnShow = FALSE;
|
m_maximizeOnShow = FALSE;
|
||||||
|
|
||||||
|
// unlike (almost?) all other windows, frames are created hidden
|
||||||
|
m_isShown = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
long wxTopLevelWindowMSW::MSWGetCreateWindowFlags(long *exflags) const
|
||||||
|
{
|
||||||
|
long style = GetWindowStyle();
|
||||||
|
long msflags = 0;
|
||||||
|
|
||||||
|
// first select the kind of window being created
|
||||||
|
if ( style & wxCAPTION )
|
||||||
|
{
|
||||||
|
if ( style & wxFRAME_TOOL_WINDOW )
|
||||||
|
msflags |= WS_POPUPWINDOW;
|
||||||
|
else
|
||||||
|
msflags |= WS_OVERLAPPED;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msflags |= WS_POPUP;
|
||||||
|
}
|
||||||
|
|
||||||
|
// next translate the individual flags
|
||||||
|
if ( style & wxMINIMIZE_BOX )
|
||||||
|
msflags |= WS_MINIMIZEBOX;
|
||||||
|
if ( style & wxMAXIMIZE_BOX )
|
||||||
|
msflags |= WS_MAXIMIZEBOX;
|
||||||
|
if ( style & wxTHICK_FRAME )
|
||||||
|
msflags |= WS_THICKFRAME;
|
||||||
|
if ( style & wxSYSTEM_MENU )
|
||||||
|
msflags |= WS_SYSMENU;
|
||||||
|
if ( style & wxMINIMIZE )
|
||||||
|
msflags |= WS_MINIMIZE;
|
||||||
|
if ( style & wxMAXIMIZE )
|
||||||
|
msflags |= WS_MAXIMIZE;
|
||||||
|
if ( style & wxCAPTION )
|
||||||
|
msflags |= WS_CAPTION;
|
||||||
|
if ( style & wxCLIP_CHILDREN )
|
||||||
|
msflags |= WS_CLIPCHILDREN;
|
||||||
|
|
||||||
|
// Keep this here because it saves recoding this function in wxTinyFrame
|
||||||
|
#if wxUSE_ITSY_BITSY && !defined(__WIN32__)
|
||||||
|
if ( style & wxTINY_CAPTION_VERT )
|
||||||
|
msflags |= IBS_VERTCAPTION;
|
||||||
|
if ( style & wxTINY_CAPTION_HORIZ )
|
||||||
|
msflags |= IBS_HORZCAPTION;
|
||||||
|
#else
|
||||||
|
if ( style & (wxTINY_CAPTION_VERT | wxTINY_CAPTION_HORIZ) )
|
||||||
|
msflags |= WS_CAPTION;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if ( exflags )
|
||||||
|
{
|
||||||
|
*exflags = MakeExtendedStyle(style);
|
||||||
|
|
||||||
|
// make all frames appear in the win9x shell taskbar unless
|
||||||
|
// wxFRAME_TOOL_WINDOW or wxFRAME_NO_TASKBAR is given - without giving
|
||||||
|
// them WS_EX_APPWINDOW style, the child (i.e. owned) frames wouldn't
|
||||||
|
// appear in it
|
||||||
|
#if !defined(__WIN16__) && !defined(__SC__)
|
||||||
|
if ( (style & wxFRAME_TOOL_WINDOW) || (style & wxFRAME_NO_TASKBAR) )
|
||||||
|
*exflags |= WS_EX_TOOLWINDOW;
|
||||||
|
else if ( !(style & wxFRAME_NO_TASKBAR) )
|
||||||
|
*exflags |= WS_EX_APPWINDOW;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if ( style & wxSTAY_ON_TOP )
|
||||||
|
*exflags |= WS_EX_TOPMOST;
|
||||||
|
|
||||||
|
#ifdef __WIN32__
|
||||||
|
if ( m_exStyle & wxFRAME_EX_CONTEXTHELP )
|
||||||
|
*exflags |= WS_EX_CONTEXTHELP;
|
||||||
|
#endif // __WIN32__
|
||||||
|
}
|
||||||
|
|
||||||
|
return msflags;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxTopLevelWindowMSW::CreateDialog(const wxChar *dlgTemplate,
|
||||||
|
const wxString& title,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size)
|
||||||
|
{
|
||||||
|
#ifdef __WXMICROWIN__
|
||||||
|
// no dialogs support under MicroWin yet
|
||||||
|
return CreateFrame(title, pos, size);
|
||||||
|
#else // !__WXMICROWIN__
|
||||||
|
wxWindow *parent = GetParent();
|
||||||
|
|
||||||
|
// for the dialogs without wxDIALOG_NO_PARENT style, use the top level
|
||||||
|
// app window as parent - this avoids creating modal dialogs without
|
||||||
|
// parent
|
||||||
|
if ( !parent && !(GetWindowStyleFlag() & wxDIALOG_NO_PARENT) )
|
||||||
|
{
|
||||||
|
parent = wxTheApp->GetTopWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_hWnd = (WXHWND)::CreateDialog(wxGetInstance(),
|
||||||
|
dlgTemplate,
|
||||||
|
parent ? GetHwndOf(parent) : NULL,
|
||||||
|
(DLGPROC)wxDlgProc);
|
||||||
|
|
||||||
|
if ( !m_hWnd )
|
||||||
|
{
|
||||||
|
wxFAIL_MSG(_("Did you forget to include wx/msw/wx.rc in your resources?"));
|
||||||
|
|
||||||
|
wxLogSysError(_("Can't create dialog using template '%s'"), dlgTemplate);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
long exflags;
|
||||||
|
(void)MSWGetCreateWindowFlags(&exflags);
|
||||||
|
|
||||||
|
if ( exflags )
|
||||||
|
{
|
||||||
|
::SetWindowLong(GetHwnd(), GWL_EXSTYLE, exflags);
|
||||||
|
::SetWindowPos(GetHwnd(), NULL, 0, 0, 0, 0,
|
||||||
|
SWP_NOSIZE |
|
||||||
|
SWP_NOMOVE |
|
||||||
|
SWP_NOZORDER |
|
||||||
|
SWP_NOACTIVATE);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(__WIN95__)
|
||||||
|
// For some reason, the system menu is activated when we use the
|
||||||
|
// WS_EX_CONTEXTHELP style, so let's set a reasonable icon
|
||||||
|
if ( exflags & WS_EX_CONTEXTHELP )
|
||||||
|
{
|
||||||
|
wxFrame *winTop = wxDynamicCast(wxTheApp->GetTopWindow(), wxFrame);
|
||||||
|
if ( winTop )
|
||||||
|
{
|
||||||
|
wxIcon icon = winTop->GetIcon();
|
||||||
|
if ( icon.Ok() )
|
||||||
|
{
|
||||||
|
::SendMessage(GetHwnd(), WM_SETICON,
|
||||||
|
(WPARAM)TRUE,
|
||||||
|
(LPARAM)GetHiconOf(icon));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // __WIN95__
|
||||||
|
|
||||||
|
// move the dialog to its initial position without forcing repainting
|
||||||
|
int x, y, w, h;
|
||||||
|
if ( MSWGetCreateWindowCoords(pos, size, x, y, w, h) )
|
||||||
|
{
|
||||||
|
if ( !::MoveWindow(GetHwnd(), x, y, w, h, FALSE) )
|
||||||
|
{
|
||||||
|
wxLogLastError(wxT("MoveWindow"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//else: leave it at default position
|
||||||
|
|
||||||
|
if ( !title.empty() )
|
||||||
|
{
|
||||||
|
::SetWindowText(GetHwnd(), title);
|
||||||
|
}
|
||||||
|
|
||||||
|
SubclassWin(m_hWnd);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
#endif // __WXMICROWIN__/!__WXMICROWIN__
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxTopLevelWindowMSW::CreateFrame(const wxString& title,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size)
|
||||||
|
{
|
||||||
|
long exflags;
|
||||||
|
long flags = MSWGetCreateWindowFlags(&exflags);
|
||||||
|
|
||||||
|
return MSWCreate(wxCanvasClassName, title, pos, size, flags, exflags);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTopLevelWindowMSW::Create(wxWindow *parent,
|
bool wxTopLevelWindowMSW::Create(wxWindow *parent,
|
||||||
@@ -92,7 +287,35 @@ bool wxTopLevelWindowMSW::Create(wxWindow *parent,
|
|||||||
if ( parent )
|
if ( parent )
|
||||||
parent->AddChild(this);
|
parent->AddChild(this);
|
||||||
|
|
||||||
return TRUE;
|
if ( GetExtraStyle() & wxTOPLEVEL_EX_DIALOG )
|
||||||
|
{
|
||||||
|
// TODO: it would be better to construct the dialog template in memory
|
||||||
|
// during run-time than to rely on the limited number of
|
||||||
|
// templates in wx.rc because:
|
||||||
|
// a) you wouldn't have to include wx.rc in all wxWin programs
|
||||||
|
// (and the number of complaints about it would dtop)
|
||||||
|
// b) we'd be able to provide more templates simply, i.e.
|
||||||
|
// we could generate the templates for all style
|
||||||
|
// combinations
|
||||||
|
|
||||||
|
// we have different dialog templates to allows creation of dialogs
|
||||||
|
// with & without captions under MSWindows, resizeable or not (but a
|
||||||
|
// resizeable dialog always has caption - otherwise it would look too
|
||||||
|
// strange)
|
||||||
|
const wxChar *dlgTemplate;
|
||||||
|
if ( style & wxRESIZE_BORDER )
|
||||||
|
dlgTemplate = wxT("wxResizeableDialog");
|
||||||
|
else if ( style & wxCAPTION )
|
||||||
|
dlgTemplate = wxT("wxCaptionDialog");
|
||||||
|
else
|
||||||
|
dlgTemplate = wxT("wxNoCaptionDialog");
|
||||||
|
|
||||||
|
return CreateDialog(dlgTemplate, title, pos, size);
|
||||||
|
}
|
||||||
|
else // !dialog
|
||||||
|
{
|
||||||
|
return CreateFrame(title, pos, size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTopLevelWindowMSW::~wxTopLevelWindowMSW()
|
wxTopLevelWindowMSW::~wxTopLevelWindowMSW()
|
||||||
|
@@ -433,11 +433,7 @@ bool wxWindowMSW::Create(wxWindow *parent,
|
|||||||
m_isShown = FALSE;
|
m_isShown = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return MSWCreate(m_windowId, parent, wxCanvasClassName,
|
return MSWCreate(wxCanvasClassName, NULL, pos, size, msflags, exStyle);
|
||||||
(wxWindow *)this, NULL,
|
|
||||||
pos.x, pos.y,
|
|
||||||
WidthDefault(size.x), HeightDefault(size.y),
|
|
||||||
msflags, NULL, exStyle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -986,11 +982,19 @@ void wxWindowMSW::SubclassWin(WXHWND hWnd)
|
|||||||
|
|
||||||
wxAssociateWinWithHandle(hwnd, this);
|
wxAssociateWinWithHandle(hwnd, this);
|
||||||
|
|
||||||
m_oldWndProc = (WXFARPROC) GetWindowLong(hwnd, GWL_WNDPROC);
|
m_oldWndProc = (WXFARPROC)::GetWindowLong(hwnd, GWL_WNDPROC);
|
||||||
|
|
||||||
wxASSERT( (WXFARPROC) m_oldWndProc != (WXFARPROC) wxWndProc );
|
// we don't need to subclass the window of our own class (in the Windows
|
||||||
|
// sense of the word)
|
||||||
SetWindowLong(hwnd, GWL_WNDPROC, (LONG) wxWndProc);
|
if ( (WXFARPROC) m_oldWndProc != (WXFARPROC) wxWndProc )
|
||||||
|
{
|
||||||
|
::SetWindowLong(hwnd, GWL_WNDPROC, (LONG) wxWndProc);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// don't bother restoring it neither
|
||||||
|
m_oldWndProc = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMSW::UnsubclassWin()
|
void wxWindowMSW::UnsubclassWin()
|
||||||
@@ -1005,11 +1009,15 @@ void wxWindowMSW::UnsubclassWin()
|
|||||||
|
|
||||||
wxCHECK_RET( ::IsWindow(hwnd), wxT("invalid HWND in UnsubclassWin") );
|
wxCHECK_RET( ::IsWindow(hwnd), wxT("invalid HWND in UnsubclassWin") );
|
||||||
|
|
||||||
FARPROC farProc = (FARPROC) GetWindowLong(hwnd, GWL_WNDPROC);
|
if ( m_oldWndProc )
|
||||||
if ( (m_oldWndProc != 0) && (farProc != (FARPROC) m_oldWndProc) )
|
|
||||||
{
|
{
|
||||||
SetWindowLong(hwnd, GWL_WNDPROC, (LONG) m_oldWndProc);
|
FARPROC wndProc = (FARPROC)::GetWindowLong(hwnd, GWL_WNDPROC);
|
||||||
m_oldWndProc = 0;
|
if ( wndProc != (FARPROC) m_oldWndProc )
|
||||||
|
{
|
||||||
|
::SetWindowLong(hwnd, GWL_WNDPROC, (LONG) m_oldWndProc);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_oldWndProc = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1035,6 +1043,7 @@ WXDWORD wxWindowMSW::MakeExtendedStyle(long style, bool eliminateBorders)
|
|||||||
exStyle |= WS_EX_STATICEDGE;
|
exStyle |= WS_EX_STATICEDGE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return exStyle;
|
return exStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1053,7 +1062,7 @@ WXDWORD wxWindowMSW::Determine3DEffects(WXDWORD defaultBorderStyle,
|
|||||||
|| (m_windowStyle & wxNO_BORDER) )
|
|| (m_windowStyle & wxNO_BORDER) )
|
||||||
{
|
{
|
||||||
*want3D = FALSE;
|
*want3D = FALSE;
|
||||||
return MakeExtendedStyle(m_windowStyle, FALSE);
|
return MakeExtendedStyle(m_windowStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine whether we should be using 3D effects or not.
|
// Determine whether we should be using 3D effects or not.
|
||||||
@@ -2007,7 +2016,19 @@ void wxWindowMSW::UnpackMenuSelect(WXWPARAM wParam, WXLPARAM lParam,
|
|||||||
|
|
||||||
// Hook for new window just as it's being created, when the window isn't yet
|
// Hook for new window just as it's being created, when the window isn't yet
|
||||||
// associated with the handle
|
// associated with the handle
|
||||||
wxWindowMSW *wxWndHook = NULL;
|
static wxWindowMSW *gs_winBeingCreated = NULL;
|
||||||
|
|
||||||
|
// implementation of wxWindowCreationHook class: it just sets gs_winBeingCreated to the
|
||||||
|
// window being created and insures that it's always unset back later
|
||||||
|
wxWindowCreationHook::wxWindowCreationHook(wxWindowMSW *winBeingCreated)
|
||||||
|
{
|
||||||
|
gs_winBeingCreated = winBeingCreated;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxWindowCreationHook::~wxWindowCreationHook()
|
||||||
|
{
|
||||||
|
gs_winBeingCreated = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// Main window proc
|
// Main window proc
|
||||||
LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
@@ -2021,38 +2042,21 @@ LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM w
|
|||||||
wxWindowMSW *wnd = wxFindWinFromHandle((WXHWND) hWnd);
|
wxWindowMSW *wnd = wxFindWinFromHandle((WXHWND) hWnd);
|
||||||
|
|
||||||
// when we get the first message for the HWND we just created, we associate
|
// when we get the first message for the HWND we just created, we associate
|
||||||
// it with wxWindow stored in wxWndHook
|
// it with wxWindow stored in gs_winBeingCreated
|
||||||
if ( !wnd && wxWndHook )
|
if ( !wnd && gs_winBeingCreated )
|
||||||
{
|
{
|
||||||
#if 0 // def __WXDEBUG__
|
wxAssociateWinWithHandle(hWnd, gs_winBeingCreated);
|
||||||
char buf[512];
|
wnd = gs_winBeingCreated;
|
||||||
::GetClassNameA((HWND) hWnd, buf, 512);
|
gs_winBeingCreated = NULL;
|
||||||
wxString className(buf);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
wxAssociateWinWithHandle(hWnd, wxWndHook);
|
|
||||||
wnd = wxWndHook;
|
|
||||||
wxWndHook = NULL;
|
|
||||||
wnd->SetHWND((WXHWND)hWnd);
|
wnd->SetHWND((WXHWND)hWnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT rc;
|
LRESULT rc;
|
||||||
|
|
||||||
// Stop right here if we don't have a valid handle in our wxWindow object.
|
|
||||||
if ( wnd && !wnd->GetHWND() )
|
|
||||||
{
|
|
||||||
// FIXME: why do we do this?
|
|
||||||
wnd->SetHWND((WXHWND) hWnd);
|
|
||||||
rc = wnd->MSWDefWindowProc(message, wParam, lParam );
|
|
||||||
wnd->SetHWND(0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( wnd )
|
if ( wnd )
|
||||||
rc = wnd->MSWWindowProc(message, wParam, lParam);
|
rc = wnd->MSWWindowProc(message, wParam, lParam);
|
||||||
else
|
else
|
||||||
rc = DefWindowProc( hWnd, message, wParam, lParam );
|
rc = ::DefWindowProc(hWnd, message, wParam, lParam);
|
||||||
}
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@@ -2583,25 +2587,12 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
|
|||||||
return rc.result;
|
return rc.result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dialog window proc
|
// ----------------------------------------------------------------------------
|
||||||
LONG APIENTRY _EXPORT
|
// wxWindow <-> HWND map
|
||||||
wxDlgProc(HWND WXUNUSED(hWnd), UINT message, WPARAM WXUNUSED(wParam), LPARAM WXUNUSED(lParam))
|
// ----------------------------------------------------------------------------
|
||||||
{
|
|
||||||
if ( message == WM_INITDIALOG )
|
|
||||||
{
|
|
||||||
// for this message, returning TRUE tells system to set focus to the
|
|
||||||
// first control in the dialog box
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// for all the other ones, FALSE means that we didn't process the
|
|
||||||
// message
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
wxList *wxWinHandleList = NULL;
|
wxList *wxWinHandleList = NULL;
|
||||||
|
|
||||||
wxWindow *wxFindWinFromHandle(WXHWND hWnd)
|
wxWindow *wxFindWinFromHandle(WXHWND hWnd)
|
||||||
{
|
{
|
||||||
wxNode *node = wxWinHandleList->Find((long)hWnd);
|
wxNode *node = wxWinHandleList->Find((long)hWnd);
|
||||||
@@ -2610,10 +2601,6 @@ wxWindow *wxFindWinFromHandle(WXHWND hWnd)
|
|||||||
return (wxWindow *)node->Data();
|
return (wxWindow *)node->Data();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 // def __WXDEBUG__
|
|
||||||
static int gs_AssociationCount = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void wxAssociateWinWithHandle(HWND hWnd, wxWindowMSW *win)
|
void wxAssociateWinWithHandle(HWND hWnd, wxWindowMSW *win)
|
||||||
{
|
{
|
||||||
// adding NULL hWnd is (first) surely a result of an error and
|
// adding NULL hWnd is (first) surely a result of an error and
|
||||||
@@ -2621,36 +2608,30 @@ void wxAssociateWinWithHandle(HWND hWnd, wxWindowMSW *win)
|
|||||||
wxCHECK_RET( hWnd != (HWND)NULL,
|
wxCHECK_RET( hWnd != (HWND)NULL,
|
||||||
wxT("attempt to add a NULL hWnd to window list ignored") );
|
wxT("attempt to add a NULL hWnd to window list ignored") );
|
||||||
|
|
||||||
|
|
||||||
wxWindow *oldWin = wxFindWinFromHandle((WXHWND) hWnd);
|
wxWindow *oldWin = wxFindWinFromHandle((WXHWND) hWnd);
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
if ( oldWin && (oldWin != win) )
|
if ( oldWin && (oldWin != win) )
|
||||||
{
|
{
|
||||||
wxString str(win->GetClassInfo()->GetClassName());
|
wxLogDebug(wxT("HWND %X already associated with another window (%s)"),
|
||||||
wxLogError(wxT("Bug! Found existing HWND %X for new window of class %s"), (int) hWnd, (const wxChar*) str);
|
hWnd, win->GetClassInfo()->GetClassName());
|
||||||
}
|
}
|
||||||
else if (!oldWin)
|
else
|
||||||
|
#endif // __WXDEBUG__
|
||||||
|
if (!oldWin)
|
||||||
{
|
{
|
||||||
#if 0 // def __WXDEBUG__
|
|
||||||
gs_AssociationCount ++;
|
|
||||||
wxLogDebug("+ Association %d", gs_AssociationCount);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
wxWinHandleList->Append((long)hWnd, win);
|
wxWinHandleList->Append((long)hWnd, win);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRemoveHandleAssociation(wxWindowMSW *win)
|
void wxRemoveHandleAssociation(wxWindowMSW *win)
|
||||||
{
|
{
|
||||||
#if 0 // def __WXDEBUG__
|
|
||||||
if (wxWinHandleList->Member(win))
|
|
||||||
{
|
|
||||||
wxLogDebug("- Association %d", gs_AssociationCount);
|
|
||||||
gs_AssociationCount --;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
wxWinHandleList->DeleteObject(win);
|
wxWinHandleList->DeleteObject(win);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// various MSW speciic class dependent functions
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Default destroyer - override if you destroy it in some other way
|
// Default destroyer - override if you destroy it in some other way
|
||||||
// (e.g. with MDI child windows)
|
// (e.g. with MDI child windows)
|
||||||
void wxWindowMSW::MSWDestroyWindow()
|
void wxWindowMSW::MSWDestroyWindow()
|
||||||
@@ -2686,61 +2667,75 @@ void wxWindowMSW::MSWDetachWindowMenu()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif // __WXUNIVERSAL__
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindowMSW::MSWCreate(int id,
|
bool wxWindowMSW::MSWGetCreateWindowCoords(const wxPoint& pos,
|
||||||
wxWindow *parent,
|
const wxSize& size,
|
||||||
const wxChar *wclass,
|
int& x, int& y,
|
||||||
wxWindow * WXUNUSED(wx_win),
|
int& w, int& h) const
|
||||||
const wxChar *title,
|
|
||||||
int x,
|
|
||||||
int y,
|
|
||||||
int width,
|
|
||||||
int height,
|
|
||||||
WXDWORD style,
|
|
||||||
const wxChar *dialog_template,
|
|
||||||
WXDWORD extendedStyle)
|
|
||||||
{
|
{
|
||||||
int x1 = CW_USEDEFAULT;
|
bool nonDefault = FALSE;
|
||||||
int y1 = 0;
|
|
||||||
int width1 = CW_USEDEFAULT;
|
|
||||||
int height1 = 100;
|
|
||||||
|
|
||||||
// Find parent's size, if it exists, to set up a possible default
|
if ( pos.x == -1 )
|
||||||
// panel size the size of the parent window
|
{
|
||||||
RECT rectParent;
|
// if set x to CW_USEDEFAULT, y parameter is ignored anyhow so we can
|
||||||
|
// just as well set it to CW_USEDEFAULT as well
|
||||||
|
x =
|
||||||
|
y = CW_USEDEFAULT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x = pos.x;
|
||||||
|
y = pos.y == -1 ? CW_USEDEFAULT : pos.y;
|
||||||
|
|
||||||
|
nonDefault = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( size.x == -1 || size.y == -1 )
|
||||||
|
{
|
||||||
|
// Find parent's size, if it exists, to set up a possible default panel
|
||||||
|
// size the size of the parent window
|
||||||
|
wxWindow *parent = GetParent();
|
||||||
if ( parent )
|
if ( parent )
|
||||||
{
|
{
|
||||||
|
RECT rectParent;
|
||||||
::GetClientRect(GetHwndOf(parent), &rectParent);
|
::GetClientRect(GetHwndOf(parent), &rectParent);
|
||||||
|
|
||||||
width1 = rectParent.right - rectParent.left;
|
w = size.x == -1 ? rectParent.right - rectParent.left : size.x;
|
||||||
height1 = rectParent.bottom - rectParent.top;
|
h = size.y == -1 ? rectParent.bottom - rectParent.top : size.y;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if ( x != -1 )
|
|
||||||
x1 = x;
|
|
||||||
if ( y != -1 )
|
|
||||||
y1 = y;
|
|
||||||
if ( width != -1 )
|
|
||||||
width1 = width;
|
|
||||||
if ( height != -1 )
|
|
||||||
height1 = height;
|
|
||||||
|
|
||||||
// unfortunately, setting WS_EX_CONTROLPARENT only for some windows in the
|
|
||||||
// hierarchy with several embedded panels (and not all of them) causes the
|
|
||||||
// program to hang during the next call to IsDialogMessage() due to the bug
|
|
||||||
// in this function (at least in Windows NT 4.0, it seems to work ok in
|
|
||||||
// Win2K)
|
|
||||||
#if 0
|
|
||||||
// if we have wxTAB_TRAVERSAL style, we want WS_EX_CONTROLPARENT or
|
|
||||||
// IsDialogMessage() won't work for us
|
|
||||||
if ( GetWindowStyleFlag() & wxTAB_TRAVERSAL )
|
|
||||||
{
|
{
|
||||||
extendedStyle |= WS_EX_CONTROLPARENT;
|
w =
|
||||||
|
h = CW_USEDEFAULT;
|
||||||
}
|
}
|
||||||
#endif // 0
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
w = size.x;
|
||||||
|
h = size.y;
|
||||||
|
|
||||||
|
nonDefault = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return nonDefault;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxWindowMSW::MSWCreate(const wxChar *wclass,
|
||||||
|
const wxChar *title,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
WXDWORD style,
|
||||||
|
WXDWORD extendedStyle)
|
||||||
|
{
|
||||||
|
// choose the position/size for the new window
|
||||||
|
int x, y, w, h;
|
||||||
|
(void)MSWGetCreateWindowCoords(pos, size, x, y, w, h);
|
||||||
|
|
||||||
|
// find the correct parent HWND
|
||||||
|
wxWindow *parent = GetParent();
|
||||||
|
bool isChild = (style & WS_CHILD) != 0;
|
||||||
HWND hParent;
|
HWND hParent;
|
||||||
if ( GetWindowStyleFlag() & wxPOPUP_WINDOW )
|
if ( GetWindowStyleFlag() & wxPOPUP_WINDOW )
|
||||||
{
|
{
|
||||||
@@ -2748,123 +2743,69 @@ bool wxWindowMSW::MSWCreate(int id,
|
|||||||
// be limited to the parents client area as child windows usually are
|
// be limited to the parents client area as child windows usually are
|
||||||
hParent = ::GetDesktopWindow();
|
hParent = ::GetDesktopWindow();
|
||||||
}
|
}
|
||||||
else if ( parent )
|
else // !popup
|
||||||
{
|
{
|
||||||
|
if ( (isChild || (style & WS_POPUPWINDOW)) && parent )
|
||||||
|
{
|
||||||
|
// this is either a normal child window or a top level window with
|
||||||
|
// wxFRAME_TOOL_WINDOW style (see below)
|
||||||
hParent = GetHwndOf(parent);
|
hParent = GetHwndOf(parent);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// top level window
|
// this is either a window for which no parent was specified (not
|
||||||
|
// much we can do then) or a frame without wxFRAME_TOOL_WINDOW
|
||||||
|
// style: we should use NULL parent HWND for it or it would be
|
||||||
|
// always on top of its parent which is not what we usually want
|
||||||
|
// (in fact, we only want it for frames with the special
|
||||||
|
// wxFRAME_TOOL_WINDOW style translated into WS_POPUPWINDOW we test
|
||||||
|
// against above)
|
||||||
hParent = NULL;
|
hParent = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWndHook = this;
|
|
||||||
|
|
||||||
#ifndef __WXMICROWIN__
|
|
||||||
if ( dialog_template )
|
|
||||||
{
|
|
||||||
// for the dialogs without wxDIALOG_NO_PARENT style, use the top level
|
|
||||||
// app window as parent - this avoids creating modal dialogs without
|
|
||||||
// parent
|
|
||||||
if ( !hParent && !(GetWindowStyleFlag() & wxDIALOG_NO_PARENT) )
|
|
||||||
{
|
|
||||||
wxWindow *winTop = wxTheApp->GetTopWindow();
|
|
||||||
if ( winTop )
|
|
||||||
hParent = GetHwndOf(winTop);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_hWnd = (WXHWND)::CreateDialog(wxGetInstance(),
|
// controlId is menu handle for the top level windows, so set it to 0
|
||||||
dialog_template,
|
// unless we're creating a child window
|
||||||
hParent,
|
int controlId;
|
||||||
(DLGPROC)wxDlgProc);
|
if ( isChild )
|
||||||
|
|
||||||
if ( m_hWnd == 0 )
|
|
||||||
{
|
{
|
||||||
wxLogError(_("Can't find dialog template '%s'!\nCheck resource include path for finding wx.rc."),
|
controlId = GetId();
|
||||||
dialog_template);
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( extendedStyle != 0 )
|
|
||||||
{
|
|
||||||
::SetWindowLong(GetHwnd(), GWL_EXSTYLE, extendedStyle);
|
|
||||||
::SetWindowPos(GetHwnd(), NULL, 0, 0, 0, 0,
|
|
||||||
SWP_NOSIZE |
|
|
||||||
SWP_NOMOVE |
|
|
||||||
SWP_NOZORDER |
|
|
||||||
SWP_NOACTIVATE);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(__WIN95__)
|
|
||||||
// For some reason, the system menu is activated when we use the
|
|
||||||
// WS_EX_CONTEXTHELP style, so let's set a reasonable icon
|
|
||||||
if (extendedStyle & WS_EX_CONTEXTHELP)
|
|
||||||
{
|
|
||||||
wxFrame *winTop = wxDynamicCast(wxTheApp->GetTopWindow(), wxFrame);
|
|
||||||
if ( winTop )
|
|
||||||
{
|
|
||||||
wxIcon icon = winTop->GetIcon();
|
|
||||||
if ( icon.Ok() )
|
|
||||||
{
|
|
||||||
::SendMessage(GetHwnd(), WM_SETICON,
|
|
||||||
(WPARAM)TRUE,
|
|
||||||
(LPARAM)GetHiconOf(icon));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif // __WIN95__
|
|
||||||
|
|
||||||
|
|
||||||
// JACS: is the following still necessary? The above seems to work.
|
|
||||||
|
|
||||||
// ::SetWindowLong(GWL_EXSTYLE) doesn't work for the dialogs, so try
|
|
||||||
// to take care of (at least some) extended style flags ourselves
|
|
||||||
if ( extendedStyle & WS_EX_TOPMOST )
|
|
||||||
{
|
|
||||||
if ( !::SetWindowPos(GetHwnd(), HWND_TOPMOST, 0, 0, 0, 0,
|
|
||||||
SWP_NOSIZE | SWP_NOMOVE) )
|
|
||||||
{
|
|
||||||
wxLogLastError(wxT("SetWindowPos"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// move the dialog to its initial position without forcing repainting
|
|
||||||
if ( !::MoveWindow(GetHwnd(), x1, y1, width1, height1, FALSE) )
|
|
||||||
{
|
|
||||||
wxLogLastError(wxT("MoveWindow"));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else // creating a normal window, not a dialog
|
|
||||||
#endif // !__WXMICROWIN__
|
|
||||||
{
|
|
||||||
int controlId = 0;
|
|
||||||
if ( style & WS_CHILD )
|
|
||||||
{
|
|
||||||
controlId = id;
|
|
||||||
|
|
||||||
if ( GetWindowStyleFlag() & wxCLIP_SIBLINGS )
|
if ( GetWindowStyleFlag() & wxCLIP_SIBLINGS )
|
||||||
{
|
{
|
||||||
style |= WS_CLIPSIBLINGS;
|
style |= WS_CLIPSIBLINGS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else // !child
|
||||||
|
{
|
||||||
|
controlId = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// for each class "Foo" we have we also have "FooNR" ("no repaint") class
|
||||||
|
// which is the same but without CS_[HV]REDRAW class styles so using it
|
||||||
|
// ensures that the window is not fully repainted on each resize
|
||||||
wxString className(wclass);
|
wxString className(wclass);
|
||||||
if ( GetWindowStyleFlag() & wxNO_FULL_REPAINT_ON_RESIZE )
|
if ( GetWindowStyleFlag() & wxNO_FULL_REPAINT_ON_RESIZE )
|
||||||
{
|
{
|
||||||
className += wxT("NR");
|
className += wxT("NR");
|
||||||
}
|
}
|
||||||
|
|
||||||
m_hWnd = (WXHWND)CreateWindowEx(extendedStyle,
|
// do create the window
|
||||||
|
wxWindowCreationHook hook(this);
|
||||||
|
|
||||||
|
m_hWnd = (WXHWND)::CreateWindowEx
|
||||||
|
(
|
||||||
|
extendedStyle,
|
||||||
className,
|
className,
|
||||||
title ? title : wxT(""),
|
title ? title : wxT(""),
|
||||||
style,
|
style,
|
||||||
x1, y1,
|
x, y, w, h,
|
||||||
width1, height1,
|
hParent,
|
||||||
hParent, (HMENU)controlId,
|
(HMENU)controlId,
|
||||||
wxGetInstance(),
|
wxGetInstance(),
|
||||||
NULL);
|
NULL // no extra data
|
||||||
|
);
|
||||||
|
|
||||||
if ( !m_hWnd )
|
if ( !m_hWnd )
|
||||||
{
|
{
|
||||||
@@ -2872,23 +2813,8 @@ bool wxWindowMSW::MSWCreate(int id,
|
|||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
wxWndHook = NULL;
|
SubclassWin(m_hWnd);
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
wxNode* node = wxWinHandleList->Member(this);
|
|
||||||
if (node)
|
|
||||||
{
|
|
||||||
HWND hWnd = (HWND) node->GetKeyInteger();
|
|
||||||
if (hWnd != (HWND) m_hWnd)
|
|
||||||
{
|
|
||||||
wxLogError(wxT("A second HWND association is being added for the same window!"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif // Debug
|
|
||||||
|
|
||||||
wxAssociateWinWithHandle((HWND) m_hWnd, this);
|
|
||||||
|
|
||||||
SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
|
SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
|
||||||
|
|
||||||
|
@@ -75,9 +75,9 @@ bool wxTopLevelWindow::Create(wxWindow *parent,
|
|||||||
long styleOrig = 0,
|
long styleOrig = 0,
|
||||||
exstyleOrig = 0;
|
exstyleOrig = 0;
|
||||||
|
|
||||||
|
// FIXME -- wxUniv should provide a way to force non-native decorations!
|
||||||
if ( ms_drawDecorations == -1 )
|
if ( ms_drawDecorations == -1 )
|
||||||
ms_drawDecorations = !wxSystemSettings::HasFrameDecorations();
|
ms_drawDecorations = !wxSystemSettings::HasFrameDecorations();
|
||||||
// FIXME -- wxUniv should provide a way to force non-native decorations!
|
|
||||||
|
|
||||||
if ( ms_drawDecorations )
|
if ( ms_drawDecorations )
|
||||||
{
|
{
|
||||||
@@ -97,15 +97,6 @@ bool wxTopLevelWindow::Create(wxWindow *parent,
|
|||||||
size, style, name) )
|
size, style, name) )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// FIXME: to be removed as soon as wxTLW/wxFrame/wxDialog creation code in
|
|
||||||
// wxMSW is rationalized
|
|
||||||
#ifdef __WXMSW__
|
|
||||||
extern const wxChar *wxFrameClassName;
|
|
||||||
if ( !MSWCreate(id, NULL, wxFrameClassName, this, title,
|
|
||||||
pos.x, pos.y, size.x, size.y, style) )
|
|
||||||
return FALSE;
|
|
||||||
#endif // __WXMSW__
|
|
||||||
|
|
||||||
if ( ms_drawDecorations )
|
if ( ms_drawDecorations )
|
||||||
{
|
{
|
||||||
m_windowStyle = styleOrig;
|
m_windowStyle = styleOrig;
|
||||||
|
Reference in New Issue
Block a user