Implemented wxStatusBar::Push/PopStatusText.
Implemented wxFrame::Push/PopSTatusText ( just forward to the status bar ). Implemented wxFrame::DoGiveHelp, to show menu/toolbar help in the status bar. Added Get/SetStatusBarPane to get/set the status bar pane the menu/toolbar help will be show in git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15339 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -108,6 +108,8 @@ public:
|
||||
// forward these to status bar
|
||||
virtual void SetStatusText(const wxString &text, int number = 0);
|
||||
virtual void SetStatusWidths(int n, const int widths_field[]);
|
||||
void PushStatusText(const wxString &text, int number = 0);
|
||||
void PopStatusText(int number = 0);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
// toolbar functions
|
||||
@@ -151,6 +153,10 @@ public:
|
||||
{ return FALSE; }
|
||||
#endif // no wxTopLevelWindowNative
|
||||
|
||||
// show help text (typically in the statusbar); show is FALSE
|
||||
// if you are hiding the help, TRUE otherwise
|
||||
virtual void DoGiveHelp(const wxString& text, bool show);
|
||||
|
||||
protected:
|
||||
// the frame main menu/status/tool bars
|
||||
// ------------------------------------
|
||||
@@ -189,6 +195,12 @@ protected:
|
||||
wxStatusBar *m_frameStatusBar;
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
// set the status bar pane the help will be shown in
|
||||
void SetStatusBarPane(int n) { m_statusBarPane = n; }
|
||||
int GetStatusBarPane() const { return m_statusBarPane; }
|
||||
|
||||
int m_statusBarPane;
|
||||
|
||||
#if wxUSE_TOOLBAR
|
||||
// override to update status bar position (or anything else) when
|
||||
// something changes
|
||||
|
@@ -20,6 +20,10 @@
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
|
||||
#include "wx/list.h"
|
||||
|
||||
WX_DECLARE_LIST(wxString, wxListString);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxStatusBar: a window near the bottom of the frame used for status info
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -45,6 +49,9 @@ public:
|
||||
virtual void SetStatusText(const wxString& text, int number = 0) = 0;
|
||||
virtual wxString GetStatusText(int number = 0) const = 0;
|
||||
|
||||
void PushStatusText(const wxString& text, int number = 0);
|
||||
void PopStatusText(int number = 0);
|
||||
|
||||
// fields widths
|
||||
// -------------
|
||||
|
||||
@@ -82,15 +89,28 @@ protected:
|
||||
// reset the widths
|
||||
void ReinitWidths() { FreeWidths(); InitWidths(); }
|
||||
|
||||
// same, for text stacks
|
||||
void InitStacks();
|
||||
void FreeStacks();
|
||||
void ReinitStacks() { FreeStacks(); InitStacks(); }
|
||||
|
||||
// calculate the real field widths for the given total available size
|
||||
wxArrayInt CalculateAbsWidths(wxCoord widthTotal) const;
|
||||
|
||||
// use these functions to access the stacks of field strings
|
||||
wxListString *GetStatusStack(int i) const;
|
||||
wxListString *GetOrCreateStatusStack(int i);
|
||||
|
||||
// the current number of fields
|
||||
int m_nFields;
|
||||
|
||||
// the widths of the fields in pixels if !NULL, all fields have the same
|
||||
// width otherwise
|
||||
int *m_statusWidths;
|
||||
|
||||
// stacks of previous values for PushStatusText/PopStatusText
|
||||
// this is created on demand, use GetStatusStack/GetOrCreateStatusStack
|
||||
wxListString **m_statusTextStacks;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user