|
|
| version 1.7, 2003/11/05 17:58:01 | version 1.8, 2003/11/08 17:54:26 |
|---|---|
| Line 109 static const OSType subcommand[11] ={ '- | Line 109 static const OSType subcommand[11] ={ '- |
| static const ControlID popup[2] = { {'pop1', 1}, {'pop2', 2} }; | static const ControlID popup[2] = { {'pop1', 1}, {'pop2', 2} }; |
| static void openpopup(HIPoint location); | |
| static void skinchange(void); | |
| static DragReceiveHandlerUPP dr; | static DragReceiveHandlerUPP dr; |
| static bool isPUMA; | static bool isPUMA; |
| static void openpopup(HIPoint location); | |
| static void skinchange(void); | |
| // ---- | // ---- |
| static void checkOSVersion(void) { | static void checkOSVersion(void) { |
| Line 523 static pascal OSStatus cfWinproc(EventHa | Line 523 static pascal OSStatus cfWinproc(EventHa |
| } | } |
| } | } |
| break; | break; |
| case kEventWindowFocusAcquired: | |
| SelectWindow(hWndMain); | |
| break; | |
| default: | default: |
| break; | break; |
| Line 628 static WindowRef makeNibWindow (IBNibRef | Line 632 static WindowRef makeNibWindow (IBNibRef |
| { kEventClassWindow, kEventWindowClose }, | { kEventClassWindow, kEventWindowClose }, |
| { kEventClassWindow, kEventWindowShown }, | { kEventClassWindow, kEventWindowShown }, |
| { kEventClassWindow, kEventWindowDrawContent }, | { kEventClassWindow, kEventWindowDrawContent }, |
| { kEventClassWindow, kEventWindowFocusAcquired }, | |
| }; | }; |
| EventHandlerRef ref; | EventHandlerRef ref; |
| InstallWindowEventHandler (win, NewEventHandlerUPP(cfWinproc), GetEventTypeCount(list), list, (void *)win, &ref); | InstallWindowEventHandler (win, NewEventHandlerUPP(cfWinproc), GetEventTypeCount(list), list, (void *)win, &ref); |
| Line 660 const char *base; | Line 665 const char *base; |
| UINT j; | UINT j; |
| UINT id[SKINMRU_MAX]; | UINT id[SKINMRU_MAX]; |
| const char *file[SKINMRU_MAX]; | const char *file[SKINMRU_MAX]; |
| Str255 seltext, deftext; | char longname[256]; |
| mkstr255(seltext, str_skinsel); | AppendMenuItemTextWithCFString(ret, CFCopyLocalizedString(CFSTR("Select Skin..."),"Slect Skin"), kMenuItemAttrIconDisabled, NULL,NULL); |
| AppendMenu(ret, seltext); | |
| AppendMenu(ret, "\p-"); | AppendMenu(ret, "\p-"); |
| base = np2tool.skin; | base = np2tool.skin; |
| mkstr255(deftext, str_skindef); | AppendMenuItemTextWithCFString(ret, CFCopyLocalizedString(CFSTR("Base Skin"),"Base Skin"), kMenuItemAttrIconDisabled, NULL,NULL); |
| AppendMenu(ret, deftext); | if (base[0] == '\0') { |
| if (base[0] != '\0') { | DisableMenuItem(ret, 3); |
| EnableMenuItem(ret, 3); | |
| } | } |
| for (cnt=0; cnt<SKINMRU_MAX; cnt++) { | for (cnt=0; cnt<SKINMRU_MAX; cnt++) { |
| p = np2tool.skinmru[cnt]; | p = np2tool.skinmru[cnt]; |
| if (p[0] == '\0') { | if (p[0] == '\0') { |
| break; | break; |
| } | } |
| p = file_getname(p); | getLongFileName(longname, p); |
| p = longname; | |
| for (i=0; i<cnt; i++) { | for (i=0; i<cnt; i++) { |
| if (file_cmpname(p, file[id[i]]) < 0) { | if (file_cmpname(p, file[id[i]]) < 0) { |
| break; | break; |
| Line 691 const char *file[SKINMRU_MAX]; | Line 695 const char *file[SKINMRU_MAX]; |
| } | } |
| for (i=0; i<cnt; i++) { | for (i=0; i<cnt; i++) { |
| j = id[i]; | j = id[i]; |
| if (file[j][0] == '\0') { | if (file[j][0] != '\0') { |
| AppendMenu(ret, "\pN/A"); | UInt32 attr = kMenuItemAttrIconDisabled; |
| } | if (!file_cmpname(base, np2tool.skinmru[j])) { |
| else { | attr |= kMenuItemAttrDisabled; |
| Str255 initext; | } |
| mkstr255(initext, file[j]); | else if (file_attr(np2tool.skinmru[j]) == -1) { |
| AppendMenu(ret, initext); | attr |= kMenuItemAttrDisabled; |
| } | } |
| if (!file_cmpname(base, np2tool.skinmru[j])) { | AppendMenuItemTextWithCFString(ret, CFStringCreateWithCString(NULL, file[j], kCFStringEncodingUTF8), attr, NULL, NULL); |
| EnableMenuItem(ret, 4+i); | |
| } | } |
| } | } |
| return; | return; |
| Line 736 static void openpopup(HIPoint location) | Line 739 static void openpopup(HIPoint location) |
| MenuRef hMenu; | MenuRef hMenu; |
| short sel; | short sel; |
| Str255 closetext; | |
| UInt16 selectclose; | UInt16 selectclose; |
| char fname[MAX_PATH]; | char fname[MAX_PATH]; |
| hMenu = NewMenu(222, "\pskin"); | hMenu = NewMenu(222, "\pSkin"); |
| InsertMenu(hMenu, -1); | InsertMenu(hMenu, -1); |
| createskinmenu(hMenu); | createskinmenu(hMenu); |
| AppendMenu(hMenu, "\p-"); | AppendMenu(hMenu, "\p-"); |
| mkstr255(closetext, str_toolclose); | AppendMenuItemTextWithCFString(hMenu, CFCopyLocalizedString(CFSTR("Close"),"ToolWin Close"), kMenuItemAttrIconDisabled, NULL, NULL); |
| AppendMenu(hMenu, closetext); | |
| DeleteMenu(222); | DeleteMenu(222); |
| selectclose = CountMenuItems(hMenu); | selectclose = CountMenuItems(hMenu); |