| 243 | } |
| 244 | |
| 245 | void OnMenuClick(wxCommandEvent &evt) { |
| 246 | // This also gets clicks on unrelated things such as the toolbar, so |
| 247 | // the window ID ranges really need to be unique |
| 248 | size_t id = static_cast<size_t>(evt.GetId() - id_base); |
| 249 | if (id < items.size() && context) |
| 250 | cmd::call(items[id], context); |
| 251 | |
| 252 | #ifdef __WXMAC__ |
| 253 | else { |
| 254 | switch (evt.GetId()) { |
| 255 | case wxID_ABOUT: |
| 256 | cmd::call("app/about", context); |
| 257 | break; |
| 258 | case wxID_PREFERENCES: |
| 259 | cmd::call("app/options", context); |
| 260 | break; |
| 261 | case wxID_EXIT: |
| 262 | cmd::call("app/exit", context); |
| 263 | break; |
| 264 | default: |
| 265 | break; |
| 266 | } |
| 267 | } |
| 268 | #endif |
| 269 | } |