Fixes for wxUSE_STATUSBAR.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28305 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba 2004-07-19 09:39:38 +00:00
parent 1411f7eb1a
commit 67a9999283
17 changed files with 118 additions and 19 deletions

View File

@ -216,9 +216,11 @@ bool MainApp::OnInit(void) // Does everything needed for a program start
menu_bar->Append(file_menu, _("&File")); menu_bar->Append(file_menu, _("&File"));
menu_bar->Append(help_menu, _("&Help")); menu_bar->Append(help_menu, _("&Help"));
frame->SetMenuBar(menu_bar); frame->SetMenuBar(menu_bar);
#if wxUSE_STATUSBAR
frame->CreateStatusBar(1); frame->CreateStatusBar(1);
Temp0.Printf(_("%s has started !"),p_ProgramCfg->GetAppName().c_str()); Temp0.Printf(_("%s has started !"),p_ProgramCfg->GetAppName().c_str());
frame->SetStatusText(Temp0, 0); frame->SetStatusText(Temp0, 0);
#endif // wxUSE_STATUSBAR
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
int width, height; int width, height;
frame->GetClientSize(&width, &height); frame->GetClientSize(&width, &height);

View File

@ -125,15 +125,19 @@ int DBGrid::OnTableView(wxString Table)
{ // BrowserDB::OnGetNext Formats the field Value into tablename { // BrowserDB::OnGetNext Formats the field Value into tablename
SetCellValue(z, y,((db_Br+i_Which)->cl_BrowserDB+y)->tableName); SetCellValue(z, y,((db_Br+i_Which)->cl_BrowserDB+y)->tableName);
} }
#if wxUSE_STATUSBAR
if (z % 50 == 0) if (z % 50 == 0)
{ {
Temp0.Printf(_("-I-> DBGrid::OnTableView(%s) - Record %6d (from %d) has been read."),Table.c_str(),z,(db_Br+i_Which)->i_Records); Temp0.Printf(_("-I-> DBGrid::OnTableView(%s) - Record %6d (from %d) has been read."),Table.c_str(),z,(db_Br+i_Which)->i_Records);
pDoc->p_MainFrame->SetStatusText(Temp0, 0); pDoc->p_MainFrame->SetStatusText(Temp0, 0);
} }
#endif // wxUSE_STATUSBAR
} // for (z=0;z<(db_Br+i_Which)->i_Records;z++) } // for (z=0;z<(db_Br+i_Which)->i_Records;z++)
Temp0.Printf(_("-I-> DBGrid::OnTableView(%s) - %6d Records have been read. - Time needed : %ld ms"),Table.c_str(),z,sw.Time()); Temp0.Printf(_("-I-> DBGrid::OnTableView(%s) - %6d Records have been read. - Time needed : %ld ms"),Table.c_str(),z,sw.Time());
wxLogMessage(Temp0); wxLogMessage(Temp0);
#if wxUSE_STATUSBAR
pDoc->p_MainFrame->SetStatusText(Temp0, 0); pDoc->p_MainFrame->SetStatusText(Temp0, 0);
#endif // wxUSE_STATUSBAR
// The Grid has been filled, now leave // The Grid has been filled, now leave
goto Weiter; goto Weiter;
} // if ((ct_BrowserDB->pTableInf+x)->pColInf) } // if ((ct_BrowserDB->pTableInf+x)->pColInf)

View File

@ -221,8 +221,10 @@ int DBTree::OnPopulate()
z++; z++;
// if (z % 10 == 0) // if (z % 10 == 0)
{ {
#if wxUSE_STATUSBAR
Temp0.Printf(_("-I-> DBTree::OnPopulate(%s) - Table %6d (from %d) has been read."),(ct_BrowserDB->pTableInf+x)->tableName,z,ct_BrowserDB->numTables); Temp0.Printf(_("-I-> DBTree::OnPopulate(%s) - Table %6d (from %d) has been read."),(ct_BrowserDB->pTableInf+x)->tableName,z,ct_BrowserDB->numTables);
pDoc->p_MainFrame->SetStatusText(Temp0, 0); pDoc->p_MainFrame->SetStatusText(Temp0, 0);
#endif // wxUSE_STATUSBAR
} }
wxYield(); wxYield();
} // if ((ct_BrowserDB->pTableInf+x)->tableType == "TABLE" or VIEW) } // if ((ct_BrowserDB->pTableInf+x)->tableType == "TABLE" or VIEW)
@ -235,7 +237,9 @@ int DBTree::OnPopulate()
wxEndBusyCursor(); wxEndBusyCursor();
Temp0.Printf(_("-I-> DBTree::OnPopulate() - %6d Tables have been read. - Time needed : %ld ms"),z,sw.Time()); Temp0.Printf(_("-I-> DBTree::OnPopulate() - %6d Tables have been read. - Time needed : %ld ms"),z,sw.Time());
wxLogMessage(Temp0); wxLogMessage(Temp0);
#if wxUSE_STATUSBAR
pDoc->p_MainFrame->SetStatusText(Temp0, 0); pDoc->p_MainFrame->SetStatusText(Temp0, 0);
#endif // wxUSE_STATUSBAR
} // if((pDoc->db_Br+i_Which)->Initialize(false)) } // if((pDoc->db_Br+i_Which)->Initialize(false))
else else
{ {
@ -264,7 +268,9 @@ void DBTree::OnSelChanged(wxTreeEvent& WXUNUSED(event))
{ {
int i; int i;
Temp0.Empty(); Temp0.Empty();
#if wxUSE_STATUSBAR
pDoc->p_MainFrame->SetStatusText(Temp0,0); pDoc->p_MainFrame->SetStatusText(Temp0,0);
#endif // wxUSE_STATUSBAR
// Get the Information that we need // Get the Information that we need
wxTreeItemId itemId = GetSelection(); wxTreeItemId itemId = GetSelection();
DBTreeData *item = (DBTreeData *)GetItemData(itemId); DBTreeData *item = (DBTreeData *)GetItemData(itemId);

View File

@ -144,9 +144,11 @@ bool MainDoc::OnInitView()
// return false; // return false;
OnInitODBC(); OnInitODBC();
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
#if wxUSE_STATUSBAR
Temp0.Printf(_("-I-> MainDoc::OnInitView() - End - %d DSN's found"),i_DSN); Temp0.Printf(_("-I-> MainDoc::OnInitView() - End - %d DSN's found"),i_DSN);
p_MainFrame->SetStatusText(Temp0, 0); p_MainFrame->SetStatusText(Temp0, 0);
wxLogMessage(Temp0); wxLogMessage(Temp0);
#endif // wxUSE_STATUSBAR
return true; return true;
} }

View File

@ -137,7 +137,9 @@ void PgmCtrl::OnSelChanged(wxMouseEvent& WXUNUSED(event))
{ {
int i; int i;
Temp0.Empty(); Temp1.Empty(); Temp0.Empty(); Temp1.Empty();
#if wxUSE_STATUSBAR
pDoc->p_MainFrame->SetStatusText(Temp0,0); pDoc->p_MainFrame->SetStatusText(Temp0,0);
#endif // wxUSE_STATUSBAR
// Get the Information that we need // Get the Information that we need
wxTreeItemId itemId = GetSelection(); wxTreeItemId itemId = GetSelection();
TreeData *item = (TreeData *)GetItemData(itemId); TreeData *item = (TreeData *)GetItemData(itemId);

View File

@ -198,7 +198,9 @@ FortyFrame::FortyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos
SetSizer( topsizer ); SetSizer( topsizer );
topsizer->SetSizeHints( this ); topsizer->SetSizeHints( this );
#if wxUSE_STATUSBAR
CreateStatusBar(); CreateStatusBar();
#endif // wxUSE_STATUSBAR
} }
FortyFrame::~FortyFrame() FortyFrame::~FortyFrame()

View File

@ -261,9 +261,11 @@ LifeFrame::LifeFrame() : wxFrame( (wxFrame *) NULL, wxID_ANY,
toolBar->Realize(); toolBar->Realize();
toolBar->EnableTool(ID_STOP, false); // must be after Realize() ! toolBar->EnableTool(ID_STOP, false); // must be after Realize() !
#if wxUSE_STATUSBAR
// status bar // status bar
CreateStatusBar(2); CreateStatusBar(2);
SetStatusText(_("Welcome to Life!")); SetStatusText(_("Welcome to Life!"));
#endif // wxUSE_STATUSBAR
// game and timer // game and timer
m_life = new Life(); m_life = new Life();
@ -884,10 +886,12 @@ void LifeCanvas::OnMouse(wxMouseEvent& event)
wxInt32 i = XToCell( event.GetX() ); wxInt32 i = XToCell( event.GetX() );
wxInt32 j = YToCell( event.GetY() ); wxInt32 j = YToCell( event.GetY() );
#if wxUSE_STATUSBAR
// set statusbar text // set statusbar text
wxString msg; wxString msg;
msg.Printf(_("Cell: (%d, %d)"), i, j); msg.Printf(_("Cell: (%d, %d)"), i, j);
((LifeFrame *) wxGetApp().GetTopWindow())->SetStatusText(msg, 1); ((LifeFrame *) wxGetApp().GetTopWindow())->SetStatusText(msg, 1);
#endif // wxUSE_STATUSBAR
// NOTE that wxMouseEvent::LeftDown() and wxMouseEvent::LeftIsDown() // NOTE that wxMouseEvent::LeftDown() and wxMouseEvent::LeftIsDown()
// have different semantics. The first one is used to signal that the // have different semantics. The first one is used to signal that the

View File

@ -120,9 +120,11 @@ public:
void SetRelatedFrame(wxFrame* frame, const wxString& format); void SetRelatedFrame(wxFrame* frame, const wxString& format);
wxFrame* GetRelatedFrame() const {return m_RelatedFrame;} wxFrame* GetRelatedFrame() const {return m_RelatedFrame;}
#if wxUSE_STATUSBAR
// After(!) calling SetRelatedFrame, this sets statusbar slot where messages // After(!) calling SetRelatedFrame, this sets statusbar slot where messages
// will be displayed. Default is -1 = no messages. // will be displayed. Default is -1 = no messages.
void SetRelatedStatusBar(int bar); void SetRelatedStatusBar(int bar);
#endif // wxUSE_STATUSBAR
// Sets fonts to be used when displaying HTML page. // Sets fonts to be used when displaying HTML page.
void SetFonts(wxString normal_face, wxString fixed_face, void SetFonts(wxString normal_face, wxString fixed_face,
@ -283,9 +285,11 @@ protected:
wxFrame *m_RelatedFrame; wxFrame *m_RelatedFrame;
wxString m_TitleFormat; wxString m_TitleFormat;
#if wxUSE_STATUSBAR
// frame in which page title should be displayed & number of it's statusbar // frame in which page title should be displayed & number of it's statusbar
// reserved for usage with this html window // reserved for usage with this html window
int m_RelatedStatusBar; int m_RelatedStatusBar;
#endif // wxUSE_STATUSBAR
// borders (free space between text and window borders) // borders (free space between text and window borders)
// defaults to 10 pixels. // defaults to 10 pixels.

View File

@ -76,9 +76,10 @@ MyFrame::MyFrame() :
wxFrame( (wxFrame *) NULL, wxID_ANY, _T("wxLayout"), wxFrame( (wxFrame *) NULL, wxID_ANY, _T("wxLayout"),
wxDefaultPosition, wxDefaultSize ) wxDefaultPosition, wxDefaultSize )
{ {
#if wxUSE_STATUSBAR
CreateStatusBar( 2 ); CreateStatusBar( 2 );
SetStatusText( _T("wxLayout by Karsten Ballüder.") ); SetStatusText( _T("wxLayout by Karsten Ballüder.") );
#endif // wxUSE_STATUSBAR
wxMenuBar *menu_bar = new wxMenuBar(); wxMenuBar *menu_bar = new wxMenuBar();
@ -128,7 +129,9 @@ MyFrame::MyFrame() :
SetMenuBar( menu_bar ); SetMenuBar( menu_bar );
m_lwin = new wxLayoutWindow(this); m_lwin = new wxLayoutWindow(this);
#if wxUSE_STATUSBAR
m_lwin->SetStatusBar(GetStatusBar(), 0, 1); m_lwin->SetStatusBar(GetStatusBar(), 0, 1);
#endif // wxUSE_STATUSBAR
m_lwin->SetMouseTracking(true); m_lwin->SetMouseTracking(true);
m_lwin->SetEditable(true); m_lwin->SetEditable(true);
m_lwin->SetWrapMargin(40); m_lwin->SetWrapMargin(40);

View File

@ -153,7 +153,9 @@ wxLayoutWindow::wxLayoutWindow(wxWindow *parent)
wxWANTS_CHARS), wxWANTS_CHARS),
m_llist(NULL) m_llist(NULL)
{ {
#if wxUSE_STATUSBAR
SetStatusBar(NULL); // don't use statusbar SetStatusBar(NULL); // don't use statusbar
#endif // wxUSE_STATUSBAR
m_Editable = false; m_Editable = false;
m_doSendEvents = false; m_doSendEvents = false;
m_ViewStartX = 0; m_ViewStartY = 0; m_ViewStartX = 0; m_ViewStartY = 0;
@ -310,7 +312,9 @@ wxLayoutWindow::OnMouse(int eventId, wxMouseEvent& event)
// this variables is used to only erase the message in the status // this variables is used to only erase the message in the status
// bar if we had put it there previously - otherwise empting status // bar if we had put it there previously - otherwise empting status
// bar might be undesirable // bar might be undesirable
#if wxUSE_STATUSBAR
static bool s_hasPutMessageInStatusBar = false; static bool s_hasPutMessageInStatusBar = false;
#endif // wxUSE_STATUSBAR
// found is only true if we are really over an object, not just // found is only true if we are really over an object, not just
// behind it // behind it
@ -319,27 +323,30 @@ wxLayoutWindow::OnMouse(int eventId, wxMouseEvent& event)
if(!m_HandCursor) if(!m_HandCursor)
SetCursor(wxCURSOR_HAND); SetCursor(wxCURSOR_HAND);
m_HandCursor = true; m_HandCursor = true;
#if wxUSE_STATUSBAR
if(m_StatusBar && m_StatusFieldLabel != -1) if(m_StatusBar && m_StatusFieldLabel != -1)
{ {
const wxString &label = u->GetLabel(); const wxString &label = u->GetLabel();
if(label.Length()) if(label.Length())
{ {
m_StatusBar->SetStatusText(label, m_StatusBar->SetStatusText(label,m_StatusFieldLabel);
m_StatusFieldLabel);
s_hasPutMessageInStatusBar = true; s_hasPutMessageInStatusBar = true;
} }
} }
#endif // wxUSE_STATUSBAR
} }
else else
{ {
if(m_HandCursor) if(m_HandCursor)
SetCursor(wxCURSOR_IBEAM); SetCursor(wxCURSOR_IBEAM);
m_HandCursor = false; m_HandCursor = false;
#if wxUSE_STATUSBAR
if( m_StatusBar && m_StatusFieldLabel != -1 && if( m_StatusBar && m_StatusFieldLabel != -1 &&
s_hasPutMessageInStatusBar ) s_hasPutMessageInStatusBar )
{ {
m_StatusBar->SetStatusText(wxEmptyString, m_StatusFieldLabel); m_StatusBar->SetStatusText(wxEmptyString, m_StatusFieldLabel);
} }
#endif // wxUSE_STATUSBAR
} }
} }
@ -1062,6 +1069,7 @@ wxLayoutWindow::InternalPaint(const wxRect *updateRect)
ResetDirty(); ResetDirty();
#if wxUSE_STATUSBAR
if ( m_StatusBar && m_StatusFieldCursor != -1 ) if ( m_StatusBar && m_StatusFieldCursor != -1 )
{ {
static wxPoint s_oldCursorPos(-1, -1); static wxPoint s_oldCursorPos(-1, -1);
@ -1078,6 +1086,7 @@ wxLayoutWindow::InternalPaint(const wxRect *updateRect)
m_StatusBar->SetStatusText(label, m_StatusFieldCursor); m_StatusBar->SetStatusText(label, m_StatusFieldCursor);
} }
} }
#endif // wxUSE_STATUSBAR
WXLO_TIMER_PRINT(LayoutTimer); WXLO_TIMER_PRINT(LayoutTimer);
WXLO_TIMER_PRINT(BlitTimer); WXLO_TIMER_PRINT(BlitTimer);

View File

@ -177,6 +177,7 @@ public:
/// Redraws the window, used by RequestUpdate() or OnPaint(). /// Redraws the window, used by RequestUpdate() or OnPaint().
void InternalPaint(const wxRect *updateRect); void InternalPaint(const wxRect *updateRect);
#if wxUSE_STATUSBAR
/** Tell window to update a wxStatusBar with UserData labels and /** Tell window to update a wxStatusBar with UserData labels and
cursor positions. cursor positions.
@param bar wxStatusBar pointer @param bar wxStatusBar pointer
@ -190,6 +191,7 @@ public:
m_StatusBar = bar; m_StatusFieldLabel = labelfield; m_StatusBar = bar; m_StatusFieldLabel = labelfield;
m_StatusFieldCursor = cursorfield; m_StatusFieldCursor = cursorfield;
} }
#endif // wxUSE_STATUSBAR
#ifndef __WXMSW__ #ifndef __WXMSW__
/// Enable or disable focus follow mode under non-MSW /// Enable or disable focus follow mode under non-MSW
@ -307,8 +309,10 @@ private:
wxBitmap *m_bitmap; wxBitmap *m_bitmap;
wxPoint m_bitmapSize; wxPoint m_bitmapSize;
#if wxUSE_STATUSBAR
/// A frame's statusbar to update /// A frame's statusbar to update
class wxStatusBar *m_StatusBar; class wxStatusBar *m_StatusBar;
#endif // wxUSE_STATUSBAR
/// statusbar field for labels /// statusbar field for labels
int m_StatusFieldLabel; int m_StatusFieldLabel;

View File

@ -568,6 +568,8 @@ void wxGenericMDIChildFrame::OnMenuHighlight(wxMenuEvent& event)
// but may be the MDI frame does? // but may be the MDI frame does?
m_pMDIParentFrame->OnMenuHighlight(event); m_pMDIParentFrame->OnMenuHighlight(event);
} }
#else
wxUnusedVar(event);
#endif // wxUSE_STATUSBAR #endif // wxUSE_STATUSBAR
} }

View File

@ -338,7 +338,9 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
int notebook_page = 0; int notebook_page = 0;
#if wxUSE_STATUSBAR
CreateStatusBar(); CreateStatusBar();
#endif // wxUSE_STATUSBAR
#if wxUSE_TOOLBAR #if wxUSE_TOOLBAR
// toolbar? // toolbar?
@ -377,7 +379,9 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
} }
m_HtmlWin->SetRelatedFrame(this, m_TitleFormat); m_HtmlWin->SetRelatedFrame(this, m_TitleFormat);
#if wxUSE_STATUSBAR
m_HtmlWin->SetRelatedStatusBar(0); m_HtmlWin->SetRelatedStatusBar(0);
#endif // wxUSE_STATUSBAR
if ( m_Config ) if ( m_Config )
m_HtmlWin->ReadCustomization(m_Config, m_ConfigRoot); m_HtmlWin->ReadCustomization(m_Config, m_ConfigRoot);

View File

@ -158,7 +158,9 @@ void wxHtmlWindow::Init()
m_tmpLastCell = NULL; m_tmpLastCell = NULL;
m_tmpCanDrawLocks = 0; m_tmpCanDrawLocks = 0;
m_FS = new wxFileSystem(); m_FS = new wxFileSystem();
#if wxUSE_STATUSBAR
m_RelatedStatusBar = -1; m_RelatedStatusBar = -1;
#endif // wxUSE_STATUSBAR
m_RelatedFrame = NULL; m_RelatedFrame = NULL;
m_TitleFormat = wxT("%s"); m_TitleFormat = wxT("%s");
m_OpenedPage = m_OpenedAnchor = m_OpenedPageTitle = wxEmptyString; m_OpenedPage = m_OpenedAnchor = m_OpenedPageTitle = wxEmptyString;
@ -228,10 +230,12 @@ void wxHtmlWindow::SetRelatedFrame(wxFrame* frame, const wxString& format)
#if wxUSE_STATUSBAR
void wxHtmlWindow::SetRelatedStatusBar(int bar) void wxHtmlWindow::SetRelatedStatusBar(int bar)
{ {
m_RelatedStatusBar = bar; m_RelatedStatusBar = bar;
} }
#endif // wxUSE_STATUSBAR
@ -355,13 +359,15 @@ bool wxHtmlWindow::LoadPage(const wxString& location)
else else
{ {
needs_refresh = TRUE; needs_refresh = true;
#if wxUSE_STATUSBAR
// load&display it: // load&display it:
if (m_RelatedStatusBar != -1) if (m_RelatedStatusBar != -1)
{ {
m_RelatedFrame->SetStatusText(_("Connecting..."), m_RelatedStatusBar); m_RelatedFrame->SetStatusText(_("Connecting..."), m_RelatedStatusBar);
Refresh(FALSE); Refresh(false);
} }
#endif // wxUSE_STATUSBAR
f = m_Parser->OpenURL(wxHTML_URL_PAGE, location); f = m_Parser->OpenURL(wxHTML_URL_PAGE, location);
@ -377,7 +383,7 @@ bool wxHtmlWindow::LoadPage(const wxString& location)
{ {
wxLogError(_("Unable to open requested HTML document: %s"), location.c_str()); wxLogError(_("Unable to open requested HTML document: %s"), location.c_str());
m_tmpCanDrawLocks--; m_tmpCanDrawLocks--;
return FALSE; return false;
} }
else else
@ -385,12 +391,14 @@ bool wxHtmlWindow::LoadPage(const wxString& location)
wxList::compatibility_iterator node; wxList::compatibility_iterator node;
wxString src = wxEmptyString; wxString src = wxEmptyString;
#if wxUSE_STATUSBAR
if (m_RelatedStatusBar != -1) if (m_RelatedStatusBar != -1)
{ {
wxString msg = _("Loading : ") + location; wxString msg = _("Loading : ") + location;
m_RelatedFrame->SetStatusText(msg, m_RelatedStatusBar); m_RelatedFrame->SetStatusText(msg, m_RelatedStatusBar);
Refresh(FALSE); Refresh(false);
} }
#endif // wxUSE_STATUSBAR
node = m_Filters.GetFirst(); node = m_Filters.GetFirst();
while (node) while (node)
@ -419,7 +427,10 @@ bool wxHtmlWindow::LoadPage(const wxString& location)
delete f; delete f;
if (m_RelatedStatusBar != -1) m_RelatedFrame->SetStatusText(_("Done"), m_RelatedStatusBar); #if wxUSE_STATUSBAR
if (m_RelatedStatusBar != -1)
m_RelatedFrame->SetStatusText(_("Done"), m_RelatedStatusBar);
#endif // wxUSE_STATUSBAR
} }
} }
@ -1118,6 +1129,7 @@ void wxHtmlWindow::OnInternalIdle()
if (lnk != m_tmpLastLink) if (lnk != m_tmpLastLink)
{ {
#if wxUSE_STATUSBAR
if (lnk == NULL) if (lnk == NULL)
{ {
if (m_RelatedStatusBar != -1) if (m_RelatedStatusBar != -1)
@ -1130,6 +1142,7 @@ void wxHtmlWindow::OnInternalIdle()
m_RelatedFrame->SetStatusText(lnk->GetHref(), m_RelatedFrame->SetStatusText(lnk->GetHref(),
m_RelatedStatusBar); m_RelatedStatusBar);
} }
#endif // wxUSE_STATUSBAR
m_tmpLastLink = lnk; m_tmpLastLink = lnk;
} }

View File

@ -234,7 +234,9 @@ wxMDIParentFrame::~wxMDIParentFrame()
#if wxUSE_TOOLBAR #if wxUSE_TOOLBAR
m_frameToolBar = NULL; m_frameToolBar = NULL;
#endif #endif
#if wxUSE_STATUSBAR
m_frameStatusBar = NULL; m_frameStatusBar = NULL;
#endif // wxUSE_STATUSBAR
DestroyChildren(); DestroyChildren();
@ -732,7 +734,9 @@ wxMDIChildFrame::~wxMDIChildFrame()
#if wxUSE_TOOLBAR #if wxUSE_TOOLBAR
m_frameToolBar = NULL; m_frameToolBar = NULL;
#endif #endif
#if wxUSE_STATUSBAR
m_frameStatusBar = NULL; m_frameStatusBar = NULL;
#endif // wxUSE_STATUSBAR
DestroyChildren(); DestroyChildren();
@ -759,12 +763,14 @@ void wxMDIChildFrame::DoSetClientSize(int width, int height)
int actual_width = rect2.right - rect2.left - rect.right + width; int actual_width = rect2.right - rect2.left - rect.right + width;
int actual_height = rect2.bottom - rect2.top - rect.bottom + height; int actual_height = rect2.bottom - rect2.top - rect.bottom + height;
#if wxUSE_STATUSBAR
if (GetStatusBar() && GetStatusBar()->IsShown()) if (GetStatusBar() && GetStatusBar()->IsShown())
{ {
int sx, sy; int sx, sy;
GetStatusBar()->GetSize(&sx, &sy); GetStatusBar()->GetSize(&sx, &sy);
actual_height += sy; actual_height += sy;
} }
#endif // wxUSE_STATUSBAR
POINT point; POINT point;
point.x = rect2.left; point.x = rect2.left;

View File

@ -259,7 +259,9 @@ void wxFrame::DoSetClientSize(int width, int height)
#if wxUSE_TOOLBAR #if wxUSE_TOOLBAR
if ( m_frameToolBar ) if ( m_frameToolBar )
{ {
#if wxUSE_STATUSBAR
height += m_frameStatusBar->GetSize().y; height += m_frameStatusBar->GetSize().y;
#endif // wxUSE_STATUSBAR
if ( m_frameToolBar->GetWindowStyleFlag() & wxTB_VERTICAL ) if ( m_frameToolBar->GetWindowStyleFlag() & wxTB_VERTICAL )
width += m_frameToolBar->GetSize().x; width += m_frameToolBar->GetSize().x;

View File

@ -311,7 +311,9 @@ bool MyApp::OnInit()
// Create the main frame window // Create the main frame window
frame = new MyFrame(NULL, wxID_ANY, _T("Tex2RTF"), wxDefaultPosition, wxSize(400, 300)); frame = new MyFrame(NULL, wxID_ANY, _T("Tex2RTF"), wxDefaultPosition, wxSize(400, 300));
#if wxUSE_STATUSBAR
frame->CreateStatusBar(2); frame->CreateStatusBar(2);
#endif // wxUSE_STATUSBAR
// Give it an icon // Give it an icon
// TODO: uncomment this when we have tex2rtf.xpm // TODO: uncomment this when we have tex2rtf.xpm
@ -391,16 +393,26 @@ bool MyApp::OnInit()
if (path != _T("")) if (path != _T(""))
ReadCustomMacros((wxChar *)path.c_str()); ReadCustomMacros((wxChar *)path.c_str());
#if wxUSE_STATUSBAR
wxStrcpy(buf, _T("In ")); wxStrcpy(buf, _T("In "));
switch (convertMode)
if (winHelp && (convertMode == TEX_RTF)) {
wxStrcat(buf, _T("WinHelp RTF")); case TEX_RTF:
else if (!winHelp && (convertMode == TEX_RTF)) wxStrcat(buf, (winHelp) ? _T("WinHelp RTF"), _T("linear RTF"));
wxStrcat(buf, _T("linear RTF")); break;
else if (convertMode == TEX_HTML) wxStrcat(buf, _T("HTML")); case TEX_HTML:
else if (convertMode == TEX_XLP) wxStrcat(buf, _T("XLP")); wxStrcat(buf, _T("HTML"));
wxStrcat(buf, _T(" mode.")); break;
case TEX_XLP:
wxStrcat(buf, _T("XLP"));
break;
default:
wxStrcat(buf, _T("unknown"));
break;
}
wxStrcat(buf, _T(" mode."));
frame->SetStatusText(buf, 1); frame->SetStatusText(buf, 1);
#endif // wxUSE_STATUSBAR
frame->Show(true); frame->Show(true);
return true; return true;
@ -649,7 +661,9 @@ void MyFrame::OnGo(wxCommandEvent& WXUNUSED(event))
if (stopRunning) if (stopRunning)
{ {
#if wxUSE_STATUSBAR
SetStatusText(_T("Build aborted!")); SetStatusText(_T("Build aborted!"));
#endif // wxUSE_STATUSBAR
wxString errBuf; wxString errBuf;
errBuf.Printf(_T("\nErrors encountered during this pass: %lu\n"), errorCount); errBuf.Printf(_T("\nErrors encountered during this pass: %lu\n"), errorCount);
OnInform((wxChar *)errBuf.c_str()); OnInform((wxChar *)errBuf.c_str());
@ -683,9 +697,11 @@ void MyFrame::OnSaveFile(wxCommandEvent& WXUNUSED(event))
if (s != _T("")) if (s != _T(""))
{ {
textWindow->SaveFile(s); textWindow->SaveFile(s);
#if wxUSE_STATUSBAR
wxChar buf[350]; wxChar buf[350];
wxSnprintf(buf, sizeof(buf), _T("Saved text to %s"), (const wxChar*) s.c_str()); wxSnprintf(buf, sizeof(buf), _T("Saved text to %s"), (const wxChar*) s.c_str());
frame->SetStatusText(buf, 0); frame->SetStatusText(buf, 0);
#endif // wxUSE_STATUSBAR
} }
} }
@ -740,7 +756,9 @@ void MyFrame::OnModeRTF(wxCommandEvent& WXUNUSED(event))
winHelp = false; winHelp = false;
InputFile = NULL; InputFile = NULL;
OutputFile = NULL; OutputFile = NULL;
#if wxUSE_STATUSBAR
SetStatusText(_T("In linear RTF mode."), 1); SetStatusText(_T("In linear RTF mode."), 1);
#endif // wxUSE_STATUSBAR
} }
void MyFrame::OnModeWinHelp(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnModeWinHelp(wxCommandEvent& WXUNUSED(event))
@ -749,7 +767,9 @@ void MyFrame::OnModeWinHelp(wxCommandEvent& WXUNUSED(event))
winHelp = true; winHelp = true;
InputFile = NULL; InputFile = NULL;
OutputFile = NULL; OutputFile = NULL;
#if wxUSE_STATUSBAR
SetStatusText(_T("In WinHelp RTF mode."), 1); SetStatusText(_T("In WinHelp RTF mode."), 1);
#endif // wxUSE_STATUSBAR
} }
void MyFrame::OnModeHTML(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnModeHTML(wxCommandEvent& WXUNUSED(event))
@ -758,7 +778,9 @@ void MyFrame::OnModeHTML(wxCommandEvent& WXUNUSED(event))
winHelp = false; winHelp = false;
InputFile = NULL; InputFile = NULL;
OutputFile = NULL; OutputFile = NULL;
#if wxUSE_STATUSBAR
SetStatusText(_T("In HTML mode."), 1); SetStatusText(_T("In HTML mode."), 1);
#endif // wxUSE_STATUSBAR
} }
void MyFrame::OnModeXLP(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnModeXLP(wxCommandEvent& WXUNUSED(event))
@ -766,12 +788,15 @@ void MyFrame::OnModeXLP(wxCommandEvent& WXUNUSED(event))
convertMode = TEX_XLP; convertMode = TEX_XLP;
InputFile = NULL; InputFile = NULL;
OutputFile = NULL; OutputFile = NULL;
#if wxUSE_STATUSBAR
SetStatusText(_T("In XLP mode."), 1); SetStatusText(_T("In XLP mode."), 1);
#endif // wxUSE_STATUSBAR
} }
void MyFrame::OnOptionsCurleyBrace(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnOptionsCurleyBrace(wxCommandEvent& WXUNUSED(event))
{ {
checkCurleyBraces = !checkCurleyBraces; checkCurleyBraces = !checkCurleyBraces;
#if wxUSE_STATUSBAR
if (checkCurleyBraces) if (checkCurleyBraces)
{ {
SetStatusText(_T("Checking curley braces: YES"), 1); SetStatusText(_T("Checking curley braces: YES"), 1);
@ -780,12 +805,14 @@ void MyFrame::OnOptionsCurleyBrace(wxCommandEvent& WXUNUSED(event))
{ {
SetStatusText(_T("Checking curley braces: NO"), 1); SetStatusText(_T("Checking curley braces: NO"), 1);
} }
#endif // wxUSE_STATUSBAR
} }
void MyFrame::OnOptionsSyntaxChecking(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnOptionsSyntaxChecking(wxCommandEvent& WXUNUSED(event))
{ {
checkSyntax = !checkSyntax; checkSyntax = !checkSyntax;
#if wxUSE_STATUSBAR
if (checkSyntax) if (checkSyntax)
{ {
SetStatusText(_T("Checking syntax: YES"), 1); SetStatusText(_T("Checking syntax: YES"), 1);
@ -794,6 +821,7 @@ void MyFrame::OnOptionsSyntaxChecking(wxCommandEvent& WXUNUSED(event))
{ {
SetStatusText(_T("Checking syntax: NO"), 1); SetStatusText(_T("Checking syntax: NO"), 1);
} }
#endif // wxUSE_STATUSBAR
} }
@ -955,7 +983,7 @@ bool Go(void)
TexCleanUp(); TexCleanUp();
return false; return false;
} }
#ifndef NO_GUI #if !defined(NO_GUI) && wxUSE_STATUSBAR
if (isInteractive) if (isInteractive)
{ {
wxString buf; wxString buf;
@ -1018,11 +1046,13 @@ bool Go(void)
OnInform((wxChar *)buf.c_str()); OnInform((wxChar *)buf.c_str());
} }
#if wxUSE_STATUSBAR
if (isInteractive) if (isInteractive)
{ {
buf.Printf(_T("Done, %d %s."), passNumber, (passNumber > 1) ? _T("passes") : _T("pass")); buf.Printf(_T("Done, %d %s."), passNumber, (passNumber > 1) ? _T("passes") : _T("pass"));
frame->SetStatusText((wxChar *)buf.c_str()); frame->SetStatusText((wxChar *)buf.c_str());
} }
#endif // wxUSE_STATUSBAR
#else #else
buf.Printf(_T("Done, %d %s."), passNumber, (passNumber > 1) ? _T("passes") : _T("pass")); buf.Printf(_T("Done, %d %s."), passNumber, (passNumber > 1) ? _T("passes") : _T("pass"));
OnInform((wxChar *)buf.c_str()); OnInform((wxChar *)buf.c_str());
@ -1041,7 +1071,7 @@ bool Go(void)
TexCleanUp(); TexCleanUp();
startedSections = false; startedSections = false;
#ifndef NO_GUI #if !defined(NO_GUI) && wxUSE_STATUSBAR
frame->SetStatusText(_T("Aborted by user.")); frame->SetStatusText(_T("Aborted by user."));
#endif // GUI #endif // GUI
@ -1276,7 +1306,7 @@ bool Tex2RTFConnection::OnExecute(const wxString& WXUNUSED(topic), wxChar *data,
{ {
// Try for a setting // Try for a setting
wxStrcpy(Tex2RTFLastStatus, RegisterSetting(firstArg, secondArg, false)); wxStrcpy(Tex2RTFLastStatus, RegisterSetting(firstArg, secondArg, false));
#ifndef NO_GUI #if !defined(NO_GUI) && wxUSE_STATUSBAR
if (frame && wxStrcmp(firstArg, _T("conversionMode")) == 0) if (frame && wxStrcmp(firstArg, _T("conversionMode")) == 0)
{ {
wxChar buf[100]; wxChar buf[100];