--- np2/macosx/toolwin.cpp 2003/11/05 17:58:01 1.7 +++ np2/macosx/toolwin.cpp 2003/11/11 16:33:50 1.9 @@ -109,12 +109,12 @@ static const OSType subcommand[11] ={ '- 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(void); + // ---- static void checkOSVersion(void) { @@ -165,7 +165,7 @@ static PicHandle skinload(const char *pa return(ret); } } - return(getBMPfromResource("np2tool", bounds)); + return(getBMPfromResource("np2tool", bounds, CFSTR("bmp"))); } // ---- @@ -523,12 +523,25 @@ static pascal OSStatus cfWinproc(EventHa } } break; - + + case kEventWindowFocusAcquired: + SelectWindow(hWndMain); + break; + default: break; } } + else if (GetEventClass(event)==kEventClassKeyboard && GetEventKind(event)==kEventRawKeyDown) { + UInt32 modif; + GetEventParameter (event, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modif); + if (modif & cmdKey) { + EventRecord eve; + ConvertEventRefToEventRecord( event,&eve ); + recieveCommand(MenuEvent(&eve)); + } + } (void)myHandler; return err; @@ -624,10 +637,12 @@ static WindowRef makeNibWindow (IBNibRef if (err == noErr) { InstallStandardEventHandler(GetWindowEventTarget(win)); EventTypeSpec list[]={ - { kEventClassCommand, kEventCommandProcess }, - { kEventClassWindow, kEventWindowClose }, - { kEventClassWindow, kEventWindowShown }, - { kEventClassWindow, kEventWindowDrawContent }, + { kEventClassCommand, kEventCommandProcess }, + { kEventClassWindow, kEventWindowClose }, + { kEventClassWindow, kEventWindowShown }, + { kEventClassWindow, kEventWindowDrawContent }, + { kEventClassWindow, kEventWindowFocusAcquired }, + { kEventClassKeyboard, kEventRawKeyDown}, }; EventHandlerRef ref; InstallWindowEventHandler (win, NewEventHandlerUPP(cfWinproc), GetEventTypeCount(list), list, (void *)win, &ref); @@ -660,24 +675,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"), kMenuItemAttrIconDisabled, NULL,NULL); + if (base[0] == '\0') { + DisableMenuItem(ret, 3); } for (cnt=0; cnt