mirror of https://github.com/mlaux/gb6.git
show state dialog when selected from menu
This commit is contained in:
parent
698cc17030
commit
e00b998024
|
@ -112,17 +112,32 @@ bool ShowOpenBox(void)
|
|||
return false;
|
||||
}
|
||||
|
||||
DialogPtr stateDialog;
|
||||
void ShowStateDialog(void)
|
||||
{
|
||||
DialogPtr dp;
|
||||
|
||||
if (!stateDialog) {
|
||||
stateDialog = GetNewDialog(DLOG_STATE, 0L, (WindowPtr) -1L);
|
||||
}
|
||||
|
||||
ShowWindow(stateDialog);
|
||||
SelectWindow(stateDialog);
|
||||
}
|
||||
|
||||
void ShowAboutBox(void)
|
||||
{
|
||||
DialogPtr dp;
|
||||
EventRecord e;
|
||||
DialogItemIndex hitItem;
|
||||
|
||||
dp = GetNewDialog(DLOG_ABOUT, 0L, (WindowPtr) -1L);
|
||||
|
||||
DrawDialog(dp);
|
||||
ModalDialog(NULL, &hitItem);
|
||||
|
||||
while(!GetNextEvent(mDownMask, &e));
|
||||
while(WaitMouseUp());
|
||||
// DrawDialog(dp);
|
||||
// while(!GetNextEvent(mDownMask, &e));
|
||||
// while(WaitMouseUp());
|
||||
|
||||
DisposeDialog(dp);
|
||||
}
|
||||
|
@ -156,6 +171,12 @@ void OnMenuAction(long action)
|
|||
g_running = 0;
|
||||
}
|
||||
}
|
||||
|
||||
else if (menu == MENU_EMULATION) {
|
||||
if (item == EMULATION_STATE) {
|
||||
ShowStateDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnMouseDown(EventRecord *pEvt)
|
||||
|
@ -195,7 +216,13 @@ int main(int argc, char *argv[])
|
|||
|
||||
while(g_running) {
|
||||
if(WaitNextEvent(everyEvent, &evt, 10, 0) != nullEvent) {
|
||||
switch(evt.what) {
|
||||
if (IsDialogEvent(&evt)) {
|
||||
DialogRef hitBox;
|
||||
DialogItemIndex hitItem;
|
||||
if (DialogSelect(&evt, &hitBox, &hitItem)) {
|
||||
stateDialog = NULL;
|
||||
}
|
||||
} else switch(evt.what) {
|
||||
case mouseDown:
|
||||
OnMouseDown(&evt);
|
||||
break;
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#define ALRT_4_LINE 129
|
||||
|
||||
#define DLOG_ABOUT 128
|
||||
#define DLOG_STATE 129
|
||||
|
||||
#define MBAR_DEFAULT 128
|
||||
|
||||
|
@ -35,8 +36,9 @@
|
|||
#define FILE_QUIT 4
|
||||
|
||||
#define EMULATION_PAUSE 1
|
||||
#define EMULATION_PREFERENCES 3
|
||||
#define EMULATION_KEY_MAPPINGS 4
|
||||
#define EMULATION_STATE 2
|
||||
#define EMULATION_PREFERENCES 4
|
||||
#define EMULATION_KEY_MAPPINGS 5
|
||||
|
||||
typedef unsigned char bool;
|
||||
#define true 1
|
||||
|
|
Loading…
Reference in New Issue