-
-wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
-{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
-
- wxCHECK_MSG( m_frameToolBar == NULL, FALSE, "recreating toolbar in wxFrame" );
-
- m_frameToolBar = OnCreateToolBar( style, id, name );
-
- GetChildren().DeleteObject( m_frameToolBar );
-
- m_sizeSet = FALSE;
-
- return m_frameToolBar;
-}
-
-wxToolBar* wxFrame::OnCreateToolBar( long style, wxWindowID id, const wxString& name )
-{
- return new wxToolBar( this, id, wxDefaultPosition, wxDefaultSize, style, name );
-}
-
-wxToolBar *wxFrame::GetToolBar() const
-{
- return m_frameToolBar;
-}
-
-wxStatusBar* wxFrame::CreateStatusBar( int number, long style, wxWindowID id, const wxString& name )
-{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
-
- wxCHECK_MSG( m_frameStatusBar == NULL, FALSE, "recreating status bar in wxFrame" );
-
- m_frameStatusBar = OnCreateStatusBar( number, style, id, name );
-
- m_sizeSet = FALSE;
-
- return m_frameStatusBar;
-}
-
-wxStatusBar *wxFrame::OnCreateStatusBar( int number, long style, wxWindowID id, const wxString& name )
-{
- wxStatusBar *statusBar = (wxStatusBar *) 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;
-}
-
-void wxFrame::SetStatusText(const wxString& text, int number)
-{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
-
- wxCHECK_RET( m_frameStatusBar != NULL, "no statusbar to set text for" );
-
- m_frameStatusBar->SetStatusText(text, number);
-}
-
-void wxFrame::SetStatusWidths(int n, const int widths_field[] )
-{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
-
- wxCHECK_RET( m_frameStatusBar != NULL, "no statusbar to set widths for" );
-
- m_frameStatusBar->SetStatusWidths(n, widths_field);
-}
-
-wxStatusBar *wxFrame::GetStatusBar() const
-{
- return m_frameStatusBar;
-}
-
-void wxFrame::SetTitle( const wxString &title )
-{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
-
- m_title = title;
- if (m_title.IsNull()) m_title = "";
- gtk_window_set_title( GTK_WINDOW(m_widget), title );
-}
-
-void wxFrame::SetIcon( const wxIcon &icon )
-{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
-
- m_icon = icon;
- if (!icon.Ok()) return;
-
- wxMask *mask = icon.GetMask();
- GdkBitmap *bm = (GdkBitmap *) NULL;
- if (mask) bm = mask->GetBitmap();
-
- gdk_window_set_icon( m_widget->window, (GdkWindow *) NULL, icon.GetPixmap(), bm );
-}
-