mirror of
https://github.com/mlaux/gb6.git
synced 2024-06-08 14:29:33 +00:00
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;
|
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)
|
void ShowAboutBox(void)
|
||||||
{
|
{
|
||||||
DialogPtr dp;
|
DialogPtr dp;
|
||||||
EventRecord e;
|
EventRecord e;
|
||||||
|
DialogItemIndex hitItem;
|
||||||
|
|
||||||
dp = GetNewDialog(DLOG_ABOUT, 0L, (WindowPtr) -1L);
|
dp = GetNewDialog(DLOG_ABOUT, 0L, (WindowPtr) -1L);
|
||||||
|
|
||||||
DrawDialog(dp);
|
ModalDialog(NULL, &hitItem);
|
||||||
|
|
||||||
while(!GetNextEvent(mDownMask, &e));
|
// DrawDialog(dp);
|
||||||
while(WaitMouseUp());
|
// while(!GetNextEvent(mDownMask, &e));
|
||||||
|
// while(WaitMouseUp());
|
||||||
|
|
||||||
DisposeDialog(dp);
|
DisposeDialog(dp);
|
||||||
}
|
}
|
||||||
|
@ -156,6 +171,12 @@ void OnMenuAction(long action)
|
||||||
g_running = 0;
|
g_running = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (menu == MENU_EMULATION) {
|
||||||
|
if (item == EMULATION_STATE) {
|
||||||
|
ShowStateDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnMouseDown(EventRecord *pEvt)
|
void OnMouseDown(EventRecord *pEvt)
|
||||||
|
@ -195,7 +216,13 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
while(g_running) {
|
while(g_running) {
|
||||||
if(WaitNextEvent(everyEvent, &evt, 10, 0) != nullEvent) {
|
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:
|
case mouseDown:
|
||||||
OnMouseDown(&evt);
|
OnMouseDown(&evt);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#define ALRT_4_LINE 129
|
#define ALRT_4_LINE 129
|
||||||
|
|
||||||
#define DLOG_ABOUT 128
|
#define DLOG_ABOUT 128
|
||||||
|
#define DLOG_STATE 129
|
||||||
|
|
||||||
#define MBAR_DEFAULT 128
|
#define MBAR_DEFAULT 128
|
||||||
|
|
||||||
|
@ -35,8 +36,9 @@
|
||||||
#define FILE_QUIT 4
|
#define FILE_QUIT 4
|
||||||
|
|
||||||
#define EMULATION_PAUSE 1
|
#define EMULATION_PAUSE 1
|
||||||
#define EMULATION_PREFERENCES 3
|
#define EMULATION_STATE 2
|
||||||
#define EMULATION_KEY_MAPPINGS 4
|
#define EMULATION_PREFERENCES 4
|
||||||
|
#define EMULATION_KEY_MAPPINGS 5
|
||||||
|
|
||||||
typedef unsigned char bool;
|
typedef unsigned char bool;
|
||||||
#define true 1
|
#define true 1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user