OSDN Git Service

change displaying menu condition in NG.
authorornse01 <ornse01@users.sourceforge.jp>
Sun, 26 Dec 2010 09:07:19 +0000 (09:07 +0000)
committerornse01 <ornse01@users.sourceforge.jp>
Sun, 26 Dec 2010 09:07:19 +0000 (09:07 +0000)
git-svn-id: http://svn.sourceforge.jp/svnroot/bchan/bchan/trunk@161 20a0b8eb-f62a-4a12-8fe1-b598822500fb

src/main.c

index 23734c7..ba47589 100644 (file)
@@ -693,8 +693,21 @@ LOCAL VOID bchan_butdn_pressnumber(bchan_t *bchan, WEVENT *wev, W resindex)
        B *data;
        COLOR color;
        UW attr = 0;
+       Bool ok;
+       datlayout_res_t *layout_res;
 
        DP(("press DATDRAW_FINDACTION_TYPE_NUMBER: %d\n", resindex + 1));
+
+       ok = datlayoutarray_getresbyindex(bchan->layoutarray, resindex, &layout_res);
+       if (ok == False) {
+               return;
+       }
+
+       ok = datlayout_res_isenableidNG(layout_res);
+       if (ok == True) {
+               return;
+       }
+
        err = datcache_searchresindexdata(bchan->cache, resindex, &attr, &color);
        if (err == DATCACHE_SEARCHRESINDEXDATA_FOUND) {
                if ((attr & DATCACHE_RESINDEXDATA_FLAG_NG) != 0) {
@@ -740,15 +753,28 @@ LOCAL VOID bchan_butdn_pressresheaderid(bchan_t *bchan, WEVENT *wev, W resindex)
        B *data;
        COLOR color;
        UW attr = 0;
+       Bool ok;
+       datlayout_res_t *layout_res;
 
        DP(("press DATDRAW_FINDACTION_TYPE_ID\n"));
 
-       datlayout_getidfromindex(bchan->layout, resindex, &id, &id_len);
+       ok = datlayoutarray_getresbyindex(bchan->layoutarray, resindex, &layout_res);
+       if (ok == False) {
+               DP(("      id is not exist\n"));
+               return;
+       }
+
+       datlayout_res_getid(layout_res, &id, &id_len);
        if (id == NULL) {
                DP(("      id is not exist\n"));
                return;
        }
 
+       ok = datlayout_res_isenableindexNG(layout_res);
+       if (ok == True) {
+               return;
+       }
+
        err = datcache_searchresiddata(bchan->cache, id, id_len, &attr, &color);
        if (err == DATCACHE_SEARCHRESIDDATA_FOUND) {
                if ((attr & DATCACHE_RESIDDATA_FLAG_NG) != 0) {