From 8487f8874288a8e4fe40ead153c73dfc7777f41b Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Fri, 5 Nov 1999 15:54:10 +0000 Subject: [PATCH] Added IsTopLevel() as a virtual function. Added fontenum.hto filelist.txt, Changed window positioning code again, some more related things. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4372 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- Makefile.in | 17 ++++++- distrib/msw/tmake/filelist.txt | 3 +- include/wx/gtk/dialog.h | 2 + include/wx/gtk/frame.h | 2 + include/wx/gtk/mdi.h | 89 +++++++++++++++++----------------- include/wx/gtk1/dialog.h | 2 + include/wx/gtk1/frame.h | 2 + include/wx/gtk1/mdi.h | 89 +++++++++++++++++----------------- include/wx/motif/dialog.h | 2 + include/wx/motif/frame.h | 2 + include/wx/motif/mdi.h | 2 + include/wx/msw/dialog.h | 2 + include/wx/msw/frame.h | 2 + include/wx/msw/mdi.h | 2 + include/wx/window.h | 2 +- samples/dialogs/dialogs.cpp | 2 +- src/common/wincmn.cpp | 2 +- src/gtk/dialog.cpp | 12 ++--- src/gtk/frame.cpp | 13 ++--- src/gtk/menu.cpp | 8 +-- src/gtk/textctrl.cpp | 2 +- src/gtk1/dialog.cpp | 12 ++--- src/gtk1/frame.cpp | 13 ++--- src/gtk1/menu.cpp | 8 +-- src/gtk1/textctrl.cpp | 2 +- 25 files changed, 151 insertions(+), 143 deletions(-) diff --git a/Makefile.in b/Makefile.in index dadf3f979c..da64a1abcf 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,5 +1,5 @@ # -# This file was automatically generated by tmake at 18:34, 1999/11/01 +# This file was automatically generated by tmake at 16:44, 1999/11/05 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE UNX.T! # @@ -222,6 +222,9 @@ WX_HEADERS = \ filesys.h \ font.h \ fontdlg.h \ + fontenum.h \ + fontmap.h \ + fontutil.h \ frame.h \ fs_inet.h \ fs_zip.h \ @@ -646,6 +649,7 @@ GTK_GENERICOBJS = \ scrolwin.o \ splitter.o \ statusbr.o \ + tabg.o \ textdlgg.o \ tipdlg.o \ treectrl.o \ @@ -680,6 +684,7 @@ GTK_GENERICDEPS = \ scrolwin.d \ splitter.d \ statusbr.d \ + tabg.d \ textdlgg.d \ tipdlg.d \ treectrl.d \ @@ -713,6 +718,7 @@ GTK_COMMONOBJS = \ filefn.o \ filesys.o \ fontcmn.o \ + fontmap.o \ framecmn.o \ fs_inet.o \ fs_zip.o \ @@ -808,6 +814,7 @@ GTK_COMMONDEPS = \ filefn.d \ filesys.d \ fontcmn.d \ + fontmap.d \ framecmn.d \ fs_inet.d \ fs_zip.d \ @@ -1099,6 +1106,7 @@ MOTIF_COMMONOBJS = \ filefn.o \ filesys.o \ fontcmn.o \ + fontmap.o \ framecmn.o \ fs_inet.o \ fs_zip.o \ @@ -1194,6 +1202,7 @@ MOTIF_COMMONDEPS = \ filefn.d \ filesys.d \ fontcmn.d \ + fontmap.d \ framecmn.d \ fs_inet.d \ fs_zip.d \ @@ -1443,6 +1452,7 @@ MSW_COMMONOBJS = \ filefn.o \ filesys.o \ fontcmn.o \ + fontmap.o \ framecmn.o \ fs_inet.o \ fs_zip.o \ @@ -1539,6 +1549,7 @@ MSW_COMMONDEPS = \ filefn.d \ filesys.d \ fontcmn.d \ + fontmap.d \ framecmn.d \ fs_inet.d \ fs_zip.d \ @@ -1639,6 +1650,7 @@ MSW_GUIOBJS = \ filedlg.o \ font.o \ fontdlg.o \ + fontutil.o \ frame.o \ gauge95.o \ gdiobj.o \ @@ -1726,6 +1738,7 @@ MSW_GUIDEPS = \ filedlg.d \ font.d \ fontdlg.d \ + fontutil.d \ frame.d \ gauge95.d \ gdiobj.d \ @@ -1894,6 +1907,7 @@ HTMLDEPS = \ UNIX_OBJS = \ dialup.o \ fontenum.o \ + fontutil.o \ gsocket.o \ threadpsx.o \ utilsunx.o @@ -1901,6 +1915,7 @@ UNIX_OBJS = \ UNIX_DEPS = \ dialup.d \ fontenum.d \ + fontutil.d \ gsocket.d \ threadpsx.d \ utilsunx.d diff --git a/distrib/msw/tmake/filelist.txt b/distrib/msw/tmake/filelist.txt index ad4eb8a955..f79577b449 100644 --- a/distrib/msw/tmake/filelist.txt +++ b/distrib/msw/tmake/filelist.txt @@ -481,8 +481,9 @@ filedlg.h W filefn.h W filesys.h W font.h W -fontdlg.h W +fontenum.h W fontmap.h W +fontdlg.h W fontutil.h W frame.h W fs_inet.h W diff --git a/include/wx/gtk/dialog.h b/include/wx/gtk/dialog.h index f440b8a6be..5e66c12306 100644 --- a/include/wx/gtk/dialog.h +++ b/include/wx/gtk/dialog.h @@ -85,6 +85,8 @@ public: virtual void Maximize() { } virtual void Restore() { } + virtual bool IsTopLevel() const { return TRUE; } + // implementation virtual void GtkOnSize( int x, int y, int width, int height ); diff --git a/include/wx/gtk/frame.h b/include/wx/gtk/frame.h index 506ee744c2..1a3edac959 100644 --- a/include/wx/gtk/frame.h +++ b/include/wx/gtk/frame.h @@ -96,6 +96,8 @@ public: virtual void Restore(); virtual void Iconize( bool iconize ); virtual bool IsIconized() const; + + virtual bool IsTopLevel() const { return TRUE; } virtual void Command( int id ); diff --git a/include/wx/gtk/mdi.h b/include/wx/gtk/mdi.h index 0de3e863bc..e8f87df94d 100644 --- a/include/wx/gtk/mdi.h +++ b/include/wx/gtk/mdi.h @@ -44,25 +44,19 @@ extern const wxChar* wxStatusLineNameStr; class wxMDIParentFrame: public wxFrame { - DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) - - friend class wxMDIChildFrame; - public: - wxMDIParentFrame(); wxMDIParentFrame( wxWindow *parent, - wxWindowID id, const wxString& title, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, - const wxString& name = wxFrameNameStr ); - ~wxMDIParentFrame(void); - bool Create( wxWindow *parent, - wxWindowID id, const wxString& title, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, - const wxString& name = wxFrameNameStr ); - + wxWindowID id, const wxString& title, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, + const wxString& name = wxFrameNameStr ); + ~wxMDIParentFrame(void); + bool Create( wxWindow *parent, + wxWindowID id, const wxString& title, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, + const wxString& name = wxFrameNameStr ); void GetClientSize(int *width, int *height) const; wxMDIChildFrame *GetActiveChild() const; @@ -87,7 +81,11 @@ public: virtual void GtkOnSize( int x, int y, int width, int height ); virtual void OnInternalIdle(); - DECLARE_EVENT_TABLE() +private: + friend class wxMDIChildFrame; + + DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) + DECLARE_EVENT_TABLE() }; //----------------------------------------------------------------------------- @@ -96,10 +94,7 @@ public: class wxMDIChildFrame: public wxFrame { - DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) - - public: - +public: wxMDIChildFrame(); wxMDIChildFrame( wxMDIParentFrame *parent, wxWindowID id, const wxString& title, @@ -111,51 +106,53 @@ class wxMDIChildFrame: public wxFrame const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr ); - virtual void SetMenuBar( wxMenuBar *menu_bar ); - virtual wxMenuBar *GetMenuBar() const; + virtual void SetMenuBar( wxMenuBar *menu_bar ); + virtual wxMenuBar *GetMenuBar() const; - virtual void GetClientSize( int *width, int *height ) const; - virtual void AddChild( wxWindowBase *child ); + virtual void GetClientSize( int *width, int *height ) const; + virtual void AddChild( wxWindowBase *child ); - virtual void Activate(); + virtual void Activate(); #if wxUSE_STATUSBAR // no status bars - virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1, + virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1, long WXUNUSED(style) = 1, wxWindowID WXUNUSED(id) = 1, const wxString& WXUNUSED(name) = wxEmptyString) - { return (wxStatusBar*)NULL; } + { return (wxStatusBar*)NULL; } - virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; } - virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {} - virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {} + virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; } + virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {} + virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {} #endif // no size hints - virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH), + virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH), int WXUNUSED(maxW), int WXUNUSED(maxH), int WXUNUSED(incW), int WXUNUSED(incH) ) {} #if wxUSE_TOOLBAR // no toolbar bars - virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id), - const wxString& WXUNUSED(name) ) { return (wxToolBar*)NULL; } - virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; } + virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id), + const wxString& WXUNUSED(name) ) { return (wxToolBar*)NULL; } + virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; } #endif // no icon - void SetIcon( const wxIcon &icon ) { m_icon = icon; } + void SetIcon( const wxIcon &icon ) { m_icon = icon; } // no title - void SetTitle( const wxString &title ) { m_title = title; } - wxString GetTitle() const { return m_title; } + void SetTitle( const wxString &title ) { m_title = title; } + wxString GetTitle() const { return m_title; } // no maximize etc - virtual void Maximize( bool WXUNUSED(maximize) ) {} - virtual void Restore() {} + virtual void Maximize( bool WXUNUSED(maximize) ) {} + virtual void Restore() {} - void OnActivate( wxActivateEvent &event ); + virtual bool IsTopLevel() const { return FALSE; } + + void OnActivate( wxActivateEvent &event ); // implementation @@ -163,7 +160,9 @@ class wxMDIChildFrame: public wxFrame GtkNotebookPage *m_page; bool m_justInserted; - DECLARE_EVENT_TABLE() +private: + DECLARE_EVENT_TABLE() + DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) }; //----------------------------------------------------------------------------- @@ -172,14 +171,14 @@ class wxMDIChildFrame: public wxFrame class wxMDIClientWindow: public wxWindow { - DECLARE_DYNAMIC_CLASS(wxMDIClientWindow) - public: - wxMDIClientWindow(); wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 ); ~wxMDIClientWindow(); virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL ); + +private: + DECLARE_DYNAMIC_CLASS(wxMDIClientWindow) }; #endif // __MDIH__ diff --git a/include/wx/gtk1/dialog.h b/include/wx/gtk1/dialog.h index f440b8a6be..5e66c12306 100644 --- a/include/wx/gtk1/dialog.h +++ b/include/wx/gtk1/dialog.h @@ -85,6 +85,8 @@ public: virtual void Maximize() { } virtual void Restore() { } + virtual bool IsTopLevel() const { return TRUE; } + // implementation virtual void GtkOnSize( int x, int y, int width, int height ); diff --git a/include/wx/gtk1/frame.h b/include/wx/gtk1/frame.h index 506ee744c2..1a3edac959 100644 --- a/include/wx/gtk1/frame.h +++ b/include/wx/gtk1/frame.h @@ -96,6 +96,8 @@ public: virtual void Restore(); virtual void Iconize( bool iconize ); virtual bool IsIconized() const; + + virtual bool IsTopLevel() const { return TRUE; } virtual void Command( int id ); diff --git a/include/wx/gtk1/mdi.h b/include/wx/gtk1/mdi.h index 0de3e863bc..e8f87df94d 100644 --- a/include/wx/gtk1/mdi.h +++ b/include/wx/gtk1/mdi.h @@ -44,25 +44,19 @@ extern const wxChar* wxStatusLineNameStr; class wxMDIParentFrame: public wxFrame { - DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) - - friend class wxMDIChildFrame; - public: - wxMDIParentFrame(); wxMDIParentFrame( wxWindow *parent, - wxWindowID id, const wxString& title, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, - const wxString& name = wxFrameNameStr ); - ~wxMDIParentFrame(void); - bool Create( wxWindow *parent, - wxWindowID id, const wxString& title, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, - const wxString& name = wxFrameNameStr ); - + wxWindowID id, const wxString& title, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, + const wxString& name = wxFrameNameStr ); + ~wxMDIParentFrame(void); + bool Create( wxWindow *parent, + wxWindowID id, const wxString& title, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, + const wxString& name = wxFrameNameStr ); void GetClientSize(int *width, int *height) const; wxMDIChildFrame *GetActiveChild() const; @@ -87,7 +81,11 @@ public: virtual void GtkOnSize( int x, int y, int width, int height ); virtual void OnInternalIdle(); - DECLARE_EVENT_TABLE() +private: + friend class wxMDIChildFrame; + + DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) + DECLARE_EVENT_TABLE() }; //----------------------------------------------------------------------------- @@ -96,10 +94,7 @@ public: class wxMDIChildFrame: public wxFrame { - DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) - - public: - +public: wxMDIChildFrame(); wxMDIChildFrame( wxMDIParentFrame *parent, wxWindowID id, const wxString& title, @@ -111,51 +106,53 @@ class wxMDIChildFrame: public wxFrame const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr ); - virtual void SetMenuBar( wxMenuBar *menu_bar ); - virtual wxMenuBar *GetMenuBar() const; + virtual void SetMenuBar( wxMenuBar *menu_bar ); + virtual wxMenuBar *GetMenuBar() const; - virtual void GetClientSize( int *width, int *height ) const; - virtual void AddChild( wxWindowBase *child ); + virtual void GetClientSize( int *width, int *height ) const; + virtual void AddChild( wxWindowBase *child ); - virtual void Activate(); + virtual void Activate(); #if wxUSE_STATUSBAR // no status bars - virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1, + virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1, long WXUNUSED(style) = 1, wxWindowID WXUNUSED(id) = 1, const wxString& WXUNUSED(name) = wxEmptyString) - { return (wxStatusBar*)NULL; } + { return (wxStatusBar*)NULL; } - virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; } - virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {} - virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {} + virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; } + virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {} + virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {} #endif // no size hints - virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH), + virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH), int WXUNUSED(maxW), int WXUNUSED(maxH), int WXUNUSED(incW), int WXUNUSED(incH) ) {} #if wxUSE_TOOLBAR // no toolbar bars - virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id), - const wxString& WXUNUSED(name) ) { return (wxToolBar*)NULL; } - virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; } + virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id), + const wxString& WXUNUSED(name) ) { return (wxToolBar*)NULL; } + virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; } #endif // no icon - void SetIcon( const wxIcon &icon ) { m_icon = icon; } + void SetIcon( const wxIcon &icon ) { m_icon = icon; } // no title - void SetTitle( const wxString &title ) { m_title = title; } - wxString GetTitle() const { return m_title; } + void SetTitle( const wxString &title ) { m_title = title; } + wxString GetTitle() const { return m_title; } // no maximize etc - virtual void Maximize( bool WXUNUSED(maximize) ) {} - virtual void Restore() {} + virtual void Maximize( bool WXUNUSED(maximize) ) {} + virtual void Restore() {} - void OnActivate( wxActivateEvent &event ); + virtual bool IsTopLevel() const { return FALSE; } + + void OnActivate( wxActivateEvent &event ); // implementation @@ -163,7 +160,9 @@ class wxMDIChildFrame: public wxFrame GtkNotebookPage *m_page; bool m_justInserted; - DECLARE_EVENT_TABLE() +private: + DECLARE_EVENT_TABLE() + DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) }; //----------------------------------------------------------------------------- @@ -172,14 +171,14 @@ class wxMDIChildFrame: public wxFrame class wxMDIClientWindow: public wxWindow { - DECLARE_DYNAMIC_CLASS(wxMDIClientWindow) - public: - wxMDIClientWindow(); wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 ); ~wxMDIClientWindow(); virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL ); + +private: + DECLARE_DYNAMIC_CLASS(wxMDIClientWindow) }; #endif // __MDIH__ diff --git a/include/wx/motif/dialog.h b/include/wx/motif/dialog.h index 1c01f7f4e9..df9688ddee 100644 --- a/include/wx/motif/dialog.h +++ b/include/wx/motif/dialog.h @@ -66,6 +66,8 @@ public: virtual bool IsIconized() const; + virtual bool IsTopLevel() const { return TRUE; } + void SetTitle(const wxString& title); wxString GetTitle() const ; diff --git a/include/wx/motif/frame.h b/include/wx/motif/frame.h index 11e67cb620..1e932f95f3 100644 --- a/include/wx/motif/frame.h +++ b/include/wx/motif/frame.h @@ -78,6 +78,8 @@ public: void SetTitle(const wxString& title); wxString GetTitle() const { return m_title; } + virtual bool IsTopLevel() const { return TRUE; } + void Centre(int direction = wxBOTH); // Call this to simulate a menu command diff --git a/include/wx/motif/mdi.h b/include/wx/motif/mdi.h index 79e52de767..62d6efb7d7 100644 --- a/include/wx/motif/mdi.h +++ b/include/wx/motif/mdi.h @@ -169,6 +169,8 @@ public: virtual void Activate(); virtual bool IsIconized() const ; + virtual bool IsTopLevel() const { return FALSE; } + // Is the frame maximized? Returns TRUE for // wxMDIChildFrame due to the tabbed implementation. virtual bool IsMaximized(void) const ; diff --git a/include/wx/msw/dialog.h b/include/wx/msw/dialog.h index 0e4dce9d62..f7a07592f8 100644 --- a/include/wx/msw/dialog.h +++ b/include/wx/msw/dialog.h @@ -77,6 +77,8 @@ public: virtual bool IsIconized() const; void Fit(); + virtual bool IsTopLevel() const { return TRUE; } + void SetTitle(const wxString& title); wxString GetTitle() const ; diff --git a/include/wx/msw/frame.h b/include/wx/msw/frame.h index e285472352..0a328f9440 100644 --- a/include/wx/msw/frame.h +++ b/include/wx/msw/frame.h @@ -135,6 +135,8 @@ public: // Compatibility bool Iconized() const { return IsIconized(); } + virtual bool IsTopLevel() const { return TRUE; } + virtual void Maximize(bool maximize); // virtual bool LoadAccelerators(const wxString& table); diff --git a/include/wx/msw/mdi.h b/include/wx/msw/mdi.h index 828df13b23..8beb8f1914 100644 --- a/include/wx/msw/mdi.h +++ b/include/wx/msw/mdi.h @@ -142,6 +142,8 @@ public: long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr); + virtual bool IsTopLevel() const { return FALSE; } + // MDI operations virtual void Maximize(bool maximize = TRUE); virtual void Restore(); diff --git a/include/wx/window.h b/include/wx/window.h index a265f57e52..429a44fdff 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -338,7 +338,7 @@ public: inline wxWindow *GetGrandParent() const; // is this window a top level one? - bool IsTopLevel() const; + virtual bool IsTopLevel() const; // it doesn't really change parent, use ReParent() instead void SetParent( wxWindowBase *parent ) { m_parent = (wxWindow *)parent; } diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index bec8295d8b..5445609834 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -56,7 +56,7 @@ bool MyApp::OnInit(void) m_canvasFont = *wxNORMAL_FONT; // Create the main frame window - MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "wxWindows dialogs example", wxPoint(50, 50), wxSize(400, 300)); + MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "wxWindows dialogs example", wxPoint(20, 20), wxSize(400, 300)); // Make a menubar wxMenu *file_menu = new wxMenu; diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index ccba8e7c53..7af94827f8 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -427,7 +427,7 @@ bool wxWindowBase::Enable(bool enable) bool wxWindowBase::IsTopLevel() const { - return wxDynamicCast(this, wxFrame) || wxDynamicCast(this, wxDialog); + return FALSE; } // ---------------------------------------------------------------------------- diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index fb8e676622..156cd6f955 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -118,13 +118,10 @@ gtk_dialog_realized_callback( GtkWidget *widget, wxDialog *win ) if (g_isIdle) wxapp_install_idle_handler(); - // FIXME I don't know when does it appear, but it's not in 1.2.2 -#if GTK_CHECK_VERSION(1, 2, 3) /* I haven't been able to set the position of the dialog before it is shown, so I set the position in "realize" */ - gtk_window_reposition( GTK_WINDOW(widget), win->m_x, win->m_y ); -#endif // GTK > 1.2.2 + gtk_widget_set_uposition( widget, win->m_x, win->m_y ); /* all this is for Motif Window Manager "hints" and is supposed to be recognized by other WM as well. not tested. */ @@ -171,7 +168,7 @@ gtk_dialog_realized_callback( GtkWidget *widget, wxDialog *win ) gtk_window_set_policy(GTK_WINDOW(win->m_widget), 1, 1, 1); /* set size hints */ - gint flag = GDK_HINT_POS; + gint flag = 0; // GDK_HINT_POS; if ((win->GetMinWidth() != -1) || (win->GetMinHeight() != -1)) flag |= GDK_HINT_MIN_SIZE; if ((win->GetMaxWidth() != -1) || (win->GetMaxHeight() != -1)) flag |= GDK_HINT_MAX_SIZE; if (flag) @@ -494,18 +491,15 @@ void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags ) if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth; if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight; - // FIXME I don't know when does it appear, but it's not in 1.2.2 -#if GTK_CHECK_VERSION(1, 2, 3) if ((m_x != -1) || (m_y != -1)) { if ((m_x != old_x) || (m_y != old_y)) { /* we set the position here and when showing the dialog for the first time in idle time */ - gtk_window_reposition( GTK_WINDOW(m_widget), m_x, m_y ); + gtk_widget_set_uposition( m_widget, m_x, m_y ); } } -#endif // GTK > 1.2.2 if ((m_width != old_width) || (m_height != old_height)) { diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 2fc6814ccd..f4cdea22db 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -207,14 +207,10 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win ) if (g_isIdle) wxapp_install_idle_handler(); - // FIXME I don't know when does it appear, but it's not in 1.2.2 -#if GTK_CHECK_VERSION(1, 2, 3) /* I haven't been able to set the position of the dialog before it is shown, so I set the position in "realize" */ - wxLogDebug( "%d %d\n", win->m_x, win->m_y ); - gtk_window_reposition( GTK_WINDOW(widget), win->m_x, win->m_y ); -#endif // GTK > 1.2.2 + gtk_widget_set_uposition( widget, win->m_x, win->m_y ); /* all this is for Motif Window Manager "hints" and is supposed to be recognized by other WM as well. not tested. */ @@ -254,7 +250,7 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win ) gtk_window_set_policy(GTK_WINDOW(win->m_widget), 1, 1, 1); /* set size hints */ - gint flag = GDK_HINT_POS; + gint flag = 0; // GDK_HINT_POS; if ((win->GetMinWidth() != -1) || (win->GetMinHeight() != -1)) flag |= GDK_HINT_MIN_SIZE; if ((win->GetMaxWidth() != -1) || (win->GetMaxHeight() != -1)) flag |= GDK_HINT_MAX_SIZE; if (flag) @@ -569,16 +565,13 @@ void wxFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags ) if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth; if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight; - // FIXME I don't know when does it appear, but it's not in 1.2.2 -#if GTK_CHECK_VERSION(1, 2, 3) if ((m_x != -1) || (m_y != -1)) { if ((m_x != old_x) || (m_y != old_y)) { - gtk_window_reposition( GTK_WINDOW(m_widget), m_x, m_y ); + gtk_widget_set_uposition( m_widget, m_x, m_y ); } } -#endif // GTK > 1.2.2 if ((m_width != old_width) || (m_height != old_height)) { diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 66fc6d72fb..4cb9fe2243 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -121,7 +121,7 @@ static void wxMenubarUnsetInvokingWindow( wxMenu *menu, wxWindow *win ) #if (GTK_MINOR_VERSION > 0) wxWindow *top_frame = win; - while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame)) + while (top_frame->GetParent() && !(top_frame->IsTopLevel())) top_frame = top_frame->GetParent(); /* support for native hot keys */ @@ -144,7 +144,7 @@ static void wxMenubarSetInvokingWindow( wxMenu *menu, wxWindow *win ) #if (GTK_MINOR_VERSION > 0) wxWindow *top_frame = win; - while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame)) + while (top_frame->GetParent() && !(top_frame->IsTopLevel())) top_frame = top_frame->GetParent(); /* support for native hot keys */ @@ -166,7 +166,7 @@ void wxMenuBar::SetInvokingWindow( wxWindow *win ) m_invokingWindow = win; #if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0) wxWindow *top_frame = win; - while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame)) + while (top_frame->GetParent() && !(top_frame->IsTopLevel())) top_frame = top_frame->GetParent(); /* support for native key accelerators indicated by underscroes */ @@ -187,7 +187,7 @@ void wxMenuBar::UnsetInvokingWindow( wxWindow *win ) m_invokingWindow = (wxWindow*) NULL; #if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0) wxWindow *top_frame = win; - while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame)) + while (top_frame->GetParent() && !(top_frame->IsTopLevel())) top_frame = top_frame->GetParent(); /* support for native key accelerators indicated by underscroes */ diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index d7a5312e13..ec0d15875c 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -782,7 +782,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &key_event ) if ((key_event.KeyCode() == WXK_RETURN) && !(m_windowStyle & wxTE_MULTILINE)) { wxWindow *top_frame = m_parent; - while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame)) + while (top_frame->GetParent() && !(top_frame->IsTopLevel())) top_frame = top_frame->GetParent(); GtkWindow *window = GTK_WINDOW(top_frame->m_widget); diff --git a/src/gtk1/dialog.cpp b/src/gtk1/dialog.cpp index fb8e676622..156cd6f955 100644 --- a/src/gtk1/dialog.cpp +++ b/src/gtk1/dialog.cpp @@ -118,13 +118,10 @@ gtk_dialog_realized_callback( GtkWidget *widget, wxDialog *win ) if (g_isIdle) wxapp_install_idle_handler(); - // FIXME I don't know when does it appear, but it's not in 1.2.2 -#if GTK_CHECK_VERSION(1, 2, 3) /* I haven't been able to set the position of the dialog before it is shown, so I set the position in "realize" */ - gtk_window_reposition( GTK_WINDOW(widget), win->m_x, win->m_y ); -#endif // GTK > 1.2.2 + gtk_widget_set_uposition( widget, win->m_x, win->m_y ); /* all this is for Motif Window Manager "hints" and is supposed to be recognized by other WM as well. not tested. */ @@ -171,7 +168,7 @@ gtk_dialog_realized_callback( GtkWidget *widget, wxDialog *win ) gtk_window_set_policy(GTK_WINDOW(win->m_widget), 1, 1, 1); /* set size hints */ - gint flag = GDK_HINT_POS; + gint flag = 0; // GDK_HINT_POS; if ((win->GetMinWidth() != -1) || (win->GetMinHeight() != -1)) flag |= GDK_HINT_MIN_SIZE; if ((win->GetMaxWidth() != -1) || (win->GetMaxHeight() != -1)) flag |= GDK_HINT_MAX_SIZE; if (flag) @@ -494,18 +491,15 @@ void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags ) if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth; if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight; - // FIXME I don't know when does it appear, but it's not in 1.2.2 -#if GTK_CHECK_VERSION(1, 2, 3) if ((m_x != -1) || (m_y != -1)) { if ((m_x != old_x) || (m_y != old_y)) { /* we set the position here and when showing the dialog for the first time in idle time */ - gtk_window_reposition( GTK_WINDOW(m_widget), m_x, m_y ); + gtk_widget_set_uposition( m_widget, m_x, m_y ); } } -#endif // GTK > 1.2.2 if ((m_width != old_width) || (m_height != old_height)) { diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 2fc6814ccd..f4cdea22db 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -207,14 +207,10 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win ) if (g_isIdle) wxapp_install_idle_handler(); - // FIXME I don't know when does it appear, but it's not in 1.2.2 -#if GTK_CHECK_VERSION(1, 2, 3) /* I haven't been able to set the position of the dialog before it is shown, so I set the position in "realize" */ - wxLogDebug( "%d %d\n", win->m_x, win->m_y ); - gtk_window_reposition( GTK_WINDOW(widget), win->m_x, win->m_y ); -#endif // GTK > 1.2.2 + gtk_widget_set_uposition( widget, win->m_x, win->m_y ); /* all this is for Motif Window Manager "hints" and is supposed to be recognized by other WM as well. not tested. */ @@ -254,7 +250,7 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win ) gtk_window_set_policy(GTK_WINDOW(win->m_widget), 1, 1, 1); /* set size hints */ - gint flag = GDK_HINT_POS; + gint flag = 0; // GDK_HINT_POS; if ((win->GetMinWidth() != -1) || (win->GetMinHeight() != -1)) flag |= GDK_HINT_MIN_SIZE; if ((win->GetMaxWidth() != -1) || (win->GetMaxHeight() != -1)) flag |= GDK_HINT_MAX_SIZE; if (flag) @@ -569,16 +565,13 @@ void wxFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags ) if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth; if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight; - // FIXME I don't know when does it appear, but it's not in 1.2.2 -#if GTK_CHECK_VERSION(1, 2, 3) if ((m_x != -1) || (m_y != -1)) { if ((m_x != old_x) || (m_y != old_y)) { - gtk_window_reposition( GTK_WINDOW(m_widget), m_x, m_y ); + gtk_widget_set_uposition( m_widget, m_x, m_y ); } } -#endif // GTK > 1.2.2 if ((m_width != old_width) || (m_height != old_height)) { diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp index 66fc6d72fb..4cb9fe2243 100644 --- a/src/gtk1/menu.cpp +++ b/src/gtk1/menu.cpp @@ -121,7 +121,7 @@ static void wxMenubarUnsetInvokingWindow( wxMenu *menu, wxWindow *win ) #if (GTK_MINOR_VERSION > 0) wxWindow *top_frame = win; - while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame)) + while (top_frame->GetParent() && !(top_frame->IsTopLevel())) top_frame = top_frame->GetParent(); /* support for native hot keys */ @@ -144,7 +144,7 @@ static void wxMenubarSetInvokingWindow( wxMenu *menu, wxWindow *win ) #if (GTK_MINOR_VERSION > 0) wxWindow *top_frame = win; - while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame)) + while (top_frame->GetParent() && !(top_frame->IsTopLevel())) top_frame = top_frame->GetParent(); /* support for native hot keys */ @@ -166,7 +166,7 @@ void wxMenuBar::SetInvokingWindow( wxWindow *win ) m_invokingWindow = win; #if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0) wxWindow *top_frame = win; - while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame)) + while (top_frame->GetParent() && !(top_frame->IsTopLevel())) top_frame = top_frame->GetParent(); /* support for native key accelerators indicated by underscroes */ @@ -187,7 +187,7 @@ void wxMenuBar::UnsetInvokingWindow( wxWindow *win ) m_invokingWindow = (wxWindow*) NULL; #if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0) wxWindow *top_frame = win; - while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame)) + while (top_frame->GetParent() && !(top_frame->IsTopLevel())) top_frame = top_frame->GetParent(); /* support for native key accelerators indicated by underscroes */ diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index d7a5312e13..ec0d15875c 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -782,7 +782,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &key_event ) if ((key_event.KeyCode() == WXK_RETURN) && !(m_windowStyle & wxTE_MULTILINE)) { wxWindow *top_frame = m_parent; - while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame)) + while (top_frame->GetParent() && !(top_frame->IsTopLevel())) top_frame = top_frame->GetParent(); GtkWindow *window = GTK_WINDOW(top_frame->m_widget); -- 2.45.2