|
|
| version 1.5, 2004/06/21 03:18:04 | version 1.8, 2005/02/11 21:17:22 |
|---|---|
| Line 11 typedef struct _mhdl { | Line 11 typedef struct _mhdl { |
| struct _mhdl *chain; | struct _mhdl *chain; |
| struct _mhdl *next; | struct _mhdl *next; |
| struct _mhdl *child; | struct _mhdl *child; |
| MENUID id; | MENUID id; |
| MENUFLG flag; | MENUFLG flag; |
| RECT_T rct; | RECT_T rct; |
| char string[32]; | OEMCHAR string[32]; |
| } _MENUHDL, *MENUHDL; | } _MENUHDL, *MENUHDL; |
| typedef struct { | typedef struct { |
| Line 38 typedef struct { | Line 38 typedef struct { |
| int lastpos; | int lastpos; |
| int popupx; | int popupx; |
| int popupy; | int popupy; |
| char title[128]; | OEMCHAR title[128]; |
| } MENUSYS; | } MENUSYS; |
| static MENUSYS menusys; | static MENUSYS menusys; |
| #if !defined(RESOURCE_US) && (!defined(CHARSET_OEM) || defined(OSLANG_SJIS)) | #if !defined(RESOURCE_US) && (!defined(CHARSET_OEM) || defined(OSLANG_SJIS)) |
| static const char str_sysr[] = // 元のサイズに戻す | static const OEMCHAR str_sysr[] = // 元のサイズに戻す |
| "\214\263\202\314\203\124\203\103\203\131\202\311" \ | "\214\263\202\314\203\124\203\103\203\131\202\311" \ |
| "\226\337\202\267"; | "\226\337\202\267"; |
| static const char str_sysm[] = // 移動 | static const OEMCHAR str_sysm[] = // 移動 |
| "\210\332\223\256"; | "\210\332\223\256"; |
| static const char str_syss[] = // サイズ変更 | static const OEMCHAR str_syss[] = // サイズ変更 |
| "\203\124\203\103\203\131\225\317\215\130"; | "\203\124\203\103\203\131\225\317\215\130"; |
| static const char str_sysn[] = // 最小化 | static const OEMCHAR str_sysn[] = // 最小化 |
| "\215\305\217\254\211\273"; | "\215\305\217\254\211\273"; |
| static const char str_sysx[] = // 最大化 | static const OEMCHAR str_sysx[] = // 最大化 |
| "\215\305\221\345\211\273"; | "\215\305\221\345\211\273"; |
| static const char str_sysc[] = // 閉じる | static const OEMCHAR str_sysc[] = // 閉じる |
| "\225\302\202\266\202\351"; | "\225\302\202\266\202\351"; |
| #elif defined(OSLANG_EUC) | #elif defined(OSLANG_EUC) && !defined(RESOURCE_US) |
| static const char str_sysr[] = // 元のサイズに戻す | static const OEMCHAR str_sysr[] = // 元のサイズに戻す |
| "\270\265\244\316\245\265\245\244\245\272\244\313" \ | "\270\265\244\316\245\265\245\244\245\272\244\313" \ |
| "\314\341\244\271"; | "\314\341\244\271"; |
| static const char str_sysm[] = // 移動 | static const OEMCHAR str_sysm[] = // 移動 |
| "\260\334\306\260"; | "\260\334\306\260"; |
| static const char str_syss[] = // サイズ変更 | static const OEMCHAR str_syss[] = // サイズ変更 |
| "\245\265\245\244\245\272\312\321\271\271"; | "\245\265\245\244\245\272\312\321\271\271"; |
| static const char str_sysn[] = // 最小化 | static const OEMCHAR str_sysn[] = // 最小化 |
| "\272\307\276\256\262\275"; | "\272\307\276\256\262\275"; |
| static const char str_sysx[] = // 最大化 | static const OEMCHAR str_sysx[] = // 最大化 |
| "\272\307\302\347\262\275"; | "\272\307\302\347\262\275"; |
| static const char str_sysc[] = // 閉じる | static const OEMCHAR str_sysc[] = // 閉じる |
| "\312\304\244\270\244\353"; | "\312\304\244\270\244\353"; |
| #elif defined(OSLANG_UTF8) && !defined(RESOURCE_US) | #elif defined(OSLANG_UTF8) && !defined(RESOURCE_US) |
| static const char str_sysr[] = // 元のサイズに戻す | static const OEMCHAR str_sysr[] = // 元のサイズに戻す |
| "\345\205\203\343\201\256\343\202\265\343\202\244\343\202\272" \ | "\345\205\203\343\201\256\343\202\265\343\202\244\343\202\272" \ |
| "\343\201\253\346\210\273\343\201\231"; | "\343\201\253\346\210\273\343\201\231"; |
| static const char str_sysm[] = // 移動 | static const OEMCHAR str_sysm[] = // 移動 |
| "\347\247\273\345\213\225"; | "\347\247\273\345\213\225"; |
| static const char str_syss[] = // サイズ変更 | static const OEMCHAR str_syss[] = // サイズ変更 |
| "\343\202\265\343\202\244\343\202\272\345\244\211\346\233\264"; | "\343\202\265\343\202\244\343\202\272\345\244\211\346\233\264"; |
| static const char str_sysn[] = // 最小化 | static const OEMCHAR str_sysn[] = // 最小化 |
| "\346\234\200\345\260\217\345\214\226"; | "\346\234\200\345\260\217\345\214\226"; |
| static const char str_sysx[] = // 最大化 | static const OEMCHAR str_sysx[] = // 最大化 |
| "\346\234\200\345\244\247\345\214\226"; | "\346\234\200\345\244\247\345\214\226"; |
| static const char str_sysc[] = // 閉じる | static const OEMCHAR str_sysc[] = // 閉じる |
| "\351\226\211\343\201\230\343\202\213"; | "\351\226\211\343\201\230\343\202\213"; |
| #else | #else |
| static const char str_sysr[] = "Restore"; | static const OEMCHAR str_sysr[] = OEMTEXT("Restore"); |
| static const char str_sysm[] = "Move"; | static const OEMCHAR str_sysm[] = OEMTEXT("Move"); |
| static const char str_syss[] = "Size"; | static const OEMCHAR str_syss[] = OEMTEXT("Size"); |
| static const char str_sysn[] = "Minimize"; | static const OEMCHAR str_sysn[] = OEMTEXT("Minimize"); |
| static const char str_sysx[] = "Maximize"; | static const OEMCHAR str_sysx[] = OEMTEXT("Maximize"); |
| static const char str_sysc[] = "Close"; | static const OEMCHAR str_sysc[] = OEMTEXT("Close"); |
| #endif | #endif |
| Line 138 static MENUHDL append1(MENUSYS *sys, con | Line 138 static MENUHDL append1(MENUSYS *sys, con |
| hdl.id = item->id; | hdl.id = item->id; |
| hdl.flag = item->flag & (~MENU_DELETED); | hdl.flag = item->flag & (~MENU_DELETED); |
| if (item->string) { | if (item->string) { |
| milsjis_ncpy(hdl.string, item->string, sizeof(hdl.string)); | milstr_ncpy(hdl.string, item->string, NELEMENTS(hdl.string)); |
| } | } |
| ret = (MENUHDL)listarray_enum(sys->res, seaempty, NULL); | ret = (MENUHDL)listarray_enum(sys->res, seaempty, NULL); |
| if (ret) { | if (ret) { |
| Line 291 enum { | Line 291 enum { |
| MEXIST_ITEM = 0x08 | MEXIST_ITEM = 0x08 |
| }; | }; |
| static BOOL wndopenbase(MENUSYS *sys) { | static BRESULT wndopenbase(MENUSYS *sys) { |
| MENUHDL menu; | MENUHDL menu; |
| RECT_T mrect; | RECT_T mrect; |
| Line 345 static BOOL wndopenbase(MENUSYS *sys) { | Line 345 static BOOL wndopenbase(MENUSYS *sys) { |
| mrect.right -= MENUSYS_BCAPTION; | mrect.right -= MENUSYS_BCAPTION; |
| mrect.bottom += MENUSYS_BCAPTION; | mrect.bottom += MENUSYS_BCAPTION; |
| } | } |
| vram = menuvram_create(menubase.width, height); | vram = menuvram_create(menubase.width, height, menubase.bpp); |
| sys->wnd[0].vram = vram; | sys->wnd[0].vram = vram; |
| if (vram == NULL) { | if (vram == NULL) { |
| goto wopn0_err; | goto wopn0_err; |
| Line 482 static void citemdraw(VRAMHDL vram, MENU | Line 482 static void citemdraw(VRAMHDL vram, MENU |
| } | } |
| } | } |
| static BOOL childopn(MENUSYS *sys, int depth, int pos) { | static BRESULT childopn(MENUSYS *sys, int depth, int pos) { |
| MENUHDL menu; | MENUHDL menu; |
| RECT_T parent; | RECT_T parent; |
| Line 559 static BOOL childopn(MENUSYS *sys, int d | Line 559 static BOOL childopn(MENUSYS *sys, int d |
| width = menubase.width; | width = menubase.width; |
| } | } |
| height += (MENU_FBORDER + MENU_BORDER); | height += (MENU_FBORDER + MENU_BORDER); |
| wnd->vram = menuvram_create(width, height); | wnd->vram = menuvram_create(width, height, menubase.bpp); |
| if (wnd->vram == NULL) { | if (wnd->vram == NULL) { |
| TRACEOUT(("sub menu vram couldn't create")); | TRACEOUT(("sub menu vram couldn't create")); |
| goto copn_err; | goto copn_err; |
| Line 708 static void defcmd(MENUID id) { | Line 708 static void defcmd(MENUID id) { |
| (void)id; | (void)id; |
| } | } |
| BOOL menusys_create(const MSYSITEM *item, void (*cmd)(MENUID id), | BRESULT menusys_create(const MSYSITEM *item, void (*cmd)(MENUID id), |
| UINT16 icon, const char *title) { | UINT16 icon, const OEMCHAR *title) { |
| MENUSYS *ret; | MENUSYS *ret; |
| LISTARRAY r; | LISTARRAY r; |
| Line 723 BOOL menusys_create(const MSYSITEM *item | Line 723 BOOL menusys_create(const MSYSITEM *item |
| } | } |
| ret->cmd = cmd; | ret->cmd = cmd; |
| if (title) { | if (title) { |
| milsjis_ncpy(ret->title, title, sizeof(ret->title)); | milstr_ncpy(ret->title, title, NELEMENTS(ret->title)); |
| } | } |
| r = listarray_new(sizeof(_MENUHDL), 32); | r = listarray_new(sizeof(_MENUHDL), 32); |
| if (r == NULL) { | if (r == NULL) { |
| Line 758 void menusys_destroy(void) { | Line 758 void menusys_destroy(void) { |
| } | } |
| } | } |
| BOOL menusys_open(int x, int y) { | BRESULT menusys_open(int x, int y) { |
| MENUSYS *sys; | MENUSYS *sys; |
| Line 1087 static void menusys_settxt(MENUID id, vo | Line 1087 static void menusys_settxt(MENUID id, vo |
| } | } |
| if (arg) { | if (arg) { |
| milsjis_ncpy(itm->string, (char *)arg, sizeof(itm->string)); | milstr_ncpy(itm->string, (OEMCHAR *)arg, NELEMENTS(itm->string)); |
| } | } |
| else { | else { |
| itm->string[0] = '\0'; | itm->string[0] = '\0'; |