Enable/disable the toolbar buttons
| 76 | |
| 77 | /// Enable/disable the toolbar buttons |
| 78 | void OnIdle(wxIdleEvent &) { |
| 79 | for (size_t i = 0; i < commands.size(); ++i) { |
| 80 | if (commands[i]->Type() & cmd::COMMAND_VALIDATE) |
| 81 | EnableTool(TOOL_ID_BASE + i, commands[i]->Validate(context)); |
| 82 | if (commands[i]->Type() & cmd::COMMAND_TOGGLE || commands[i]->Type() & cmd::COMMAND_RADIO) |
| 83 | ToggleTool(TOOL_ID_BASE + i, commands[i]->IsActive(context)); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | /// Toolbar button click handler |
| 88 | void OnClick(wxCommandEvent &evt) { |