From f38374d0d7aa865e9bbe8ee61b75b94ffcdfb220 Mon Sep 17 00:00:00 2001 From: David Webster Date: Fri, 19 Nov 1999 22:36:55 +0000 Subject: [PATCH] Removal of previous wxValidtor code for wxOS2 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4634 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/control.h | 4 - include/wx/generic/listctrl.h | 12 - include/wx/generic/treectrl.h | 12 - include/wx/os2/bmpbuttn.h | 8 - include/wx/os2/button.h | 8 - include/wx/os2/checkbox.h | 16 -- include/wx/os2/checklst.h | 4 - include/wx/os2/choice.h | 8 - include/wx/os2/combobox.h | 8 - include/wx/os2/frame.h | 154 ++++------ include/wx/os2/gauge.h | 8 - include/wx/os2/listbox.h | 8 - include/wx/os2/radiobox.h | 8 - include/wx/os2/radiobut.h | 16 -- include/wx/os2/scrolbar.h | 8 - include/wx/os2/slider.h | 8 - include/wx/os2/textctrl.h | 8 - include/wx/validate.h | 4 - include/wx/window.h | 9 +- src/common/ctrlcmn.cpp | 4 - src/common/validate.cpp | 7 - src/common/wincmn.cpp | 17 -- src/generic/listctrl.cpp | 8 - src/generic/treectrl.cpp | 16 +- src/html/helpfrm.cpp | 6 + src/jpeg/MAKEFILE.VA | 2 +- src/msw/makefile.vc | 18 +- src/os2/bmpbuttn.cpp | 4 - src/os2/button.cpp | 4 - src/os2/checkbox.cpp | 8 - src/os2/checklst.cpp | 4 - src/os2/choice.cpp | 4 - src/os2/colordlg.cpp | 78 ------ src/os2/combobox.cpp | 4 - src/os2/frame.cpp | 511 +++++++++++++--------------------- src/os2/gauge.cpp | 4 - src/os2/listbox.cpp | 4 - src/os2/makefile.va | 5 +- src/os2/radiobox.cpp | 4 - src/os2/radiobut.cpp | 8 - src/os2/scrolbar.cpp | 4 - src/os2/slider.cpp | 4 - src/os2/textctrl.cpp | 4 - src/os2/utilsexc.cpp | 4 + src/os2/window.cpp | 69 ++++- src/png/MAKEFILE.VA | 2 +- src/xpm/MAKEFILE.VA | 2 +- src/zlib/MAKEFILE.VA | 2 +- 48 files changed, 332 insertions(+), 790 deletions(-) delete mode 100644 src/os2/colordlg.cpp diff --git a/include/wx/control.h b/include/wx/control.h index bfdda99063..6f5999c7bc 100644 --- a/include/wx/control.h +++ b/include/wx/control.h @@ -42,11 +42,7 @@ protected: const wxSize& size, long style, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator, -# else const wxValidator& validator, -# endif #endif const wxString& name); diff --git a/include/wx/generic/listctrl.h b/include/wx/generic/listctrl.h index 6d6c2a81c1..5d191352b2 100644 --- a/include/wx/generic/listctrl.h +++ b/include/wx/generic/listctrl.h @@ -381,11 +381,7 @@ class WXDLLEXPORT wxListTextCtrl: public wxTextCtrl const wxString &value = "", const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - int style = 0, const wxValidator* validator = wxDefaultValidator, -# else int style = 0, const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString &name = "wxListTextCtrlText" ); void OnChar( wxKeyEvent &event ); @@ -515,11 +511,7 @@ class WXDLLEXPORT wxListCtrl: public wxControl wxListCtrl( wxWindow *parent, wxWindowID id = -1, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - long style = wxLC_ICON, const wxValidator* validator = wxDefaultValidator, -# else long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString &name = "listctrl" ) { @@ -529,11 +521,7 @@ class WXDLLEXPORT wxListCtrl: public wxControl bool Create( wxWindow *parent, wxWindowID id = -1, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - long style = wxLC_ICON, const wxValidator* validator = wxDefaultValidator, -# else long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString &name = "listctrl" ); void OnSize( wxSizeEvent &event ); diff --git a/include/wx/generic/treectrl.h b/include/wx/generic/treectrl.h index 9e8bf4ed5c..4be159ae58 100644 --- a/include/wx/generic/treectrl.h +++ b/include/wx/generic/treectrl.h @@ -182,11 +182,7 @@ class WXDLLEXPORT wxTreeTextCtrl: public wxTextCtrl const wxString &value = wxEmptyString, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - int style = 0, const wxValidator* validator = wxDefaultValidator, -# else int style = 0, const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString &name = wxTextCtrlNameStr ); void OnChar( wxKeyEvent &event ); @@ -211,11 +207,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator *validator = wxDefaultValidator, -# else const wxValidator &validator = wxDefaultValidator, -# endif #endif const wxString& name = wxTreeCtrlNameStr) { @@ -229,11 +221,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator *validator = wxDefaultValidator, -# else const wxValidator &validator = wxDefaultValidator, -# endif #endif const wxString& name = wxTreeCtrlNameStr); diff --git a/include/wx/os2/bmpbuttn.h b/include/wx/os2/bmpbuttn.h index 76e7fbdaea..f7f5b070fe 100644 --- a/include/wx/os2/bmpbuttn.h +++ b/include/wx/os2/bmpbuttn.h @@ -27,11 +27,7 @@ class WXDLLEXPORT wxBitmapButton: public wxButton const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxButtonNameStr) { @@ -42,11 +38,7 @@ class WXDLLEXPORT wxBitmapButton: public wxButton const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxButtonNameStr); diff --git a/include/wx/os2/button.h b/include/wx/os2/button.h index 09614dc3c1..2626a0aa9c 100644 --- a/include/wx/os2/button.h +++ b/include/wx/os2/button.h @@ -26,11 +26,7 @@ class WXDLLEXPORT wxButton: public wxControl const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxButtonNameStr) { @@ -41,11 +37,7 @@ class WXDLLEXPORT wxButton: public wxControl const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxButtonNameStr); diff --git a/include/wx/os2/checkbox.h b/include/wx/os2/checkbox.h index 677f3699f7..c3fc2e2513 100644 --- a/include/wx/os2/checkbox.h +++ b/include/wx/os2/checkbox.h @@ -28,11 +28,7 @@ class WXDLLEXPORT wxCheckBox: public wxControl const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxCheckBoxNameStr) { @@ -43,11 +39,7 @@ class WXDLLEXPORT wxCheckBox: public wxControl const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxCheckBoxNameStr); @@ -77,11 +69,7 @@ class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxCheckBoxNameStr) { @@ -92,11 +80,7 @@ class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxCheckBoxNameStr); diff --git a/include/wx/os2/checklst.h b/include/wx/os2/checklst.h index 59a7951d67..1bfeb6c264 100644 --- a/include/wx/os2/checklst.h +++ b/include/wx/os2/checklst.h @@ -32,11 +32,7 @@ public: const wxString choices[] = NULL, long style = 0, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxListBoxNameStr); diff --git a/include/wx/os2/choice.h b/include/wx/os2/choice.h index 54eab34fa1..1e3fc5a02b 100644 --- a/include/wx/os2/choice.h +++ b/include/wx/os2/choice.h @@ -29,11 +29,7 @@ public: int n = 0, const wxString choices[] = NULL, long style = 0, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxChoiceNameStr) { @@ -46,11 +42,7 @@ public: int n = 0, const wxString choices[] = NULL, long style = 0, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxChoiceNameStr); diff --git a/include/wx/os2/combobox.h b/include/wx/os2/combobox.h index 1d9b4392f4..1b8b532805 100644 --- a/include/wx/os2/combobox.h +++ b/include/wx/os2/combobox.h @@ -34,11 +34,7 @@ class WXDLLEXPORT wxComboBox: public wxChoice int n = 0, const wxString choices[] = NULL, long style = 0, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxComboBoxNameStr) { @@ -52,11 +48,7 @@ class WXDLLEXPORT wxComboBox: public wxChoice int n = 0, const wxString choices[] = NULL, long style = 0, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxComboBoxNameStr); diff --git a/include/wx/os2/frame.h b/include/wx/os2/frame.h index e830d71c49..bdb35dcdc9 100644 --- a/include/wx/os2/frame.h +++ b/include/wx/os2/frame.h @@ -12,37 +12,24 @@ #ifndef _WX_FRAME_H_ #define _WX_FRAME_H_ -#include "wx/window.h" -#include "wx/os2/accel.h" -#include "wx/icon.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxFrameNameStr; -WXDLLEXPORT_DATA(extern const wxChar*) wxToolBarNameStr; -WXDLLEXPORT_DATA(extern const wxChar*) wxStatusLineNameStr; - -class WXDLLEXPORT wxMenuBar; -class WXDLLEXPORT wxStatusBar; -class WXDLLEXPORT wxToolBar; - -class WXDLLEXPORT wxFrame : public wxWindow +class WXDLLEXPORT wxFrame : public wxFrameBase { - DECLARE_DYNAMIC_CLASS(wxFrame) - public: - wxFrame(); + // construction + wxFrame() { Init(); } wxFrame(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr) + wxWindowID id, + const wxString& title, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE, + const wxString& name = wxFrameNameStr) { + Init(); + Create(parent, id, title, pos, size, style, name); } - ~wxFrame(); - bool Create(wxWindow *parent, wxWindowID id, const wxString& title, @@ -51,32 +38,26 @@ public: long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr); - virtual bool Destroy(); - - void OnSize(wxSizeEvent& event); - void OnMenuHighlight(wxMenuEvent& event); - void OnActivate(wxActivateEvent& event); - void OnIdle(wxIdleEvent& event); - void OnCloseWindow(wxCloseEvent& event); - - bool Show(bool show); - - void DetachMenuBar(); - // Set menu bar - void SetMenuBar(wxMenuBar *menu_bar); - virtual wxMenuBar *GetMenuBar() const; + virtual ~wxFrame(); - // Call this to simulate a menu command - bool Command(int id) { return ProcessCommand(id); } + // implement base class pure virtuals + virtual void Maximize(bool maximize = TRUE); + virtual bool IsMaximized() const; + virtual void Iconize(bool iconize = TRUE); + virtual bool IsIconized() const; + virtual void Restore(); + virtual void SetMenuBar(wxMenuBar *menubar); + virtual void SetIcon(const wxIcon& icon); - // process menu command: returns TRUE if processed - bool ProcessCommand(int id); + // implementation only from now on + // ------------------------------- - // make the window modal (all other windows unresponsive) - virtual void MakeModal(bool modal = TRUE); + // override some more virtuals + virtual bool Show(bool show = TRUE); - // Set icon - virtual void SetIcon(const wxIcon& icon); + // event handlers + void OnActivate(wxActivateEvent& event); + void OnSysColourChanged(wxSysColourChangedEvent& event); // Toolbar #if wxUSE_TOOLBAR @@ -84,71 +65,36 @@ public: wxWindowID id = -1, const wxString& name = wxToolBarNameStr); - virtual wxToolBar *OnCreateToolBar(long style, wxWindowID id, const wxString& name); - - virtual void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; } - virtual wxToolBar *GetToolBar() const { return m_frameToolBar; } - virtual void PositionToolBar(); #endif // wxUSE_TOOLBAR -#if wxUSE_STATUSBAR // Status bar - virtual wxStatusBar* CreateStatusBar(int number = 1, - long style = wxST_SIZEGRIP, - wxWindowID id = 0, - const wxString& name = wxStatusLineNameStr); - - wxStatusBar *GetStatusBar() const { return m_frameStatusBar; } - void SetStatusBar(wxStatusBar *statusBar) { m_frameStatusBar = statusBar; } +#if wxUSE_STATUSBAR + virtual wxStatusBar* OnCreateStatusBar(int number = 1, + long style = wxST_SIZEGRIP, + wxWindowID id = 0, + const wxString& name = wxStatusLineNameStr); virtual void PositionStatusBar(); - virtual wxStatusBar *OnCreateStatusBar(int number, - long style, - wxWindowID id, - const wxString& name); - - // Set status line text - virtual void SetStatusText(const wxString& text, int number = 0); - // Set status line widths - virtual void SetStatusWidths(int n, const int widths_field[]); + // Hint to tell framework which status bar to use: the default is to use + // native one for the platforms which support it (Win32), the generic one + // otherwise - // Hint to tell framework which status bar to use // TODO: should this go into a wxFrameworkSettings class perhaps? - static void UseNativeStatusBar(bool useNative) { m_useNativeStatusBar = useNative; }; - static bool UsesNativeStatusBar() { return m_useNativeStatusBar; }; + static void UseNativeStatusBar(bool useNative) + { m_useNativeStatusBar = useNative; }; + static bool UsesNativeStatusBar() + { return m_useNativeStatusBar; }; #endif // wxUSE_STATUSBAR - // Iconize - virtual void Iconize(bool iconize); - - virtual bool IsIconized() const; - - // Is it maximized? - virtual bool IsMaximized() const; - - // Compatibility - bool Iconized() const { return IsIconized(); } - - virtual void Maximize(bool maximize); - // virtual bool LoadAccelerators(const wxString& table); - - // Responds to colour changes - void OnSysColourChanged(wxSysColourChangedEvent& event); - - // Query app for menu item updates (called from OnIdle) - void DoMenuUpdates(); - void DoMenuUpdates(wxMenu* menu, wxWindow* focusWin); - WXHMENU GetWinMenu() const { return m_hMenu; } // Returns the origin of client area (may be different from (0,0) if the // frame has a toolbar) virtual wxPoint GetClientAreaOrigin() const; - // Implementation only from here - // event handlers + // event handlers bool HandlePaint(); bool HandleSize(int x, int y, WXUINT flag); bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control); @@ -158,13 +104,19 @@ public: wxWindow *wx_win, const wxChar *title, int x, int y, int width, int height, long style); - // tooltip management + // tooltip management #if wxUSE_TOOLTIPS WXHWND GetToolTipCtrl() const { return m_hwndToolTip; } void SetToolTipCtrl(WXHWND hwndTT) { m_hwndToolTip = hwndTT; } #endif // tooltips protected: + // common part of all ctors + void Init(); + + // common part of Iconize(), Maximize() and Restore() + void DoShowWindow(int nShowCmd); + // override base class virtuals virtual void DoGetClientSize(int *width, int *height) const; virtual void DoGetSize(int *width, int *height) const; @@ -175,6 +127,9 @@ protected: virtual void DoClientToScreen(int *x, int *y) const; virtual void DoScreenToClient(int *x, int *y) const; + // helper + void DetachMenuBar(); + // a plug in for MDI frame classes which need to do something special when // the menubar is set virtual void InternalSetMenuBar(); @@ -188,27 +143,20 @@ protected: // window proc for the frames MRESULT OS2WindowProc(HWND hwnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam); - wxMenuBar * m_frameMenuBar; - wxIcon m_icon; bool m_iconized; WXHICON m_defaultIcon; #if wxUSE_STATUSBAR - wxStatusBar * m_frameStatusBar; - static bool m_useNativeStatusBar; #endif // wxUSE_STATUSBAR -#if wxUSE_TOOLBAR - wxToolBar* m_frameToolBar; -#endif // wxUSE_TOOLBAR - private: #if wxUSE_TOOLTIPS WXHWND m_hwndToolTip; #endif // tooltips DECLARE_EVENT_TABLE() + DECLARE_DYNAMIC_CLASS(wxFrame) }; #endif diff --git a/include/wx/os2/gauge.h b/include/wx/os2/gauge.h index cdb6d227f6..24c44ba4c8 100644 --- a/include/wx/os2/gauge.h +++ b/include/wx/os2/gauge.h @@ -28,11 +28,7 @@ class WXDLLEXPORT wxGauge: public wxControl const wxSize& size = wxDefaultSize, long style = wxGA_HORIZONTAL, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxGaugeNameStr) { @@ -45,11 +41,7 @@ class WXDLLEXPORT wxGauge: public wxControl const wxSize& size = wxDefaultSize, long style = wxGA_HORIZONTAL, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxGaugeNameStr); diff --git a/include/wx/os2/listbox.h b/include/wx/os2/listbox.h index 4a5691fb7b..4bc2ade8be 100644 --- a/include/wx/os2/listbox.h +++ b/include/wx/os2/listbox.h @@ -43,11 +43,7 @@ public: int n = 0, const wxString choices[] = NULL, long style = 0, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxListBoxNameStr) { @@ -60,11 +56,7 @@ public: int n = 0, const wxString choices[] = NULL, long style = 0, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxListBoxNameStr); diff --git a/include/wx/os2/radiobox.h b/include/wx/os2/radiobox.h index ec2ac64f86..9c424e8894 100644 --- a/include/wx/os2/radiobox.h +++ b/include/wx/os2/radiobox.h @@ -30,11 +30,7 @@ public: int n = 0, const wxString choices[] = NULL, int majorDim = 0, long style = wxRA_HORIZONTAL, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr) -# else const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr) -# endif #endif { Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name); @@ -47,11 +43,7 @@ public: int n = 0, const wxString choices[] = NULL, int majorDim = 0, long style = wxRA_HORIZONTAL, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr); -# else const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr); -# endif #endif virtual bool OS2Command(WXUINT param, WXWORD id); diff --git a/include/wx/os2/radiobut.h b/include/wx/os2/radiobut.h index 996f74487c..f1e03be04a 100644 --- a/include/wx/os2/radiobut.h +++ b/include/wx/os2/radiobut.h @@ -27,11 +27,7 @@ class WXDLLEXPORT wxRadioButton: public wxControl const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxRadioButtonNameStr) { @@ -43,11 +39,7 @@ class WXDLLEXPORT wxRadioButton: public wxControl const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxRadioButtonNameStr); @@ -76,11 +68,7 @@ class WXDLLEXPORT wxBitmapRadioButton: public wxRadioButton const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxBitmapRadioButtonNameStr) { @@ -92,11 +80,7 @@ class WXDLLEXPORT wxBitmapRadioButton: public wxRadioButton const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxBitmapRadioButtonNameStr); diff --git a/include/wx/os2/scrolbar.h b/include/wx/os2/scrolbar.h index 7be44ed401..e77f17ec44 100644 --- a/include/wx/os2/scrolbar.h +++ b/include/wx/os2/scrolbar.h @@ -30,11 +30,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSB_HORIZONTAL, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxScrollBarNameStr) { @@ -45,11 +41,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSB_HORIZONTAL, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxScrollBarNameStr); diff --git a/include/wx/os2/slider.h b/include/wx/os2/slider.h index 09ed090957..b290372735 100644 --- a/include/wx/os2/slider.h +++ b/include/wx/os2/slider.h @@ -30,11 +30,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSL_HORIZONTAL, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxSliderNameStr) { @@ -49,11 +45,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSL_HORIZONTAL, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxSliderNameStr); diff --git a/include/wx/os2/textctrl.h b/include/wx/os2/textctrl.h index 56ba625ffa..a378830e55 100644 --- a/include/wx/os2/textctrl.h +++ b/include/wx/os2/textctrl.h @@ -25,11 +25,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxTextCtrlNameStr) { @@ -42,11 +38,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif const wxString& name = wxTextCtrlNameStr); diff --git a/include/wx/validate.h b/include/wx/validate.h index 370f38e473..25a4c5894a 100644 --- a/include/wx/validate.h +++ b/include/wx/validate.h @@ -82,11 +82,7 @@ private: DECLARE_DYNAMIC_CLASS(wxValidator) }; -#if defined(__VISAGECPP__) -WXDLLEXPORT_DATA(extern const wxValidator*) wxDefaultValidator; -#else WXDLLEXPORT_DATA(extern const wxValidator) wxDefaultValidator; -#endif #endif // wxUSE_VALIDATORS diff --git a/include/wx/window.h b/include/wx/window.h index afc521e18f..f78da2dbfc 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -121,12 +121,9 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, + #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else const wxValidator& validator = wxDefaultValidator, -# endif #endif // wxUSE_VALIDATORS const wxString& name = wxPanelNameStr); @@ -392,11 +389,7 @@ public: #if wxUSE_VALIDATORS // a window may have an associated validator which is used to control // user input -# if defined(__VISAGECPP__) - virtual void SetValidator( const wxValidator *validator ); -# else virtual void SetValidator( const wxValidator &validator ); -# endif virtual wxValidator *GetValidator() { return m_windowValidator; } #endif // wxUSE_VALIDATORS diff --git a/src/common/ctrlcmn.cpp b/src/common/ctrlcmn.cpp index be7735196d..dec9f63a0c 100644 --- a/src/common/ctrlcmn.cpp +++ b/src/common/ctrlcmn.cpp @@ -43,11 +43,7 @@ bool wxControlBase::CreateControl(wxWindowBase *parent, const wxSize& size, long style, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator, -# else const wxValidator& validator, -# endif #endif const wxString& name) { diff --git a/src/common/validate.cpp b/src/common/validate.cpp index 50d072c6b2..44e0caeece 100644 --- a/src/common/validate.cpp +++ b/src/common/validate.cpp @@ -32,14 +32,7 @@ #include "wx/validate.h" -#if defined(__VISAGECPP__) -// treated as a static global class by VA and thus cannot use in this form. -// Defined as a pointer and then explicity allocated and deallocated -// by user if desired -const wxValidator* wxDefaultValidator = NULL; -#else const wxValidator wxDefaultValidator; -#endif #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxValidator, wxEvtHandler) diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 782d3bf7d1..dd3822251d 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -159,11 +159,7 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent, const wxSize& WXUNUSED(size), long style, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator, -# else const wxValidator& validator, -# endif #endif const wxString& name) { @@ -619,18 +615,6 @@ void wxWindowBase::SetCaret(wxCaret *caret) // validators // ---------------------------------------------------------------------------- -# if defined(__VISAGECPP__) -void wxWindowBase::SetValidator(const wxValidator* validator) -{ - if ( m_windowValidator ) - delete m_windowValidator; - - m_windowValidator = (wxValidator *)validator->Clone(); - - if ( m_windowValidator ) - m_windowValidator->SetWindow(this) ; -} -# else void wxWindowBase::SetValidator(const wxValidator& validator) { if ( m_windowValidator ) @@ -641,7 +625,6 @@ void wxWindowBase::SetValidator(const wxValidator& validator) if ( m_windowValidator ) m_windowValidator->SetWindow(this) ; } -# endif // __VISAGECPP__ #endif // wxUSE_VALIDATORS // ---------------------------------------------------------------------------- diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index ead089a205..59bf7da65d 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -981,11 +981,7 @@ wxListTextCtrl::wxListTextCtrl( wxWindow *parent, const wxWindowID id, bool *accept, wxString *res, wxListMainWindow *owner, const wxString &value, const wxPoint &pos, const wxSize &size, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - int style, const wxValidator* validator, const wxString &name ) : -# else int style, const wxValidator& validator, const wxString &name ) : -# endif #endif wxTextCtrl( parent, id, value, pos, size, style, validator, name ) { @@ -2576,11 +2572,7 @@ wxListCtrl::~wxListCtrl() bool wxListCtrl::Create( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - long style, const wxValidator *validator, -# else long style, const wxValidator &validator, -# endif #endif const wxString &name ) { diff --git a/src/generic/treectrl.cpp b/src/generic/treectrl.cpp index aaaeeed06b..0c7de22577 100644 --- a/src/generic/treectrl.cpp +++ b/src/generic/treectrl.cpp @@ -197,11 +197,7 @@ wxTreeTextCtrl::wxTreeTextCtrl( wxWindow *parent, const wxWindowID id, bool *accept, wxString *res, wxTreeCtrl *owner, const wxString &value, const wxPoint &pos, const wxSize &size, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - int style, const wxValidator* validator, const wxString &name ) : -# else int style, const wxValidator& validator, const wxString &name ) : -# endif #endif wxTextCtrl( parent, id, value, pos, size, style, validator, name ) { @@ -523,7 +519,7 @@ void wxTreeCtrl::Init() m_dragCount = 0; m_renameTimer = new wxTreeRenameTimer( this ); - + m_normalFont = wxSystemSettings::GetSystemFont( wxSYS_DEFAULT_GUI_FONT ); m_boldFont = wxFont( m_normalFont.GetPointSize(), m_normalFont.GetFamily(), @@ -536,11 +532,7 @@ bool wxTreeCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator *validator, -# else const wxValidator &validator, -# endif #endif const wxString& name ) { @@ -843,7 +835,7 @@ wxTreeItemId wxTreeCtrl::DoInsertItem(const wxTreeItemId& parentId, } wxClientDC dc(this); - wxGenericTreeItem *item = + wxGenericTreeItem *item = new wxGenericTreeItem( parent, text, dc, image, selImage, data ); if ( data != NULL ) @@ -871,7 +863,7 @@ wxTreeItemId wxTreeCtrl::AddRoot(const wxString& text, { data->m_pItem = m_anchor; } - + if (!HasFlag(wxTR_MULTIPLE)) { m_current = m_key_current = m_anchor; @@ -1602,7 +1594,7 @@ void wxTreeCtrl::OnPaint( wxPaintEvent &WXUNUSED(event) ) dc.SetFont( m_normalFont ); dc.SetPen( m_dottedPen ); - + // this is now done dynamically //if(GetImageList() == NULL) // m_lineHeight = (int)(dc.GetCharHeight() + 4); diff --git a/src/html/helpfrm.cpp b/src/html/helpfrm.cpp index 68fbdd7f4c..8f61ef0ffc 100644 --- a/src/html/helpfrm.cpp +++ b/src/html/helpfrm.cpp @@ -292,6 +292,12 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, const wxString& ti // showtime if (m_NavigPan && m_Splitter) { m_Splitter -> SetMinimumPaneSize(20); + if (m_Cfg.navig_on) + m_Splitter -> SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); + else { + m_Splitter -> SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); + m_Splitter -> Unsplit(); + } if (m_Cfg.navig_on) { m_NavigPan -> Show(TRUE); m_Splitter -> SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); diff --git a/src/jpeg/MAKEFILE.VA b/src/jpeg/MAKEFILE.VA index b4926a384f..50c8d57b87 100644 --- a/src/jpeg/MAKEFILE.VA +++ b/src/jpeg/MAKEFILE.VA @@ -19,7 +19,7 @@ OS2LIBFLAGS=/NOL /NOE OS2LIBS=CPPOM30.lib CPPOOC3.LIB OS2386.LIB # Change WXDIR or WXWIN to wherever wxWindows is found -WXDIR = j:\dev\wx2\wxWindows +WXDIR = h:\dev\wx2\wxWindows OS2JPEGDIR=$(WXDIR)\src\jpeg OS2JPEGINC=$(WINJPEGDIR) diff --git a/src/msw/makefile.vc b/src/msw/makefile.vc index 92897f9072..6d7c6ebc81 100644 --- a/src/msw/makefile.vc +++ b/src/msw/makefile.vc @@ -350,22 +350,22 @@ test: $(MSWDIR)\$D\wave.obj test2: ..\common\Debug\config.obj $D: - mkdir $D + md $D $(COMMDIR)\$D: - mkdir $(COMMDIR)\$D + md $(COMMDIR)\$D $(MSWDIR)\$D: - mkdir $(MSWDIR)\$D + md $(MSWDIR)\$D $(GENDIR)\$D: - mkdir $(GENDIR)\$D + md $(GENDIR)\$D $(OLEDIR)\$D: - mkdir $(OLEDIR)\$D + md $(OLEDIR)\$D $(HTMLDIR)\$D: - mkdir $(HTMLDIR)\$D + md $(HTMLDIR)\$D # wxWindows library as DLL dll: @@ -727,7 +727,7 @@ $(DOCDIR)/pdf/techref.rtf: $(DOCDIR)/latex/techref/techref.tex $(DOCDIR)\html\wx\wx.htm: $(DOCDIR)\latex\wx\classes.tex $(DOCDIR)\latex\wx\body.tex $(DOCDIR)/latex/wx/topics.tex $(DOCDIR)\latex\wx\manual.tex cd $(DOCDIR)\latex\wx - -mkdir $(DOCDIR)\html\wx + -md $(DOCDIR)\html\wx -start $(WAITFLAG) tex2rtf $(DOCDIR)\latex\wx\manual.tex $(DOCDIR)\html\wx\wx.htm -twice -html -erase $(DOCDIR)\html\wx\*.con -erase $(DOCDIR)\html\wx\*.ref @@ -743,7 +743,7 @@ $(DOCDIR)\html\wx\wx.chm : $(DOCDIR)\html\wx\wx.htm $(DOCDIR)\html\wx\wx.hhp $(DOCDIR)\html\porting\port.htm: $(DOCDIR)\latex\porting\porting.tex cd $(DOCDIR)\latex\porting - -mkdir $(DOCDIR)\html\porting + -md $(DOCDIR)\html\porting -start $(WAITFLAG) tex2rtf $(DOCDIR)\latex\porting\porting.tex $(DOCDIR)\html\porting\port.htm -twice -html -erase $(DOCDIR)\html\porting\*.con -erase $(DOCDIR)\html\porting\*.ref @@ -753,7 +753,7 @@ $(DOCDIR)\html\porting\port.htm: $(DOCDIR)\latex\porting\porting.tex $(DOCDIR)\html\proplist\prop.htm: $(DOCDIR)\latex\proplist\prop.tex $(DOCDIR)\latex\proplist\body.tex $(DOCDIR)\latex\proplist\classes.tex $(DOCDIR)\latex\proplist\changes.tex cd $(DOCDIR)\latex\proplist - -mkdir $(DOCDIR)\html\proplist + -md $(DOCDIR)\html\proplist -start $(WAITFLAG) tex2rtf $(DOCDIR)\latex\proplist\prop.tex $(DOCDIR)\html\proplist\prop.htm -twice -html -erase $(DOCDIR)\html\proplist\*.con -erase $(DOCDIR)\html\proplist\*.ref diff --git a/src/os2/bmpbuttn.cpp b/src/os2/bmpbuttn.cpp index 0035901c3b..8f61361eba 100644 --- a/src/os2/bmpbuttn.cpp +++ b/src/os2/bmpbuttn.cpp @@ -29,11 +29,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit const wxPoint& pos, const wxSize& size, long style, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator, -# else const wxValidator& validator, -# endif #endif const wxString& name) { diff --git a/src/os2/button.cpp b/src/os2/button.cpp index dc33b17225..c4f5ac0f10 100644 --- a/src/os2/button.cpp +++ b/src/os2/button.cpp @@ -33,11 +33,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size, long style, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator, -# else const wxValidator& validator, -# endif #endif const wxString& name) { diff --git a/src/os2/checkbox.cpp b/src/os2/checkbox.cpp index 035c4504cc..c4a3b2f099 100644 --- a/src/os2/checkbox.cpp +++ b/src/os2/checkbox.cpp @@ -50,11 +50,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size, long style, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator, -# else const wxValidator& validator, -# endif #endif const wxString& name) { @@ -185,11 +181,7 @@ bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *l const wxPoint& pos, const wxSize& size, long style, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator, -# else const wxValidator& validator, -# endif #endif const wxString& name) { diff --git a/src/os2/checklst.cpp b/src/os2/checklst.cpp index e53cf20284..b11ed7c1f8 100644 --- a/src/os2/checklst.cpp +++ b/src/os2/checklst.cpp @@ -260,11 +260,7 @@ wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, int nStrings, const wxString choices[], #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - long style, const wxValidator* val, -# else long style, const wxValidator& val, -# endif #endif const wxString& name) : wxListBox() diff --git a/src/os2/choice.cpp b/src/os2/choice.cpp index dbfeedf60a..b5dc463a1e 100644 --- a/src/os2/choice.cpp +++ b/src/os2/choice.cpp @@ -31,11 +31,7 @@ bool wxChoice::Create(wxWindow *parent, int n, const wxString choices[], long style, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator, -# else const wxValidator& validator, -# endif #endif const wxString& name) { diff --git a/src/os2/colordlg.cpp b/src/os2/colordlg.cpp deleted file mode 100644 index 44607982b2..0000000000 --- a/src/os2/colordlg.cpp +++ /dev/null @@ -1,78 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: colordlg.cpp -// Purpose: wxColourDialog class. NOTE: you can use the generic class -// if you wish, instead of implementing this. -// Author: David Webster -// Modified by: -// Created: 10/13/99 -// RCS-ID: $Id$ -// Copyright: (c) David Webster -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifndef WX_PRECOMP -#include -#include "wx/defs.h" -#include "wx/bitmap.h" -#include "wx/pen.h" -#include "wx/brush.h" -#include "wx/colour.h" -#include "wx/gdicmn.h" -#include "wx/utils.h" -#include "wx/frame.h" -#include "wx/dialog.h" -#include "wx/msgdlg.h" -#endif - -#define INCL_PM -#include - -#include "wx/os2/private.h" -#include "wx/colordlg.h" -#include "wx/cmndata.h" - -#include -#include -#include - -#define wxDIALOG_DEFAULT_X 300 -#define wxDIALOG_DEFAULT_Y 300 - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog) -#endif - -/* - * wxColourDialog - */ - -wxColourDialog::wxColourDialog() -{ - m_dialogParent = NULL; -} - -wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data) -{ - Create(parent, data); -} - -bool wxColourDialog::Create(wxWindow *parent, wxColourData *data) -{ - m_dialogParent = parent; - - if (data) - m_colourData = *data; - return TRUE; -} - -int wxColourDialog::ShowModal() -{ - /* TODO: implement dialog - */ - - return wxID_CANCEL; -} - diff --git a/src/os2/combobox.cpp b/src/os2/combobox.cpp index d8b0bd0e6d..a91a566f36 100644 --- a/src/os2/combobox.cpp +++ b/src/os2/combobox.cpp @@ -64,11 +64,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, int n, const wxString choices[], long style, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator, -# else const wxValidator& validator, -# endif #endif const wxString& name) { diff --git a/src/os2/frame.cpp b/src/os2/frame.cpp index 3464ed3300..fa543a0f52 100644 --- a/src/os2/frame.cpp +++ b/src/os2/frame.cpp @@ -12,10 +12,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - #ifndef WX_PRECOMP #include "wx/setup.h" #include "wx/frame.h" @@ -28,61 +24,83 @@ #endif // WX_PRECOMP #include "wx/os2/private.h" -#include "wx/statusbr.h" -#include "wx/toolbar.h" + +#if wxUSE_STATUSBAR + #include "wx/statusbr.h" +#endif // wxUSE_STATUSBAR + +#if wxUSE_TOOLBAR + #include "wx/toolbar.h" +#endif // wxUSE_TOOLBAR + #include "wx/menuitem.h" #include "wx/log.h" +// ---------------------------------------------------------------------------- +// globals +// ---------------------------------------------------------------------------- + extern wxWindowList wxModelessWindows; extern wxList WXDLLEXPORT wxPendingDelete; extern wxChar wxFrameClassName[]; extern wxMenu *wxCurrentPopupMenu; +// ---------------------------------------------------------------------------- +// event tables +// ---------------------------------------------------------------------------- + #if !USE_SHARED_LIBRARY -BEGIN_EVENT_TABLE(wxFrame, wxWindow) - EVT_SIZE(wxFrame::OnSize) - EVT_ACTIVATE(wxFrame::OnActivate) - EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight) - EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged) - EVT_IDLE(wxFrame::OnIdle) - EVT_CLOSE(wxFrame::OnCloseWindow) +BEGIN_EVENT_TABLE(wxFrame, wxFrameBase) + EVT_ACTIVATE(wxFrame::OnActivate) + EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged) END_EVENT_TABLE() IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow) #endif -bool wxFrame::m_useNativeStatusBar = FALSE; +// ============================================================================ +// implementation +// ============================================================================ -wxFrame::wxFrame() -{ - m_frameToolBar = NULL ; - m_frameMenuBar = NULL; - m_frameStatusBar = NULL; +// ---------------------------------------------------------------------------- +// static class members +// ---------------------------------------------------------------------------- - m_iconized = FALSE; -} +#if wxUSE_NATIVE_STATUSBAR + bool wxFrame::m_useNativeStatusBar = TRUE; +#else + bool wxFrame::m_useNativeStatusBar = FALSE; +#endif -bool wxFrame::Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) +// ---------------------------------------------------------------------------- +// creation/destruction +// ---------------------------------------------------------------------------- + +void wxFrame::Init() { + m_iconized = FALSE; + #if wxUSE_TOOLTIPS m_hwndToolTip = 0; #endif +} +bool wxFrame::Create(wxWindow *parent, + wxWindowID id, + const wxString& title, + const wxPoint& pos, + const wxSize& size, + long style, + const wxString& name) +{ SetName(name); m_windowStyle = style; m_frameMenuBar = NULL; - m_frameToolBar = NULL ; + m_frameToolBar = NULL; m_frameStatusBar = NULL; SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); -// m_icon = NULL; if ( id > -1 ) m_windowId = id; else @@ -119,13 +137,9 @@ wxFrame::~wxFrame() m_isBeingDeleted = TRUE; wxTopLevelWindows.DeleteObject(this); - if (m_frameStatusBar) - delete m_frameStatusBar; - if (m_frameMenuBar) - delete m_frameMenuBar; - -/* New behaviour March 1998: check if it's the last top-level window */ -// if (wxTheApp && (this == wxTheApp->GetTopWindow())) +// TODO: +/* + DeleteAllBars(); if (wxTheApp && (wxTopLevelWindows.Number() == 0)) { @@ -133,7 +147,7 @@ wxFrame::~wxFrame() if (wxTheApp->GetExitOnFrameDelete()) { -// PostQuitMessage(0); + PostQuitMessage(0); } } @@ -144,9 +158,6 @@ wxFrame::~wxFrame() // Try to bring the parent to the top. // MT:Only do this if this frame is currently the active window, else weird // things start to happen - -// TODO: -/* if ( wxGetActiveWindow() == this ) if (GetParent() && GetParent()->GetHWND()) ::BringWindowToTop((HWND) GetParent()->GetHWND()); @@ -161,12 +172,14 @@ void wxFrame::DoGetClientSize(int *x, int *y) const RECT rect; ::GetClientRect(GetHwnd(), &rect); +#if wxUSE_STATUSBAR if ( GetStatusBar() ) { int statusX, statusY; GetStatusBar()->GetClientSize(&statusX, &statusY); rect.bottom -= statusY; } +#endif // wxUSE_STATUSBAR wxPoint pt(GetClientAreaOrigin()); rect.bottom -= pt.y; @@ -199,12 +212,14 @@ void wxFrame::DoSetClientSize(int width, int height) int actual_width = rect2.right - rect2.left - rect.right + width; int actual_height = rect2.bottom - rect2.top - rect.bottom + height; +#if wxUSE_STATUSBAR if ( GetStatusBar() ) { int statusX, statusY; GetStatusBar()->GetClientSize(&statusX, &statusY); actual_height += statusY; } +#endif // wxUSE_STATUSBAR wxPoint pt(GetClientAreaOrigin()); actual_width += pt.y; @@ -248,73 +263,61 @@ void wxFrame::DoGetPosition(int *x, int *y) const */ } -bool wxFrame::Show(bool show) +// ---------------------------------------------------------------------------- +// variations around ::ShowWindow() +// ---------------------------------------------------------------------------- + +void wxFrame::DoShowWindow(int nShowCmd) { // TODO: /* - int cshow; - if (show) - cshow = SW_SHOW; - else - cshow = SW_HIDE; - - if (!show) - { - // Try to highlight the correct window (the parent) - HWND hWndParent = 0; - if (GetParent()) - { - hWndParent = (HWND) GetParent()->GetHWND(); - if (hWndParent) - ::BringWindowToTop(hWndParent); - } - } - - ShowWindow(GetHwnd(), (BOOL)cshow); - if (show) - { - BringWindowToTop(GetHwnd()); + ::ShowWindow(GetHwnd(), nShowCmd); - wxActivateEvent event(wxEVT_ACTIVATE, TRUE, m_windowId); - event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(event); - } - return TRUE; + m_iconized = nShowCmd == SW_MINIMIZE; */ - return FALSE; } -void wxFrame::Iconize(bool iconize) +bool wxFrame::Show(bool show) { // TODO: /* - if (!iconize) - Show(TRUE); + DoShowWindow(show ? SW_SHOW : SW_HIDE); - int cshow; - if (iconize) - cshow = SW_MINIMIZE; - else - cshow = SW_RESTORE; - ShowWindow(GetHwnd(), (BOOL)cshow); - m_iconized = iconize; + if ( show ) + { + ::BringWindowToTop(GetHwnd()); + + wxActivateEvent event(wxEVT_ACTIVATE, TRUE, m_windowId); + event.SetEventObject( this ); + GetEventHandler()->ProcessEvent(event); + } + else + { + // Try to highlight the correct window (the parent) + if ( GetParent() ) + { + HWND hWndParent = GetHwndOf(GetParent()); + if (hWndParent) + ::BringWindowToTop(hWndParent); + } + } */ + return TRUE; +} + +void wxFrame::Iconize(bool iconize) +{ +// DoShowWindow(iconize ? SW_MINIMIZE : SW_RESTORE); } -// Equivalent to maximize/restore in Windows void wxFrame::Maximize(bool maximize) { -// TODO: -/* - Show(TRUE); - int cshow; - if (maximize) - cshow = SW_MAXIMIZE; - else - cshow = SW_RESTORE; - ShowWindow(GetHwnd(), cshow); - m_iconized = FALSE; -*/ +// DoShowWindow(maximize ? SW_MAXIMIZE : SW_RESTORE); +} + +void wxFrame::Restore() +{ +// DoShowWindow(SW_RESTORE); } bool wxFrame::IsIconized() const @@ -324,99 +327,63 @@ bool wxFrame::IsIconized() const ((wxFrame *)this)->m_iconized = (::IsIconic(GetHwnd()) != 0); return m_iconized; */ - return FALSE; + return FALSE; } // Is it maximized? bool wxFrame::IsMaximized() const { -// return (::IsZoomed(GetHwnd()) != 0) ; - return FALSE; +// TODO: +/* + return (::IsZoomed(GetHwnd()) != 0); +*/ + return FALSE; } void wxFrame::SetIcon(const wxIcon& icon) { + wxFrameBase::SetIcon(icon); + // TODO: /* - m_icon = icon; - if ( m_icon.Ok() ) - SendMessage(GetHwnd(), WM_SETICON, - (WPARAM)TRUE, (LPARAM)(HICON) m_icon.GetHICON()); + if ( m_icon.Ok() ) + { + SendMessage(GetHwnd(), WM_SETICON, + (WPARAM)TRUE, (LPARAM)(HICON) m_icon.GetHICON()); + } */ } #if wxUSE_STATUSBAR -wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id, - const wxString& name) +wxStatusBar *wxFrame::OnCreateStatusBar(int number, + long style, + wxWindowID id, + const wxString& name) { wxStatusBar *statusBar = NULL; - { - statusBar = new wxStatusBar(this, id, wxPoint(0, 0), wxSize(100, 20), - style, name); - - // Set the height according to the font and the border size - wxClientDC dc(statusBar); - dc.SetFont(statusBar->GetFont()); - - long x, y; - dc.GetTextExtent("X", &x, &y); - - int height = (int)( (y * 1.1) + 2* statusBar->GetBorderY()); - - statusBar->SetSize(-1, -1, 100, height); - } - - statusBar->SetFieldsCount(number); - return statusBar; -} - -wxStatusBar* wxFrame::CreateStatusBar(int number, long style, wxWindowID id, - const wxString& name) -{ - // VZ: calling CreateStatusBar twice is an error - why anyone would do it? - wxCHECK_MSG( m_frameStatusBar == NULL, FALSE, - wxT("recreating status bar in wxFrame") ); - - m_frameStatusBar = OnCreateStatusBar(number, style, id, - name); - if ( m_frameStatusBar ) - { - PositionStatusBar(); - return m_frameStatusBar; - } - else - return NULL; -} - -void wxFrame::SetStatusText(const wxString& text, int number) -{ - wxCHECK_RET( m_frameStatusBar != NULL, wxT("no statusbar to set text for") ); - m_frameStatusBar->SetStatusText(text, number); -} - -void wxFrame::SetStatusWidths(int n, const int widths_field[]) -{ - wxCHECK_RET( m_frameStatusBar != NULL, wxT("no statusbar to set widths for") ); + statusBar = wxFrameBase::OnCreateStatusBar(number, style, id, name); - m_frameStatusBar->SetStatusWidths(n, widths_field); - PositionStatusBar(); + return statusBar; } void wxFrame::PositionStatusBar() { - // native status bar positions itself - if (m_frameStatusBar) - { - int w, h; - GetClientSize(&w, &h); - int sw, sh; - m_frameStatusBar->GetSize(&sw, &sh); - - // Since we wish the status bar to be directly under the client area, - // we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS. - m_frameStatusBar->SetSize(0, h, w, sh); - } +// TODO: +/* + // native status bar positions itself + if ( m_frameStatusBar ) + { + int w, h; + GetClientSize(&w, &h); + int sw, sh; + m_frameStatusBar->GetSize(&sw, &sh); + + // Since we wish the status bar to be directly under the client area, + // we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS. + m_frameStatusBar->SetSize(0, h, w, sh); + } +*/ } #endif // wxUSE_STATUSBAR @@ -467,6 +434,8 @@ void wxFrame::InternalSetMenuBar() // Responds to colour changes, and passes event on to children. void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event) { +// TODO: +/* SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); Refresh(); @@ -479,6 +448,7 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event) // Propagate the event to the non-top-level children wxWindow::OnSysColourChanged(event); +*/ } /* @@ -555,57 +525,8 @@ bool wxFrame::OS2Create(int id, wxWindow *parent, const wxChar *wclass, wxWindow // style instead of WS_OVERLAPPED if (width > -1 && height > -1) ::PostMessage(GetHwnd(), WM_SIZE, SIZE_RESTORED, MAKELPARAM(width, height)); - - return TRUE; */ - return FALSE; -} - -// Default resizing behaviour - if only ONE subwindow, resize to client -// rectangle size -void wxFrame::OnSize(wxSizeEvent& event) -{ - // if we're using constraints - do use them -#if wxUSE_CONSTRAINTS - if ( GetAutoLayout() ) - { - Layout(); - return; - } -#endif - - // do we have _exactly_ one child? - wxWindow *child = NULL; - for ( wxWindowList::Node *node = GetChildren().GetFirst(); - node; - node = node->GetNext() ) - { - wxWindow *win = node->GetData(); - if ( !win->IsTopLevel() -#if wxUSE_STATUSBAR - && (win != GetStatusBar()) -#endif // wxUSE_STATUSBAR -#if wxUSE_TOOLBAR - && (win != GetToolBar()) -#endif // wxUSE_TOOLBAR - ) - { - if ( child ) - return; // it's our second subwindow - nothing to do - child = win; - } - } - - if ( child ) { - // we have exactly one child - set it's size to fill the whole frame - int clientW, clientH; - GetClientSize(&clientW, &clientH); - - int x = 0; - int y = 0; - - child->SetSize(x, y, clientW, clientH); - } + return TRUE; } // Default activation behaviour - set the focus for the first child @@ -637,67 +558,11 @@ void wxFrame::OnActivate(wxActivateEvent& event) } } -// The default implementation for the close window event. -void wxFrame::OnCloseWindow(wxCloseEvent& event) -{ - Destroy(); -} - -// Destroy the window (delayed, if a managed window) -bool wxFrame::Destroy() -{ - if (!wxPendingDelete.Member(this)) - wxPendingDelete.Append(this); - return TRUE; -} - -// Default menu selection behaviour - display a help string -void wxFrame::OnMenuHighlight(wxMenuEvent& event) -{ - if (GetStatusBar()) - { - wxString help; - int menuId = event.GetMenuId(); - if ( menuId != -1 ) - { - wxMenuBar *menuBar = GetMenuBar(); - if (menuBar && menuBar->FindItem(menuId)) - { - help = menuBar->GetHelpString(menuId); - } - } - - // set status text even if the string is empty - this will at - // least remove the string from the item which was previously - // selected - SetStatusText(help); - } -} - -wxMenuBar *wxFrame::GetMenuBar() const -{ - return m_frameMenuBar; -} - -bool wxFrame::ProcessCommand(int id) -{ - wxMenuBar *bar = GetMenuBar() ; - if ( !bar ) - return FALSE; - - wxMenuItem *item = bar->FindItem(id); - - if ( item && item->IsCheckable() ) - { - bar->Check(id, !bar->IsChecked(id)) ; - } - - wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, id); - commandEvent.SetInt( id ); - commandEvent.SetEventObject( this ); - - return GetEventHandler()->ProcessEvent(commandEvent); -} +// ---------------------------------------------------------------------------- +// wxFrame size management: we exclude the areas taken by menu/status/toolbars +// from the client area, so the client area is what's really available for the +// frame contents +// ---------------------------------------------------------------------------- // Checks if there is a toolbar, and returns the first free client position wxPoint wxFrame::GetClientAreaOrigin() const @@ -744,28 +609,20 @@ void wxFrame::DoClientToScreen(int *x, int *y) const wxWindow::DoClientToScreen(x, y); } +// ---------------------------------------------------------------------------- +// tool/status bar stuff +// ---------------------------------------------------------------------------- + #if wxUSE_TOOLBAR + wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name) { - wxCHECK_MSG( m_frameToolBar == NULL, FALSE, - wxT("recreating toolbar in wxFrame") ); - - wxToolBar* toolBar = OnCreateToolBar(style, id, name); - if (toolBar) + if ( wxFrameBase::CreateToolBar(style, id, name) ) { - SetToolBar(toolBar); PositionToolBar(); - return toolBar; - } - else - { - return NULL; } -} -wxToolBar* wxFrame::OnCreateToolBar(long style, wxWindowID id, const wxString& name) -{ - return new wxToolBar(this, id, wxDefaultPosition, wxDefaultSize, style, name); + return m_frameToolBar; } void wxFrame::PositionToolBar() @@ -775,33 +632,40 @@ void wxFrame::PositionToolBar() RECT rect; ::GetClientRect(GetHwnd(), &rect); +#if wxUSE_STATUSBAR if ( GetStatusBar() ) { - int statusX, statusY; - GetStatusBar()->GetClientSize(&statusX, &statusY); - rect.bottom -= statusY; + int statusX, statusY; + GetStatusBar()->GetClientSize(&statusX, &statusY); + rect.bottom -= statusY; } +#endif // wxUSE_STATUSBAR - if (GetToolBar()) + if ( GetToolBar() ) { int tw, th; - GetToolBar()->GetSize(& tw, & th); + GetToolBar()->GetSize(&tw, &th); - if (GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL) + if ( GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL ) { - // Use the 'real' MSW position - GetToolBar()->SetSize(0, 0, tw, rect.bottom, wxSIZE_NO_ADJUSTMENTS); + th = rect.bottom; } else { - // Use the 'real' MSW position - GetToolBar()->SetSize(0, 0, rect.right, th, wxSIZE_NO_ADJUSTMENTS); + tw = rect.right; } + + // Use the 'real' MSW position here + GetToolBar()->SetSize(0, 0, tw, th, wxSIZE_NO_ADJUSTMENTS); } */ } #endif // wxUSE_TOOLBAR +// ---------------------------------------------------------------------------- +// frame state (iconized/maximized/...) +// ---------------------------------------------------------------------------- + // propagate our state change to all child frames: this allows us to emulate X // Windows behaviour where child frames float independently of the parent one // on the desktop, but are iconized/restored with it @@ -820,20 +684,6 @@ void wxFrame::IconizeChildFrames(bool bIconize) } } - -// make the window modal (all other windows unresponsive) -void wxFrame::MakeModal(bool modal) -{ - if (modal) { - wxEnableTopLevelWindows(FALSE); - Enable(TRUE); // keep this window enabled - } - else { - wxEnableTopLevelWindows(TRUE); - } -} - - // =========================================================================== // message processing // =========================================================================== @@ -844,9 +694,11 @@ void wxFrame::MakeModal(bool modal) bool wxFrame::OS2TranslateMessage(WXMSG* pMsg) { +// TODO: +/* if ( wxWindow::OS2TranslateMessage(pMsg) ) return TRUE; - +*/ // try the menu bar accels wxMenuBar *menuBar = GetMenuBar(); if ( !menuBar ) @@ -944,10 +796,20 @@ bool wxFrame::HandleSize(int x, int y, WXUINT id) m_iconized = TRUE; break; } -*/ + if ( !m_iconized ) { // forward WM_SIZE to status bar control +#if wxUSE_NATIVE_STATUSBAR + if (m_frameStatusBar && m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95))) + { + wxSizeEvent event(wxSize(x, y), m_frameStatusBar->GetId()); + event.SetEventObject( m_frameStatusBar ); + + ((wxStatusBar95 *)m_frameStatusBar)->OnSize(event); + } +#endif // wxUSE_NATIVE_STATUSBAR + PositionStatusBar(); PositionToolBar(); @@ -955,18 +817,20 @@ bool wxFrame::HandleSize(int x, int y, WXUINT id) event.SetEventObject( this ); processed = GetEventHandler()->ProcessEvent(event); } - +*/ return processed; } bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control) { +// TODO: +/* if ( control ) { // In case it's e.g. a toolbar. wxWindow *win = wxFindWinFromHandle(control); if ( win ) - return win->OS2Command(cmd, id); + return win->MSWCommand(cmd, id); } // handle here commands from menus and accelerators @@ -977,7 +841,7 @@ bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control) wxMenu *popupMenu = wxCurrentPopupMenu; wxCurrentPopupMenu = NULL; - return popupMenu->OS2Command(cmd, id); + return popupMenu->MSWCommand(cmd, id); } if ( ProcessCommand(id) ) @@ -985,7 +849,7 @@ bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control) return TRUE; } } - +*/ return FALSE; } @@ -1003,14 +867,13 @@ bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu) { item = nItem; } -*/ else { // don't give hints for separators (doesn't make sense) nor for the // items opening popup menus (they don't have them anyhow) return FALSE; } - +*/ wxMenuEvent event(wxEVT_MENU_HIGHLIGHT, item); event.SetEventObject( this ); @@ -1023,7 +886,7 @@ bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu) MRESULT wxFrame::OS2WindowProc(HWND hwnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam) { - MRESULT rc = 0; + long rc = 0; bool processed = FALSE; // TODO: @@ -1074,10 +937,12 @@ MRESULT wxFrame::OS2WindowProc(HWND hwnd, WXUINT message, WXWPARAM wParam, WXLPA processed = HandleSize(LOWORD(lParam), HIWORD(lParam), wParam); break; } -*/ + if ( !processed ) - rc = wxWindow::OS2WindowProc(hwnd, message, wParam, lParam); + rc = wxWindow::MSWWindowProc(message, wParam, lParam); return rc; +*/ + return (MRESULT)0; } diff --git a/src/os2/gauge.cpp b/src/os2/gauge.cpp index 8bce479cec..d8185a69d9 100644 --- a/src/os2/gauge.cpp +++ b/src/os2/gauge.cpp @@ -58,11 +58,7 @@ bool wxGauge::Create(wxWindow *parent, wxWindowID id, const wxSize& size, long style, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator, -# else const wxValidator& validator, -# endif #endif const wxString& name) { diff --git a/src/os2/listbox.cpp b/src/os2/listbox.cpp index 7fa3750188..f90d2d1417 100644 --- a/src/os2/listbox.cpp +++ b/src/os2/listbox.cpp @@ -81,11 +81,7 @@ bool wxListBox::Create(wxWindow *parent, int n, const wxString choices[], long style, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator, -# else const wxValidator& validator, -# endif #endif const wxString& name) { diff --git a/src/os2/makefile.va b/src/os2/makefile.va index d599b860fb..78d12ab328 100644 --- a/src/os2/makefile.va +++ b/src/os2/makefile.va @@ -353,7 +353,7 @@ COMLIBOBJS2 = \ utilscmn.obj \ valgen.obj \ validate.obj \ - valtext.obj + valtext.obj COMLIBOBJS3 = \ variant.obj \ @@ -518,6 +518,7 @@ OS2LIBOBJS2 = \ window.obj HTMLOBJS = \ + ..\html\$D\helpctrl.obj \ ..\html\$D\helpdata.obj \ ..\html\$D\helpfrm.obj \ ..\html\$D\htmlcell.obj \ @@ -537,6 +538,7 @@ HTMLOBJS = \ ..\html\$D\winpars.obj HTMLLIBOBJS = \ + helpctrl.obj \ helpdata.obj \ helpfrm.obj \ htmlcell.obj \ @@ -701,6 +703,7 @@ $(GENLIBOBJS): copy ..\generic\$D\treectrl.obj $(HTMLLIBOBJS): + copy ..\html\$D\helpctrl.obj copy ..\html\$D\helpdata.obj copy ..\html\$D\helpfrm.obj copy ..\html\$D\htmlcell.obj diff --git a/src/os2/radiobox.cpp b/src/os2/radiobox.cpp index 43bcd15f5e..0ea23cc062 100644 --- a/src/os2/radiobox.cpp +++ b/src/os2/radiobox.cpp @@ -144,11 +144,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title, int n, const wxString choices[], int majorDim, long style, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* val, const wxString& name) -# else const wxValidator& val, const wxString& name) -# endif #endif { m_selectedButton = -1; diff --git a/src/os2/radiobut.cpp b/src/os2/radiobut.cpp index 5453a8ec52..1905f909e2 100644 --- a/src/os2/radiobut.cpp +++ b/src/os2/radiobut.cpp @@ -47,11 +47,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator, -# else const wxValidator& validator, -# endif #endif const wxString& name) { @@ -159,11 +155,7 @@ bool wxBitmapRadioButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator, -# else const wxValidator& validator, -# endif #endif const wxString& name) { diff --git a/src/os2/scrolbar.cpp b/src/os2/scrolbar.cpp index a279ce3612..bcf4a9e187 100644 --- a/src/os2/scrolbar.cpp +++ b/src/os2/scrolbar.cpp @@ -36,11 +36,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator, -# else const wxValidator& validator, -# endif #endif const wxString& name) { diff --git a/src/os2/slider.cpp b/src/os2/slider.cpp index e0a6852d4a..7817503b7f 100644 --- a/src/os2/slider.cpp +++ b/src/os2/slider.cpp @@ -47,11 +47,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator, -# else const wxValidator& validator, -# endif #endif const wxString& name) { diff --git a/src/os2/textctrl.cpp b/src/os2/textctrl.cpp index c9d836f4ea..20aeec6bb9 100644 --- a/src/os2/textctrl.cpp +++ b/src/os2/textctrl.cpp @@ -88,11 +88,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, const wxSize& size, long style, #if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator, -# else const wxValidator& validator, -# endif #endif const wxString& name) { diff --git a/src/os2/utilsexc.cpp b/src/os2/utilsexc.cpp index 1ebf118034..88048a5d18 100644 --- a/src/os2/utilsexc.cpp +++ b/src/os2/utilsexc.cpp @@ -29,6 +29,10 @@ #define INCL_DOSERRORS #define INCL_DOS #include +#define PURE_32 +#include +#include +#include #include #include diff --git a/src/os2/window.cpp b/src/os2/window.cpp index 3ae47914ad..ebb2c611d2 100644 --- a/src/os2/window.cpp +++ b/src/os2/window.cpp @@ -382,7 +382,7 @@ void wxWindow::SetTitle( const wxString& rTitle ) { - ::WinSetWindowText(GetHwnd(), title.c_str()); + ::WinSetWindowText(GetHwnd(), rTitle.c_str()); } wxString wxWindow::GetTitle() const @@ -392,24 +392,77 @@ wxString wxWindow::GetTitle() const void wxWindow::CaptureMouse() { - // TODO: + HWND hWnd = GetHwnd(); + + if (hWnd && !m_bWinCaptured) + { + ::WinSetCapture(HWND_DESKTOP, hWnd); + m_bWinCaptured = TRUE; + } } void wxWindow::ReleaseMouse() { - // TODO: + if ( m_bWinCaptured ) + { + ::WinSetCapture(HWND_DESKTOP, NULLHANDLE); + m_bWinCaptured = FALSE; + } } -bool wxWindow::SetFont(const wxFont& f) +bool wxWindow::SetFont( + const wxFont& rFont +) { - // TODO: + if (!wxWindowBase::SetFont(rFont)) + { + // nothing to do + return(FALSE); + } + + HWND hWnd = GetHwnd(); + + if (hWnd != 0) + { + wxChar zFont[128]; + + sprintf(zFont, "%d.%s", rFont.GetPointSize(), rFont.GetFaceName().c_str()); + return(::WinSetPresParam(hWnd, PP_FONTNAMESIZE, strlen(zFont), (PVOID)zFont)); + } return(TRUE); } -bool wxWindow::SetCursor(const wxCursor& cursor) // check if base implementation is OK +bool wxWindow::SetCursor( + const wxCursor& rCursor +) // check if base implementation is OK { - // TODO: - return(TRUE); + if ( !wxWindowBase::SetCursor(rCursor)) + { + // no change + return FALSE; + } + + wxASSERT_MSG( m_cursor.Ok(), + wxT("cursor must be valid after call to the base version")); + + HWND hWnd = GetHwnd(); + POINTL vPoint; + RECTL vRect; + HPS hPS; + HRGN hRGN; + + hPS = ::WinGetPS(hWnd); + + ::WinQueryPointerPos(HWND_DESKTOP, &vPoint); + ::WinQueryWindowRect(hWnd, &vRect); + + hRGN = ::GpiCreateRegion(hPS, 1L, &vRect); + + if ((::GpiPtInRegion(hPS, hRGN, &vPoint) == PRGN_INSIDE) && !wxIsBusy()) + { +// ::SetCursor((HCURSOR)m_cursor.GetHCURSOR()); + } + return TRUE; } void wxWindow::WarpPointer(int x_pos, int y_pos) diff --git a/src/png/MAKEFILE.VA b/src/png/MAKEFILE.VA index ca5e78db75..23909907dd 100644 --- a/src/png/MAKEFILE.VA +++ b/src/png/MAKEFILE.VA @@ -19,7 +19,7 @@ OS2LIBFLAGS=/NOL /NOE OS2LIBS=CPPOM30.lib CPPOOC3.LIB OS2386.LIB # Change WXDIR or WXWIN to wherever wxWindows is found -WXDIR = j:\dev\wx2\wxWindows +WXDIR = h:\dev\wx2\wxWindows OS2PNGDIR=$(WXDIR)\src\png OS2PNGINC=$(WINPNGDIR) diff --git a/src/xpm/MAKEFILE.VA b/src/xpm/MAKEFILE.VA index f3466868c2..b6282a002a 100644 --- a/src/xpm/MAKEFILE.VA +++ b/src/xpm/MAKEFILE.VA @@ -19,7 +19,7 @@ OS2LIBFLAGS=/NOL /NOE OS2LIBS=CPPOM30.lib CPPOOC3.LIB OS2386.LIB # Change WXDIR or WXWIN to wherever wxWindows is found -WXDIR = j:\dev\wx2\wxWindows +WXDIR = h:\dev\wx2\wxWindows OS2XPMDIR=$(WXDIR)\src\xpm OS2XPMINC=$(WINXPMDIR) diff --git a/src/zlib/MAKEFILE.VA b/src/zlib/MAKEFILE.VA index 3e4fcdf3eb..165b8e9ece 100644 --- a/src/zlib/MAKEFILE.VA +++ b/src/zlib/MAKEFILE.VA @@ -19,7 +19,7 @@ OS2LIBFLAGS=/NOL /NOE OS2LIBS=CPPOM30.lib CPPOOC3.LIB OS2386.LIB # Change WXDIR or WXWIN to wherever wxWindows is found -WXDIR = j:\dev\wx2\wxWindows +WXDIR = h:\dev\wx2\wxWindows OS2ZLIBDIR=$(WXDIR)\src\zlib OS2ZLIBINC=$(WINPNGDIR) -- 2.47.2