X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ff7b1510ea7f7855091df83d75a44415dc1cba18..30f82ea416c2b34d1d608cf6ebc369690eb2304e:/src/gtk1/frame.cpp diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 7791d8203e..0505ec5fec 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -23,8 +23,8 @@ #include "wx/dcclient.h" #include "wx/gtk/win_gtk.h" -const wxMENU_HEIGHT = 28; -const wxSTATUS_HEIGHT = 25; +const int wxMENU_HEIGHT = 28; +const int wxSTATUS_HEIGHT = 25; extern wxList wxTopLevelWindows; extern wxList wxPendingDelete; @@ -92,13 +92,13 @@ IMPLEMENT_DYNAMIC_CLASS(wxFrame,wxWindow) wxFrame::wxFrame() { - m_frameMenuBar = NULL; - m_frameStatusBar = NULL; - m_frameToolBar = NULL; + m_frameMenuBar = (wxMenuBar *) NULL; + m_frameStatusBar = (wxStatusBar *) NULL; + m_frameToolBar = (wxToolBar *) NULL; m_sizeSet = FALSE; m_addPrivateChild = FALSE; - m_wxwindow = NULL; - m_mainWindow = NULL; + m_wxwindow = (GtkWidget *) NULL; + m_mainWindow = (GtkWidget *) NULL; wxTopLevelWindows.Insert( this ); } @@ -106,13 +106,13 @@ wxFrame::wxFrame( wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos, const wxSize &size, long style, const wxString &name ) { - m_frameMenuBar = NULL; - m_frameStatusBar = NULL; - m_frameToolBar = NULL; + m_frameMenuBar = (wxMenuBar *) NULL; + m_frameStatusBar = (wxStatusBar *) NULL; + m_frameToolBar = (wxToolBar *) NULL; m_sizeSet = FALSE; m_addPrivateChild = FALSE; - m_wxwindow = NULL; - m_mainWindow = NULL; + m_wxwindow = (GtkWidget *) NULL; + m_mainWindow = (GtkWidget *) NULL; Create( parent, id, title, pos, size, style, name ); wxTopLevelWindows.Insert( this ); } @@ -235,7 +235,7 @@ void wxFrame::GetClientSize( int *width, int *height ) const if (m_frameToolBar) { int y = 0; - m_frameToolBar->GetSize( NULL, &y ); + m_frameToolBar->GetSize( (int *) NULL, &y ); (*height) -= y; } } @@ -249,7 +249,7 @@ void wxFrame::SetClientSize( int const width, int const height ) if (m_frameToolBar) { int y = 0; - m_frameToolBar->GetSize( NULL, &y ); + m_frameToolBar->GetSize( (int *) NULL, &y ); h += y; } wxWindow::SetClientSize( width, h ); @@ -269,7 +269,8 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height m_width = width; m_height = height; - gtk_widget_set_usize( m_widget, width, height ); + // VZ: why?? + //gtk_widget_set_usize( m_widget, width, height ); int main_x = 0; int main_y = 0; @@ -295,7 +296,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height } int toolbar_height = 0; - if (m_frameToolBar) m_frameToolBar->GetSize( NULL, &toolbar_height ); + if (m_frameToolBar) m_frameToolBar->GetSize( (int *) NULL, &toolbar_height ); main_y += toolbar_height; main_height -= toolbar_height; @@ -337,7 +338,7 @@ void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) ) return; // do we have exactly one child? - wxWindow *child = NULL; + wxWindow *child = (wxWindow *) NULL; for(wxNode *node = GetChildren()->First(); node; node = node->Next()) { wxWindow *win = (wxWindow *)node->Data(); @@ -469,7 +470,7 @@ wxStatusBar* wxFrame::CreateStatusBar( int number, long style, wxWindowID id, co wxStatusBar *wxFrame::OnCreateStatusBar( int number, long style, wxWindowID id, const wxString& name ) { - wxStatusBar *statusBar = NULL; + wxStatusBar *statusBar = (wxStatusBar *) NULL; statusBar = new wxStatusBar(this, id, wxPoint(0, 0), wxSize(100, 20), style, name); @@ -514,10 +515,19 @@ void wxFrame::SetTitle( const wxString &title ) gtk_window_set_title( GTK_WINDOW(m_widget), title ); } -void wxFrame::SetSizeHints(int minW, int minH, int maxW, int maxH, int WXUNUSED(incW) ) +void wxFrame::SetSizeHints(int minW, int minH, + int WXUNUSED(maxW), int WXUNUSED(maxH), + int WXUNUSED(incW) ) { + // gdk_window_set_hints alone doesn't really prevent the user from shrinking + // the window to the size smaller than (minW, minH) + gtk_widget_set_usize( GTK_WIDGET(m_widget), minW, minH ); + + /* gdk_window_set_hints( m_widget->window, -1, -1, - minW, minH, maxW, maxH, GDK_HINT_MIN_SIZE | GDK_HINT_MIN_SIZE ); + minW, minH, maxW, maxH, + GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE ); + */ } void wxFrame::SetIcon( const wxIcon &icon ) @@ -526,9 +536,9 @@ void wxFrame::SetIcon( const wxIcon &icon ) if (!icon.Ok()) return; wxMask *mask = icon.GetMask(); - GdkBitmap *bm = NULL; + GdkBitmap *bm = (GdkBitmap *) NULL; if (mask) bm = mask->GetBitmap(); - gdk_window_set_icon( m_widget->window, NULL, icon.GetPixmap(), bm ); + gdk_window_set_icon( m_widget->window, (GdkWindow *) NULL, icon.GetPixmap(), bm ); }