--- np2/macosx/toolwin.cpp 2003/11/03 10:19:43 1.1 +++ np2/macosx/toolwin.cpp 2003/11/12 19:06:33 1.10 @@ -5,13 +5,14 @@ #include "dosio.h" #include "ini.h" #include "resource.h" -#include "toolmac.h" +#include "toolwin.h" #include "np2opening.h" #include "dialogutils.h" #include "dialog.h" #include "soundmng.h" #include "fdefine.h" + enum { IDC_TOOLHDDACC = 0, IDC_TOOLFDD1ACC, @@ -106,14 +107,31 @@ static const OSType subcommand[11] ={ '- 'exit', }; +#define BASENUMBER 4 static const ControlID popup[2] = { {'pop1', 1}, {'pop2', 2} }; -static void openpopup(HIPoint location); -static void skinchange(void); static DragReceiveHandlerUPP dr; +static bool isPUMA; + +static void openpopup(HIPoint location); +static void skinchange(bool remake); // ---- +static void checkOSVersion(void) { + static long res = 0; + if (!res) { + Gestalt(gestaltSystemVersion, &res); + if (res<0x1020) { + isPUMA = true; + } + else { + isPUMA = false; + } + } +} + + static PicHandle skinload(const char *path, Rect* bounds) { char fname[MAX_PATH]; @@ -150,7 +168,7 @@ static PicHandle skinload(const char *pa return(ret); } } - return(getBMPfromResource("np2tool", bounds)); + return(getBMPfromResource("np2tool", bounds, CFSTR("bmp"))); } // ---- @@ -441,6 +459,8 @@ static void toolwindestroy(void) { static pascal OSStatus cfWinproc(EventHandlerCallRef myHandler, EventRef event, void* userData) { OSStatus err = eventNotHandledErr; HICommand cmd; + ControlRef sub; + int i; if (GetEventClass(event)==kEventClassCommand && GetEventKind(event)==kEventCommandProcess ) { GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &cmd); @@ -497,10 +517,34 @@ static pascal OSStatus cfWinproc(EventHa err=noErr; break; + case kEventWindowDrawContent: + case kEventWindowShown: + for (i=0; i"),"Base Skin"), kMenuItemAttrIconDisabled, NULL,NULL); + if (base[0] == '\0') { + CheckMenuItem(ret, BASENUMBER-1, true); } for (cnt=0; cnti; j--) { - id[j] = id[j-1]; - } - id[i] = cnt; - file[cnt] = p; - } - for (i=0; i