_mainDialog is now a Window, for now. We'll see if that's a good idea.

This commit is contained in:
Zaccari Silverman 2019-04-30 22:56:14 -04:00
parent 1b0d8adc52
commit c7d6ba7544
4 changed files with 40 additions and 12 deletions

View File

@ -46,10 +46,9 @@ void PresentUnimplementedDlog(){
}
void PresentMainDlog(){
_mainDialog = GetNewDialog(dlogMain, 0, (WindowPtr)-1);
MacSetPort(_mainDialog);
SwitchDITL(ditlMain);
_mainDialog = GetNewWindow(windMain, 0, (WindowPtr)-1);
//_mainDialog = GetNewDialog(dlogMain, 0, (WindowPtr)-1);
//SwitchDITL(ditlMain);
//Do anything else.
}
@ -67,7 +66,7 @@ void SwitchDITL(short int toDitlID){
AppendDITL(_mainDialog, newDitl, overlayDITL);
ReleaseResource(newDitl);
UpdateDialog(_mainDialog, _mainDialog->visRgn);
//UpdateDialog(_mainDialog, _mainDialog->visRgn);
}
@ -113,7 +112,7 @@ void HandleEvent(EventRecord *eventPtr){
break;
case updateEvt:
//HandleUpdate(eventPtr);
HandleUpdate(eventPtr);
break;
case kHighLevelEvent:
AEProcessAppleEvent(eventPtr);
@ -140,7 +139,8 @@ void HandleMouseDown(EventRecord *eventPtr){
case inContent:
//If it's in the content of the window. Todo.
//HandleInContent(eventPtr)
if (window != FrontWindow()) SelectWindow(window);
HandleInContent(eventPtr);
break;
case inDrag:
@ -200,14 +200,29 @@ void HandleUpdate(EventRecord *eventPtr){
}
}
void HandleInContent(EventRecord *eventPtr){
//Todo
WindowPtr window;
short int part;
part = FindWindow(eventPtr->where, &window);
//Drag the window if CMD is held down.
if ((eventPtr->modifiers & cmdKey) != 0)
DragWindow(window, eventPtr->where, &qd.screenBits.bounds);
else
DragWindow(window, eventPtr->where, &qd.screenBits.bounds);
}
void QuitApp(){
_run = 0; //Now, the EventLoop will stop.
//Do any clean-up here.
CloseDialog(_mainDialog);
CloseWindow(_mainDialog);
//CloseDialog(_mainDialog);
//ExitToShell();
//For now, there isn't much else to do.
}

View File

@ -27,5 +27,6 @@ void HandleEvent(EventRecord *eventPtr);
void HandleMouseDown(EventRecord *eventPtr);
void HandleMenuChoice(long menuChoice);
void HandleUpdate(EventRecord *eventPtr);
void HandleInContent(EventRecord *eventPtr);
void QuitApp();

View File

@ -35,8 +35,10 @@
#define alrtUnimplemented 129
#define ditlUnimplemented 129
#define windMain 130
#define dlogMain 130
#define ditlMain 130
#define dlogMainSmall 131
#define ditlMainSmall 131

View File

@ -53,9 +53,19 @@ resource 'DITL' (ditlUnimplemented, purgeable){
}
};
resource 'WIND' (windMain){
{0, 0, 400, 600},
zoomDocProc,
visible,
goAway,
0,
"PetProject-m68k",
centerMainScreen
};
resource 'DLOG' (dlogMain){ //Purgeable?
{0, 0, 400, 600},
movableDBoxProc,
zoomDocProc,
visible,
goAway, //Revisit this
0,
@ -94,7 +104,7 @@ resource 'SIZE' (-1) {
500 * 1024, // Carbon apparently needs additional memory.
500 * 1024
#else
100 * 1024,
100 * 1024
200 * 1024,
200 * 1024
#endif
};