--- np2/macosx/Attic/configure.cpp 2003/10/23 21:00:24 1.3 +++ np2/macosx/Attic/configure.cpp 2003/10/24 20:46:13 1.5 @@ -12,6 +12,7 @@ #include "ini.h" #include "sysmng.h" #include "configure.h" +#include "dialogutils.h" int sound_renewals = 0; static WindowRef configWin; @@ -19,30 +20,7 @@ static WindowRef configWin; #define AVE(a, b) \ (((a) + (b)) / 2) -static void endLoop(void) { - OSStatus err; - HideSheetWindow(configWin); - DisposeWindow(configWin); - err=QuitAppModalLoopForWindow(configWin); -} - -ControlRef getControlRefByID(OSType sign, int id, WindowRef win) { - ControlRef conRef; - ControlID conID; - - conID.signature=sign; - conID.id=id; - GetControlByID(win, &conID, &conRef); - return conRef; -} - -static SInt16 getSelectedValue(OSType sign, int id) { - SInt16 value; - - value=GetControlValue(getControlRefByID(sign, id, configWin)); - - return value; -} +#define getSelectedValue(a,b) GetControlValue(getControlRefByID(a,b,configWin)) static int getMultiple(void) { int multi; @@ -264,12 +242,12 @@ static pascal OSStatus cfWinproc(EventHa } sysmng_update(update); - endLoop(); + endLoop(configWin); err=noErr; break; case kHICommandCancel: - endLoop(); + endLoop(configWin); err=noErr; break; } @@ -291,7 +269,7 @@ static void makeNibWindow (IBNibRef nibR { kEventClassWindow, kEventWindowActivated } }; EventHandlerRef ref; - InstallWindowEventHandler (configWin, NewEventHandlerUPP(cfWinproc), 2, list, (void *)configWin, &ref); + InstallWindowEventHandler (configWin, NewEventHandlerUPP(cfWinproc), GetEventTypeCount(list), list, (void *)configWin, &ref); ShowSheetWindow(configWin, hWndMain); err=RunAppModalLoopForWindow(configWin);