|
|
| version 1.16, 2004/01/11 16:58:47 | version 1.21, 2005/05/20 17:25:03 |
|---|---|
| Line 16 | Line 16 |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| extern void HandleMenuChoice(long wParam); | |
| enum { | enum { |
| IDC_TOOLHDDACC = 0, | IDC_TOOLHDDACC = 0, |
| Line 202 const char *p; | Line 203 const char *p; |
| bool success = false; | bool success = false; |
| GetBevelButtonMenuHandle(hwnd, &menu); | GetBevelButtonMenuHandle(hwnd, &menu); |
| while (MenuHasEnabledItems(menu)) { | DeleteMenuItems(menu, 1, fdd->cnt); |
| DeleteMenuItem(menu, 1); | |
| }; | |
| #if 0 | #if 0 |
| GetControlBounds(hwnd, &rc); | GetControlBounds(hwnd, &rc); |
| width = rc.right - rc.left - 6; // border size? | width = rc.right - rc.left - 6; // border size? |
| Line 224 const char *p; | Line 223 const char *p; |
| if (file_attr(p) != FILEATTR_ARCHIVE) { | if (file_attr(p) != FILEATTR_ARCHIVE) { |
| attr |= kMenuItemAttrDisabled; | attr |= kMenuItemAttrDisabled; |
| } | } |
| AppendMenuItemTextWithCFString(menu, str, attr, NULL, NULL); | AppendMenuItemTextWithCFString(menu, str, attr, 0, 0); |
| } | } |
| CFRelease(str); | CFRelease(str); |
| } | } |
| Line 264 const char *p; | Line 263 const char *p; |
| } | } |
| else { | else { |
| SetControlTitleWithCFString(hwnd, CFSTR(" ")); | SetControlTitleWithCFString(hwnd, CFSTR(" ")); |
| for (i=0; i<fdd->cnt; i++) { | |
| CheckMenuItem(menu, i+1, 0); | |
| } | |
| } | } |
| } | } |
| Line 456 const char *cls; | Line 458 const char *cls; |
| style = 1; | style = 1; |
| CreateBevelButtonControl(hWnd, &bounds, CFSTRj(p->text), | CreateBevelButtonControl(hWnd, &bounds, CFSTRj(p->text), |
| kControlBevelButtonSmallBevel, | kControlBevelButtonSmallBevel, |
| 0 ,NULL, NULL, NULL, NULL, &sub); | 0 ,NULL, 0, 0, 0, &sub); |
| SetControlCommandID(sub, subcommand[i]); | SetControlCommandID(sub, subcommand[i]); |
| SetControlFontStyle(sub, &fontstyle); | SetControlFontStyle(sub, &fontstyle); |
| break; | break; |
| Line 528 static pascal OSStatus cfWinproc(EventHa | Line 530 static pascal OSStatus cfWinproc(EventHa |
| switch (cmd.commandID) | switch (cmd.commandID) |
| { | { |
| case 'rset': | case 'rset': |
| recieveCommand(IDM_RESET); | HandleMenuChoice(IDM_RESET); |
| err=noErr; | err=noErr; |
| break; | break; |
| Line 538 static pascal OSStatus cfWinproc(EventHa | Line 540 static pascal OSStatus cfWinproc(EventHa |
| break; | break; |
| case 'opn1': | case 'opn1': |
| recieveCommand(IDM_FDD1OPEN); | HandleMenuChoice(IDM_FDD1OPEN); |
| err=noErr; | err=noErr; |
| break; | break; |
| case 'ejt1': | case 'ejt1': |
| recieveCommand(IDM_FDD1EJECT); | HandleMenuChoice(IDM_FDD1EJECT); |
| err=noErr; | err=noErr; |
| break; | break; |
| Line 553 static pascal OSStatus cfWinproc(EventHa | Line 555 static pascal OSStatus cfWinproc(EventHa |
| break; | break; |
| case 'opn2': | case 'opn2': |
| recieveCommand(IDM_FDD2OPEN); | HandleMenuChoice(IDM_FDD2OPEN); |
| err=noErr; | err=noErr; |
| break; | break; |
| case 'ejt2': | case 'ejt2': |
| recieveCommand(IDM_FDD2EJECT); | HandleMenuChoice(IDM_FDD2EJECT); |
| err=noErr; | err=noErr; |
| break; | break; |
| case 'exit': | case 'exit': |
| recieveCommand(IDM_EXIT); | HandleMenuChoice(IDM_EXIT); |
| err=noErr; | err=noErr; |
| break; | break; |
| Line 617 static pascal OSStatus cfWinproc(EventHa | Line 619 static pascal OSStatus cfWinproc(EventHa |
| EventRecord eve; | EventRecord eve; |
| ConvertEventRefToEventRecord( event,&eve ); | ConvertEventRefToEventRecord( event,&eve ); |
| mousemng_disable(MOUSEPROC_MACUI); | mousemng_disable(MOUSEPROC_MACUI); |
| recieveCommand(MenuEvent(&eve)); | HandleMenuChoice(MenuEvent(&eve)); |
| mousemng_enable(MOUSEPROC_MACUI); | mousemng_enable(MOUSEPROC_MACUI); |
| } | } |
| else { | else { |
| Line 855 const char *base; | Line 857 const char *base; |
| UINT i; | UINT i; |
| char longname[256]; | char longname[256]; |
| AppendMenuItemTextWithCFString(ret, CFCopyLocalizedString(CFSTR("Select Skin..."),"Slect Skin"), kMenuItemAttrIconDisabled, NULL,NULL); | AppendMenuItemTextWithCFString(ret, CFCopyLocalizedString(CFSTR("Select Skin..."),"Slect Skin"), kMenuItemAttrIconDisabled, 0, 0); |
| AppendMenu(ret, "\p-"); | AppendMenu(ret, "\p-"); |
| base = np2tool.skin; | base = np2tool.skin; |
| AppendMenuItemTextWithCFString(ret, CFCopyLocalizedString(CFSTR("<Base Skin>"),"Base Skin"), kMenuItemAttrIconDisabled, NULL,NULL); | AppendMenuItemTextWithCFString(ret, CFCopyLocalizedString(CFSTR("<Base Skin>"),"Base Skin"), kMenuItemAttrIconDisabled, 0, 0); |
| if (base[0] == '\0') { | if (base[0] == '\0') { |
| CheckMenuItem(ret, BASENUMBER-1, true); | CheckMenuItem(ret, BASENUMBER-1, true); |
| } | } |
| Line 876 const char *base; | Line 878 const char *base; |
| if (!getLongFileName(longname, p)) { | if (!getLongFileName(longname, p)) { |
| strcpy(longname, file_getname(p)); | strcpy(longname, file_getname(p)); |
| } | } |
| AppendMenuItemTextWithCFString(ret, CFStringCreateWithCString(NULL, longname, kCFStringEncodingUTF8), attr, NULL, NULL); | AppendMenuItemTextWithCFString(ret, CFStringCreateWithCString(NULL, longname, kCFStringEncodingUTF8), attr, 0, 0); |
| } | } |
| for (i=0; i<cnt; i++) { | for (i=0; i<cnt; i++) { |
| if (!file_cmpname(base, np2tool.skinmru[i])) { | if (!file_cmpname(base, np2tool.skinmru[i])) { |
| Line 924 static void openpopup(Point location) { | Line 926 static void openpopup(Point location) { |
| InsertMenu(hMenu, -1); | InsertMenu(hMenu, -1); |
| createskinmenu(hMenu); | createskinmenu(hMenu); |
| AppendMenu(hMenu, "\p-"); | AppendMenu(hMenu, "\p-"); |
| AppendMenuItemTextWithCFString(hMenu, CFCopyLocalizedString(CFSTR("Close"),"ToolWin Close"), kMenuItemAttrIconDisabled, NULL, NULL); | AppendMenuItemTextWithCFString(hMenu, CFCopyLocalizedString(CFSTR("Close"),"ToolWin Close"), kMenuItemAttrIconDisabled, 0, 0); |
| DeleteMenu(222); | DeleteMenu(222); |
| selectclose = CountMenuItems(hMenu); | selectclose = CountMenuItems(hMenu); |
| sel = LoWord(PopUpMenuSelect(hMenu, location.v, location.h, 0)); | sel = LoWord(PopUpMenuSelect(hMenu, location.v, location.h, 0)); |
| Line 936 static void openpopup(Point location) { | Line 938 static void openpopup(Point location) { |
| switch (sel) { | switch (sel) { |
| case 1: | case 1: |
| if(dialog_fileselect(fname, sizeof(fname), hWndMain, OPEN_INI)) { | if(dialog_fileselect(fname, sizeof(fname), hWndMain, OPEN_INI)) { |
| if (file_getftype(fname)==FTYPE_TEXT) { | if (file_getftype(fname)==FTYPE_INI) { |
| strcpy(np2tool.skin, fname); | strcpy(np2tool.skin, fname); |
| skinchange(true); | skinchange(true); |
| } | } |
| Line 1191 const DISKACC *accterm; | Line 1193 const DISKACC *accterm; |
| // ---- | // ---- |
| static const char ini_title[] = "NP2 tool"; | static const char ini_title[] = "NP2 tool"; |
| #if !defined(SUPPORT_PC9821) | |
| static const char inifile[] = "np2.cfg"; // same file name.. | static const char inifile[] = "np2.cfg"; // same file name.. |
| #else | |
| static const char inifile[] = "np21.cfg"; | |
| #endif | |
| static const INITBL iniitem[] = { | static const INITBL iniitem[] = { |
| {"WindposX", INITYPE_SINT32, &np2tool.posx, 0}, | {"WindposX", INITYPE_SINT32, &np2tool.posx, 0}, |