• R/O
  • SSH
  • HTTPS

bchan: 提交


Commit MetaInfo

修訂454 (tree)
時間2012-04-30 22:15:38
作者ornse01

Log Message

implement menu handling logic.

Change Summary

差異

--- bchanl/trunk/src/bchanl_menus.c (revision 453)
+++ bchanl/trunk/src/bchanl_menus.c (revision 454)
@@ -43,7 +43,7 @@
4343 #define BCHANL_MAINMENU_ITEMNUM_WINDOW 4
4444 #define BCHANL_MAINMENU_ITEMNUM_GADGET (BCHANL_MAINMENU_ITEMNUM_WINDOW + 1)
4545
46-EXPORT W bchanl_mainmenu_setup(bchanl_mainmenu_t *mainmenu, Bool subectjoptionenable)
46+EXPORT W bchanl_mainmenu_setup(bchanl_mainmenu_t *mainmenu, Bool subectjoptionenable, Bool extbbsmanageropen, Bool extbbsselected)
4747 {
4848 /* [表示] -> [スレ一覧設定] */
4949 if (subectjoptionenable == False) {
@@ -52,6 +52,32 @@
5252 mchg_atr(mainmenu->mnid, (1 << 8)|2, M_SEL);
5353 }
5454
55+ /* [外部板] -> [外部板管理] */
56+ if (extbbsmanageropen == False) {
57+ mchg_atr(mainmenu->mnid, (3 << 8)|1, M_NOSEL);
58+ } else {
59+ mchg_atr(mainmenu->mnid, (3 << 8)|1, M_SEL);
60+ }
61+
62+ /* [外部板] -> [板追加] */
63+ if (extbbsmanageropen != False) {
64+ mchg_atr(mainmenu->mnid, (3 << 8)|3, M_ACT);
65+ } else {
66+ mchg_atr(mainmenu->mnid, (3 << 8)|3, M_INACT);
67+ }
68+ /* [外部板] -> [一つ上げる] */
69+ /* [外部板] -> [一つ下げる] */
70+ /* [外部板] -> [削除] */
71+ if (extbbsselected == False) {
72+ mchg_atr(mainmenu->mnid, (3 << 8)|4, M_INACT);
73+ mchg_atr(mainmenu->mnid, (3 << 8)|5, M_INACT);
74+ mchg_atr(mainmenu->mnid, (3 << 8)|6, M_INACT);
75+ } else {
76+ mchg_atr(mainmenu->mnid, (3 << 8)|4, M_ACT);
77+ mchg_atr(mainmenu->mnid, (3 << 8)|5, M_ACT);
78+ mchg_atr(mainmenu->mnid, (3 << 8)|6, M_ACT);
79+ }
80+
5581 wget_dmn(&(mainmenu->mnitem[BCHANL_MAINMENU_ITEMNUM_WINDOW].ptr));
5682 mset_itm(mainmenu->mnid, BCHANL_MAINMENU_ITEMNUM_WINDOW, mainmenu->mnitem+BCHANL_MAINMENU_ITEMNUM_WINDOW);
5783 oget_men(0, NULL, &(mainmenu->mnitem[BCHANL_MAINMENU_ITEMNUM_GADGET].ptr), NULL, NULL);
@@ -69,7 +95,7 @@
6995 ret = BCHANL_MAINMENU_SELECT_CLOSE;
7096 break;
7197 case 1: /* [表示] */
72- switch(i & 0xff) {
98+ switch (i & 0xff) {
7399 case 1: /* [再表示] */
74100 ret = BCHANL_MAINMENU_SELECT_REDISPLAY;
75101 break;
@@ -82,13 +108,32 @@
82108 }
83109 break;
84110 case 2: /* [操作] */
85- switch(i & 0xff) {
111+ switch (i & 0xff) {
86112 case 1: /* [板一覧再取得] */
87113 ret = BCHANL_MAINMENU_SELECT_BBSMENUFETCH;
88114 break;
89- case 2: /* [外部板の追加] */
90- ret = BCHANL_MAINMENU_SELECT_REGISTEREXTBBS;
115+ default:
116+ ret = BCHANL_MAINMENU_SELECT_NOSELECT;
91117 break;
118+ }
119+ break;
120+ case 3: /* [外部板] */
121+ switch (i & 0xff) {
122+ case 1: /* [外部板管理] */
123+ ret = BCHANL_MAINMENU_SELECT_EXTBBS_MANAGER;
124+ break;
125+ case 3: /* [板追加] */
126+ ret = BCHANL_MAINMENU_SELECT_EXTBBS_REGISTER;
127+ break;
128+ case 4: /* [一つ上げる] */
129+ ret = BCHANL_MAINMENU_SELECT_EXTBBS_UP;
130+ break;
131+ case 5: /* [一つ下げる] */
132+ ret = BCHANL_MAINMENU_SELECT_EXTBBS_DOWN;
133+ break;
134+ case 6: /* [削除] */
135+ ret = BCHANL_MAINMENU_SELECT_EXTBBS_DELETE;
136+ break;
92137 default:
93138 ret = BCHANL_MAINMENU_SELECT_NOSELECT;
94139 break;
--- bchanl/trunk/src/bchanl_menus.h (revision 453)
+++ bchanl/trunk/src/bchanl_menus.h (revision 454)
@@ -38,13 +38,17 @@
3838
3939 IMPORT W bchanl_mainmenu_initialize(bchanl_mainmenu_t *mainmenu, W dnum);
4040 IMPORT VOID bchanl_mainmenu_finalize(bchanl_mainmenu_t *mainmenu);
41-IMPORT W bchanl_mainmenu_setup(bchanl_mainmenu_t *mainmenu, Bool subectjoptionenable);
41+IMPORT W bchanl_mainmenu_setup(bchanl_mainmenu_t *mainmenu, Bool subectjoptionenable, Bool extbbsmanageropen, Bool extbbsselected);
4242 #define BCHANL_MAINMENU_SELECT_NOSELECT 0
4343 #define BCHANL_MAINMENU_SELECT_CLOSE 1
4444 #define BCHANL_MAINMENU_SELECT_REDISPLAY 2
4545 #define BCHANL_MAINMENU_SELECT_BBSMENUFETCH 3
4646 #define BCHANL_MAINMENU_SELECT_SUBJECTOPTION 4
47-#define BCHANL_MAINMENU_SELECT_REGISTEREXTBBS 5
47+#define BCHANL_MAINMENU_SELECT_EXTBBS_MANAGER 5
48+#define BCHANL_MAINMENU_SELECT_EXTBBS_REGISTER 6
49+#define BCHANL_MAINMENU_SELECT_EXTBBS_UP 7
50+#define BCHANL_MAINMENU_SELECT_EXTBBS_DOWN 8
51+#define BCHANL_MAINMENU_SELECT_EXTBBS_DELETE 9
4852 IMPORT W bchanl_mainmenu_popup(bchanl_mainmenu_t *mainmenu, PNT pos);
4953 IMPORT W bchanl_mainmenu_keyselect(bchanl_mainmenu_t *mainmenu, TC keycode);
5054
--- bchanl/trunk/src/main.c (revision 453)
+++ bchanl/trunk/src/main.c (revision 454)
@@ -1392,11 +1392,12 @@
13921392
13931393 LOCAL VOID bchanl_setupmenu(bchanl_t *bchanl)
13941394 {
1395- Bool isopen;
1395+ Bool isopen, isopen_extbbs;
13961396
13971397 isopen = subjectoptionwindow_isopen(bchanl->subjectoptionwindow);
1398+ isopen_extbbs = externalbbswindow_isopen(bchanl->externalbbswindow);
13981399
1399- bchanl_mainmenu_setup(&bchanl->mainmenu, isopen);
1400+ bchanl_mainmenu_setup(&bchanl->mainmenu, isopen, isopen_extbbs, False);
14001401 }
14011402
14021403 LOCAL VOID bchanl_selectmenu(bchanl_t *bchanl, W sel)
@@ -1423,11 +1424,7 @@
14231424 subjectoptionwindow_close(bchanl->subjectoptionwindow);
14241425 }
14251426 break;
1426- case BCHANL_MAINMENU_SELECT_REGISTEREXTBBS: /* [外部板の追加] */
1427- isopen = registerexternalwindow_isopen(bchanl->registerexternalwindow);
1428- if (isopen == False) {
1429- registerexternalwindow_open(bchanl->registerexternalwindow);
1430- }
1427+ case BCHANL_MAINMENU_SELECT_EXTBBS_MANAGER: /* [外部板の追加] */
14311428 isopen = externalbbswindow_isopen(bchanl->externalbbswindow);
14321429 if (isopen == False) {
14331430
@@ -1440,6 +1437,19 @@
14401437 extbbslist_editcontext_setviewrect(bchanl->bbsmenu.editctx, 0, 0, work.c.right - work.c.left, work.c.bottom - work.c.top);
14411438 externalbbswindow_setworkrect(bchanl->externalbbswindow, 0, 0, work.c.right - work.c.left, work.c.bottom - work.c.top);
14421439 }
1440+ break;
1441+ case BCHANL_MAINMENU_SELECT_EXTBBS_REGISTER:
1442+ isopen = registerexternalwindow_isopen(bchanl->registerexternalwindow);
1443+ if (isopen == False) {
1444+ registerexternalwindow_open(bchanl->registerexternalwindow);
1445+ }
1446+ break;
1447+ case BCHANL_MAINMENU_SELECT_EXTBBS_UP:
1448+ break;
1449+ case BCHANL_MAINMENU_SELECT_EXTBBS_DOWN:
1450+ break;
1451+ case BCHANL_MAINMENU_SELECT_EXTBBS_DELETE:
1452+ break;
14431453 }
14441454 return;
14451455 }
Show on old repository browser