WxUpdateUIEvent class
| UpdateUI event is sent in idle time to update menus and toolbars. |
|---|
| void bindUpdateUIEvent( OnUpdateUIEventFunc ) |
| void unbindUpdateUIEvent() |
Intercept this event and call check if a e.g. toolbar item needs to be checked.
// Somewhere in your frame
final colormenu = WxMenu();
colormenu.appendRadioItem( idLightMode, "Light mode\tCtrl-D", help: "Can you see the light today?" );
colormenu.appendRadioItem( idDarkMode, "Dark mode\tCtrl-D", help: "See you on the dark side!" );
// Somewhere else in your frame
final toolbar = createToolBar( style: wxTB_FLAT|wxTB_TEXT );
toolbar.addRadioTool( idLightMode, "Light", WxBitmapBundle.fromMaterialIcon(WxMaterialIcon.light_mode, WxSize(32,32) ), null, shortHelp: "Light mode" );
toolbar.addRadioTool( idDarkMode, "Dark", WxBitmapBundle.fromMaterialIcon(WxMaterialIcon.dark_mode, WxSize(32,32) ), null, shortHelp: "Dark mode" );
// catch the event and update toolbar and menu
bindUpdateUIEvent( (event) {
switch (event.getId()) {
case idDarkMode: event.check( wxTheApp.isDark() ); return;
case idLightMode: event.check( !wxTheApp.isDark() ); return;
}
}, -1 );
- Inheritance
-
- Object
- WxClass
- WxObject
- WxEvent
- WxCommandEvent
- WxUpdateUIEvent
Constructors
- WxUpdateUIEvent({int id = 0})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
check(
bool check) → void - Call this to indicate that the UI element should be checked
-
dispose(
) → void -
Destroys the C++ wxObject instance in wxDart Native
inherited
-
enable(
bool enable) → void - Call this to indicate that the UI element should be enabled
-
get3StateValue(
) → int -
getChecked(
) → bool -
getClientData(
) → dynamic -
Retrieves client data, typically associated with an item
using WxItemContainer.setClientData inherited by WxListBox
WxChoice, WxComboBox and WxRadioBox
inherited
-
getEnabled(
) → bool -
getEventObject(
) → WxObject? -
Gets the object from which the event originates
inherited
-
getEventType(
) → int -
inherited
-
getExtraLong(
) → int -
Some other integer value,
inherited
-
getId(
) → int -
inherited
-
getInt(
) → int -
Sets integer content, usually by the system.
inherited
-
getSelection(
) → int -
Returns index of selected item, e.g. from a WxChoice
inherited
-
getSetChecked(
) → bool -
getSetEnabled(
) → bool -
getSetShown(
) → bool -
getSetText(
) → bool -
getShown(
) → bool -
getSkipped(
) → bool -
True if event should be handled as not yet handled
inherited
-
getString(
) → String -
Get sting content. Could be the text of a WxTextCtrl or the
selected entry in a WxListBox
inherited
-
getText(
) → String -
is3State(
) → bool -
isCheckable(
) → bool -
isChecked(
) → bool -
Returns true if item was checked, e.g. from a WxCheckBox
inherited
-
isSelection(
) → bool -
If this is a selection event not deselection, from controls
allow multiple item to be selected and unselected
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
printName(
) → void -
Prints the name of the Dart class in wxDart Flutter and the
name of the C++ class in wxDart Native
inherited
-
set3StateValue(
int check) → void - Call this to indicate that the UI element should have this 3-state checkbox state
-
setClientData(
dynamic data) → void -
Set client data associated with the event
inherited
-
setEventObject(
WxObject object) → void -
Sets the object from which the event originates
inherited
-
setEventType(
int type) → void -
inherited
-
setExtraLong(
int extraLong) → void -
Some other integer value,
inherited
-
setId(
int id) → void -
inherited
-
setInt(
int intCommand) → void -
Returns an integer value. Could be selection index.
inherited
-
setString(
String text) → void -
Sets string content, usually by the system.
inherited
-
setText(
String text) → void - Call this to indicate that the UI element should have this text
-
show(
bool show) → void - Call this to indicate that the UI element should be shown
-
skip(
{bool skip = true}) → void -
Marks the event as unread so that other event handler can
handle this event again
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited