--- np2/macosx/toolwin.cpp 2003/11/05 16:08:59 1.4 +++ np2/macosx/toolwin.cpp 2003/11/08 17:54:26 1.8 @@ -109,19 +109,23 @@ static const OSType subcommand[11] ={ '- static const ControlID popup[2] = { {'pop1', 1}, {'pop2', 2} }; +static DragReceiveHandlerUPP dr; +static bool isPUMA; + static void openpopup(HIPoint location); static void skinchange(void); -static DragReceiveHandlerUPP dr; // ---- -static bool isPuma(void) { +static void checkOSVersion(void) { long res; Gestalt(gestaltSystemVersion, &res); if (res<0x1020) { - return(true); + isPUMA = true; + } + else { + isPUMA = false; } - return(false); } @@ -519,7 +523,11 @@ static pascal OSStatus cfWinproc(EventHa } } break; - + + case kEventWindowFocusAcquired: + SelectWindow(hWndMain); + break; + default: break; @@ -609,7 +617,7 @@ static WindowRef makeNibWindow (IBNibRef OSStatus err; WindowRef win = NULL; - if (isPuma()) { + if (isPUMA) { Rect bounds; SetRect(&bounds, 0, 0, 100, 100); err = CreateNewWindow(kFloatingWindowClass, kWindowStandardHandlerAttribute, &bounds, &win); @@ -624,6 +632,7 @@ static WindowRef makeNibWindow (IBNibRef { kEventClassWindow, kEventWindowClose }, { kEventClassWindow, kEventWindowShown }, { kEventClassWindow, kEventWindowDrawContent }, + { kEventClassWindow, kEventWindowFocusAcquired }, }; EventHandlerRef ref; InstallWindowEventHandler (win, NewEventHandlerUPP(cfWinproc), GetEventTypeCount(list), list, (void *)win, &ref); @@ -656,24 +665,23 @@ const char *base; UINT j; UINT id[SKINMRU_MAX]; const char *file[SKINMRU_MAX]; - Str255 seltext, deftext; + char longname[256]; - mkstr255(seltext, str_skinsel); - AppendMenu(ret, seltext); + AppendMenuItemTextWithCFString(ret, CFCopyLocalizedString(CFSTR("Select Skin..."),"Slect Skin"), kMenuItemAttrIconDisabled, NULL,NULL); AppendMenu(ret, "\p-"); base = np2tool.skin; - mkstr255(deftext, str_skindef); - AppendMenu(ret, deftext); - if (base[0] != '\0') { - EnableMenuItem(ret, 3); + AppendMenuItemTextWithCFString(ret, CFCopyLocalizedString(CFSTR("Base Skin"),"Base Skin"), kMenuItemAttrIconDisabled, NULL,NULL); + if (base[0] == '\0') { + DisableMenuItem(ret, 3); } for (cnt=0; cnt