Fixes for wxUSE_STATUSBAR.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28309 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -93,7 +93,9 @@ bool MyApp::OnInit()
|
||||
// Associate the menu bar with the frame
|
||||
frame->SetMenuBar(menu_bar);
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
frame->CreateStatusBar();
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
frame->Show(TRUE);
|
||||
|
||||
|
@@ -107,8 +107,10 @@ bool MyApp::OnInit(void)
|
||||
wxT("wxWidgets Resource Sample"),
|
||||
wxPoint(-1, -1), wxSize(300, 250) );
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
// Give it a status line
|
||||
frame->CreateStatusBar(2);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
wxMenuBar *menu_bar = wxResourceCreateMenuBar(wxT("menu1"));
|
||||
|
||||
|
@@ -43,8 +43,10 @@ bool MyApp::OnInit()
|
||||
// Create the main frame window
|
||||
MyFrame* frame = new MyFrame(NULL, _T("Tree Test"), wxPoint(-1, -1), wxSize(400, 550));
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
// Give it a status line
|
||||
frame->CreateStatusBar(2);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
// Give it an icon
|
||||
#ifdef __WINDOWS__
|
||||
@@ -85,7 +87,9 @@ bool MyApp::OnInit()
|
||||
|
||||
frame->Show(TRUE);
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
frame->SetStatusText(_T("Hello, tree!"));
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
// Return the main frame window
|
||||
return TRUE;
|
||||
|
@@ -69,7 +69,9 @@ bool MyApp::OnInit(void)
|
||||
|
||||
frame->SetMenuBar(menu_bar);
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
frame->CreateStatusBar(3);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
frame->Show(true);
|
||||
|
||||
|
@@ -96,7 +96,9 @@ bool MyApp::OnInit(void)
|
||||
menu_bar->Append(file_menu, _("&File"));
|
||||
menu_bar->Append(active_menu, _("Active &Layout"));
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
frame->CreateStatusBar(3);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
frame->SetMenuBar(menu_bar);
|
||||
|
||||
|
@@ -83,7 +83,9 @@ bool MyApp::OnInit(void)
|
||||
|
||||
menu_bar->Append(file_menu, _("&File"));
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
frame->CreateStatusBar(3);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
frame->SetMenuBar(menu_bar);
|
||||
|
||||
frame->Show(true);
|
||||
|
@@ -84,7 +84,9 @@ bool MyApp::OnInit(void)
|
||||
|
||||
menu_bar->Append(file_menu, _("&File"));
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
frame->CreateStatusBar(3);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
frame->SetMenuBar(menu_bar);
|
||||
|
||||
frame->Show(true);
|
||||
|
@@ -88,7 +88,9 @@ bool MyApp::OnInit(void)
|
||||
|
||||
menu_bar->Append(file_menu, _("&File"));
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
frame->CreateStatusBar(3);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
frame->SetMenuBar(menu_bar);
|
||||
|
||||
frame->Show(true);
|
||||
|
@@ -66,7 +66,9 @@ bool MyApp::OnInit(void)
|
||||
MyFrame::MyFrame(int type, wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size):
|
||||
wxFrame(frame, wxID_ANY, title, pos, size, wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL)
|
||||
{
|
||||
#if wxUSE_STATUSBAR
|
||||
CreateStatusBar(1);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
sizer = NULL;
|
||||
if (type == 1)
|
||||
{
|
||||
|
@@ -431,7 +431,9 @@ void MMBoardFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
|
||||
// Update misc info
|
||||
UpdateMMedInfo();
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
SetStatusText(selected_file, 2);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
// Update info text
|
||||
UpdateInfoText();
|
||||
@@ -469,7 +471,6 @@ void MMBoardFrame::UpdateInfoText()
|
||||
|
||||
void MMBoardFrame::UpdateMMedInfo()
|
||||
{
|
||||
wxString temp_string;
|
||||
MMBoardTime current, length;
|
||||
|
||||
if (m_opened_file) {
|
||||
@@ -480,10 +481,15 @@ void MMBoardFrame::UpdateMMedInfo()
|
||||
length = current;
|
||||
}
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
// We refresh the status bar
|
||||
wxString temp_string;
|
||||
temp_string.Printf(wxT("%02d:%02d / %02d:%02d"), current.hours * 60 + current.minutes,
|
||||
current.seconds, length.hours * 60 + length.minutes, length.seconds);
|
||||
SetStatusText(temp_string, 1);
|
||||
#else
|
||||
wxUnusedVar(length);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
// We set the slider position
|
||||
m_positionSlider->SetValue(current.hours * 3600 + current.minutes * 60 + current.seconds);
|
||||
|
@@ -480,7 +480,9 @@ void MyEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys,
|
||||
}
|
||||
else
|
||||
{
|
||||
#if wxUSE_STATUSBAR
|
||||
wxGetApp().frame->SetStatusText(label);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -118,7 +118,9 @@ bool MyApp::OnInit(void)
|
||||
//// Associate the menu bar with the frame
|
||||
frame->SetMenuBar(menu_bar);
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
frame->CreateStatusBar(1);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
frame->Centre(wxBOTH);
|
||||
frame->Show(true);
|
||||
|
@@ -72,6 +72,7 @@ bool csEditorToolPalette::OnLeftClick(int toolIndex, bool toggled)
|
||||
|
||||
void csEditorToolPalette::OnMouseEnter(int toolIndex)
|
||||
{
|
||||
#if wxUSE_STATUSBAR
|
||||
wxString msg = wxEmptyString;
|
||||
if (toolIndex == PALETTE_ARROW)
|
||||
msg = _T("Pointer");
|
||||
@@ -82,6 +83,9 @@ void csEditorToolPalette::OnMouseEnter(int toolIndex)
|
||||
msg = symbol->GetName();
|
||||
}
|
||||
((wxFrame*) wxGetApp().GetTopWindow())->SetStatusText(msg);
|
||||
#else
|
||||
wxUnusedVar(toolIndex);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
}
|
||||
|
||||
void csEditorToolPalette::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
|
@@ -159,7 +159,9 @@ void csEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys,
|
||||
}
|
||||
else
|
||||
{
|
||||
#if wxUSE_STATUSBAR
|
||||
((wxFrame*)wxGetApp().GetTopWindow())->SetStatusText(m_label);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -170,7 +170,9 @@ bool csApp::OnInit(void)
|
||||
wxConfig config(_T("OGL Studio"), _T("wxWidgets"));
|
||||
m_docManager->FileHistoryLoad(config);
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
frame->CreateStatusBar();
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
// The ordering of these is important for layout purposes
|
||||
CreateDiagramToolBar(frame);
|
||||
|
@@ -115,9 +115,11 @@ MyFrame::MyFrame()
|
||||
|
||||
SetMenuBar( menu_bar );
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
CreateStatusBar(2);
|
||||
int widths[] = { -1, 100 };
|
||||
SetStatusWidths( 2, widths );
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
m_plot = new wxPlotWindow( this, -1, wxPoint(0,0), wxSize(100,100), wxSUNKEN_BORDER | wxPLOT_DEFAULT );
|
||||
m_plot->SetUnitsPerValue( 0.01 );
|
||||
|
@@ -179,9 +179,11 @@ bool MyApp::OnInit()
|
||||
// Associate the menu bar with the frame
|
||||
frame->SetMenuBar(menu_bar);
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
frame->CreateStatusBar();
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
frame->Show(TRUE);
|
||||
frame->Show(true);
|
||||
|
||||
SetTopWindow(frame);
|
||||
|
||||
@@ -391,7 +393,9 @@ wxSUNKEN_BORDER|wxVSCROLL|wxHSCROLL)
|
||||
void MyCanvas::OnDraw(wxDC& dc)
|
||||
{
|
||||
// vars to use ...
|
||||
#if wxUSE_STATUSBAR
|
||||
wxString s ;
|
||||
#endif // wxUSE_STATUSBAR
|
||||
wxPen wP ;
|
||||
wxBrush wB ;
|
||||
wxPoint points[6];
|
||||
@@ -417,7 +421,9 @@ void MyCanvas::OnDraw(wxDC& dc)
|
||||
dc.DrawPoint (25,15) ;
|
||||
dc.DrawLine(50, 30, 200, 30);
|
||||
dc.DrawSpline(50, 200, 50, 100, 200, 10);
|
||||
#if wxUSE_STATUSBAR
|
||||
s = wxT("Green Cross, Cyan Line and spline");
|
||||
#endif // wxUSE_STATUSBAR
|
||||
break ;
|
||||
|
||||
case 1:
|
||||
@@ -440,7 +446,9 @@ void MyCanvas::OnDraw(wxDC& dc)
|
||||
|
||||
dc.DrawPolygon(5, points);
|
||||
dc.DrawLines (6, points, 160);
|
||||
#if wxUSE_STATUSBAR
|
||||
s = wxT("Blue rectangle, red edge, clear rounded rectangle, gold ellipse, gold and clear stars");
|
||||
#endif // wxUSE_STATUSBAR
|
||||
break ;
|
||||
|
||||
case 2:
|
||||
@@ -460,7 +468,9 @@ void MyCanvas::OnDraw(wxDC& dc)
|
||||
dc.SetFont(wF);
|
||||
dc.SetTextForeground (wC) ;
|
||||
dc.DrawText(wxT("This is a Times-style string"), 50, 60);
|
||||
#if wxUSE_STATUSBAR
|
||||
s = wxT("Swiss, Times text; red text, rotated and colored orange");
|
||||
#endif // wxUSE_STATUSBAR
|
||||
break ;
|
||||
|
||||
case 3 :
|
||||
@@ -494,7 +504,9 @@ void MyCanvas::OnDraw(wxDC& dc)
|
||||
dc.DrawEllipticArc(300, 50,200,100,90.0,145.0) ;
|
||||
dc.DrawEllipticArc(300,100,200,100,90.0,345.0) ;
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
s = wxT("This is an arc test page");
|
||||
#endif // wxUSE_STATUSBAR
|
||||
break ;
|
||||
|
||||
case 4:
|
||||
@@ -502,7 +514,9 @@ void MyCanvas::OnDraw(wxDC& dc)
|
||||
dc.SetBrush (wxBrush (_T("SALMON"),wxTRANSPARENT));
|
||||
dc.DrawCheckMark ( 80,50,75,75);
|
||||
dc.DrawRectangle ( 80,50,75,75);
|
||||
#if wxUSE_STATUSBAR
|
||||
s = wxT("Two check marks");
|
||||
#endif // wxUSE_STATUSBAR
|
||||
break ;
|
||||
|
||||
case 5:
|
||||
@@ -532,17 +546,23 @@ void MyCanvas::OnDraw(wxDC& dc)
|
||||
dc.DrawLine(0, 0, 200, 200);
|
||||
dc.DrawLine(200, 0, 0, 200);
|
||||
dc.DrawText(wxT("This is an 18pt string in MapMode"), 50, 60);
|
||||
#if wxUSE_STATUSBAR
|
||||
s = wxT("Scaling test page");
|
||||
#endif // wxUSE_STATUSBAR
|
||||
break ;
|
||||
|
||||
case 6:
|
||||
dc.DrawIcon( wxIcon(mondrian_xpm), 10, 10 );
|
||||
dc.DrawBitmap ( wxBitmap(svgbitmap_xpm), 50,15);
|
||||
#if wxUSE_STATUSBAR
|
||||
s = wxT("Icon and Bitmap ");
|
||||
#endif // wxUSE_STATUSBAR
|
||||
break ;
|
||||
|
||||
}
|
||||
#if wxUSE_STATUSBAR
|
||||
m_child->SetStatusText(s);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
}
|
||||
|
||||
|
||||
@@ -559,8 +579,10 @@ const long style)
|
||||
{
|
||||
|
||||
m_frame = (MyFrame *) parent ;
|
||||
#if wxUSE_STATUSBAR
|
||||
CreateStatusBar();
|
||||
SetStatusText(title);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
int w, h ;
|
||||
GetClientSize ( &w, &h );
|
||||
|
@@ -122,12 +122,14 @@ MyFrame::MyFrame(wxWindow* parent)
|
||||
// needs to be all in one step.
|
||||
SetToolBar(wxXmlResource::Get()->LoadToolBar(this, wxT("main_toolbar")));
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
// Give the frame a optional statusbar. The '1' just means one field.
|
||||
// A gripsizer will automatically get put on into the corner, if that
|
||||
// is the normal OS behaviour for frames on that platform. Helptext
|
||||
// for menu items and toolbar tools will automatically get displayed
|
||||
// here.
|
||||
CreateStatusBar( 1 );
|
||||
#endif // wxUSE_STATUSBAR
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@@ -90,7 +90,9 @@ PreviewFrame::PreviewFrame()
|
||||
m_ScrollWin->SetBackgroundColour(_T("light steel blue"));
|
||||
m_Splitter->SplitHorizontally(m_ScrollWin, m_LogCtrl, cfg->Read(_T("previewframe_sash"), 300));
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
CreateStatusBar();
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
#ifdef __WXMSW__
|
||||
SendSizeEvent(); // force resize for WXMSW
|
||||
|
@@ -179,9 +179,11 @@ bool MyApp::OnInit()
|
||||
// Associate the menu bar with the frame
|
||||
frame->SetMenuBar(menu_bar);
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
frame->CreateStatusBar();
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
frame->Show(TRUE);
|
||||
frame->Show(true);
|
||||
|
||||
SetTopWindow(frame);
|
||||
|
||||
@@ -391,7 +393,9 @@ wxSUNKEN_BORDER|wxVSCROLL|wxHSCROLL)
|
||||
void MyCanvas::OnDraw(wxDC& dc)
|
||||
{
|
||||
// vars to use ...
|
||||
#if wxUSE_STATUSBAR
|
||||
wxString s ;
|
||||
#endif // wxUSE_STATUSBAR
|
||||
wxPen wP ;
|
||||
wxBrush wB ;
|
||||
wxPoint points[6];
|
||||
@@ -417,7 +421,9 @@ void MyCanvas::OnDraw(wxDC& dc)
|
||||
dc.DrawPoint (25,15) ;
|
||||
dc.DrawLine(50, 30, 200, 30);
|
||||
dc.DrawSpline(50, 200, 50, 100, 200, 10);
|
||||
#if wxUSE_STATUSBAR
|
||||
s = wxT("Green Cross, Cyan Line and spline");
|
||||
#endif // wxUSE_STATUSBAR
|
||||
break ;
|
||||
|
||||
case 1:
|
||||
@@ -440,7 +446,9 @@ void MyCanvas::OnDraw(wxDC& dc)
|
||||
|
||||
dc.DrawPolygon(5, points);
|
||||
dc.DrawLines (6, points, 160);
|
||||
#if wxUSE_STATUSBAR
|
||||
s = wxT("Blue rectangle, red edge, clear rounded rectangle, gold ellipse, gold and clear stars");
|
||||
#endif // wxUSE_STATUSBAR
|
||||
break ;
|
||||
|
||||
case 2:
|
||||
@@ -460,7 +468,9 @@ void MyCanvas::OnDraw(wxDC& dc)
|
||||
dc.SetFont(wF);
|
||||
dc.SetTextForeground (wC) ;
|
||||
dc.DrawText(wxT("This is a Times-style string"), 50, 60);
|
||||
#if wxUSE_STATUSBAR
|
||||
s = wxT("Swiss, Times text; red text, rotated and colored orange");
|
||||
#endif // wxUSE_STATUSBAR
|
||||
break ;
|
||||
|
||||
case 3 :
|
||||
@@ -494,7 +504,9 @@ void MyCanvas::OnDraw(wxDC& dc)
|
||||
dc.DrawEllipticArc(300, 50,200,100,90.0,145.0) ;
|
||||
dc.DrawEllipticArc(300,100,200,100,90.0,345.0) ;
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
s = wxT("This is an arc test page");
|
||||
#endif // wxUSE_STATUSBAR
|
||||
break ;
|
||||
|
||||
case 4:
|
||||
@@ -502,7 +514,9 @@ void MyCanvas::OnDraw(wxDC& dc)
|
||||
dc.SetBrush (wxBrush (_T("SALMON"),wxTRANSPARENT));
|
||||
dc.DrawCheckMark ( 80,50,75,75);
|
||||
dc.DrawRectangle ( 80,50,75,75);
|
||||
#if wxUSE_STATUSBAR
|
||||
s = wxT("Two check marks");
|
||||
#endif // wxUSE_STATUSBAR
|
||||
break ;
|
||||
|
||||
case 5:
|
||||
@@ -532,17 +546,23 @@ void MyCanvas::OnDraw(wxDC& dc)
|
||||
dc.DrawLine(0, 0, 200, 200);
|
||||
dc.DrawLine(200, 0, 0, 200);
|
||||
dc.DrawText(wxT("This is an 18pt string in MapMode"), 50, 60);
|
||||
#if wxUSE_STATUSBAR
|
||||
s = wxT("Scaling test page");
|
||||
#endif // wxUSE_STATUSBAR
|
||||
break ;
|
||||
|
||||
case 6:
|
||||
dc.DrawIcon( wxIcon(mondrian_xpm), 10, 10 );
|
||||
dc.DrawBitmap ( wxBitmap(svgbitmap_xpm), 50,15);
|
||||
#if wxUSE_STATUSBAR
|
||||
s = wxT("Icon and Bitmap ");
|
||||
#endif // wxUSE_STATUSBAR
|
||||
break ;
|
||||
|
||||
}
|
||||
#if wxUSE_STATUSBAR
|
||||
m_child->SetStatusText(s);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
}
|
||||
|
||||
|
||||
@@ -559,8 +579,10 @@ const long style)
|
||||
{
|
||||
|
||||
m_frame = (MyFrame *) parent ;
|
||||
#if wxUSE_STATUSBAR
|
||||
CreateStatusBar();
|
||||
SetStatusText(title);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
int w, h ;
|
||||
GetClientSize ( &w, &h );
|
||||
|
@@ -122,12 +122,14 @@ MyFrame::MyFrame(wxWindow* parent)
|
||||
// needs to be all in one step.
|
||||
SetToolBar(wxXmlResource::Get()->LoadToolBar(this, wxT("main_toolbar")));
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
// Give the frame a optional statusbar. The '1' just means one field.
|
||||
// A gripsizer will automatically get put on into the corner, if that
|
||||
// is the normal OS behaviour for frames on that platform. Helptext
|
||||
// for menu items and toolbar tools will automatically get displayed
|
||||
// here.
|
||||
CreateStatusBar( 1 );
|
||||
#endif // wxUSE_STATUSBAR
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@@ -140,7 +140,9 @@ ctMainFrame::ctMainFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id,
|
||||
|
||||
SetIcon(wxIcon(wxconfigtool_xpm));
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
CreateStatusBar(2);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
wxMenuBar* menuBar = CreateMenuBar();
|
||||
SetMenuBar(menuBar);
|
||||
|
@@ -180,12 +180,14 @@ bool wxEmulatorApp::OnInit()
|
||||
wxEmulatorFrame *frame = new wxEmulatorFrame(_T("wxEmulator"),
|
||||
wxPoint(50, 50), wxSize(450, 340));
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
frame->SetStatusText(m_emulatorInfo.m_emulatorTitle, 0);
|
||||
|
||||
wxString sizeStr;
|
||||
sizeStr.Printf(wxT("Screen: %dx%d"), (int) m_emulatorInfo.m_emulatorScreenSize.x,
|
||||
(int) m_emulatorInfo.m_emulatorScreenSize.y);
|
||||
frame->SetStatusText(sizeStr, 1);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
m_containerWindow = new wxEmulatorContainer(frame, wxID_ANY);
|
||||
|
||||
|
Reference in New Issue
Block a user