From bb6290e3514a84a7b50860d1c75d4623696ff601 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 7 Jul 1998 14:57:42 +0000 Subject: [PATCH] Various bug fixes, cosmetic changes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@184 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/msw/msw.rsp | 1 + docs/latex/wx/toolbar.tex | 5 +- docs/latex/wx/tstyles.tex | 2 +- docs/msw/changes.txt | 6 ++ docs/msw/install.txt | 5 +- include/wx/defs.h | 2 + include/wx/event.h | 25 -------- include/wx/memory.h | 2 +- include/wx/msw/app.h | 82 ++++++++++-------------- include/wx/msw/frame.h | 14 ---- include/wx/msw/ole/dropsrc.h | 2 +- include/wx/msw/window.h | 39 ------------ src/common/event.cpp | 81 ------------------------ src/common/memory.cpp | 4 +- src/msw/app.cpp | 109 ++++++++++++++++++-------------- src/msw/frame.cpp | 107 ------------------------------- src/msw/tbar95.cpp | 16 ++++- src/msw/window.cpp | 52 --------------- utils/dialoged/src/dialoged.cpp | 4 -- 19 files changed, 132 insertions(+), 426 deletions(-) diff --git a/distrib/msw/msw.rsp b/distrib/msw/msw.rsp index 436d000b55..4f1f877229 100644 --- a/distrib/msw/msw.rsp +++ b/distrib/msw/msw.rsp @@ -21,6 +21,7 @@ src/msw/*.h src/msw/makefile.* src/msw/*.lst src/msw/*.def +src/msw/*.inc src/msw/ctl3d/*.* src/msw/ctl3d/msvc/*.* diff --git a/docs/latex/wx/toolbar.tex b/docs/latex/wx/toolbar.tex index 155756a81e..365e810151 100644 --- a/docs/latex/wx/toolbar.tex +++ b/docs/latex/wx/toolbar.tex @@ -578,7 +578,10 @@ It uses the native toolbar control. \wxheading{Window styles} -There are no specific styles for this class. +\twocolwidtha{5cm} +\begin{twocollist}\itemsep=0pt +\twocolitem{\windowstyle{wxTB\_FLAT}}{Gives the toolbar a flat look ('coolbar' or 'flatbar' style).} +\end{twocollist} See also \helpref{window styles overview}{windowstyles}. diff --git a/docs/latex/wx/tstyles.tex b/docs/latex/wx/tstyles.tex index 393f753182..c31d33afa4 100644 --- a/docs/latex/wx/tstyles.tex +++ b/docs/latex/wx/tstyles.tex @@ -5,7 +5,7 @@ created. The symbols are defined in such as way that they can be combined in a ` C++ {\it bitwise-or} operator. For example: \begin{verbatim} - wxCAPTION | wxMINIMIZE_BOX | wxMINIMIZE_BOX | wxTHICK_FRAME + wxCAPTION | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME \end{verbatim} For the window styles specific to each window class, please see the documentation diff --git a/docs/msw/changes.txt b/docs/msw/changes.txt index 827736e990..f97796ec2c 100644 --- a/docs/msw/changes.txt +++ b/docs/msw/changes.txt @@ -2,6 +2,12 @@ wxWindows 2.0 for Windows Change Log ------------------------------------ +Alpha 12, July ??1998 +----------------------- + +- Added wxApp::GetComCtl32Version, and wxTB_FLAT style, so can + have flat toolbars on Win98 or Win95 with IE >= 3 installed. + Alpha 11, July 3rd 1998 ----------------------- diff --git a/docs/msw/install.txt b/docs/msw/install.txt index 6e5f894c28..7a38c06c4d 100644 --- a/docs/msw/install.txt +++ b/docs/msw/install.txt @@ -16,8 +16,6 @@ wx200gen.zip Generic source code and samples (required) wx200msw.zip Windows-specific source code and samples (required) wx200doc.zip Documentation source code (not required) wx200hlp.zip WinHelp documentation -wx200ps.zip PostScript documentation (will probably - disappear in favour of PDF) wx200pdf.zip Acrobat PDF documentation wx200htm.zip HTML documentation @@ -113,7 +111,8 @@ and other intermediate compiler files. Gotchas: -- libwx.a is 28 MB or more. +- libwx.a is 28 MB or more - but only 2.9 MB if compiled with no + debug info (-g0) and level 4 optimization (-O4). - install.exe doesn't have built-in decompression because lzexpand.lib isn't available with Gnu-Win32. However, you can use it with external decompression utilities. diff --git a/include/wx/defs.h b/include/wx/defs.h index a25d957fea..aac88fdfa9 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -367,6 +367,8 @@ typedef void (*wxFunction) (wxObject&, wxEvent&); */ #define wxTB_3DBUTTONS 0x8000 +// Flatbar/Coolbar under Win98 +#define wxTB_FLAT 0x0002 /* * Apply to all panel items diff --git a/include/wx/event.h b/include/wx/event.h index 20855f2a76..55e0d2d0df 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -966,31 +966,6 @@ class WXDLLEXPORT wxEvtHandler: public wxObject // Default behaviour virtual long Default(void) { if (GetNextHandler()) return GetNextHandler()->Default(); else return 0; }; -/* -#if WXWIN_COMPATIBILITY - virtual void OldOnMenuCommand(int WXUNUSED(cmd)); - virtual void OldOnMenuSelect(int WXUNUSED(cmd)); - virtual void OldOnInitMenuPopup(int WXUNUSED(pos)); - virtual void OldOnScroll(wxCommandEvent& WXUNUSED(event)); - virtual void OldOnPaint(void); - virtual void OldOnSize(int WXUNUSED(width), int WXUNUSED(height)); - virtual void OldOnMove(int WXUNUSED(x), int WXUNUSED(y)); - virtual void OldOnMouseEvent(wxMouseEvent& WXUNUSED(event)); - virtual void OldOnChar(wxKeyEvent& WXUNUSED(event)); - // Under Windows, we can intercept character input per dialog or frame - virtual bool OldOnCharHook(wxKeyEvent& WXUNUSED(event)); - virtual void OldOnActivate(bool WXUNUSED(active)); - virtual void OldOnSetFocus(void); - virtual void OldOnKillFocus(void); - virtual bool OldOnSysColourChange(void); - virtual void OldOnDropFiles(int n, char *files[], int x, int y); - - virtual void OnDefaultAction(wxControl *WXUNUSED(initiatingItem)) {}; - virtual void OnChangeFocus(wxControl *WXUNUSED(from), wxControl *WXUNUSED(to)) {}; - virtual bool OnFunctionKey(wxKeyEvent &WXUNUSED(event)) { return FALSE; }; -#endif -*/ - virtual bool OnClose(void); inline char *GetClientData(void) const { return m_clientData; } diff --git a/include/wx/memory.h b/include/wx/memory.h index 468acdfabf..040ed1b042 100644 --- a/include/wx/memory.h +++ b/include/wx/memory.h @@ -56,7 +56,7 @@ void wxDebugFree(void * buf, bool isVect = FALSE); void * operator new (size_t size, char * fileName, int lineNum); void operator delete (void * buf); -#if !( defined (_MSC_VER) && (_MSC_VER <= 800) ) +#if !( defined (_MSC_VER) && (_MSC_VER <= 1000) ) void * operator new[] (size_t size, char * fileName, int lineNum); void operator delete[] (void * buf); #endif diff --git a/include/wx/msw/app.h b/include/wx/msw/app.h index 08708f877f..35719e9206 100644 --- a/include/wx/msw/app.h +++ b/include/wx/msw/app.h @@ -34,80 +34,75 @@ class WXDLLEXPORT wxLog; WXDLLEXPORT_DATA(extern wxApp*) wxTheApp; -void WXDLLEXPORT wxCleanUp(void); -void WXDLLEXPORT wxCommonCleanUp(void); // Call this from the platform's wxCleanUp() -void WXDLLEXPORT wxCommonInit(void); // Call this from the platform's initialization +void WXDLLEXPORT wxCleanUp(); +void WXDLLEXPORT wxCommonCleanUp(); // Call this from the platform's wxCleanUp() +void WXDLLEXPORT wxCommonInit(); // Call this from the platform's initialization // Force an exit from main loop -void WXDLLEXPORT wxExit(void); +void WXDLLEXPORT wxExit(); // Yield to other apps/messages -bool WXDLLEXPORT wxYield(void); +bool WXDLLEXPORT wxYield(); // Represents the application. Derive OnInit and declare // a new App object to start application class WXDLLEXPORT wxApp: public wxEvtHandler { DECLARE_DYNAMIC_CLASS(wxApp) - wxApp(void); - inline ~wxApp(void) {} + wxApp(); + inline ~wxApp() {} static void SetInitializerFunction(wxAppInitializerFunction fn) { m_appInitFn = fn; } - static wxAppInitializerFunction GetInitializerFunction(void) { return m_appInitFn; } + static wxAppInitializerFunction GetInitializerFunction() { return m_appInitFn; } - virtual int MainLoop(void); - void ExitMainLoop(void); - bool Initialized(void); - virtual bool Pending(void) ; - virtual void Dispatch(void) ; + virtual int MainLoop(); + void ExitMainLoop(); + bool Initialized(); + virtual bool Pending() ; + virtual void Dispatch() ; virtual void OnIdle(wxIdleEvent& event); // Generic - virtual bool OnInit(void) { return FALSE; }; + virtual bool OnInit() { return FALSE; }; // No specific tasks to do here. - virtual bool OnInitGui(void) { return TRUE; } + virtual bool OnInitGui() { return TRUE; } // Called to set off the main loop - virtual int OnRun(void) { return MainLoop(); }; - virtual int OnExit(void) { return 0; }; + virtual int OnRun() { return MainLoop(); }; + virtual int OnExit() { return 0; }; inline void SetPrintMode(int mode) { m_printMode = mode; } - inline int GetPrintMode(void) const { return m_printMode; } - - inline void SetExitOnFrameDelete(bool flag) { m_exitOnFrameDelete = flag; } - inline bool GetExitOnFrameDelete(void) const { return m_exitOnFrameDelete; } + inline int GetPrintMode() const { return m_printMode; } -/* - inline void SetShowFrameOnInit(bool flag) { m_showOnInit = flag; } - inline bool GetShowFrameOnInit(void) const { return m_showOnInit; } -*/ + inline void SetExitOnFrameDelete(bool flag) { m_exitOnFrameDelete = flag; } + inline bool GetExitOnFrameDelete() const { return m_exitOnFrameDelete; } - inline wxString GetAppName(void) const { + inline wxString GetAppName() const { if (m_appName != "") return m_appName; else return m_className; } inline void SetAppName(const wxString& name) { m_appName = name; }; - inline wxString GetClassName(void) const { return m_className; } + inline wxString GetClassName() const { return m_className; } inline void SetClassName(const wxString& name) { m_className = name; } - wxWindow *GetTopWindow(void) const ; + wxWindow *GetTopWindow() const ; inline void SetTopWindow(wxWindow *win) { m_topWindow = win; } inline void SetWantDebugOutput(bool flag) { m_wantDebugOutput = flag; } - inline bool GetWantDebugOutput(void) { return m_wantDebugOutput; } + inline bool GetWantDebugOutput() { return m_wantDebugOutput; } // Send idle event to all top-level windows. // Returns TRUE if more idle time is requested. - bool SendIdleEvents(void); + bool SendIdleEvents(); // Send idle event to window and all subwindows // Returns TRUE if more idle time is requested. bool SendIdleEvents(wxWindow* win); inline void SetAuto3D(bool flag) { m_auto3D = flag; } - inline bool GetAuto3D(void) const { return m_auto3D; } + inline bool GetAuto3D() const { return m_auto3D; } // Creates a log object virtual wxLog* CreateLogTarget(); @@ -141,24 +136,15 @@ public: // Implementation static bool Initialize(WXHINSTANCE instance); - static void CommonInit(void); - static bool RegisterWindowClasses(void); - static void CleanUp(void); - static void CommonCleanUp(void); - virtual bool DoMessage(void); + static void CommonInit(); + static bool RegisterWindowClasses(); + static void CleanUp(); + static void CommonCleanUp(); + virtual bool DoMessage(); virtual bool ProcessMessage(WXMSG* pMsg); - void DeletePendingObjects(void); - bool ProcessIdle(void); - -/* - inline void SetPendingCleanup(bool flag) { m_pendingCleanup = flag; } - inline bool GetPendingCleanup(void) { return m_pendingCleanup; } - - bool DoResourceCleanup(void); - // Set resource collection scheme on or off. - inline void SetResourceCollection(bool flag) { m_resourceCollection = flag; } - inline bool GetResourceCollection(void) { return m_resourceCollection; } -*/ + void DeletePendingObjects(); + bool ProcessIdle(); + int GetComCtl32Version() const; public: static long sm_lastMessageTime; diff --git a/include/wx/msw/frame.h b/include/wx/msw/frame.h index e23b96ee47..5ccba3701c 100644 --- a/include/wx/msw/frame.h +++ b/include/wx/msw/frame.h @@ -50,20 +50,6 @@ public: long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr); -#if WXWIN_COMPATIBILITY -/* - // The default thing is to set the focus for the first child window. - // Override for your own behaviour. - virtual void OldOnActivate(bool flag); - - // Default behaviour is to display a help string for the menu item. - virtual void OldOnMenuSelect(int id); - - inline virtual void OldOnMenuCommand(int WXUNUSED(id)) {}; // Called on frame menu command - void OldOnSize(int x, int y); -*/ -#endif - virtual bool Destroy(void); void SetClientSize(int width, int height); void GetClientSize(int *width, int *height) const; diff --git a/include/wx/msw/ole/dropsrc.h b/include/wx/msw/ole/dropsrc.h index 1f932f0a6a..4630de728d 100644 --- a/include/wx/msw/ole/dropsrc.h +++ b/include/wx/msw/ole/dropsrc.h @@ -52,7 +52,7 @@ public: // do it (call this in response to a mouse button press, for example) // params: if bAllowMove is false, data can be only copied - DragResult DoDragDrop(bool bAllowMove = false); + DragResult DoDragDrop(bool bAllowMove = FALSE); // overridable: you may give some custom UI feedback during d&d operation // in this function (it's called on each mouse move, so it shouldn't be too diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index 47ef66082e..a0792f8a06 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -392,26 +392,6 @@ public: void OnPaint(wxPaintEvent& event); void OnIdle(wxIdleEvent& event); -// virtual void OnChangeFocus(wxControl *from, wxControl *to); -// virtual bool OnFunctionKey(wxKeyEvent &event); - -/* -#if WXWIN_COMPATIBILITY - virtual void OldOnMenuSelect(int WXUNUSED(cmd)); - virtual void OldOnInitMenuPopup(int WXUNUSED(pos)); - virtual void OldOnScroll(wxCommandEvent& WXUNUSED(event)); - virtual void OldOnPaint(void); // Called when needs painting - virtual void OldOnSize(int width, int height); // Called on resize - virtual void OldOnMouseEvent(wxMouseEvent& event); // Called on mouse event - virtual void OldOnChar(wxKeyEvent& event); // Called on character event - virtual void OldOnMenuCommand(int cmd); // Dealt with properly in wxFrame - inline virtual void OldOnMove(int WXUNUSED(x), int WXUNUSED(y)); // Called on move - inline virtual void OldOnActivate(bool WXUNUSED(active)); // Called on window activation (MSW) - virtual void OldOnSetFocus(void); // Called on setting focus - virtual void OldOnKillFocus(void); // Called on killing focus -#endif -*/ - public: //////////////////////////////////////////////////////////////////////// //// IMPLEMENTATION @@ -616,11 +596,6 @@ protected: int m_caretHeight; bool m_caretEnabled; bool m_caretShown; - - // Device context being stored whilst drawing is done -// WXHDC m_tempHDC; - // Temporary device context stored during an OnPaint -// WXHDC m_paintHDC; wxFont m_windowFont; // Window's font bool m_isShown; bool m_doubleClickAllowed ; @@ -642,8 +617,6 @@ protected: bool m_backgroundTransparent; -// wxDC * m_windowDC; // The canvas's device context - int m_xThumbSize; int m_yThumbSize; @@ -709,20 +682,8 @@ inline wxColour wxWindow::GetDefaultBackgroundColour(void) const { return m_defa inline wxButton *wxWindow::GetDefaultItem(void) const { return m_defaultItem; } inline void wxWindow::SetDefaultItem(wxButton *but) { m_defaultItem = but; } -// inline wxDC *wxWindow::GetDC(void) const { return m_windowDC; } inline bool wxWindow::IsRetained(void) const { return ((m_windowStyle & wxRETAINED) == wxRETAINED); } -/* -#if WXWIN_COMPATIBILITY -inline void wxWindow::OldOnMenuSelect(int WXUNUSED(cmd)) { Default(); }; -inline void wxWindow::OldOnInitMenuPopup(int WXUNUSED(pos)) { Default(); }; -inline void wxWindow::OldOnScroll(wxCommandEvent& WXUNUSED(event)) { Default(); }; -inline void wxWindow::OldOnMenuCommand(int WXUNUSED(cmd)) { Default(); } // Dealt with properly in wxFrame -inline void wxWindow::OldOnMove(int WXUNUSED(x), int WXUNUSED(y)) { Default(); }; // Called on move -inline void wxWindow::OldOnActivate(bool WXUNUSED(active)) { Default(); }; // Called on window activation (MSW) -#endif -*/ - inline void wxWindow::SetShowing(bool show) { m_isShown = show; } inline wxList *wxWindow::GetConstraintsInvolvedIn(void) const { return m_constraintsInvolvedIn; } inline wxSizer *wxWindow::GetSizer(void) const { return m_windowSizer; } diff --git a/src/common/event.cpp b/src/common/event.cpp index 35f3a6593a..945860f5c9 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -432,87 +432,6 @@ bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event ) return FALSE; }; -/* -#if WXWIN_COMPATIBILITY -void wxEvtHandler::OldOnMenuCommand(int cmd) -{ - if (GetNextHandler()) GetNextHandler()->OldOnMenuCommand(cmd); -} - -void wxEvtHandler::OldOnMenuSelect(int cmd) -{ - if (GetNextHandler()) GetNextHandler()->OldOnMenuSelect(cmd); -} - -void wxEvtHandler::OldOnInitMenuPopup(int pos) -{ - if (GetNextHandler()) GetNextHandler()->OldOnInitMenuPopup(pos); -} - -void wxEvtHandler::OldOnScroll(wxCommandEvent& event) -{ - if (GetNextHandler()) GetNextHandler()->OldOnScroll(event); -} - -void wxEvtHandler::OldOnPaint(void) -{ - if (GetNextHandler()) GetNextHandler()->OldOnPaint(); -} -void wxEvtHandler::OldOnSize(int width, int height) -{ - if (GetNextHandler()) GetNextHandler()->OldOnSize(width, height); -} - -void wxEvtHandler::OldOnMove(int x, int y) -{ - if (GetNextHandler()) GetNextHandler()->OldOnMove(x, y); -} - -void wxEvtHandler::OldOnMouseEvent(wxMouseEvent& event) -{ - if (GetNextHandler()) GetNextHandler()->OldOnMouseEvent(event); -} - -void wxEvtHandler::OldOnChar(wxKeyEvent& event) -{ - if (GetNextHandler()) GetNextHandler()->OldOnChar(event); -} - -// Under Windows, we can intercept character input per dialog or frame -bool wxEvtHandler::OldOnCharHook(wxKeyEvent& event) -{ - if (GetNextHandler()) return GetNextHandler()->OldOnCharHook(event); - else return FALSE; -} - -void wxEvtHandler::OldOnActivate(bool active) -{ - if (GetNextHandler()) GetNextHandler()->OldOnActivate(active); -} - -void wxEvtHandler::OldOnSetFocus(void) -{ - if (GetNextHandler()) GetNextHandler()->OldOnSetFocus(); -} - -void wxEvtHandler::OldOnKillFocus(void) -{ - if (GetNextHandler()) GetNextHandler()->OldOnKillFocus(); -} - -bool wxEvtHandler::OldOnSysColourChange(void) -{ - if (GetNextHandler()) return GetNextHandler()->OldOnSysColourChange(); - return FALSE; -} - -void wxEvtHandler::OldOnDropFiles(int n, char *files[], int x, int y) -{ - if (GetNextHandler()) GetNextHandler()->OldOnDropFiles(n, files, x, y); -} -#endif -*/ - bool wxEvtHandler::OnClose(void) { if (GetNextHandler()) return GetNextHandler()->OnClose(); diff --git a/src/common/memory.cpp b/src/common/memory.cpp index fee8108d50..0270a1b7f9 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -884,7 +884,7 @@ void * operator new (size_t size, char * fileName, int lineNum) #endif } -#if !( defined (_MSC_VER) && (_MSC_VER <= 800) ) +#if !( defined (_MSC_VER) && (_MSC_VER <= 1000) ) void * operator new[] (size_t size, char * fileName, int lineNum) { #ifdef NO_DEBUG_ALLOCATION @@ -904,7 +904,7 @@ void operator delete (void * buf) #endif } -#if !( defined (_MSC_VER) && (_MSC_VER <= 800) ) +#if !( defined (_MSC_VER) && (_MSC_VER <= 1000) ) void operator delete[] (void * buf) { #ifdef NO_DEBUG_ALLOCATION diff --git a/src/msw/app.cpp b/src/msw/app.cpp index b3dae1191e..5543717f13 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -161,7 +161,7 @@ bool wxApp::Initialize(WXHANDLE instance) return TRUE; } -bool wxApp::RegisterWindowClasses(void) +bool wxApp::RegisterWindowClasses() { /////////////////////////////////////////////////////////////////////// // Register the frame window class. @@ -286,7 +286,7 @@ bool wxApp::RegisterWindowClasses(void) } // Cleans up any wxWindows internal structures left lying around -void wxApp::CleanUp(void) +void wxApp::CleanUp() { wxModule::CleanUpModules(); @@ -335,7 +335,7 @@ void wxApp::CleanUp(void) delete wxLog::SetActiveTarget(NULL); } -void wxApp::CommonInit(void) +void wxApp::CommonInit() { #ifdef __WINDOWS__ wxBuffer = new char[1500]; @@ -345,32 +345,8 @@ void wxApp::CommonInit(void) wxClassInfo::InitializeClasses(); -#ifdef __X__ - wxTheFontNameDirectory.Initialize(); -#endif - -#if defined(__X__) && USE_RESOURCES - // Read standard font names from .Xdefaults - - extern char *wxDecorativeFontName; - extern char *wxRomanFontName; - extern char *wxModernFontName; - extern char *wxSwissFontName; - extern char *wxScriptFontName; - extern char *wxTeletypeFontName; - extern char *wxDefaultFontName; - - (void) wxGetResource("wxWindows", "defaultFamily", &wxDefaultFontName); - (void) wxGetResource("wxWindows", "decorativeFamily", &wxDecorativeFontName); - (void) wxGetResource("wxWindows", "romanFamily", &wxRomanFontName); - (void) wxGetResource("wxWindows", "modernFamily", &wxModernFontName); - (void) wxGetResource("wxWindows", "swissFamily", &wxSwissFontName); - (void) wxGetResource("wxWindows", "scriptFamily", &wxScriptFontName); - (void) wxGetResource("wxWindows", "teletypeFamily", &wxTeletypeFontName); -#endif - #if USE_RESOURCES - (void) wxGetResource("wxWindows", "OsVersion", &wxOsVersion); + wxGetResource("wxWindows", "OsVersion", &wxOsVersion); #endif wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING); @@ -393,7 +369,7 @@ void wxApp::CommonInit(void) g_globalCursor = new wxCursor; } -void wxApp::CommonCleanUp(void) +void wxApp::CommonCleanUp() { #if USE_WX_RESOURCES wxCleanUpResourceSystem(); @@ -660,7 +636,7 @@ int wxEntry(WXHINSTANCE hInstance) // Static member initialization wxAppInitializerFunction wxApp::m_appInitFn = (wxAppInitializerFunction) NULL; -wxApp::wxApp(void) +wxApp::wxApp() { m_topWindow = NULL; wxTheApp = this; @@ -677,13 +653,11 @@ wxApp::wxApp(void) #else m_printMode = wxPRINT_POSTSCRIPT; #endif -// work_proc = NULL; m_exitOnFrameDelete = TRUE; -// m_showOnInit = TRUE; m_auto3D = TRUE; } -bool wxApp::Initialized(void) +bool wxApp::Initialized() { #ifndef _WINDLL if (GetTopWindow()) @@ -701,7 +675,7 @@ bool wxApp::Initialized(void) * received. * */ -bool wxApp::DoMessage(void) +bool wxApp::DoMessage() { if (!::GetMessage(&s_currentMsg, (HWND) NULL, 0, 0)) { @@ -732,7 +706,7 @@ bool wxApp::DoMessage(void) * are processed (it'll sit in DoMessage). */ -int wxApp::MainLoop(void) +int wxApp::MainLoop() { m_keepGoing = TRUE; while (m_keepGoing) @@ -747,7 +721,7 @@ int wxApp::MainLoop(void) } // Returns TRUE if more time is needed. -bool wxApp::ProcessIdle(void) +bool wxApp::ProcessIdle() { wxIdleEvent event; event.SetEventObject(this); @@ -756,17 +730,17 @@ bool wxApp::ProcessIdle(void) return event.MoreRequested(); } -void wxApp::ExitMainLoop(void) +void wxApp::ExitMainLoop() { m_keepGoing = FALSE; } -bool wxApp::Pending(void) +bool wxApp::Pending() { return (::PeekMessage(&s_currentMsg, 0, 0, 0, PM_NOREMOVE) != 0) ; } -void wxApp::Dispatch(void) +void wxApp::Dispatch() { if (!DoMessage()) m_keepGoing = FALSE; @@ -834,7 +808,7 @@ void wxApp::OnIdle(wxIdleEvent& event) } // Send idle event to all top-level windows -bool wxApp::SendIdleEvents(void) +bool wxApp::SendIdleEvents() { bool needMore = FALSE; wxNode* node = wxTopLevelWindows.First(); @@ -873,7 +847,7 @@ bool wxApp::SendIdleEvents(wxWindow* win) return needMore ; } -void wxApp::DeletePendingObjects(void) +void wxApp::DeletePendingObjects() { wxNode *node = wxPendingDelete.First(); while (node) @@ -893,7 +867,7 @@ void wxApp::DeletePendingObjects(void) /* // Free up font objects that are not being used at present. -bool wxApp::DoResourceCleanup(void) +bool wxApp::DoResourceCleanup() { // wxDebugMsg("ResourceCleanup\n"); @@ -945,12 +919,12 @@ bool wxApp::DoResourceCleanup(void) } */ -wxLog* wxApp::CreateLogTarget(void) +wxLog* wxApp::CreateLogTarget() { return new wxLogGui; } -wxWindow* wxApp::GetTopWindow(void) const +wxWindow* wxApp::GetTopWindow() const { if (m_topWindow) return m_topWindow; @@ -960,14 +934,57 @@ wxWindow* wxApp::GetTopWindow(void) const return NULL; } -void wxExit(void) +int wxApp::GetComCtl32Version() const +{ + // have we loaded COMCTL32 yet? + HMODULE theModule = ::GetModuleHandle("COMCTL32"); + int version = 0; + + // if so, then we can check for the version + if (theModule) + { + // InitCommonControlsEx is unique to 4.7 and later + FARPROC theProc = ::GetProcAddress(theModule, "InitCommonControlsEx"); + + if (! theProc) + { // not found, must be 4.00 + version = 400; + } + else + { + // The following symbol are unique to 4.71 + // DllInstall + // FlatSB_EnableScrollBar FlatSB_GetScrollInfo FlatSB_GetScrollPos + // FlatSB_GetScrollProp FlatSB_GetScrollRange FlatSB_SetScrollInfo + // FlatSB_SetScrollPos FlatSB_SetScrollProp FlatSB_SetScrollRange + // FlatSB_ShowScrollBar + // _DrawIndirectImageList _DuplicateImageList + // InitializeFlatSB + // UninitializeFlatSB + // we could check for any of these - I chose DllInstall + FARPROC theProc = ::GetProcAddress(theModule, "DllInstall"); + if (! theProc) + { + // not found, must be 4.70 + version = 470; + } + else + { // found, must be 4.71 + version = 471; + } + } + } + return version; +} + +void wxExit() { wxApp::CleanUp(); FatalAppExit(0, "Fatal error: exiting"); } // Yield to incoming messages -bool wxYield(void) +bool wxYield() { MSG msg; // We want to go back to the main message loop diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 4c6e280e2d..cd070d1aed 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -852,113 +852,6 @@ void wxFrame::OnMenuHighlight(wxMenuEvent& event) } } -#if 0 -#if WXWIN_COMPATIBILITY -void wxFrame::OldOnSize(int x, int y) -{ -#if WXWIN_COMPATIBILITY == 1 - wxSizeEvent event(wxSize(x, y), m_windowId); - event.SetEventObject( this ); - if (GetEventHandler()->ProcessEvent(event)) - return; -#endif - // Search for a child which is a subwindow, not another frame. - wxWindow *child = NULL; - // Count the number of _subwindow_ children - int noChildren = 0; - for(wxNode *node = GetChildren()->First(); node; node = node->Next()) - { - wxWindow *win = (wxWindow *)node->Data(); - if (!win->IsKindOf(CLASSINFO(wxFrame)) && !win->IsKindOf(CLASSINFO(wxDialog)) && (win != GetStatusBar())) - { - child = win; - noChildren ++; - } - } - - // If not one child, call the Layout function if compiled in - if (!child || (noChildren > 1) -#if USE_CONSTRAINTS - || GetAutoLayout() -#endif - ) - { -#if USE_CONSTRAINTS - if (GetAutoLayout()) - Layout(); -#endif - return; - } - - if (child) - { - int client_x, client_y; - -#if DEBUG > 1 - wxDebugMsg("wxFrame::OnSize: about to set the child's size.\n"); -#endif - - GetClientSize(&client_x, &client_y); - child->SetSize(0, 0, client_x, client_y); - } -} - -// Default activation behaviour - set the focus for the first child -// subwindow found. -void wxFrame::OldOnActivate(bool flag) -{ -#if WXWIN_COMPATIBILITY == 1 - wxActivateEvent event(wxEVT_ACTIVATE, flag, m_windowId); - event.SetEventObject( this ); - if (GetEventHandler()->ProcessEvent(event)) - return; -#endif - for(wxNode *node = GetChildren()->First(); node; node = node->Next()) - { - // Find a child that's a subwindow, but not a dialog box. - wxWindow *child = (wxWindow *)node->Data(); - if (!child->IsKindOf(CLASSINFO(wxFrame)) && - !child->IsKindOf(CLASSINFO(wxDialog))) - { -#if DEBUG > 1 - wxDebugMsg("wxFrame::OnActivate: about to set the child's focus.\n"); -#endif - child->SetFocus(); - return; - } - } -} - -// Default menu selection behaviour - display a help string -void wxFrame::OldOnMenuSelect(int id) -{ -#if WXWIN_COMPATIBILITY == 1 - wxMenuEvent event(wxEVT_MENU_HIGHLIGHT, id); - event.SetEventObject( this ); - if (GetEventHandler()->ProcessEvent(event)) - return; -#endif - if (GetStatusBar()) - { - if (id == -1) - SetStatusText(""); - else - { - wxMenuBar *menuBar = GetMenuBar(); - if (menuBar) - { - wxString helpString(menuBar->GetHelpString(id)); - if (helpString != "") - SetStatusText(helpString); - } - } - } -} -#endif - -#endif - // 0 - wxMenuBar *wxFrame::GetMenuBar(void) const { return m_frameMenuBar; diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 8f37ba6ce0..63a64b9f57 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -45,6 +45,13 @@ #include "wx/app.h" #include "wx/msw/private.h" +#ifndef TBSTYLE_FLAT +#define TBSTYLE_LIST 0x1000 +#define TBSTYLE_FLAT 0x0800 +#define TBSTYLE_TRANSPARENT 0x8000 +#endif + // use TBSTYLE_TRANSPARENT if you use TBSTYLE_FLAT + #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxToolBar95, wxToolBarBase) @@ -123,12 +130,19 @@ bool wxToolBar95::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, co y = 0; m_windowId = (id < 0 ? NewControlId() : id); + DWORD msStyle = WS_CHILD | WS_BORDER | WS_VISIBLE | TBSTYLE_TOOLTIPS; + + if (style & wxTB_FLAT) + { + if (wxTheApp->GetComCtl32Version() > 400) + msStyle |= TBSTYLE_FLAT; + } // Create the toolbar control. HWND hWndToolbar = CreateWindowEx(0L, // No extended styles. TOOLBARCLASSNAME, // Class name for the toolbar. "", // No default text. - WS_CHILD | WS_BORDER | WS_VISIBLE | TBSTYLE_TOOLTIPS, // Styles and defaults. + msStyle, // Styles and defaults. x, y, width, height, // Standard toolbar size and position. (HWND) parent->GetHWND(), // Parent window of the toolbar. (HMENU)m_windowId, // Toolbar ID. diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 8fdc4d7cb9..752a0951a0 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1668,10 +1668,6 @@ void wxWindow::MSWOnMenuHighlight(WXWORD WXUNUSED(item), WXWORD WXUNUSED(flags), void wxWindow::MSWOnInitMenuPopup(WXHMENU menu, int pos, bool isSystem) { -/* - if (!isSystem) - OldOnInitMenuPopup(pos); -*/ } bool wxWindow::MSWOnActivate(int state, bool WXUNUSED(minimized), WXHWND WXUNUSED(activate)) @@ -3592,54 +3588,6 @@ WXDWORD wxWindow::Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D) return exStyle; } -/* -#if WXWIN_COMPATIBILITY -void wxWindow::OldOnPaint(void) -{ - wxPaintEvent event(m_windowId); - event.m_eventObject = this; - if (!GetEventHandler()->ProcessEvent(event)) - Default(); -}; - -void wxWindow::OldOnSize(int w, int h) -{ - wxSizeEvent event(wxSize(w, h), m_windowId); - event.m_eventObject = this; - if (!GetEventHandler()->ProcessEvent(event)) - Default(); -}; - -void wxWindow::OldOnMouseEvent(wxMouseEvent& event) -{ - if (!GetEventHandler()->ProcessEvent(event)) - Default(); -}; - -void wxWindow::OldOnChar(wxKeyEvent& event) -{ - if (!GetEventHandler()->ProcessEvent(event)) - Default(); -}; - -void wxWindow::OldOnSetFocus(void) -{ - wxFocusEvent event(wxEVT_SET_FOCUS, m_windowId); - event.m_eventObject = this; - if (!GetEventHandler()->ProcessEvent(event)) - Default(); -}; - -void wxWindow::OldOnKillFocus(void) -{ - wxFocusEvent event(wxEVT_KILL_FOCUS, m_windowId); - event.m_eventObject = this; - if (!GetEventHandler()->ProcessEvent(event)) - Default(); -}; -#endif -*/ - void wxWindow::OnChar(wxKeyEvent& event) { bool isVirtual; diff --git a/utils/dialoged/src/dialoged.cpp b/utils/dialoged/src/dialoged.cpp index bde94cba52..7c1145286f 100644 --- a/utils/dialoged/src/dialoged.cpp +++ b/utils/dialoged/src/dialoged.cpp @@ -26,10 +26,6 @@ #include "dialoged.h" -// A macro needed for some compilers (AIX) that need 'main' to be defined -// in the application itself. -IMPLEMENT_WXWIN_MAIN - IMPLEMENT_APP(MyApp) MyApp::MyApp(void) -- 2.45.2