--- np2/macosx/Attic/configure.cpp 2003/10/23 21:00:24 1.3 +++ np2/macosx/Attic/configure.cpp 2003/10/24 19:19:58 1.4 @@ -12,6 +12,7 @@ #include "ini.h" #include "sysmng.h" #include "configure.h" +#include "dialogutils.h" int sound_renewals = 0; static WindowRef configWin; @@ -19,23 +20,8 @@ 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; -} - +#define getSelectedValue(a,b) GetControlValue(getControlRefByID(a,b,configWin)) +/* static SInt16 getSelectedValue(OSType sign, int id) { SInt16 value; @@ -43,6 +29,7 @@ static SInt16 getSelectedValue(OSType si return value; } +*/ static int getMultiple(void) { int multi; @@ -264,12 +251,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 +278,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);