menu_bar->Append(file_menu, _("&File"));
menu_bar->Append(help_menu, _("&Help"));
frame->SetMenuBar(menu_bar);
+#if wxUSE_STATUSBAR
frame->CreateStatusBar(1);
Temp0.Printf(_("%s has started !"),p_ProgramCfg->GetAppName().c_str());
frame->SetStatusText(Temp0, 0);
+#endif // wxUSE_STATUSBAR
//---------------------------------------------------------------------------------------
int width, height;
frame->GetClientSize(&width, &height);
{ // BrowserDB::OnGetNext Formats the field Value into tablename
SetCellValue(z, y,((db_Br+i_Which)->cl_BrowserDB+y)->tableName);
}
+#if wxUSE_STATUSBAR
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);
pDoc->p_MainFrame->SetStatusText(Temp0, 0);
}
+#endif // wxUSE_STATUSBAR
} // 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());
wxLogMessage(Temp0);
+#if wxUSE_STATUSBAR
pDoc->p_MainFrame->SetStatusText(Temp0, 0);
+#endif // wxUSE_STATUSBAR
// The Grid has been filled, now leave
goto Weiter;
} // if ((ct_BrowserDB->pTableInf+x)->pColInf)
z++;
// 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);
pDoc->p_MainFrame->SetStatusText(Temp0, 0);
+#endif // wxUSE_STATUSBAR
}
wxYield();
} // if ((ct_BrowserDB->pTableInf+x)->tableType == "TABLE" or VIEW)
wxEndBusyCursor();
Temp0.Printf(_("-I-> DBTree::OnPopulate() - %6d Tables have been read. - Time needed : %ld ms"),z,sw.Time());
wxLogMessage(Temp0);
+#if wxUSE_STATUSBAR
pDoc->p_MainFrame->SetStatusText(Temp0, 0);
+#endif // wxUSE_STATUSBAR
} // if((pDoc->db_Br+i_Which)->Initialize(false))
else
{
{
int i;
Temp0.Empty();
+#if wxUSE_STATUSBAR
pDoc->p_MainFrame->SetStatusText(Temp0,0);
+#endif // wxUSE_STATUSBAR
// Get the Information that we need
wxTreeItemId itemId = GetSelection();
DBTreeData *item = (DBTreeData *)GetItemData(itemId);
// return false;
OnInitODBC();
//---------------------------------------------------------------------------------------
+#if wxUSE_STATUSBAR
Temp0.Printf(_("-I-> MainDoc::OnInitView() - End - %d DSN's found"),i_DSN);
p_MainFrame->SetStatusText(Temp0, 0);
wxLogMessage(Temp0);
+#endif // wxUSE_STATUSBAR
return true;
}
{
int i;
Temp0.Empty(); Temp1.Empty();
+#if wxUSE_STATUSBAR
pDoc->p_MainFrame->SetStatusText(Temp0,0);
+#endif // wxUSE_STATUSBAR
// Get the Information that we need
wxTreeItemId itemId = GetSelection();
TreeData *item = (TreeData *)GetItemData(itemId);
SetSizer( topsizer );
topsizer->SetSizeHints( this );
+#if wxUSE_STATUSBAR
CreateStatusBar();
+#endif // wxUSE_STATUSBAR
}
FortyFrame::~FortyFrame()
toolBar->Realize();
toolBar->EnableTool(ID_STOP, false); // must be after Realize() !
+#if wxUSE_STATUSBAR
// status bar
CreateStatusBar(2);
SetStatusText(_("Welcome to Life!"));
+#endif // wxUSE_STATUSBAR
// game and timer
m_life = new Life();
wxInt32 i = XToCell( event.GetX() );
wxInt32 j = YToCell( event.GetY() );
+#if wxUSE_STATUSBAR
// set statusbar text
wxString msg;
msg.Printf(_("Cell: (%d, %d)"), i, j);
((LifeFrame *) wxGetApp().GetTopWindow())->SetStatusText(msg, 1);
+#endif // wxUSE_STATUSBAR
// NOTE that wxMouseEvent::LeftDown() and wxMouseEvent::LeftIsDown()
// have different semantics. The first one is used to signal that the
void SetRelatedFrame(wxFrame* frame, const wxString& format);
wxFrame* GetRelatedFrame() const {return m_RelatedFrame;}
+#if wxUSE_STATUSBAR
// After(!) calling SetRelatedFrame, this sets statusbar slot where messages
// will be displayed. Default is -1 = no messages.
void SetRelatedStatusBar(int bar);
+#endif // wxUSE_STATUSBAR
// Sets fonts to be used when displaying HTML page.
void SetFonts(wxString normal_face, wxString fixed_face,
wxFrame *m_RelatedFrame;
wxString m_TitleFormat;
+#if wxUSE_STATUSBAR
// frame in which page title should be displayed & number of it's statusbar
// reserved for usage with this html window
int m_RelatedStatusBar;
+#endif // wxUSE_STATUSBAR
// borders (free space between text and window borders)
// defaults to 10 pixels.
wxFrame( (wxFrame *) NULL, wxID_ANY, _T("wxLayout"),
wxDefaultPosition, wxDefaultSize )
{
+#if wxUSE_STATUSBAR
CreateStatusBar( 2 );
-
SetStatusText( _T("wxLayout by Karsten Ballüder.") );
+#endif // wxUSE_STATUSBAR
wxMenuBar *menu_bar = new wxMenuBar();
SetMenuBar( menu_bar );
m_lwin = new wxLayoutWindow(this);
+#if wxUSE_STATUSBAR
m_lwin->SetStatusBar(GetStatusBar(), 0, 1);
+#endif // wxUSE_STATUSBAR
m_lwin->SetMouseTracking(true);
m_lwin->SetEditable(true);
m_lwin->SetWrapMargin(40);
wxWANTS_CHARS),
m_llist(NULL)
{
+#if wxUSE_STATUSBAR
SetStatusBar(NULL); // don't use statusbar
+#endif // wxUSE_STATUSBAR
m_Editable = false;
m_doSendEvents = false;
m_ViewStartX = 0; m_ViewStartY = 0;
// this variables is used to only erase the message in the status
// bar if we had put it there previously - otherwise empting status
// bar might be undesirable
+#if wxUSE_STATUSBAR
static bool s_hasPutMessageInStatusBar = false;
+#endif // wxUSE_STATUSBAR
// found is only true if we are really over an object, not just
// behind it
if(!m_HandCursor)
SetCursor(wxCURSOR_HAND);
m_HandCursor = true;
+#if wxUSE_STATUSBAR
if(m_StatusBar && m_StatusFieldLabel != -1)
{
const wxString &label = u->GetLabel();
if(label.Length())
{
- m_StatusBar->SetStatusText(label,
- m_StatusFieldLabel);
+ m_StatusBar->SetStatusText(label,m_StatusFieldLabel);
s_hasPutMessageInStatusBar = true;
}
}
+#endif // wxUSE_STATUSBAR
}
else
{
if(m_HandCursor)
SetCursor(wxCURSOR_IBEAM);
m_HandCursor = false;
+#if wxUSE_STATUSBAR
if( m_StatusBar && m_StatusFieldLabel != -1 &&
s_hasPutMessageInStatusBar )
{
m_StatusBar->SetStatusText(wxEmptyString, m_StatusFieldLabel);
}
+#endif // wxUSE_STATUSBAR
}
}
ResetDirty();
+#if wxUSE_STATUSBAR
if ( m_StatusBar && m_StatusFieldCursor != -1 )
{
static wxPoint s_oldCursorPos(-1, -1);
m_StatusBar->SetStatusText(label, m_StatusFieldCursor);
}
}
+#endif // wxUSE_STATUSBAR
WXLO_TIMER_PRINT(LayoutTimer);
WXLO_TIMER_PRINT(BlitTimer);
/// Redraws the window, used by RequestUpdate() or OnPaint().
void InternalPaint(const wxRect *updateRect);
+#if wxUSE_STATUSBAR
/** Tell window to update a wxStatusBar with UserData labels and
cursor positions.
@param bar wxStatusBar pointer
m_StatusBar = bar; m_StatusFieldLabel = labelfield;
m_StatusFieldCursor = cursorfield;
}
+#endif // wxUSE_STATUSBAR
#ifndef __WXMSW__
/// Enable or disable focus follow mode under non-MSW
wxBitmap *m_bitmap;
wxPoint m_bitmapSize;
+#if wxUSE_STATUSBAR
/// A frame's statusbar to update
class wxStatusBar *m_StatusBar;
+#endif // wxUSE_STATUSBAR
/// statusbar field for labels
int m_StatusFieldLabel;
// but may be the MDI frame does?
m_pMDIParentFrame->OnMenuHighlight(event);
}
+#else
+ wxUnusedVar(event);
#endif // wxUSE_STATUSBAR
}
int notebook_page = 0;
+#if wxUSE_STATUSBAR
CreateStatusBar();
+#endif // wxUSE_STATUSBAR
#if wxUSE_TOOLBAR
// toolbar?
}
m_HtmlWin->SetRelatedFrame(this, m_TitleFormat);
+#if wxUSE_STATUSBAR
m_HtmlWin->SetRelatedStatusBar(0);
+#endif // wxUSE_STATUSBAR
if ( m_Config )
m_HtmlWin->ReadCustomization(m_Config, m_ConfigRoot);
m_tmpLastCell = NULL;
m_tmpCanDrawLocks = 0;
m_FS = new wxFileSystem();
+#if wxUSE_STATUSBAR
m_RelatedStatusBar = -1;
+#endif // wxUSE_STATUSBAR
m_RelatedFrame = NULL;
m_TitleFormat = wxT("%s");
m_OpenedPage = m_OpenedAnchor = m_OpenedPageTitle = wxEmptyString;
+#if wxUSE_STATUSBAR
void wxHtmlWindow::SetRelatedStatusBar(int bar)
{
m_RelatedStatusBar = bar;
}
+#endif // wxUSE_STATUSBAR
else
{
- needs_refresh = TRUE;
+ needs_refresh = true;
+#if wxUSE_STATUSBAR
// load&display it:
if (m_RelatedStatusBar != -1)
{
m_RelatedFrame->SetStatusText(_("Connecting..."), m_RelatedStatusBar);
- Refresh(FALSE);
+ Refresh(false);
}
+#endif // wxUSE_STATUSBAR
f = m_Parser->OpenURL(wxHTML_URL_PAGE, location);
{
wxLogError(_("Unable to open requested HTML document: %s"), location.c_str());
m_tmpCanDrawLocks--;
- return FALSE;
+ return false;
}
else
wxList::compatibility_iterator node;
wxString src = wxEmptyString;
+#if wxUSE_STATUSBAR
if (m_RelatedStatusBar != -1)
{
wxString msg = _("Loading : ") + location;
m_RelatedFrame->SetStatusText(msg, m_RelatedStatusBar);
- Refresh(FALSE);
+ Refresh(false);
}
+#endif // wxUSE_STATUSBAR
node = m_Filters.GetFirst();
while (node)
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
}
}
if (lnk != m_tmpLastLink)
{
+#if wxUSE_STATUSBAR
if (lnk == NULL)
{
if (m_RelatedStatusBar != -1)
m_RelatedFrame->SetStatusText(lnk->GetHref(),
m_RelatedStatusBar);
}
+#endif // wxUSE_STATUSBAR
m_tmpLastLink = lnk;
}
#if wxUSE_TOOLBAR
m_frameToolBar = NULL;
#endif
+#if wxUSE_STATUSBAR
m_frameStatusBar = NULL;
+#endif // wxUSE_STATUSBAR
DestroyChildren();
#if wxUSE_TOOLBAR
m_frameToolBar = NULL;
#endif
+#if wxUSE_STATUSBAR
m_frameStatusBar = NULL;
+#endif // wxUSE_STATUSBAR
DestroyChildren();
int actual_width = rect2.right - rect2.left - rect.right + width;
int actual_height = rect2.bottom - rect2.top - rect.bottom + height;
+#if wxUSE_STATUSBAR
if (GetStatusBar() && GetStatusBar()->IsShown())
{
int sx, sy;
GetStatusBar()->GetSize(&sx, &sy);
actual_height += sy;
}
+#endif // wxUSE_STATUSBAR
POINT point;
point.x = rect2.left;
#if wxUSE_TOOLBAR
if ( m_frameToolBar )
{
+#if wxUSE_STATUSBAR
height += m_frameStatusBar->GetSize().y;
+#endif // wxUSE_STATUSBAR
if ( m_frameToolBar->GetWindowStyleFlag() & wxTB_VERTICAL )
width += m_frameToolBar->GetSize().x;
// Create the main frame window
frame = new MyFrame(NULL, wxID_ANY, _T("Tex2RTF"), wxDefaultPosition, wxSize(400, 300));
+#if wxUSE_STATUSBAR
frame->CreateStatusBar(2);
+#endif // wxUSE_STATUSBAR
// Give it an icon
// TODO: uncomment this when we have tex2rtf.xpm
if (path != _T(""))
ReadCustomMacros((wxChar *)path.c_str());
+#if wxUSE_STATUSBAR
wxStrcpy(buf, _T("In "));
-
- if (winHelp && (convertMode == TEX_RTF))
- wxStrcat(buf, _T("WinHelp RTF"));
- else if (!winHelp && (convertMode == TEX_RTF))
- wxStrcat(buf, _T("linear RTF"));
- else if (convertMode == TEX_HTML) wxStrcat(buf, _T("HTML"));
- else if (convertMode == TEX_XLP) wxStrcat(buf, _T("XLP"));
- wxStrcat(buf, _T(" mode."));
+ switch (convertMode)
+ {
+ case TEX_RTF:
+ wxStrcat(buf, (winHelp) ? _T("WinHelp RTF"), _T("linear RTF"));
+ break;
+ case TEX_HTML:
+ wxStrcat(buf, _T("HTML"));
+ break;
+ case TEX_XLP:
+ wxStrcat(buf, _T("XLP"));
+ break;
+ default:
+ wxStrcat(buf, _T("unknown"));
+ break;
+ }
+ wxStrcat(buf, _T(" mode."));
frame->SetStatusText(buf, 1);
+#endif // wxUSE_STATUSBAR
frame->Show(true);
return true;
if (stopRunning)
{
+#if wxUSE_STATUSBAR
SetStatusText(_T("Build aborted!"));
+#endif // wxUSE_STATUSBAR
wxString errBuf;
errBuf.Printf(_T("\nErrors encountered during this pass: %lu\n"), errorCount);
OnInform((wxChar *)errBuf.c_str());
if (s != _T(""))
{
textWindow->SaveFile(s);
+#if wxUSE_STATUSBAR
wxChar buf[350];
wxSnprintf(buf, sizeof(buf), _T("Saved text to %s"), (const wxChar*) s.c_str());
frame->SetStatusText(buf, 0);
+#endif // wxUSE_STATUSBAR
}
}
winHelp = false;
InputFile = NULL;
OutputFile = NULL;
+#if wxUSE_STATUSBAR
SetStatusText(_T("In linear RTF mode."), 1);
+#endif // wxUSE_STATUSBAR
}
void MyFrame::OnModeWinHelp(wxCommandEvent& WXUNUSED(event))
winHelp = true;
InputFile = NULL;
OutputFile = NULL;
+#if wxUSE_STATUSBAR
SetStatusText(_T("In WinHelp RTF mode."), 1);
+#endif // wxUSE_STATUSBAR
}
void MyFrame::OnModeHTML(wxCommandEvent& WXUNUSED(event))
winHelp = false;
InputFile = NULL;
OutputFile = NULL;
+#if wxUSE_STATUSBAR
SetStatusText(_T("In HTML mode."), 1);
+#endif // wxUSE_STATUSBAR
}
void MyFrame::OnModeXLP(wxCommandEvent& WXUNUSED(event))
convertMode = TEX_XLP;
InputFile = NULL;
OutputFile = NULL;
+#if wxUSE_STATUSBAR
SetStatusText(_T("In XLP mode."), 1);
+#endif // wxUSE_STATUSBAR
}
void MyFrame::OnOptionsCurleyBrace(wxCommandEvent& WXUNUSED(event))
{
checkCurleyBraces = !checkCurleyBraces;
+#if wxUSE_STATUSBAR
if (checkCurleyBraces)
{
SetStatusText(_T("Checking curley braces: YES"), 1);
{
SetStatusText(_T("Checking curley braces: NO"), 1);
}
+#endif // wxUSE_STATUSBAR
}
void MyFrame::OnOptionsSyntaxChecking(wxCommandEvent& WXUNUSED(event))
{
checkSyntax = !checkSyntax;
+#if wxUSE_STATUSBAR
if (checkSyntax)
{
SetStatusText(_T("Checking syntax: YES"), 1);
{
SetStatusText(_T("Checking syntax: NO"), 1);
}
+#endif // wxUSE_STATUSBAR
}
TexCleanUp();
return false;
}
-#ifndef NO_GUI
+#if !defined(NO_GUI) && wxUSE_STATUSBAR
if (isInteractive)
{
wxString buf;
OnInform((wxChar *)buf.c_str());
}
+#if wxUSE_STATUSBAR
if (isInteractive)
{
buf.Printf(_T("Done, %d %s."), passNumber, (passNumber > 1) ? _T("passes") : _T("pass"));
frame->SetStatusText((wxChar *)buf.c_str());
}
+#endif // wxUSE_STATUSBAR
#else
buf.Printf(_T("Done, %d %s."), passNumber, (passNumber > 1) ? _T("passes") : _T("pass"));
OnInform((wxChar *)buf.c_str());
TexCleanUp();
startedSections = false;
-#ifndef NO_GUI
+#if !defined(NO_GUI) && wxUSE_STATUSBAR
frame->SetStatusText(_T("Aborted by user."));
#endif // GUI
{
// Try for a setting
wxStrcpy(Tex2RTFLastStatus, RegisterSetting(firstArg, secondArg, false));
-#ifndef NO_GUI
+#if !defined(NO_GUI) && wxUSE_STATUSBAR
if (frame && wxStrcmp(firstArg, _T("conversionMode")) == 0)
{
wxChar buf[100];