OSDN Git Service

unite res index info.
authorornse01 <ornse01@users.sourceforge.jp>
Sat, 12 Jun 2010 10:00:12 +0000 (10:00 +0000)
committerornse01 <ornse01@users.sourceforge.jp>
Sat, 12 Jun 2010 10:00:12 +0000 (10:00 +0000)
git-svn-id: http://svn.sourceforge.jp/svnroot/bchan/bchan/trunk@123 20a0b8eb-f62a-4a12-8fe1-b598822500fb

src/Makefile
src/main.c

index 447e637..2e250d2 100644 (file)
@@ -38,7 +38,7 @@ VPATH = $(S)
 HEADER := $(S) $(HEADER)
 
 # ¥½¡¼¥¹¥Õ¥¡¥¤¥ë
-SRC =  main.c cache.c parser.c layout.c window.c retriever.c tadlib.c confirm.c poptray.c postres.c http.c submit.c sjisstring.c parselib.c submitutil.c bchan_vobj.c tadurl.c bchan_panels.c bchan_menus.c residhash.c
+SRC =  main.c cache.c parser.c layout.c window.c retriever.c tadlib.c confirm.c poptray.c postres.c http.c submit.c sjisstring.c parselib.c submitutil.c bchan_vobj.c tadurl.c bchan_panels.c bchan_menus.c residhash.c resindexhash.c
 
 # ¥Ç¡¼¥¿¥Ü¥Ã¥¯¥¹¥½¡¼¥¹¥Õ¥¡¥¤¥ë
 DBSRC =
index e006163..1afae13 100644 (file)
@@ -619,8 +619,22 @@ LOCAL VOID bchan_butdn_pressnumber(bchan_t *bchan, WEVENT *wev, W resindex)
        W size, err;
        PNT pos;
        B *data;
+       COLOR color;
+       UW attr = 0;
 
        DP(("press DATDRAW_FINDACTION_TYPE_NUMBER: %d\n", resindex + 1));
+       err = datcache_searchresindexdata(bchan->cache, resindex, &attr, &color);
+       if (err == DATCACHE_SEARCHRESINDEXDATA_FOUND) {
+               if ((attr & DATCACHE_RESINDEXDATA_FLAG_NG) != 0) {
+                       err = bchan_resnumbermenu_setngselected(&bchan->resnumbermenu, True);
+               } else {
+                       err = bchan_resnumbermenu_setngselected(&bchan->resnumbermenu, False);
+               }
+       } else {
+               attr = 0;
+               err = bchan_resnumbermenu_setngselected(&bchan->resnumbermenu, False);
+       }
+
        pos.x = wev->s.pos.x;
        pos.y = wev->s.pos.y;
        gcnv_abs(bchan->gid, &pos);
@@ -634,6 +648,12 @@ LOCAL VOID bchan_butdn_pressnumber(bchan_t *bchan, WEVENT *wev, W resindex)
                datlayout_resindextotraytextdata(bchan->layout, resindex, data, size);
                bchan_pushstringtotray((TC*)data, size/2);
                free(data);
+       } if (err == BCHAN_RESNUMBERMENU_SELECT_NG) {
+               if ((attr & DATCACHE_RESINDEXDATA_FLAG_NG) != 0) {
+                       datcache_removeresindexdata(bchan->cache, resindex);
+               } else {
+                       err = datcache_addresindexdata(bchan->cache, resindex, DATCACHE_RESINDEXDATA_FLAG_NG, 0x10000000);
+               }
        }
 }