Started to lay down the foundation for events. More thorough accelerator string testing.

This commit is contained in:
Pietro Gagliardi 2015-04-21 18:58:29 -04:00
parent ac8e59c004
commit cdbd31c554
2 changed files with 20 additions and 13 deletions

31
test.c
View File

@ -6,26 +6,31 @@
// TODO convert to using the new conversion macros
// TODO why can't these be const?
void noopMenu(void *source, void *data)
{
// do nothing
}
static const uiMenuItem fileMenu[] = {
{ uiMenuItemTypeCommand, "New" },
{ uiMenuItemTypeCommand, "Open" },
{ uiMenuItemTypeQuit, NULL },
{ 0, NULL },
{ uiMenuItemTypeCommand, "New", noopMenu, NULL },
{ uiMenuItemTypeCommand, "Open", noopMenu, NULL },
{ uiMenuItemTypeQuit, NULL, noopMenu, NULL },
{ 0, NULL, NULL, NULL },
};
static const uiMenuItem editMenu[] = {
{ uiMenuItemTypeCommand, "Undo" },
{ uiMenuItemTypeSeparator, NULL },
{ uiMenuItemTypeCheckbox, "Check Me" },
{ uiMenuItemTypeCommand, "A&ccelerator T_est" },
{ uiMenuItemTypePreferences, NULL },
{ 0, NULL },
{ uiMenuItemTypeCommand, "Undo", noopMenu, NULL },
{ uiMenuItemTypeSeparator, NULL, NULL, NULL },
{ uiMenuItemTypeCheckbox, "Check Me", noopMenu, NULL },
{ uiMenuItemTypeCommand, "A&ccelerator T_est\tTest", noopMenu, NULL },
{ uiMenuItemTypePreferences, NULL, noopMenu, NULL },
{ 0, NULL, NULL, NULL },
};
static const uiMenuItem helpMenu[] = {
{ uiMenuItemTypeCommand, "Help" },
{ uiMenuItemTypeAbout, NULL },
{ 0, NULL },
{ uiMenuItemTypeCommand, "Help", noopMenu, NULL },
{ uiMenuItemTypeAbout, NULL, noopMenu, NULL },
{ 0, NULL, NULL, NULL },
};
static uiMenu menu[] = {

2
ui.idl
View File

@ -145,6 +145,8 @@ struct Menu {
struct MenuItem {
field Type MenuItemType;
field Name *const char;
field OnClicked *func(sender *void, data *void);
field OnClickedData *void;
};
enum MenuItemType {