back to gui
wxStatusBar
generated from ../src/mod_gui/control/statbar.cpp
A status bar is a narrow window that can be placed along the bottom of a frame
to give small amounts of status information. It can contain one or more fields,
one or more of which can be variable length according to the size of the window
The example shows a frame with a statusbar that contains a wxBitmapButton.
When you click the button the bitmap is changed.
wxTheApp.onInit = init;
function init()
{
wxImage.addHandler(new wxGIFHandler());
var frame = new wxFrame(null, -1, "A Statusbar Example");
var statusbar = frame.createStatusBar(2);
statusbar.bitmapOn = new wxBitmap("green.gif", wxBitmapType.GIF);
statusbar.bitmapOff = new wxBitmap("red.gif", wxBitmapType.GIF);
statusbar.sw = true;
statusbar.button = new wxBitmapButton(statusbar, 1, statusbar.bitmapOn);
statusbar.button.onClicked = switched;
frame.visible = true;
topWindow = frame;
return true;
}
function switched()
{
sw = ! sw;
if ( sw )
bitmapLabel = bitmapOn;
else
bitmapLabel = bitmapOff;
refresh();
}
Constants
Styles
| Name |
Description |
| SIZEGRIP |
|
Constructor
wxStatusBar
wxStatusBar()
wxStatusBar(Parent,
Id,
Style = wxStatusBar.SIZEGRIP)
| Name |
Type |
Default |
Description |
| Parent |
wxWindow |
|
The parent of wxStatusBar.
|
| Id |
Integer |
|
An window identifier. Use -1 when you don't need it.
|
| Style |
Integer |
wxStatusBar.SIZEGRIP |
The wxStatusBar style.
|
Constructs a new wxStatusBar object.
Properties
| Name |
Type |
Description |
| fieldsCount |
Integer |
Get/Set the number of fields in the statusbar.
See also setFieldsCount
|
| statusWidths |
Array |
Get/Set the width for each field. At least one element must be -1 (meaning variable width).
See also setStatusWidths
|
Methods
create
create(Parent,
Id,
Style = wxStatusBar.SIZEGRIP) : Boolean
| Name |
Type |
Default |
Description |
| Parent |
wxWindow |
|
The parent of wxStatusBar.
|
| Id |
Integer |
|
An window identifier. Use -1 when you don't need it.
|
| Style |
Integer |
wxStatusBar.SIZEGRIP |
The wxStatusBar style.
|
Constructs a new wxStatusBar object.
getFieldRect
getFieldRect(Field) : wxRect
| Name |
Type |
Default |
Description |
| Field |
Integer |
|
The field of the statusbar.
|
Returns the size and position of a field's internal bounding rectangle
getStatusText
getStatusText(Field = 0) : String
| Name |
Type |
Default |
Description |
| Field |
Integer |
0 |
The field of the statusbar.
|
Gets the status text of the given field
setFieldsCount
setFieldsCount(Count,
Widths = null)
| Name |
Type |
Default |
Description |
| Count |
Integer |
|
The number of fields.
|
| Widths |
Array |
null |
|
Sets the number of fields, and optionally the field widths.
setStatusText
setStatusText(Text,
Field = 0)
| Name |
Type |
Default |
Description |
| Text |
String |
|
The new text for the field.
|
| Field |
Integer |
0 |
The field to change. Default is 0.
|
Sets the text of the field.