Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, October 16, 2026

Diff for tucniak/cuchar/cc_key.c between version 1.4 and 1.5

version 1.4, 2005/12/01 18:52:28 version 1.5, 2005/12/02 17:15:00
Line 18  bool findmenukey(WIN *win,unsigned short
Line 18  bool findmenukey(WIN *win,unsigned short
   while(lines!=NULL)    while(lines!=NULL)
   {    {
     unsigned short sc=((CMENU*)lines->data)->shortcut;      unsigned short sc=((CMENU*)lines->data)->shortcut;
     if(((sc&KKMASK)>='a')&&((sc&KKMASK)<='z'))sc+='A'-'a';      if(((sc&CC_MASK_KEY)>='a')&&((sc&CC_MASK_KEY)<='z'))sc+='A'-'a';
     if((sc==key)&&(menu->select!=NULL))      if((sc==key)&&(menu->select!=NULL))
     {      {
       menu->select(win,((CMENU*)lines->data)->id);        menu->select(win,((CMENU*)lines->data)->id);
Line 47  bool dosendkeymessage(WIN *spcfocus,unsi
Line 47  bool dosendkeymessage(WIN *spcfocus,unsi
   bool chang=false,gets=false;    bool chang=false,gets=false;
   long len,i,line;    long len,i,line;
   char *er,*c,s;    char *er,*c,s;
   unsigned short kk=key&KKMASK;    unsigned short kk=key&CC_MASK_KEY;
   WIN *p;    WIN *p;
   switch(spcfocus->extra->type)    switch(spcfocus->extra->type)
   {    {
     case TP_EDIT:      case CC_TP_EDIT:
       if((key==(MD_CTRL|'c'))||(key==(MD_CTRL|'C'))){edit_copy(spcfocus);gets=true;break;}        if((key==(CC_D_CTRL|'c'))||(key==(CC_D_CTRL|'C'))){edit_copy(spcfocus);gets=true;break;}
       if((key==(MD_CTRL|'v'))||(key==(MD_CTRL|'V'))){edit_paste(spcfocus);gets=true;break;}        if((key==(CC_D_CTRL|'v'))||(key==(CC_D_CTRL|'V'))){edit_paste(spcfocus);gets=true;break;}
       if((key==(MD_CTRL|'x'))||(key==(MD_CTRL|'X'))){edit_cut(spcfocus);gets=true;break;}        if((key==(CC_D_CTRL|'x'))||(key==(CC_D_CTRL|'X'))){edit_cut(spcfocus);gets=true;break;}
       if((key&(MDMASK-MD_SHIFT)))break;        if((key&(CC_MASK_MOD-CC_D_SHIFT)))break;
       edit=&spcfocus->extra->edit;        edit=&spcfocus->extra->edit;
       if(edit->style==ED_READONLY)break;        if(edit->style==CC_ED_READONLY)break;
       len=strlen(edit->text);        len=strlen(edit->text);
       if(edit->curpos>len)edit->curpos=len;        if(edit->curpos>len)edit->curpos=len;
       if(edit->maskpos!=-1)        if(edit->maskpos!=-1)
Line 88  bool dosendkeymessage(WIN *spcfocus,unsi
Line 88  bool dosendkeymessage(WIN *spcfocus,unsi
       chang=true;        chang=true;
       gets=true;        gets=true;
     break;      break;
     case TP_BUTTON:      case CC_TP_BUTTON:
       button=&spcfocus->extra->button;        button=&spcfocus->extra->button;
       if((key&~MD_SHIFT)==' ')        if((key&~CC_D_SHIFT)==' ')
       {        {
         if(button->status==TS_HIGH)button->status=TS_EXPUSH;else button->status=TS_PUSH;          if(button->status==TS_HIGH)button->status=TS_EXPUSH;else button->status=TS_PUSH;
         chang=true;          chang=true;
Line 98  bool dosendkeymessage(WIN *spcfocus,unsi
Line 98  bool dosendkeymessage(WIN *spcfocus,unsi
         gets=true;          gets=true;
       }        }
     break;      break;
     case TP_MENU:      case CC_TP_MENU:
       if((kk>='a')&&(kk<='z')){key+='A'-'a';kk=key&KKMASK;}        if((kk>='a')&&(kk<='z')){key+='A'-'a';kk=key&CC_MASK_KEY;}
       menu=&spcfocus->extra->menu;        menu=&spcfocus->extra->menu;
       if(spcfocus==focuswin)        if(spcfocus==focuswin)
       {        {
Line 119  bool dosendkeymessage(WIN *spcfocus,unsi
Line 119  bool dosendkeymessage(WIN *spcfocus,unsi
               if(s==kk)                if(s==kk)
               {                {
                 menu->activeline=line;                  menu->activeline=line;
                 dosendsyskeymessage(spcfocus,KK_ENTER);                  dosendsyskeymessage(spcfocus,CC_K_ENTER);
               }                }
               i++;                i++;
             }              }
Line 130  bool dosendkeymessage(WIN *spcfocus,unsi
Line 130  bool dosendkeymessage(WIN *spcfocus,unsi
       }        }
       if((!menu->vert)||        if((!menu->vert)||
          (spcfocus->parent==NULL)||           (spcfocus->parent==NULL)||
          (spcfocus->parent->extra->type!=TP_MENU))gets|=findmenukey(spcfocus,key);           (spcfocus->parent->extra->type!=CC_TP_MENU))gets|=findmenukey(spcfocus,key);
     break;      break;
     case TP_DIALOG:      case CC_TP_DIALOG:
       if((kk>='a')&&(kk<='z'))kk+='A'-'a';        if((kk>='a')&&(kk<='z'))kk+='A'-'a';
       for(p=spcfocus->child;p!=NULL;p=p->next)        for(p=spcfocus->child;p!=NULL;p=p->next)
         if(p->extra->type==TP_BUTTON)          if(p->extra->type==CC_TP_BUTTON)
         {          {
           button=&p->extra->button;            button=&p->extra->button;
           c=button->text;            c=button->text;
Line 148  bool dosendkeymessage(WIN *spcfocus,unsi
Line 148  bool dosendkeymessage(WIN *spcfocus,unsi
               if((s>='a')&&(s<='z'))s+='A'-'a';                if((s>='a')&&(s<='z'))s+='A'-'a';
               if(s==kk)                if(s==kk)
               {                {
                 dosendsyskeymessage(p,KK_ENTER);                  dosendsyskeymessage(p,CC_K_ENTER);
                 gets=true;                  gets=true;
               }                }
               i++;                i++;
Line 178  bool dosendsyskeymessage(WIN *spcfocus,u
Line 178  bool dosendsyskeymessage(WIN *spcfocus,u
   if(spcfocus!=NULL)    if(spcfocus!=NULL)
   switch(spcfocus->extra->type)    switch(spcfocus->extra->type)
   {    {
     case TP_EDIT:      case CC_TP_EDIT:
       edit=&spcfocus->extra->edit;        edit=&spcfocus->extra->edit;
       len=strlen(edit->text);        len=strlen(edit->text);
       switch(key)        switch(key)
       {        {
         case KK_UP:          case CC_K_UP:
           set_focus(findprevwin(spcfocus));            set_focus(findprevwin(spcfocus));
           stat=0;            stat=0;
         break;          break;
         case KK_DOWN:          case CC_K_DOWN:
           set_focus(findnextwin(spcfocus));            set_focus(findnextwin(spcfocus));
           stat=0;            stat=0;
         break;          break;
         case KK_POPUP:          case CC_K_POPUP:
           x=0;            x=0;
           y=1;            y=1;
           client_to_screen(spcfocus,&x,&y);            client_to_screen(spcfocus,&x,&y);
           set_parent(clipboardmenu,spcfocus);            set_parent(clipboardmenu,spcfocus);
           track_popup_menu(clipboardmenu,x,y);            track_popup_menu(clipboardmenu,x,y);
         break;          break;
         case KK_INS|MD_CTRL:edit_copy(spcfocus);gets=true;break;          case CC_K_INS|CC_D_CTRL:edit_copy(spcfocus);gets=true;break;
         case KK_INS|MD_SHIFT:edit_paste(spcfocus);gets=true;break;          case CC_K_INS|CC_D_SHIFT:edit_paste(spcfocus);gets=true;break;
         case KK_DEL|MD_SHIFT:edit_cut(spcfocus);gets=true;break;          case CC_K_DEL|CC_D_SHIFT:edit_cut(spcfocus);gets=true;break;
         case KK_LEFT:          case CC_K_LEFT:
           if(edit->curpos>0){edit->curpos--;chang=true;}            if(edit->curpos>0){edit->curpos--;chang=true;}
           if(edit->maskpos!=-1){edit->maskpos=-1;chang=true;}            if(edit->maskpos!=-1){edit->maskpos=-1;chang=true;}
           gets=true;break;            gets=true;break;
         case KK_LEFT|MD_SHIFT:          case CC_K_LEFT|CC_D_SHIFT:
           if(len!=0)if(edit->maskpos==-1){edit->maskpos=edit->curpos;chang=true;}            if(len!=0)if(edit->maskpos==-1){edit->maskpos=edit->curpos;chang=true;}
           if(edit->curpos>0){edit->curpos--;chang=true;}            if(edit->curpos>0){edit->curpos--;chang=true;}
           gets=true;break;            gets=true;break;
         case KK_RIGHT:          case CC_K_RIGHT:
           if(edit->curpos<len){edit->curpos++;chang=true;}            if(edit->curpos<len){edit->curpos++;chang=true;}
           if(edit->maskpos!=-1){edit->maskpos=-1;chang=true;}            if(edit->maskpos!=-1){edit->maskpos=-1;chang=true;}
           gets=true;break;            gets=true;break;
         case KK_RIGHT|MD_SHIFT:          case CC_K_RIGHT|CC_D_SHIFT:
           if(len!=0)if(edit->maskpos==-1){edit->maskpos=edit->curpos;chang=true;}            if(len!=0)if(edit->maskpos==-1){edit->maskpos=edit->curpos;chang=true;}
           if(edit->curpos<len-1){edit->curpos++;chang=true;}            if(edit->curpos<len-1){edit->curpos++;chang=true;}
           gets=true;break;            gets=true;break;
         case KK_HOME:edit->curpos=0;edit->maskpos=-1;chang=true;gets=true;break;          case CC_K_HOME:edit->curpos=0;edit->maskpos=-1;chang=true;gets=true;break;
         case KK_HOME|MD_SHIFT:          case CC_K_HOME|CC_D_SHIFT:
           if(len!=0)edit->maskpos=edit->curpos;edit->curpos=0;chang=true;gets=true;break;            if(len!=0)edit->maskpos=edit->curpos;edit->curpos=0;chang=true;gets=true;break;
         case KK_END:edit->curpos=len;edit->maskpos=-1;chang=true;gets=true;break;          case CC_K_END:edit->curpos=len;edit->maskpos=-1;chang=true;gets=true;break;
         case KK_END|MD_SHIFT:          case CC_K_END|CC_D_SHIFT:
           if(len!=0)edit->maskpos=edit->curpos;edit->curpos=len-1;chang=true;gets=true;break;            if(len!=0)edit->maskpos=edit->curpos;edit->curpos=len-1;chang=true;gets=true;break;
         case KK_DEL:;          case CC_K_DEL:;
         if(edit->style==ED_READONLY)break;          if(edit->style==CC_ED_READONLY)break;
         if(edit->curpos<len)          if(edit->curpos<len)
         {          {
           if(edit->maskpos!=-1)            if(edit->maskpos!=-1)
Line 252  bool dosendsyskeymessage(WIN *spcfocus,u
Line 252  bool dosendsyskeymessage(WIN *spcfocus,u
         }          }
         gets=true;          gets=true;
         break;          break;
         case KK_BACK:          case CC_K_BACK:
         if(edit->style==ED_READONLY)break;          if(edit->style==CC_ED_READONLY)break;
         if((edit->curpos>0)||((edit->maskpos!=-1)&&(edit->curpos>=0)))          if((edit->curpos>0)||((edit->maskpos!=-1)&&(edit->curpos>=0)))
         {          {
           if(edit->maskpos!=-1)            if(edit->maskpos!=-1)
Line 295  bool dosendsyskeymessage(WIN *spcfocus,u
Line 295  bool dosendsyskeymessage(WIN *spcfocus,u
       }        }
       if(change!=NULL)change(spcfocus);        if(change!=NULL)change(spcfocus);
     break;      break;
     case TP_BUTTON:      case CC_TP_BUTTON:
     button=&spcfocus->extra->button;      button=&spcfocus->extra->button;
     if(key==KK_ENTER)      if(key==CC_K_ENTER)
     {      {
       if(button->status==TS_HIGH)button->status=TS_EXPUSH;else button->status=TS_PUSH;        if(button->status==TS_HIGH)button->status=TS_EXPUSH;else button->status=TS_PUSH;
       chang=true;        chang=true;
       if(button->push!=NULL)button->push(spcfocus);        if(button->push!=NULL)button->push(spcfocus);
       gets=true;        gets=true;
     }      }
     else if((key==KK_LEFT)||(key==KK_UP))      else if((key==CC_K_LEFT)||(key==CC_K_UP))
     {      {
       set_focus(findprevwin(spcfocus));        set_focus(findprevwin(spcfocus));
       gets=true;        gets=true;
       stat=0;        stat=0;
     }      }
     else if((key==KK_RIGHT)||(key==KK_DOWN))      else if((key==CC_K_RIGHT)||(key==CC_K_DOWN))
     {      {
       set_focus(findnextwin(spcfocus));        set_focus(findnextwin(spcfocus));
       gets=true;        gets=true;
       stat=0;        stat=0;
     }      }
     break;      break;
     case TP_LIST:      case CC_TP_LIST:
     list=&spcfocus->extra->list;      list=&spcfocus->extra->list;
     vscroll=&list->vscroll->extra->scroll;      vscroll=&list->vscroll->extra->scroll;
     hscroll=&list->hscroll->extra->scroll;      hscroll=&list->hscroll->extra->scroll;
Line 325  bool dosendsyskeymessage(WIN *spcfocus,u
Line 325  bool dosendsyskeymessage(WIN *spcfocus,u
     numlines=list->numlines;      numlines=list->numlines;
     switch(key)      switch(key)
     {      {
       case KK_LEFT:if(hscroll->pos>hscroll->minpos){hscroll->pos--;chang=true;}gets=true;break;        case CC_K_LEFT:if(hscroll->pos>hscroll->minpos){hscroll->pos--;chang=true;}gets=true;break;
       case KK_RIGHT:if(hscroll->pos<hscroll->maxpos){hscroll->pos++;chang=true;}gets=true;break;        case CC_K_RIGHT:if(hscroll->pos<hscroll->maxpos){hscroll->pos++;chang=true;}gets=true;break;
       case KK_UP:list->activeline--;gets=true;break;        case CC_K_UP:list->activeline--;gets=true;break;
       case KK_DOWN:list->activeline++;gets=true;break;        case CC_K_DOWN:list->activeline++;gets=true;break;
       case KK_PGUP:list->activeline-=vscroll->pagecnt;gets=true;break;        case CC_K_PGUP:list->activeline-=vscroll->pagecnt;gets=true;break;
       case KK_PGDOWN:list->activeline+=vscroll->pagecnt;gets=true;break;        case CC_K_PGDOWN:list->activeline+=vscroll->pagecnt;gets=true;break;
       case KK_HOME:list->activeline=0;gets=true;break;        case CC_K_HOME:list->activeline=0;gets=true;break;
       case KK_END:list->activeline=numlines-1;gets=true;break;        case CC_K_END:list->activeline=numlines-1;gets=true;break;
       case KK_ENTER:        case CC_K_ENTER:
       if(list->combotyp==CT_COMBO)        if(list->combotyp==CC_LI_COMBO)
       {        {
         capturewin=NULL;          capturewin=NULL;
         sendmousemessage(mousex,mousey,MM_LBUTTONUP);          sendmousemessage(mousex,mousey,CC_M_LBUTTONUP);
         set_focus(spcfocus->parent);          set_focus(spcfocus->parent);
         show_win(spcfocus,false);          show_win(spcfocus,false);
         gets=true;          gets=true;
       }        }
       if(list->dblclk!=NULL)        if(list->dblclk!=NULL)
       {        {
         if((list->combotyp==CT_COMBO)&&(spcfocus->parent!=NULL)&&          if((list->combotyp==CC_LI_COMBO)&&(spcfocus->parent!=NULL)&&
            (spcfocus->parent->extra->type==TP_COMBO)&&(list->activeitem!=NULL))             (spcfocus->parent->extra->type==CC_TP_COMBO)&&(list->activeitem!=NULL))
         {          {
           combo=&spcfocus->parent->extra->combo;            combo=&spcfocus->parent->extra->combo;
           char *data=list->activeitem->data;            char *data=list->activeitem->data;
Line 355  bool dosendsyskeymessage(WIN *spcfocus,u
Line 355  bool dosendsyskeymessage(WIN *spcfocus,u
         chang=true;          chang=true;
       }        }
       break;        break;
       case KK_ESC:        case CC_K_ESC:
       if(list->combotyp==CT_COMBO)        if(list->combotyp==CC_LI_COMBO)
       {        {
         capturewin=NULL;          capturewin=NULL;
         sendmousemessage(mousex,mousey,MM_LBUTTONUP);          sendmousemessage(mousex,mousey,CC_M_LBUTTONUP);
         set_focus(spcfocus->parent);          set_focus(spcfocus->parent);
         show_win(spcfocus,false);          show_win(spcfocus,false);
         gets=true;          gets=true;
Line 377  bool dosendsyskeymessage(WIN *spcfocus,u
Line 377  bool dosendsyskeymessage(WIN *spcfocus,u
       chang=true;        chang=true;
     }      }
     break;      break;
     case TP_COMBO:      case CC_TP_COMBO:
     combo=&spcfocus->extra->combo;      combo=&spcfocus->extra->combo;
     list=&combo->list->extra->list;      list=&combo->list->extra->list;
     vscroll=&list->vscroll->extra->scroll;      vscroll=&list->vscroll->extra->scroll;
Line 388  bool dosendsyskeymessage(WIN *spcfocus,u
Line 388  bool dosendsyskeymessage(WIN *spcfocus,u
     client_to_screen(spcfocus,&x,&y);      client_to_screen(spcfocus,&x,&y);
     switch(key)      switch(key)
     {      {
       case KK_LEFT:combo->scroll--;chang=true;gets=true;break;        case CC_K_LEFT:combo->scroll--;chang=true;gets=true;break;
       case KK_RIGHT:combo->scroll++;chang=true;gets=true;break;        case CC_K_RIGHT:combo->scroll++;chang=true;gets=true;break;
       case KK_UP:combo->activeline--;gets=true;break;        case CC_K_UP:combo->activeline--;gets=true;break;
       case KK_DOWN:combo->activeline++;gets=true;break;        case CC_K_DOWN:combo->activeline++;gets=true;break;
       case KK_PGUP:combo->activeline-=vscroll->pagecnt;gets=true;break;        case CC_K_PGUP:combo->activeline-=vscroll->pagecnt;gets=true;break;
       case KK_PGDOWN:combo->activeline+=vscroll->pagecnt;gets=true;break;        case CC_K_PGDOWN:combo->activeline+=vscroll->pagecnt;gets=true;break;
       case KK_HOME:combo->activeline=0;gets=true;break;        case CC_K_HOME:combo->activeline=0;gets=true;break;
       case KK_END:combo->activeline=numlines-1;gets=true;break;        case CC_K_END:combo->activeline=numlines-1;gets=true;break;
       case KK_ENTER:        case CC_K_ENTER:
         if(capturewin!=spcfocus)capturewin=NULL;          if(capturewin!=spcfocus)capturewin=NULL;
         sendmousemessage(x,y,MM_LBUTTONDOWN);          sendmousemessage(x,y,CC_M_LBUTTONDOWN);
         sendmousemessage(x,y,MM_LBUTTONUP);          sendmousemessage(x,y,CC_M_LBUTTONUP);
         gets=true;          gets=true;
       break;        break;
     }      }
Line 414  bool dosendsyskeymessage(WIN *spcfocus,u
Line 414  bool dosendsyskeymessage(WIN *spcfocus,u
       if(combo->change!=NULL)combo->change(spcfocus);        if(combo->change!=NULL)combo->change(spcfocus);
     }      }
     break;      break;
     case TP_MENU:      case CC_TP_MENU:
     menu=&spcfocus->extra->menu;      menu=&spcfocus->extra->menu;
     actline=menu->activeline;      actline=menu->activeline;
     if(menu->lines!=NULL)numlines=g_list_length(menu->lines);else numlines=0;      if(menu->lines!=NULL)numlines=g_list_length(menu->lines);else numlines=0;
     switch(key)      switch(key)
     {      {
       case KK_LEFT:        case CC_K_LEFT:
         if(!isfocused(spcfocus))return gets;          if(!isfocused(spcfocus))return gets;
         if(menu->lines==NULL)return gets;          if(menu->lines==NULL)return gets;
         if(!menu->vert)          if(!menu->vert)
Line 442  bool dosendsyskeymessage(WIN *spcfocus,u
Line 442  bool dosendsyskeymessage(WIN *spcfocus,u
           while(strcmp(((CMENU*)lines->data)->text,"-")==0);            while(strcmp(((CMENU*)lines->data)->text,"-")==0);
           if(focuswin!=spcfocus)            if(focuswin!=spcfocus)
           {            {
             dosendsyskeymessage(spcfocus,KK_ENTER);              dosendsyskeymessage(spcfocus,CC_K_ENTER);
             chang=false;              chang=false;
           }            }
           gets=true;            gets=true;
Line 452  bool dosendsyskeymessage(WIN *spcfocus,u
Line 452  bool dosendsyskeymessage(WIN *spcfocus,u
           if(spcfocus->parent!=NULL)            if(spcfocus->parent!=NULL)
           {            {
             WIN *parent=spcfocus->parent;              WIN *parent=spcfocus->parent;
             if(parent->extra->type==TP_MENU)              if(parent->extra->type==CC_TP_MENU)
             {              {
               MENU *menus=&parent->extra->menu;                MENU *menus=&parent->extra->menu;
               if(menus->vert)                if(menus->vert)
Line 468  bool dosendsyskeymessage(WIN *spcfocus,u
Line 468  bool dosendsyskeymessage(WIN *spcfocus,u
           }            }
         }          }
       break;        break;
       case KK_RIGHT:        case CC_K_RIGHT:
         if(!isfocused(spcfocus))return gets;          if(!isfocused(spcfocus))return gets;
         if(menu->lines==NULL)return gets;          if(menu->lines==NULL)return gets;
         if(!menu->vert)          if(!menu->vert)
Line 487  bool dosendsyskeymessage(WIN *spcfocus,u
Line 487  bool dosendsyskeymessage(WIN *spcfocus,u
           while(strcmp(((CMENU*)lines->data)->text,"-")==0);            while(strcmp(((CMENU*)lines->data)->text,"-")==0);
           if(focuswin!=spcfocus)            if(focuswin!=spcfocus)
           {            {
             dosendsyskeymessage(spcfocus,KK_ENTER);              dosendsyskeymessage(spcfocus,CC_K_ENTER);
             chang=false;              chang=false;
           }            }
           gets=true;            gets=true;
Line 503  bool dosendsyskeymessage(WIN *spcfocus,u
Line 503  bool dosendsyskeymessage(WIN *spcfocus,u
               y=menu->activeline+1;                y=menu->activeline+1;
               client_to_screen(spcfocus,&x,&y);                client_to_screen(spcfocus,&x,&y);
               if(capturewin!=spcfocus)capturewin=NULL;                if(capturewin!=spcfocus)capturewin=NULL;
               sendmousemessage(x,y,MM_MOUSEMOVE);                sendmousemessage(x,y,CC_M_MOUSEMOVE);
               if(submenu!=NULL)                if(submenu!=NULL)
               {                {
                 stat=2;                  stat=2;
Line 515  bool dosendsyskeymessage(WIN *spcfocus,u
Line 515  bool dosendsyskeymessage(WIN *spcfocus,u
           }            }
         }          }
       break;        break;
       case KK_UP:        case CC_K_UP:
         if(!isfocused(spcfocus))return gets;          if(!isfocused(spcfocus))return gets;
         if(menu->lines==NULL)return gets;          if(menu->lines==NULL)return gets;
         start=lines=g_list_nth(menu->lines,menu->activeline);          start=lines=g_list_nth(menu->lines,menu->activeline);
Line 534  bool dosendsyskeymessage(WIN *spcfocus,u
Line 534  bool dosendsyskeymessage(WIN *spcfocus,u
         while(strcmp(((CMENU*)lines->data)->text,"-")==0);          while(strcmp(((CMENU*)lines->data)->text,"-")==0);
         gets=true;          gets=true;
       break;        break;
       case KK_DOWN:        case CC_K_DOWN:
         if(!isfocused(spcfocus))return gets;          if(!isfocused(spcfocus))return gets;
         if(menu->lines==NULL)return gets;          if(menu->lines==NULL)return gets;
         if(menu->vert)          if(menu->vert)
Line 554  bool dosendsyskeymessage(WIN *spcfocus,u
Line 554  bool dosendsyskeymessage(WIN *spcfocus,u
         }          }
         else          else
         {          {
           dosendsyskeymessage(spcfocus,KK_ENTER);            dosendsyskeymessage(spcfocus,CC_K_ENTER);
           chang=false;            chang=false;
           gets=true;            gets=true;
         }          }
       break;        break;
       case KK_ENTER:        case CC_K_ENTER:
       if(!isfocused(spcfocus))return gets;        if(!isfocused(spcfocus))return gets;
       if(menu->lines==NULL)return gets;        if(menu->lines==NULL)return gets;
       if(menu->vert)        if(menu->vert)
Line 571  bool dosendsyskeymessage(WIN *spcfocus,u
Line 571  bool dosendsyskeymessage(WIN *spcfocus,u
           client_to_screen(spcfocus,&x,&y);            client_to_screen(spcfocus,&x,&y);
           if(capturewin!=spcfocus)capturewin=NULL;            if(capturewin!=spcfocus)capturewin=NULL;
           WIN *submenu=((CMENU*)g_list_nth(menu->lines,menu->activeline)->data)->submenu;            WIN *submenu=((CMENU*)g_list_nth(menu->lines,menu->activeline)->data)->submenu;
           sendmousemessage(x,y,submenu!=NULL?MM_MOUSEMOVE:MM_LBUTTONDOWN);            sendmousemessage(x,y,submenu!=NULL?CC_M_MOUSEMOVE:CC_M_LBUTTONDOWN);
           if(submenu==NULL)sendmousemessage(x,y,MM_LBUTTONUP);            if(submenu==NULL)sendmousemessage(x,y,CC_M_LBUTTONUP);
           if(submenu!=NULL)            if(submenu!=NULL)
           {            {
             if(submenu->extra->menu.activeline==-1)submenu->extra->menu.activeline=0;              if(submenu->extra->menu.activeline==-1)submenu->extra->menu.activeline=0;
Line 580  bool dosendsyskeymessage(WIN *spcfocus,u
Line 580  bool dosendsyskeymessage(WIN *spcfocus,u
             redrawclientwin(submenu);              redrawclientwin(submenu);
           }            }
           else            else
             sendmousemessage(gpmev.x,gpmev.y,MM_MOUSEMOVE);              sendmousemessage(gpmev.x,gpmev.y,CC_M_MOUSEMOVE);
           gets=true;            gets=true;
         }          }
       }        }
Line 602  bool dosendsyskeymessage(WIN *spcfocus,u
Line 602  bool dosendsyskeymessage(WIN *spcfocus,u
           client_to_screen(spcfocus,&x,&y);            client_to_screen(spcfocus,&x,&y);
           menu->activeline=-1;            menu->activeline=-1;
           if(capturewin!=spcfocus)capturewin=NULL;            if(capturewin!=spcfocus)capturewin=NULL;
           sendmousemessage(x,y,MM_MOUSEMOVE);            sendmousemessage(x,y,CC_M_MOUSEMOVE);
           sendmousemessage(x,y+1,MM_MOUSEMOVE);            sendmousemessage(x,y+1,CC_M_MOUSEMOVE);
           if(submenu!=NULL)            if(submenu!=NULL)
           {            {
             if(submenu->extra->menu.activeline==-1)submenu->extra->menu.activeline=0;              if(submenu->extra->menu.activeline==-1)submenu->extra->menu.activeline=0;
             redrawclientwin(submenu);              redrawclientwin(submenu);
           }            }
           else sendmousemessage(gpmev.x,gpmev.y,MM_MOUSEMOVE);            else sendmousemessage(gpmev.x,gpmev.y,CC_M_MOUSEMOVE);
           stat=2;            stat=2;
         }          }
         gets=true;          gets=true;
       }        }
       break;        break;
       case KK_ESC:        case CC_K_ESC:
       if(!isfocused(spcfocus))return gets;        if(!isfocused(spcfocus))return gets;
       menu->activeline=-1;        menu->activeline=-1;
       if(menu->vert)        if(menu->vert)
       {        {
         if((spcfocus->parent!=NULL)&&(spcfocus->parent->extra->type==TP_MENU))          if((spcfocus->parent!=NULL)&&(spcfocus->parent->extra->type==CC_TP_MENU))
         {          {
           WIN *capt=capturewin;            WIN *capt=capturewin;
           show_win(spcfocus,false);            show_win(spcfocus,false);
Line 638  bool dosendsyskeymessage(WIN *spcfocus,u
Line 638  bool dosendsyskeymessage(WIN *spcfocus,u
       {        {
         stat=0;          stat=0;
         set_focus(lastfocused);          set_focus(lastfocused);
         sendmousemessage(gpmev.x,gpmev.y,MM_LBUTTONUP);          sendmousemessage(gpmev.x,gpmev.y,CC_M_LBUTTONUP);
       }        }
       gets=true;        gets=true;
       break;        break;
       case KK_LEFT|MD_ALT:        case CC_K_LEFT|CC_D_ALT:
       case KK_F9:        case CC_K_F9:
         if((!menu->vert)&&(!isfocused(spcfocus)))          if((!menu->vert)&&(!isfocused(spcfocus)))
         {          {
           menu->activeline=0;            menu->activeline=0;
Line 661  bool dosendsyskeymessage(WIN *spcfocus,u
Line 661  bool dosendsyskeymessage(WIN *spcfocus,u
       chang=true;        chang=true;
     }      }
     break;      break;
     case TP_DIALOG:      case CC_TP_DIALOG:
     dialog=&spcfocus->extra->dialog;      dialog=&spcfocus->extra->dialog;
     switch(key)      switch(key)
     {      {
       case KK_LEFT|MD_CTRL:        case CC_K_LEFT|CC_D_CTRL:
         move_win(spcfocus,spcfocus->x-1,NOCHANGE,NOCHANGE,NOCHANGE,NOCHANGE);gets=true;break;          move_win(spcfocus,spcfocus->x-1,CC_NOCHANGE,CC_NOCHANGE,CC_NOCHANGE,CC_NOCHANGE);gets=true;break;
       case KK_RIGHT|MD_CTRL:        case CC_K_RIGHT|CC_D_CTRL:
         move_win(spcfocus,spcfocus->x+1,NOCHANGE,NOCHANGE,NOCHANGE,NOCHANGE);gets=true;break;          move_win(spcfocus,spcfocus->x+1,CC_NOCHANGE,CC_NOCHANGE,CC_NOCHANGE,CC_NOCHANGE);gets=true;break;
       case KK_UP|MD_CTRL:        case CC_K_UP|CC_D_CTRL:
         move_win(spcfocus,NOCHANGE,spcfocus->y-1,NOCHANGE,NOCHANGE,NOCHANGE);gets=true;break;          move_win(spcfocus,CC_NOCHANGE,spcfocus->y-1,CC_NOCHANGE,CC_NOCHANGE,CC_NOCHANGE);gets=true;break;
       case KK_DOWN|MD_CTRL:        case CC_K_DOWN|CC_D_CTRL:
         move_win(spcfocus,NOCHANGE,spcfocus->y+1,NOCHANGE,NOCHANGE,NOCHANGE);gets=true;break;          move_win(spcfocus,CC_NOCHANGE,spcfocus->y+1,CC_NOCHANGE,CC_NOCHANGE,CC_NOCHANGE);gets=true;break;
       case KK_HOME|MD_CTRL:        case CC_K_HOME|CC_D_CTRL:
         move_win(spcfocus,spcfocus->x-1,spcfocus->y-1,NOCHANGE,NOCHANGE,NOCHANGE);gets=true;break;          move_win(spcfocus,spcfocus->x-1,spcfocus->y-1,CC_NOCHANGE,CC_NOCHANGE,CC_NOCHANGE);gets=true;break;
       case KK_PGUP|MD_CTRL:        case CC_K_PGUP|CC_D_CTRL:
         move_win(spcfocus,spcfocus->x+1,spcfocus->y-1,NOCHANGE,NOCHANGE,NOCHANGE);gets=true;break;          move_win(spcfocus,spcfocus->x+1,spcfocus->y-1,CC_NOCHANGE,CC_NOCHANGE,CC_NOCHANGE);gets=true;break;
       case KK_PGDOWN|MD_CTRL:        case CC_K_PGDOWN|CC_D_CTRL:
         move_win(spcfocus,spcfocus->x+1,spcfocus->y+1,NOCHANGE,NOCHANGE,NOCHANGE);gets=true;break;          move_win(spcfocus,spcfocus->x+1,spcfocus->y+1,CC_NOCHANGE,CC_NOCHANGE,CC_NOCHANGE);gets=true;break;
       case KK_END|MD_CTRL:        case CC_K_END|CC_D_CTRL:
         move_win(spcfocus,spcfocus->x-1,spcfocus->y+1,NOCHANGE,NOCHANGE,NOCHANGE);gets=true;break;          move_win(spcfocus,spcfocus->x-1,spcfocus->y+1,CC_NOCHANGE,CC_NOCHANGE,CC_NOCHANGE);gets=true;break;
       case KK_LEFT|MD_CTRL|MD_SHIFT:        case CC_K_LEFT|CC_D_CTRL|CC_D_SHIFT:
         move_win(spcfocus,NOCHANGE,NOCHANGE,spcfocus->vx-1,NOCHANGE,NOCHANGE);gets=true;break;          move_win(spcfocus,CC_NOCHANGE,CC_NOCHANGE,spcfocus->vx-1,CC_NOCHANGE,CC_NOCHANGE);gets=true;break;
       case KK_RIGHT|MD_CTRL|MD_SHIFT:        case CC_K_RIGHT|CC_D_CTRL|CC_D_SHIFT:
         move_win(spcfocus,NOCHANGE,NOCHANGE,spcfocus->vx+1,NOCHANGE,NOCHANGE);gets=true;break;          move_win(spcfocus,CC_NOCHANGE,CC_NOCHANGE,spcfocus->vx+1,CC_NOCHANGE,CC_NOCHANGE);gets=true;break;
       case KK_UP|MD_CTRL|MD_SHIFT:        case CC_K_UP|CC_D_CTRL|CC_D_SHIFT:
         move_win(spcfocus,NOCHANGE,NOCHANGE,NOCHANGE,spcfocus->vy-1,NOCHANGE);gets=true;break;          move_win(spcfocus,CC_NOCHANGE,CC_NOCHANGE,CC_NOCHANGE,spcfocus->vy-1,CC_NOCHANGE);gets=true;break;
       case KK_DOWN|MD_CTRL|MD_SHIFT:        case CC_K_DOWN|CC_D_CTRL|CC_D_SHIFT:
         move_win(spcfocus,NOCHANGE,NOCHANGE,NOCHANGE,spcfocus->vy+1,NOCHANGE);gets=true;break;          move_win(spcfocus,CC_NOCHANGE,CC_NOCHANGE,CC_NOCHANGE,spcfocus->vy+1,CC_NOCHANGE);gets=true;break;
       case KK_HOME|MD_CTRL|MD_SHIFT:        case CC_K_HOME|CC_D_CTRL|CC_D_SHIFT:
         move_win(spcfocus,NOCHANGE,NOCHANGE,spcfocus->vx-1,spcfocus->vy-1,NOCHANGE);gets=true;break;          move_win(spcfocus,CC_NOCHANGE,CC_NOCHANGE,spcfocus->vx-1,spcfocus->vy-1,CC_NOCHANGE);gets=true;break;
       case KK_PGUP|MD_CTRL|MD_SHIFT:        case CC_K_PGUP|CC_D_CTRL|CC_D_SHIFT:
         move_win(spcfocus,NOCHANGE,NOCHANGE,spcfocus->vx+1,spcfocus->vy-1,NOCHANGE);gets=true;break;          move_win(spcfocus,CC_NOCHANGE,CC_NOCHANGE,spcfocus->vx+1,spcfocus->vy-1,CC_NOCHANGE);gets=true;break;
       case KK_PGDOWN|MD_CTRL|MD_SHIFT:        case CC_K_PGDOWN|CC_D_CTRL|CC_D_SHIFT:
         move_win(spcfocus,NOCHANGE,NOCHANGE,spcfocus->vx+1,spcfocus->vy+1,NOCHANGE);gets=true;break;          move_win(spcfocus,CC_NOCHANGE,CC_NOCHANGE,spcfocus->vx+1,spcfocus->vy+1,CC_NOCHANGE);gets=true;break;
       case KK_END|MD_CTRL|MD_SHIFT:        case CC_K_END|CC_D_CTRL|CC_D_SHIFT:
         move_win(spcfocus,NOCHANGE,NOCHANGE,spcfocus->vx-1,spcfocus->vy+1,NOCHANGE);gets=true;break;          move_win(spcfocus,CC_NOCHANGE,CC_NOCHANGE,spcfocus->vx-1,spcfocus->vy+1,CC_NOCHANGE);gets=true;break;
       case KK_INS|MD_CTRL|MD_SHIFT:        case CC_K_INS|CC_D_CTRL|CC_D_SHIFT:
         if((dialog->style&ST_DI_HASMAXIMIZE)==ST_DI_HASMAXIMIZE)          if((dialog->style&CC_ST_DI_HASMAXIMIZE)==CC_ST_DI_HASMAXIMIZE)
           dialog->bmaximize->extra->button.push(dialog->bmaximize);            dialog->bmaximize->extra->button.push(dialog->bmaximize);
           gets=true;            gets=true;
       break;        break;
       case KK_DEL|MD_CTRL|MD_SHIFT:        case CC_K_DEL|CC_D_CTRL|CC_D_SHIFT:
         if((dialog->style&ST_DI_HASMINIMIZE)==ST_DI_HASMINIMIZE)          if((dialog->style&CC_ST_DI_HASMINIMIZE)==CC_ST_DI_HASMINIMIZE)
           dialog->bminimize->extra->button.push(dialog->bminimize);            dialog->bminimize->extra->button.push(dialog->bminimize);
           gets=true;            gets=true;
       break;        break;
       case KK_F4|MD_SHIFT:dialog->bclose->extra->button.push(dialog->bclose);gets=true;break;        case CC_K_F4|CC_D_SHIFT:dialog->bclose->extra->button.push(dialog->bclose);gets=true;break;
       case KK_TAB:        case CC_K_TAB:
         set_focus(findchild(spcfocus));          set_focus(findchild(spcfocus));
         gets=true;          gets=true;
       break;        break;
Line 718  bool dosendsyskeymessage(WIN *spcfocus,u
Line 718  bool dosendsyskeymessage(WIN *spcfocus,u
   if(!gets)    if(!gets)
   {    {
     if(spcfocus!=NULL)      if(spcfocus!=NULL)
     if(spcfocus->extra->type!=TP_DIALOG)      if(spcfocus->extra->type!=CC_TP_DIALOG)
     {      {
       if(key==KK_TAB)        if(key==CC_K_TAB)
       {        {
         set_focus(findnextwin(spcfocus));          set_focus(findnextwin(spcfocus));
         gets=true;          gets=true;
         stat=0;          stat=0;
       }        }
       else if(key==(KK_TAB|MD_CTRL))        else if(key==(CC_K_TAB|CC_D_CTRL))
       {        {
         set_focus(findprevwin(spcfocus));          set_focus(findprevwin(spcfocus));
         gets=true;          gets=true;
         stat=0;          stat=0;
       }        }
       else if(key==(KK_TAB|MD_SHIFT))        else if(key==(CC_K_TAB|CC_D_SHIFT))
       {        {
         if(spcfocus->parent!=NULL)set_focus(spcfocus->parent);          if(spcfocus->parent!=NULL)set_focus(spcfocus->parent);
         gets=true;          gets=true;
         stat=0;          stat=0;
       }        }
       else if(key==(KK_TAB|MD_SHIFT|MD_CTRL))        else if(key==(CC_K_TAB|CC_D_SHIFT|CC_D_CTRL))
       {        {
         WIN *child=findchild(spcfocus);          WIN *child=findchild(spcfocus);
         if(child!=NULL)set_focus(child);          if(child!=NULL)set_focus(child);
Line 746  bool dosendsyskeymessage(WIN *spcfocus,u
Line 746  bool dosendsyskeymessage(WIN *spcfocus,u
         stat=0;          stat=0;
       }        }
     }      }
     if(key==KK_F5)      if(key==CC_K_F5)
     {      {
       set_focus(findchildnom(findprevdialog(spcfocus)));        set_focus(findchildnom(findprevdialog(spcfocus)));
       gets=true;        gets=true;
       stat=0;        stat=0;
     }      }
     else if(key==KK_F6)      else if(key==CC_K_F6)
     {      {
       set_focus(findchildnom(findnextdialog(spcfocus)));        set_focus(findchildnom(findnextdialog(spcfocus)));
       gets=true;        gets=true;

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top