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
This commit is contained in:
Robert Roebling
1999-11-05 15:54:10 +00:00
parent 2bc1aa1174
commit 8487f88742
25 changed files with 151 additions and 143 deletions

View File

@@ -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! # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE UNX.T!
# #
@@ -222,6 +222,9 @@ WX_HEADERS = \
filesys.h \ filesys.h \
font.h \ font.h \
fontdlg.h \ fontdlg.h \
fontenum.h \
fontmap.h \
fontutil.h \
frame.h \ frame.h \
fs_inet.h \ fs_inet.h \
fs_zip.h \ fs_zip.h \
@@ -646,6 +649,7 @@ GTK_GENERICOBJS = \
scrolwin.o \ scrolwin.o \
splitter.o \ splitter.o \
statusbr.o \ statusbr.o \
tabg.o \
textdlgg.o \ textdlgg.o \
tipdlg.o \ tipdlg.o \
treectrl.o \ treectrl.o \
@@ -680,6 +684,7 @@ GTK_GENERICDEPS = \
scrolwin.d \ scrolwin.d \
splitter.d \ splitter.d \
statusbr.d \ statusbr.d \
tabg.d \
textdlgg.d \ textdlgg.d \
tipdlg.d \ tipdlg.d \
treectrl.d \ treectrl.d \
@@ -713,6 +718,7 @@ GTK_COMMONOBJS = \
filefn.o \ filefn.o \
filesys.o \ filesys.o \
fontcmn.o \ fontcmn.o \
fontmap.o \
framecmn.o \ framecmn.o \
fs_inet.o \ fs_inet.o \
fs_zip.o \ fs_zip.o \
@@ -808,6 +814,7 @@ GTK_COMMONDEPS = \
filefn.d \ filefn.d \
filesys.d \ filesys.d \
fontcmn.d \ fontcmn.d \
fontmap.d \
framecmn.d \ framecmn.d \
fs_inet.d \ fs_inet.d \
fs_zip.d \ fs_zip.d \
@@ -1099,6 +1106,7 @@ MOTIF_COMMONOBJS = \
filefn.o \ filefn.o \
filesys.o \ filesys.o \
fontcmn.o \ fontcmn.o \
fontmap.o \
framecmn.o \ framecmn.o \
fs_inet.o \ fs_inet.o \
fs_zip.o \ fs_zip.o \
@@ -1194,6 +1202,7 @@ MOTIF_COMMONDEPS = \
filefn.d \ filefn.d \
filesys.d \ filesys.d \
fontcmn.d \ fontcmn.d \
fontmap.d \
framecmn.d \ framecmn.d \
fs_inet.d \ fs_inet.d \
fs_zip.d \ fs_zip.d \
@@ -1443,6 +1452,7 @@ MSW_COMMONOBJS = \
filefn.o \ filefn.o \
filesys.o \ filesys.o \
fontcmn.o \ fontcmn.o \
fontmap.o \
framecmn.o \ framecmn.o \
fs_inet.o \ fs_inet.o \
fs_zip.o \ fs_zip.o \
@@ -1539,6 +1549,7 @@ MSW_COMMONDEPS = \
filefn.d \ filefn.d \
filesys.d \ filesys.d \
fontcmn.d \ fontcmn.d \
fontmap.d \
framecmn.d \ framecmn.d \
fs_inet.d \ fs_inet.d \
fs_zip.d \ fs_zip.d \
@@ -1639,6 +1650,7 @@ MSW_GUIOBJS = \
filedlg.o \ filedlg.o \
font.o \ font.o \
fontdlg.o \ fontdlg.o \
fontutil.o \
frame.o \ frame.o \
gauge95.o \ gauge95.o \
gdiobj.o \ gdiobj.o \
@@ -1726,6 +1738,7 @@ MSW_GUIDEPS = \
filedlg.d \ filedlg.d \
font.d \ font.d \
fontdlg.d \ fontdlg.d \
fontutil.d \
frame.d \ frame.d \
gauge95.d \ gauge95.d \
gdiobj.d \ gdiobj.d \
@@ -1894,6 +1907,7 @@ HTMLDEPS = \
UNIX_OBJS = \ UNIX_OBJS = \
dialup.o \ dialup.o \
fontenum.o \ fontenum.o \
fontutil.o \
gsocket.o \ gsocket.o \
threadpsx.o \ threadpsx.o \
utilsunx.o utilsunx.o
@@ -1901,6 +1915,7 @@ UNIX_OBJS = \
UNIX_DEPS = \ UNIX_DEPS = \
dialup.d \ dialup.d \
fontenum.d \ fontenum.d \
fontutil.d \
gsocket.d \ gsocket.d \
threadpsx.d \ threadpsx.d \
utilsunx.d utilsunx.d

View File

@@ -481,8 +481,9 @@ filedlg.h W
filefn.h W filefn.h W
filesys.h W filesys.h W
font.h W font.h W
fontdlg.h W fontenum.h W
fontmap.h W fontmap.h W
fontdlg.h W
fontutil.h W fontutil.h W
frame.h W frame.h W
fs_inet.h W fs_inet.h W

View File

@@ -85,6 +85,8 @@ public:
virtual void Maximize() { } virtual void Maximize() { }
virtual void Restore() { } virtual void Restore() { }
virtual bool IsTopLevel() const { return TRUE; }
// implementation // implementation
virtual void GtkOnSize( int x, int y, int width, int height ); virtual void GtkOnSize( int x, int y, int width, int height );

View File

@@ -97,6 +97,8 @@ public:
virtual void Iconize( bool iconize ); virtual void Iconize( bool iconize );
virtual bool IsIconized() const; virtual bool IsIconized() const;
virtual bool IsTopLevel() const { return TRUE; }
virtual void Command( int id ); virtual void Command( int id );
void OnCloseWindow( wxCloseEvent& event ); void OnCloseWindow( wxCloseEvent& event );

View File

@@ -44,12 +44,7 @@ extern const wxChar* wxStatusLineNameStr;
class wxMDIParentFrame: public wxFrame class wxMDIParentFrame: public wxFrame
{ {
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
friend class wxMDIChildFrame;
public: public:
wxMDIParentFrame(); wxMDIParentFrame();
wxMDIParentFrame( wxWindow *parent, wxMDIParentFrame( wxWindow *parent,
wxWindowID id, const wxString& title, wxWindowID id, const wxString& title,
@@ -63,7 +58,6 @@ public:
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr ); const wxString& name = wxFrameNameStr );
void GetClientSize(int *width, int *height) const; void GetClientSize(int *width, int *height) const;
wxMDIChildFrame *GetActiveChild() const; wxMDIChildFrame *GetActiveChild() const;
@@ -87,6 +81,10 @@ public:
virtual void GtkOnSize( int x, int y, int width, int height ); virtual void GtkOnSize( int x, int y, int width, int height );
virtual void OnInternalIdle(); virtual void OnInternalIdle();
private:
friend class wxMDIChildFrame;
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
@@ -96,10 +94,7 @@ public:
class wxMDIChildFrame: public wxFrame class wxMDIChildFrame: public wxFrame
{ {
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) public:
public:
wxMDIChildFrame(); wxMDIChildFrame();
wxMDIChildFrame( wxMDIParentFrame *parent, wxMDIChildFrame( wxMDIParentFrame *parent,
wxWindowID id, const wxString& title, wxWindowID id, const wxString& title,
@@ -155,6 +150,8 @@ class wxMDIChildFrame: public wxFrame
virtual void Maximize( bool WXUNUSED(maximize) ) {} virtual void Maximize( bool WXUNUSED(maximize) ) {}
virtual void Restore() {} virtual void Restore() {}
virtual bool IsTopLevel() const { return FALSE; }
void OnActivate( wxActivateEvent &event ); void OnActivate( wxActivateEvent &event );
// implementation // implementation
@@ -163,7 +160,9 @@ class wxMDIChildFrame: public wxFrame
GtkNotebookPage *m_page; GtkNotebookPage *m_page;
bool m_justInserted; bool m_justInserted;
private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -172,14 +171,14 @@ class wxMDIChildFrame: public wxFrame
class wxMDIClientWindow: public wxWindow class wxMDIClientWindow: public wxWindow
{ {
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
public: public:
wxMDIClientWindow(); wxMDIClientWindow();
wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 ); wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 );
~wxMDIClientWindow(); ~wxMDIClientWindow();
virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL ); virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL );
private:
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
}; };
#endif // __MDIH__ #endif // __MDIH__

View File

@@ -85,6 +85,8 @@ public:
virtual void Maximize() { } virtual void Maximize() { }
virtual void Restore() { } virtual void Restore() { }
virtual bool IsTopLevel() const { return TRUE; }
// implementation // implementation
virtual void GtkOnSize( int x, int y, int width, int height ); virtual void GtkOnSize( int x, int y, int width, int height );

View File

@@ -97,6 +97,8 @@ public:
virtual void Iconize( bool iconize ); virtual void Iconize( bool iconize );
virtual bool IsIconized() const; virtual bool IsIconized() const;
virtual bool IsTopLevel() const { return TRUE; }
virtual void Command( int id ); virtual void Command( int id );
void OnCloseWindow( wxCloseEvent& event ); void OnCloseWindow( wxCloseEvent& event );

View File

@@ -44,12 +44,7 @@ extern const wxChar* wxStatusLineNameStr;
class wxMDIParentFrame: public wxFrame class wxMDIParentFrame: public wxFrame
{ {
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
friend class wxMDIChildFrame;
public: public:
wxMDIParentFrame(); wxMDIParentFrame();
wxMDIParentFrame( wxWindow *parent, wxMDIParentFrame( wxWindow *parent,
wxWindowID id, const wxString& title, wxWindowID id, const wxString& title,
@@ -63,7 +58,6 @@ public:
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr ); const wxString& name = wxFrameNameStr );
void GetClientSize(int *width, int *height) const; void GetClientSize(int *width, int *height) const;
wxMDIChildFrame *GetActiveChild() const; wxMDIChildFrame *GetActiveChild() const;
@@ -87,6 +81,10 @@ public:
virtual void GtkOnSize( int x, int y, int width, int height ); virtual void GtkOnSize( int x, int y, int width, int height );
virtual void OnInternalIdle(); virtual void OnInternalIdle();
private:
friend class wxMDIChildFrame;
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
@@ -96,10 +94,7 @@ public:
class wxMDIChildFrame: public wxFrame class wxMDIChildFrame: public wxFrame
{ {
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) public:
public:
wxMDIChildFrame(); wxMDIChildFrame();
wxMDIChildFrame( wxMDIParentFrame *parent, wxMDIChildFrame( wxMDIParentFrame *parent,
wxWindowID id, const wxString& title, wxWindowID id, const wxString& title,
@@ -155,6 +150,8 @@ class wxMDIChildFrame: public wxFrame
virtual void Maximize( bool WXUNUSED(maximize) ) {} virtual void Maximize( bool WXUNUSED(maximize) ) {}
virtual void Restore() {} virtual void Restore() {}
virtual bool IsTopLevel() const { return FALSE; }
void OnActivate( wxActivateEvent &event ); void OnActivate( wxActivateEvent &event );
// implementation // implementation
@@ -163,7 +160,9 @@ class wxMDIChildFrame: public wxFrame
GtkNotebookPage *m_page; GtkNotebookPage *m_page;
bool m_justInserted; bool m_justInserted;
private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -172,14 +171,14 @@ class wxMDIChildFrame: public wxFrame
class wxMDIClientWindow: public wxWindow class wxMDIClientWindow: public wxWindow
{ {
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
public: public:
wxMDIClientWindow(); wxMDIClientWindow();
wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 ); wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 );
~wxMDIClientWindow(); ~wxMDIClientWindow();
virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL ); virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL );
private:
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
}; };
#endif // __MDIH__ #endif // __MDIH__

View File

@@ -66,6 +66,8 @@ public:
virtual bool IsIconized() const; virtual bool IsIconized() const;
virtual bool IsTopLevel() const { return TRUE; }
void SetTitle(const wxString& title); void SetTitle(const wxString& title);
wxString GetTitle() const ; wxString GetTitle() const ;

View File

@@ -78,6 +78,8 @@ public:
void SetTitle(const wxString& title); void SetTitle(const wxString& title);
wxString GetTitle() const { return m_title; } wxString GetTitle() const { return m_title; }
virtual bool IsTopLevel() const { return TRUE; }
void Centre(int direction = wxBOTH); void Centre(int direction = wxBOTH);
// Call this to simulate a menu command // Call this to simulate a menu command

View File

@@ -169,6 +169,8 @@ public:
virtual void Activate(); virtual void Activate();
virtual bool IsIconized() const ; virtual bool IsIconized() const ;
virtual bool IsTopLevel() const { return FALSE; }
// Is the frame maximized? Returns TRUE for // Is the frame maximized? Returns TRUE for
// wxMDIChildFrame due to the tabbed implementation. // wxMDIChildFrame due to the tabbed implementation.
virtual bool IsMaximized(void) const ; virtual bool IsMaximized(void) const ;

View File

@@ -77,6 +77,8 @@ public:
virtual bool IsIconized() const; virtual bool IsIconized() const;
void Fit(); void Fit();
virtual bool IsTopLevel() const { return TRUE; }
void SetTitle(const wxString& title); void SetTitle(const wxString& title);
wxString GetTitle() const ; wxString GetTitle() const ;

View File

@@ -135,6 +135,8 @@ public:
// Compatibility // Compatibility
bool Iconized() const { return IsIconized(); } bool Iconized() const { return IsIconized(); }
virtual bool IsTopLevel() const { return TRUE; }
virtual void Maximize(bool maximize); virtual void Maximize(bool maximize);
// virtual bool LoadAccelerators(const wxString& table); // virtual bool LoadAccelerators(const wxString& table);

View File

@@ -142,6 +142,8 @@ public:
long style = wxDEFAULT_FRAME_STYLE, long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr); const wxString& name = wxFrameNameStr);
virtual bool IsTopLevel() const { return FALSE; }
// MDI operations // MDI operations
virtual void Maximize(bool maximize = TRUE); virtual void Maximize(bool maximize = TRUE);
virtual void Restore(); virtual void Restore();

View File

@@ -338,7 +338,7 @@ public:
inline wxWindow *GetGrandParent() const; inline wxWindow *GetGrandParent() const;
// is this window a top level one? // is this window a top level one?
bool IsTopLevel() const; virtual bool IsTopLevel() const;
// it doesn't really change parent, use ReParent() instead // it doesn't really change parent, use ReParent() instead
void SetParent( wxWindowBase *parent ) { m_parent = (wxWindow *)parent; } void SetParent( wxWindowBase *parent ) { m_parent = (wxWindow *)parent; }

View File

@@ -56,7 +56,7 @@ bool MyApp::OnInit(void)
m_canvasFont = *wxNORMAL_FONT; m_canvasFont = *wxNORMAL_FONT;
// Create the main frame window // 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 // Make a menubar
wxMenu *file_menu = new wxMenu; wxMenu *file_menu = new wxMenu;

View File

@@ -427,7 +427,7 @@ bool wxWindowBase::Enable(bool enable)
bool wxWindowBase::IsTopLevel() const bool wxWindowBase::IsTopLevel() const
{ {
return wxDynamicCast(this, wxFrame) || wxDynamicCast(this, wxDialog); return FALSE;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -118,13 +118,10 @@ gtk_dialog_realized_callback( GtkWidget *widget, wxDialog *win )
if (g_isIdle) if (g_isIdle)
wxapp_install_idle_handler(); 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 /* I haven't been able to set the position of
the dialog before it is shown, so I set the the dialog before it is shown, so I set the
position in "realize" */ position in "realize" */
gtk_window_reposition( GTK_WINDOW(widget), win->m_x, win->m_y ); gtk_widget_set_uposition( widget, win->m_x, win->m_y );
#endif // GTK > 1.2.2
/* all this is for Motif Window Manager "hints" and is supposed to be /* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */ 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); gtk_window_set_policy(GTK_WINDOW(win->m_widget), 1, 1, 1);
/* set size hints */ /* 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->GetMinWidth() != -1) || (win->GetMinHeight() != -1)) flag |= GDK_HINT_MIN_SIZE;
if ((win->GetMaxWidth() != -1) || (win->GetMaxHeight() != -1)) flag |= GDK_HINT_MAX_SIZE; if ((win->GetMaxWidth() != -1) || (win->GetMaxHeight() != -1)) flag |= GDK_HINT_MAX_SIZE;
if (flag) 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_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight; 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 != -1) || (m_y != -1))
{ {
if ((m_x != old_x) || (m_y != old_y)) if ((m_x != old_x) || (m_y != old_y))
{ {
/* we set the position here and when showing the dialog /* we set the position here and when showing the dialog
for the first time in idle time */ 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)) if ((m_width != old_width) || (m_height != old_height))
{ {

View File

@@ -207,14 +207,10 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win )
if (g_isIdle) if (g_isIdle)
wxapp_install_idle_handler(); 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 /* I haven't been able to set the position of
the dialog before it is shown, so I set the the dialog before it is shown, so I set the
position in "realize" */ position in "realize" */
wxLogDebug( "%d %d\n", win->m_x, win->m_y ); gtk_widget_set_uposition( widget, win->m_x, win->m_y );
gtk_window_reposition( GTK_WINDOW(widget), win->m_x, win->m_y );
#endif // GTK > 1.2.2
/* all this is for Motif Window Manager "hints" and is supposed to be /* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */ 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); gtk_window_set_policy(GTK_WINDOW(win->m_widget), 1, 1, 1);
/* set size hints */ /* 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->GetMinWidth() != -1) || (win->GetMinHeight() != -1)) flag |= GDK_HINT_MIN_SIZE;
if ((win->GetMaxWidth() != -1) || (win->GetMaxHeight() != -1)) flag |= GDK_HINT_MAX_SIZE; if ((win->GetMaxWidth() != -1) || (win->GetMaxHeight() != -1)) flag |= GDK_HINT_MAX_SIZE;
if (flag) 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_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight; 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 != -1) || (m_y != -1))
{ {
if ((m_x != old_x) || (m_y != old_y)) 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)) if ((m_width != old_width) || (m_height != old_height))
{ {

View File

@@ -121,7 +121,7 @@ static void wxMenubarUnsetInvokingWindow( wxMenu *menu, wxWindow *win )
#if (GTK_MINOR_VERSION > 0) #if (GTK_MINOR_VERSION > 0)
wxWindow *top_frame = win; 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(); top_frame = top_frame->GetParent();
/* support for native hot keys */ /* support for native hot keys */
@@ -144,7 +144,7 @@ static void wxMenubarSetInvokingWindow( wxMenu *menu, wxWindow *win )
#if (GTK_MINOR_VERSION > 0) #if (GTK_MINOR_VERSION > 0)
wxWindow *top_frame = win; 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(); top_frame = top_frame->GetParent();
/* support for native hot keys */ /* support for native hot keys */
@@ -166,7 +166,7 @@ void wxMenuBar::SetInvokingWindow( wxWindow *win )
m_invokingWindow = win; m_invokingWindow = win;
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0) #if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
wxWindow *top_frame = win; 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(); top_frame = top_frame->GetParent();
/* support for native key accelerators indicated by underscroes */ /* support for native key accelerators indicated by underscroes */
@@ -187,7 +187,7 @@ void wxMenuBar::UnsetInvokingWindow( wxWindow *win )
m_invokingWindow = (wxWindow*) NULL; m_invokingWindow = (wxWindow*) NULL;
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0) #if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
wxWindow *top_frame = win; 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(); top_frame = top_frame->GetParent();
/* support for native key accelerators indicated by underscroes */ /* support for native key accelerators indicated by underscroes */

View File

@@ -782,7 +782,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &key_event )
if ((key_event.KeyCode() == WXK_RETURN) && !(m_windowStyle & wxTE_MULTILINE)) if ((key_event.KeyCode() == WXK_RETURN) && !(m_windowStyle & wxTE_MULTILINE))
{ {
wxWindow *top_frame = m_parent; 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(); top_frame = top_frame->GetParent();
GtkWindow *window = GTK_WINDOW(top_frame->m_widget); GtkWindow *window = GTK_WINDOW(top_frame->m_widget);

View File

@@ -118,13 +118,10 @@ gtk_dialog_realized_callback( GtkWidget *widget, wxDialog *win )
if (g_isIdle) if (g_isIdle)
wxapp_install_idle_handler(); 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 /* I haven't been able to set the position of
the dialog before it is shown, so I set the the dialog before it is shown, so I set the
position in "realize" */ position in "realize" */
gtk_window_reposition( GTK_WINDOW(widget), win->m_x, win->m_y ); gtk_widget_set_uposition( widget, win->m_x, win->m_y );
#endif // GTK > 1.2.2
/* all this is for Motif Window Manager "hints" and is supposed to be /* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */ 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); gtk_window_set_policy(GTK_WINDOW(win->m_widget), 1, 1, 1);
/* set size hints */ /* 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->GetMinWidth() != -1) || (win->GetMinHeight() != -1)) flag |= GDK_HINT_MIN_SIZE;
if ((win->GetMaxWidth() != -1) || (win->GetMaxHeight() != -1)) flag |= GDK_HINT_MAX_SIZE; if ((win->GetMaxWidth() != -1) || (win->GetMaxHeight() != -1)) flag |= GDK_HINT_MAX_SIZE;
if (flag) 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_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight; 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 != -1) || (m_y != -1))
{ {
if ((m_x != old_x) || (m_y != old_y)) if ((m_x != old_x) || (m_y != old_y))
{ {
/* we set the position here and when showing the dialog /* we set the position here and when showing the dialog
for the first time in idle time */ 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)) if ((m_width != old_width) || (m_height != old_height))
{ {

View File

@@ -207,14 +207,10 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win )
if (g_isIdle) if (g_isIdle)
wxapp_install_idle_handler(); 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 /* I haven't been able to set the position of
the dialog before it is shown, so I set the the dialog before it is shown, so I set the
position in "realize" */ position in "realize" */
wxLogDebug( "%d %d\n", win->m_x, win->m_y ); gtk_widget_set_uposition( widget, win->m_x, win->m_y );
gtk_window_reposition( GTK_WINDOW(widget), win->m_x, win->m_y );
#endif // GTK > 1.2.2
/* all this is for Motif Window Manager "hints" and is supposed to be /* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */ 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); gtk_window_set_policy(GTK_WINDOW(win->m_widget), 1, 1, 1);
/* set size hints */ /* 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->GetMinWidth() != -1) || (win->GetMinHeight() != -1)) flag |= GDK_HINT_MIN_SIZE;
if ((win->GetMaxWidth() != -1) || (win->GetMaxHeight() != -1)) flag |= GDK_HINT_MAX_SIZE; if ((win->GetMaxWidth() != -1) || (win->GetMaxHeight() != -1)) flag |= GDK_HINT_MAX_SIZE;
if (flag) 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_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight; 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 != -1) || (m_y != -1))
{ {
if ((m_x != old_x) || (m_y != old_y)) 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)) if ((m_width != old_width) || (m_height != old_height))
{ {

View File

@@ -121,7 +121,7 @@ static void wxMenubarUnsetInvokingWindow( wxMenu *menu, wxWindow *win )
#if (GTK_MINOR_VERSION > 0) #if (GTK_MINOR_VERSION > 0)
wxWindow *top_frame = win; 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(); top_frame = top_frame->GetParent();
/* support for native hot keys */ /* support for native hot keys */
@@ -144,7 +144,7 @@ static void wxMenubarSetInvokingWindow( wxMenu *menu, wxWindow *win )
#if (GTK_MINOR_VERSION > 0) #if (GTK_MINOR_VERSION > 0)
wxWindow *top_frame = win; 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(); top_frame = top_frame->GetParent();
/* support for native hot keys */ /* support for native hot keys */
@@ -166,7 +166,7 @@ void wxMenuBar::SetInvokingWindow( wxWindow *win )
m_invokingWindow = win; m_invokingWindow = win;
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0) #if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
wxWindow *top_frame = win; 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(); top_frame = top_frame->GetParent();
/* support for native key accelerators indicated by underscroes */ /* support for native key accelerators indicated by underscroes */
@@ -187,7 +187,7 @@ void wxMenuBar::UnsetInvokingWindow( wxWindow *win )
m_invokingWindow = (wxWindow*) NULL; m_invokingWindow = (wxWindow*) NULL;
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0) #if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
wxWindow *top_frame = win; 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(); top_frame = top_frame->GetParent();
/* support for native key accelerators indicated by underscroes */ /* support for native key accelerators indicated by underscroes */

View File

@@ -782,7 +782,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &key_event )
if ((key_event.KeyCode() == WXK_RETURN) && !(m_windowStyle & wxTE_MULTILINE)) if ((key_event.KeyCode() == WXK_RETURN) && !(m_windowStyle & wxTE_MULTILINE))
{ {
wxWindow *top_frame = m_parent; 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(); top_frame = top_frame->GetParent();
GtkWindow *window = GTK_WINDOW(top_frame->m_widget); GtkWindow *window = GTK_WINDOW(top_frame->m_widget);