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

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

version 1.4, 2005/12/01 18:52:29 version 1.5, 2005/12/02 17:15:00
Line 20  bool file_open_dialog(WIN *parent,char *
Line 20  bool file_open_dialog(WIN *parent,char *
   WIN *di,*diskcombo,*filelist,*nameedit,*maskcombo;    WIN *di,*diskcombo,*filelist,*nameedit,*maskcombo;
   TUFOB *tufob;    TUFOB *tufob;
   PDIALOG pdialog;    PDIALOG pdialog;
   pdialog.type=TP_DIALOG;    pdialog.type=CC_TP_DIALOG;
   pdialog.style=ST_DI_SIZEABLE;    pdialog.style=CC_ST_DI_SIZEABLE;
   pdialog.caption=caption;    pdialog.caption=caption;
   pdialog.cback=cback;    pdialog.cback=cback;
   pdialog.cbactive=C_DEFAULT;    pdialog.cbactive=C_DEFAULT;
Line 47  bool file_open_dialog(WIN *parent,char *
Line 47  bool file_open_dialog(WIN *parent,char *
   disklines=g_list_append(disklines,"/");    disklines=g_list_append(disklines,"/");
   disklines=g_list_append(disklines,"/root");    disklines=g_list_append(disklines,"/root");
   disklines=g_list_append(disklines,"/home");    disklines=g_list_append(disklines,"/home");
   pbutton.type=TP_BUTTON;    pbutton.type=CC_TP_BUTTON;
   pbutton.style=BT_NORMAL;    pbutton.style=CC_BT_NORMAL;
   pbutton.checked=false;    pbutton.checked=false;
   pbutton.cback[0]=cback;    pbutton.cback[0]=cback;
   pbutton.cback[1]=cback;    pbutton.cback[1]=cback;
Line 65  bool file_open_dialog(WIN *parent,char *
Line 65  bool file_open_dialog(WIN *parent,char *
   pbutton.hasfocus=false;    pbutton.hasfocus=false;
   pbutton.push=fobdiskbuttonproc;    pbutton.push=fobdiskbuttonproc;
   pbutton.text="Look &in:";    pbutton.text="Look &in:";
   create_win(di,3,2,strlen(pbutton.text),1,(PUNION*)&pbutton,ST_VISIBLE,NULL);    create_win(di,3,2,strlen(pbutton.text),1,(PUNION*)&pbutton,CC_ST_VISIBLE,NULL);
   pcombo.type=TP_COMBO;    pcombo.type=CC_TP_COMBO;
   pcombo.activeline=0;    pcombo.activeline=0;
   pcombo.cback=C_DEFAULT;    pcombo.cback=C_DEFAULT;
   pcombo.cbutback[0]=C_BLUE;    pcombo.cbutback[0]=C_BLUE;
Line 89  bool file_open_dialog(WIN *parent,char *
Line 89  bool file_open_dialog(WIN *parent,char *
   pcombo.lstscrcarrowup=C_DEFAULT;    pcombo.lstscrcarrowup=C_DEFAULT;
   pcombo.lstscrcarrowdown=C_DEFAULT;    pcombo.lstscrcarrowdown=C_DEFAULT;
   pcombo.lstlines=disklines;    pcombo.lstlines=disklines;
   pcombo.edistyle=ED_READONLY;    pcombo.edistyle=CC_ED_READONLY;
   pcombo.edicbmask=C_WHITE;    pcombo.edicbmask=C_WHITE;
   pcombo.edicfmask=C_BLACK;    pcombo.edicfmask=C_BLACK;
   diskcombo=create_win(di,12,2,vx-3-12,1,(PUNION*)&pcombo,    diskcombo=create_win(di,12,2,vx-3-12,1,(PUNION*)&pcombo,
                        ST_VISIBLE|ST_A_HFIXED|ST_CO_WITH_EDIT,NULL);                         CC_ST_VISIBLE|CC_ST_A_HFIXED|CC_ST_CO_WITH_EDIT,NULL);
   tufob->diskcombo=diskcombo;    tufob->diskcombo=diskcombo;
   set_text(diskcombo,filename);    set_text(diskcombo,filename);
   plist.type=TP_LIST;    plist.type=CC_TP_LIST;
   plist.activeline=0;    plist.activeline=0;
   plist.lines=NULL;    plist.lines=NULL;
   plist.combotyp=CT_NORMAL;    plist.combotyp=CC_LI_NORMAL;
   plist.cback=C_DEFAULT;    plist.cback=C_DEFAULT;
   plist.cborder=C_DEFAULT;    plist.cborder=C_DEFAULT;
   plist.ctext=C_DEFAULT;    plist.ctext=C_DEFAULT;
Line 115  bool file_open_dialog(WIN *parent,char *
Line 115  bool file_open_dialog(WIN *parent,char *
   plist.scrcarrowdown=C_DEFAULT;    plist.scrcarrowdown=C_DEFAULT;
   plist.scrcback=C_DEFAULT;    plist.scrcback=C_DEFAULT;
   filelist=create_win(di,3,4,vx-5-10-3,vy-6-4,(PUNION*)&plist,    filelist=create_win(di,3,4,vx-5-10-3,vy-6-4,(PUNION*)&plist,
                       ST_VISIBLE|ST_A_FIXED,fobfilelistacelproc);                        CC_ST_VISIBLE|CC_ST_A_FIXED,fobfilelistacelproc);
   tufob->filelist=filelist;    tufob->filelist=filelist;
   pbutton.push=fobnamebuttonproc;    pbutton.push=fobnamebuttonproc;
   pbutton.text="File &name:";    pbutton.text="File &name:";
   create_win(di,3,vy-5,strlen(pbutton.text),1,(PUNION*)&pbutton,ST_VISIBLE|ST_AD_FIXED,NULL);    create_win(di,3,vy-5,strlen(pbutton.text),1,(PUNION*)&pbutton,CC_ST_VISIBLE|CC_ST_AD_FIXED,NULL);
   pedit.type=TP_EDIT;    pedit.type=CC_TP_EDIT;
   pedit.cback=C_DEFAULT;    pedit.cback=C_DEFAULT;
   pedit.cbmask=C_WHITE;    pedit.cbmask=C_WHITE;
   pedit.cfmask=C_BLACK;    pedit.cfmask=C_BLACK;
   pedit.style=ED_NORMAL;    pedit.style=CC_ED_NORMAL;
   pedit.ctext=C_DEFAULT;    pedit.ctext=C_DEFAULT;
   pedit.change=NULL;    pedit.change=NULL;
   nameedit=create_win(di,18,vy-5,vx-21,1,(PUNION*)&pedit,ST_VISIBLE|ST_AD_FIXED|ST_A_HFIXED,NULL);    nameedit=create_win(di,18,vy-5,vx-21,1,(PUNION*)&pedit,CC_ST_VISIBLE|CC_ST_AD_FIXED|CC_ST_A_HFIXED,NULL);
   tufob->nameedit=nameedit;    tufob->nameedit=nameedit;
   pbutton.push=fobmaskbuttonproc;    pbutton.push=fobmaskbuttonproc;
   pbutton.text="Files of &type:";    pbutton.text="Files of &type:";
   create_win(di,3,vy-3,strlen(pbutton.text),1,(PUNION*)&pbutton,ST_VISIBLE|ST_AD_FIXED,NULL);    create_win(di,3,vy-3,strlen(pbutton.text),1,(PUNION*)&pbutton,CC_ST_VISIBLE|CC_ST_AD_FIXED,NULL);
   masklines=NULL;    masklines=NULL;
   
   
Line 142  bool file_open_dialog(WIN *parent,char *
Line 142  bool file_open_dialog(WIN *parent,char *
   
   pcombo.change=fobdiskcombochangeproc;    pcombo.change=fobdiskcombochangeproc;
   pcombo.lstlines=masklines;    pcombo.lstlines=masklines;
   maskcombo=create_win(di,18,vy-3,vx-21,1,(PUNION*)&pcombo,ST_VISIBLE|ST_AD_FIXED|ST_A_HFIXED,NULL);    maskcombo=create_win(di,18,vy-3,vx-21,1,(PUNION*)&pcombo,CC_ST_VISIBLE|CC_ST_AD_FIXED|CC_ST_A_HFIXED,NULL);
   tufob->maskcombo=maskcombo;    tufob->maskcombo=maskcombo;
   pbutton.cback[0]=C_DEFAULT;    pbutton.cback[0]=C_DEFAULT;
   pbutton.cback[1]=C_DEFAULT;    pbutton.cback[1]=C_DEFAULT;
Line 156  bool file_open_dialog(WIN *parent,char *
Line 156  bool file_open_dialog(WIN *parent,char *
   pbutton.hasfocus=true;    pbutton.hasfocus=true;
   pbutton.push=fobopenbuttonproc;    pbutton.push=fobopenbuttonproc;
   pbutton.text="&Open";    pbutton.text="&Open";
   create_win(di,vx-13,4,10,1,(PUNION*)&pbutton,ST_VISIBLE|ST_AR_FIXED,NULL);    create_win(di,vx-13,4,10,1,(PUNION*)&pbutton,CC_ST_VISIBLE|CC_ST_AR_FIXED,NULL);
   pbutton.push=fobcancelbuttonproc;    pbutton.push=fobcancelbuttonproc;
   pbutton.text="&Cancel";    pbutton.text="&Cancel";
   create_win(di,vx-13,6,10,1,(PUNION*)&pbutton,ST_VISIBLE|ST_AR_FIXED,NULL);    create_win(di,vx-13,6,10,1,(PUNION*)&pbutton,CC_ST_VISIBLE|CC_ST_AR_FIXED,NULL);
   set_focus(filelist);    set_focus(filelist);
   show_win(di,true);    show_win(di,true);
   while((tufob->i==-1)&&apprun)message_pump();    while((tufob->i==-1)&&apprun)message_pump();
Line 188  long color_dialog(WIN *parent,char *capt
Line 188  long color_dialog(WIN *parent,char *capt
   PPAINT ppaint;    PPAINT ppaint;
   PCOMBO pcombo;    PCOMBO pcombo;
   GList *lines;    GList *lines;
   pdialog.type=TP_DIALOG;    pdialog.type=CC_TP_DIALOG;
   pdialog.style=0;    pdialog.style=0;
   pdialog.caption=caption;    pdialog.caption=caption;
   pdialog.cback=cback;    pdialog.cback=cback;
Line 206  long color_dialog(WIN *parent,char *capt
Line 206  long color_dialog(WIN *parent,char *capt
   di->user=malloc(sizeof(TUCB));    di->user=malloc(sizeof(TUCB));
   tucb=((TUCB*)(di->user));    tucb=((TUCB*)(di->user));
   tucb->i=0;    tucb->i=0;
   ppaint.type=TP_PAINT;    ppaint.type=CC_TP_PAINT;
   ppaint.style=PA_PATTERN;    ppaint.style=CC_PA_PATTERN;
   for(y=0;y<4;y++)    for(y=0;y<4;y++)
     for(x=0;x<4;x++)      for(x=0;x<4;x++)
     {      {
       i=y*4+x;        i=y*4+x;
       ppaint.cback=i;        ppaint.cback=i;
       ppaint.color=i;        ppaint.color=i;
       p=create_win(di,2*x+5,y+3,2,1,(PUNION*)&ppaint,ST_VISIBLE,cbpaintacelproc);        p=create_win(di,2*x+5,y+3,2,1,(PUNION*)&ppaint,CC_ST_VISIBLE,cbpaintacelproc);
       p->user=(void*)i;        p->user=(void*)i;
     }      }
   lines=NULL;    lines=NULL;
Line 234  long color_dialog(WIN *parent,char *capt
Line 234  long color_dialog(WIN *parent,char *capt
   lines=g_list_append(lines,getcolorname(C_LMAGENTA));    lines=g_list_append(lines,getcolorname(C_LMAGENTA));
   lines=g_list_append(lines,getcolorname(C_LCYAN));    lines=g_list_append(lines,getcolorname(C_LCYAN));
   lines=g_list_append(lines,getcolorname(C_LWHITE));    lines=g_list_append(lines,getcolorname(C_LWHITE));
   pcombo.type=TP_COMBO;    pcombo.type=CC_TP_COMBO;
   pcombo.activeline=color;    pcombo.activeline=color;
   pcombo.cback=C_DEFAULT;    pcombo.cback=C_DEFAULT;
   pcombo.cbutback[0]=C_BLUE;    pcombo.cbutback[0]=C_BLUE;
Line 257  long color_dialog(WIN *parent,char *capt
Line 257  long color_dialog(WIN *parent,char *capt
   pcombo.lstscrcarrowup=C_DEFAULT;    pcombo.lstscrcarrowup=C_DEFAULT;
   pcombo.lstscrcarrowdown=C_DEFAULT;    pcombo.lstscrcarrowdown=C_DEFAULT;
   pcombo.lstlines=lines;    pcombo.lstlines=lines;
   combo=create_win(di,17,2,MAXLEN_COLOR_STRING-1,1,(PUNION*)&pcombo,ST_VISIBLE,NULL);    combo=create_win(di,17,2,MAXLEN_COLOR_STRING-1,1,(PUNION*)&pcombo,CC_ST_VISIBLE,NULL);
   tucb->combo=combo;    tucb->combo=combo;
   ppaint.cback=C_BLUE;    ppaint.cback=C_BLUE;
   ppaint.color=C_WHITE;    ppaint.color=C_WHITE;
   p1=create_win(di,(color%4)*2+5,2,2,1,(PUNION*)&ppaint,ST_VISIBLE,NULL);    p1=create_win(di,(color%4)*2+5,2,2,1,(PUNION*)&ppaint,CC_ST_VISIBLE,NULL);
   create_win(p1,0,5,2,1,(PUNION*)&ppaint,ST_VISIBLE,NULL);    create_win(p1,0,5,2,1,(PUNION*)&ppaint,CC_ST_VISIBLE,NULL);
   tucb->p1=p1;    tucb->p1=p1;
   p2=create_win(di,3,(color/4)+3,2,1,(PUNION*)&ppaint,ST_VISIBLE,NULL);    p2=create_win(di,3,(color/4)+3,2,1,(PUNION*)&ppaint,CC_ST_VISIBLE,NULL);
   create_win(p2,10,0,2,1,(PUNION*)&ppaint,ST_VISIBLE,NULL);    create_win(p2,10,0,2,1,(PUNION*)&ppaint,CC_ST_VISIBLE,NULL);
   tucb->p2=p2;    tucb->p2=p2;
   pbutton.type=TP_BUTTON;    pbutton.type=CC_TP_BUTTON;
   pbutton.style=BT_NORMAL;    pbutton.style=CC_BT_NORMAL;
   pbutton.checked=false;    pbutton.checked=false;
   pbutton.cback[0]=C_DEFAULT;    pbutton.cback[0]=C_DEFAULT;
   pbutton.cback[1]=C_DEFAULT;    pbutton.cback[1]=C_DEFAULT;
Line 285  long color_dialog(WIN *parent,char *capt
Line 285  long color_dialog(WIN *parent,char *capt
   pbutton.hasfocus=true;    pbutton.hasfocus=true;
   pbutton.push=cbpushproc;    pbutton.push=cbpushproc;
   pbutton.text="  &Ok  ";    pbutton.text="  &Ok  ";
   p=create_win(di,19,5,1,1,(PUNION*)&pbutton,ST_VISIBLE|ST_AUTOXSIZE,NULL);    p=create_win(di,19,5,1,1,(PUNION*)&pbutton,CC_ST_VISIBLE|CC_ST_AUTOXSIZE,NULL);
   p->user=(void*)1;    p->user=(void*)1;
   pbutton.text="&Cancel";    pbutton.text="&Cancel";
   p=create_win(di,19,7,1,1,(PUNION*)&pbutton,ST_VISIBLE|ST_AUTOXSIZE,NULL);    p=create_win(di,19,7,1,1,(PUNION*)&pbutton,CC_ST_VISIBLE|CC_ST_AUTOXSIZE,NULL);
   p->user=(void*)-1;    p->user=(void*)-1;
   show_win(di,true);    show_win(di,true);
   while((tucb->i==0)&&apprun)message_pump();    while((tucb->i==0)&&apprun)message_pump();
Line 315  long message_box(WIN *parent,char *capti
Line 315  long message_box(WIN *parent,char *capti
   vx=6;    vx=6;
   vy=4;    vy=4;
   bx=0;    bx=0;
   if(style!=MB_DEFAULT)vy+=1;    if(style!=CC_MB_DEFAULT)vy+=1;
   if(style&MB_OK)bx+=bxok;    if(style&CC_MB_OK)bx+=bxok;
   if(style&MB_YES)bx+=bxyes;    if(style&CC_MB_YES)bx+=bxyes;
   if(style&MB_NO)bx+=bxno;    if(style&CC_MB_NO)bx+=bxno;
   if(style&MB_CANCEL)bx+=bxcancel;    if(style&CC_MB_CANCEL)bx+=bxcancel;
   if(bx>0)bx-=2;    if(bx>0)bx-=2;
   vx+=bx;    vx+=bx;
   st=malloc(nlen+1);    st=malloc(nlen+1);
Line 369  long message_box(WIN *parent,char *capti
Line 369  long message_box(WIN *parent,char *capti
   x=(screenx-vx)/2;    x=(screenx-vx)/2;
   y=(screeny-vy)/2;    y=(screeny-vy)/2;
   screen_to_client(parent,&x,&y);    screen_to_client(parent,&x,&y);
   pdialog.type=TP_DIALOG;    pdialog.type=CC_TP_DIALOG;
   pdialog.style=0;    pdialog.style=0;
   pdialog.caption=caption;    pdialog.caption=caption;
   pdialog.cback=C_RED;    pdialog.cback=C_RED;
Line 384  long message_box(WIN *parent,char *capti
Line 384  long message_box(WIN *parent,char *capti
   pdialog.sizeok=NULL;    pdialog.sizeok=NULL;
   pdialog.close=mbcloseproc;    pdialog.close=mbcloseproc;
   di=create_win(parent,x,y,vx,vy,(PUNION*)&pdialog,0,mbdialogacelproc);    di=create_win(parent,x,y,vx,vy,(PUNION*)&pdialog,0,mbdialogacelproc);
   ptext.type=TP_TEXT;    ptext.type=CC_TP_TEXT;
   ptext.cback=pdialog.cback;    ptext.cback=pdialog.cback;
   ptext.ctext=C_LWHITE;    ptext.ctext=C_LWHITE;
   for(i=0,j=0;j<nlen;j++)    for(i=0,j=0;j<nlen;j++)
Line 392  long message_box(WIN *parent,char *capti
Line 392  long message_box(WIN *parent,char *capti
     if((j==0)||(st[j-1]=='\0'))      if((j==0)||(st[j-1]=='\0'))
     {      {
       ptext.text=&st[j];        ptext.text=&st[j];
       create_win(di,3,2+i,1,1,(PUNION*)&ptext,ST_VISIBLE|ST_AUTOXSIZE,NULL);        create_win(di,3,2+i,1,1,(PUNION*)&ptext,CC_ST_VISIBLE|CC_ST_AUTOXSIZE,NULL);
       i++;        i++;
     }      }
   }    }
   pbutton.type=TP_BUTTON;    pbutton.type=CC_TP_BUTTON;
   pbutton.style=BT_NORMAL;    pbutton.style=CC_BT_NORMAL;
   pbutton.checked=false;    pbutton.checked=false;
   pbutton.cback[0]=C_DEFAULT;    pbutton.cback[0]=C_DEFAULT;
   pbutton.cback[1]=C_DEFAULT;    pbutton.cback[1]=C_DEFAULT;
Line 414  long message_box(WIN *parent,char *capti
Line 414  long message_box(WIN *parent,char *capti
   pbutton.hasfocus=true;    pbutton.hasfocus=true;
   pbutton.push=mbpushproc;    pbutton.push=mbpushproc;
   j=(vx-bx)/2;    j=(vx-bx)/2;
   if(style&MB_OK)    if(style&CC_MB_OK)
   {    {
     pbutton.text="&Ok";      pbutton.text="&Ok";
     but=create_win(di,j,vy-3,10,1,(PUNION*)&pbutton,ST_VISIBLE|ST_AUTOXSIZE,NULL);      but=create_win(di,j,vy-3,10,1,(PUNION*)&pbutton,CC_ST_VISIBLE|CC_ST_AUTOXSIZE,NULL);
     but->user=(void*)MB_OK;      but->user=(void*)CC_MB_OK;
     j+=bxok;      j+=bxok;
   }    }
   if(style&MB_YES)    if(style&CC_MB_YES)
   {    {
     pbutton.text="&Yes";      pbutton.text="&Yes";
     but=create_win(di,j,vy-3,10,1,(PUNION*)&pbutton,ST_VISIBLE|ST_AUTOXSIZE,NULL);      but=create_win(di,j,vy-3,10,1,(PUNION*)&pbutton,CC_ST_VISIBLE|CC_ST_AUTOXSIZE,NULL);
     but->user=(void*)MB_YES;      but->user=(void*)CC_MB_YES;
     j+=bxyes;      j+=bxyes;
   }    }
   if(style&MB_NO)    if(style&CC_MB_NO)
   {    {
     pbutton.text="&No";      pbutton.text="&No";
     but=create_win(di,j,vy-3,10,1,(PUNION*)&pbutton,ST_VISIBLE|ST_AUTOXSIZE,NULL);      but=create_win(di,j,vy-3,10,1,(PUNION*)&pbutton,CC_ST_VISIBLE|CC_ST_AUTOXSIZE,NULL);
     but->user=(void*)MB_NO;      but->user=(void*)CC_MB_NO;
     j+=bxno;      j+=bxno;
   }    }
   if(style&MB_CANCEL)    if(style&CC_MB_CANCEL)
   {    {
     pbutton.text="&Cancel";      pbutton.text="&Cancel";
     but=create_win(di,j,vy-3,10,1,(PUNION*)&pbutton,ST_VISIBLE|ST_AUTOXSIZE,NULL);      but=create_win(di,j,vy-3,10,1,(PUNION*)&pbutton,CC_ST_VISIBLE|CC_ST_AUTOXSIZE,NULL);
     but->user=(void*)MB_CANCEL;      but->user=(void*)CC_MB_CANCEL;
     j+=bxcancel;      j+=bxcancel;
   }    }
   show_win(di,true);    show_win(di,true);
Line 453  long message_box(WIN *parent,char *capti
Line 453  long message_box(WIN *parent,char *capti
 void edit_copy(WIN *edit)  void edit_copy(WIN *edit)
 {  {
   if(edit==NULL)return;    if(edit==NULL)return;
   if(edit->extra->type!=TP_EDIT)return;    if(edit->extra->type!=CC_TP_EDIT)return;
   EDIT *ed=&edit->extra->edit;    EDIT *ed=&edit->extra->edit;
   if(ed->maskpos==-1)return;    if(ed->maskpos==-1)return;
   long len=strlen(ed->text);    long len=strlen(ed->text);
Line 478  void edit_paste(WIN *edit)
Line 478  void edit_paste(WIN *edit)
 {  {
   if(clipboard==NULL)return;    if(clipboard==NULL)return;
   if(edit==NULL)return;    if(edit==NULL)return;
   if(edit->extra->type!=TP_EDIT)return;    if(edit->extra->type!=CC_TP_EDIT)return;
   EDIT *ed=&edit->extra->edit;    EDIT *ed=&edit->extra->edit;
   if(ed->style==ED_READONLY)return;    if(ed->style==CC_ED_READONLY)return;
   long i,j,l,len=strlen(ed->text),clen=strlen(clipboard);    long i,j,l,len=strlen(ed->text),clen=strlen(clipboard);
   if(ed->curpos<0)ed->curpos=0;    if(ed->curpos<0)ed->curpos=0;
   if(ed->maskpos!=-1)    if(ed->maskpos!=-1)
Line 524  void edit_paste(WIN *edit)
Line 524  void edit_paste(WIN *edit)
 void edit_delete(WIN *edit)  void edit_delete(WIN *edit)
 {  {
   if(edit==NULL)return;    if(edit==NULL)return;
   if(edit->extra->type!=TP_EDIT)return;    if(edit->extra->type!=CC_TP_EDIT)return;
   EDIT *ed=&edit->extra->edit;    EDIT *ed=&edit->extra->edit;
   if(ed->style==ED_READONLY)return;    if(ed->style==CC_ED_READONLY)return;
   if(ed->maskpos==-1)return;    if(ed->maskpos==-1)return;
   long i,j,l,len=strlen(ed->text);    long i,j,l,len=strlen(ed->text);
   if(ed->curpos<0)ed->curpos=0;    if(ed->curpos<0)ed->curpos=0;
Line 559  void edit_cut(WIN *edit)
Line 559  void edit_cut(WIN *edit)
 void edit_select(WIN *edit,long sta,long end)  void edit_select(WIN *edit,long sta,long end)
 {  {
   if(edit==NULL)return;    if(edit==NULL)return;
   if(edit->extra->type!=TP_EDIT)return;    if(edit->extra->type!=CC_TP_EDIT)return;
   EDIT *ed=&edit->extra->edit;    EDIT *ed=&edit->extra->edit;
   long len=strlen(ed->text);    long len=strlen(ed->text);
   if(sta<-1)sta=-1;    if(sta<-1)sta=-1;
Line 579  void edit_select(WIN *edit,long sta,long
Line 579  void edit_select(WIN *edit,long sta,long
 void edit_get_selection(WIN *edit,long *sta,long *end)  void edit_get_selection(WIN *edit,long *sta,long *end)
 {  {
   if(edit==NULL)return;    if(edit==NULL)return;
   if(edit->extra->type!=TP_EDIT)return;    if(edit->extra->type!=CC_TP_EDIT)return;
   EDIT *ed=&edit->extra->edit;    EDIT *ed=&edit->extra->edit;
   *sta=ed->maskpos;    *sta=ed->maskpos;
   *end=ed->curpos;    *end=ed->curpos;
Line 618  WIN *create_menu(WIN *parent,PMENU *menu
Line 618  WIN *create_menu(WIN *parent,PMENU *menu
 {  {
   if(menu==NULL)return;    if(menu==NULL)return;
   menu->lines=NULL;    menu->lines=NULL;
   return create_win(parent,0,0,0,0,(PUNION*)menu,menu->vert?0:ST_VISIBLE,acel);    return create_win(parent,0,0,0,0,(PUNION*)menu,menu->vert?0:CC_ST_VISIBLE,acel);
 }  }
   
 WIN *create_submenu(WIN *menu)  WIN *create_submenu(WIN *menu)
Line 734  bool set_focus(WIN *win)
Line 734  bool set_focus(WIN *win)
   }    }
   while(win!=NULL)    while(win!=NULL)
   {    {
     if(isactive(win)&&((win->extra->type==TP_EDIT)||((win->extra->type==TP_BUTTON)&&(win->extra->button.hasfocus))||      if(isactive(win)&&((win->extra->type==CC_TP_EDIT)||((win->extra->type==CC_TP_BUTTON)&&(win->extra->button.hasfocus))||
       (win->extra->type==TP_LIST)||(win->extra->type==TP_COMBO)||(win->extra->type==TP_MENU)||        (win->extra->type==CC_TP_LIST)||(win->extra->type==CC_TP_COMBO)||(win->extra->type==CC_TP_MENU)||
       (win->extra->type==TP_DIALOG)))        (win->extra->type==CC_TP_DIALOG)))
     {      {
       WIN *temp=focuswin;        WIN *temp=focuswin;
       focuswin=win;        focuswin=win;
Line 768  void show_win(WIN *win,bool visible)
Line 768  void show_win(WIN *win,bool visible)
       p=findchild(win);        p=findchild(win);
       if(p!=NULL)if(set_focus(p))doredraw=false;        if(p!=NULL)if(set_focus(p))doredraw=false;
     }      }
     if((win->extra->type==TP_DIALOG)&&win->extra->dialog.modal)      if((win->extra->type==CC_TP_DIALOG)&&win->extra->dialog.modal)
     {      {
       if(win->parent!=NULL)win->parent->hasmodal=visible;        if(win->parent!=NULL)win->parent->hasmodal=visible;
       else hasmodal=visible;        else hasmodal=visible;
Line 815  void screen_to_client(WIN *p,long *x,lon
Line 815  void screen_to_client(WIN *p,long *x,lon
 bool get_menu_pos(WIN *win,long id,WIN **submenu,long *pos)  bool get_menu_pos(WIN *win,long id,WIN **submenu,long *pos)
 {  {
   if(win==NULL)return false;    if(win==NULL)return false;
   if(win->extra->type==TP_MENU)    if(win->extra->type==CC_TP_MENU)
   {    {
     MENU *menu=&win->extra->menu;      MENU *menu=&win->extra->menu;
     GList *lines=menu->lines;      GList *lines=menu->lines;
Line 855  void *get_user(WIN *win)
Line 855  void *get_user(WIN *win)
 void set_checked(WIN *win,long pos,bool status)  void set_checked(WIN *win,long pos,bool status)
 {  {
   if(win==NULL)return;    if(win==NULL)return;
   if(win->extra->type==TP_BUTTON)    if(win->extra->type==CC_TP_BUTTON)
   {    {
     win->extra->button.checked=status;      win->extra->button.checked=status;
   }    }
   else if(win->extra->type==TP_MENU)    else if(win->extra->type==CC_TP_MENU)
   {    {
     MENU *menu=&win->extra->menu;      MENU *menu=&win->extra->menu;
     GList *lines=menu->lines;      GList *lines=menu->lines;
Line 877  void set_checked(WIN *win,long pos,bool
Line 877  void set_checked(WIN *win,long pos,bool
 bool get_checked(WIN *win,long pos)  bool get_checked(WIN *win,long pos)
 {  {
   if(win==NULL)return false;    if(win==NULL)return false;
   if(win->extra->type==TP_BUTTON)    if(win->extra->type==CC_TP_BUTTON)
   {    {
     return win->extra->button.checked;      return win->extra->button.checked;
   }    }
   else if(win->extra->type==TP_MENU)    else if(win->extra->type==CC_TP_MENU)
   {    {
     MENU *menu=&win->extra->menu;      MENU *menu=&win->extra->menu;
     GList *lines=menu->lines;      GList *lines=menu->lines;
Line 900  bool get_checked(WIN *win,long pos)
Line 900  bool get_checked(WIN *win,long pos)
 void set_text(WIN *win,char *text)  void set_text(WIN *win,char *text)
 {  {
   if(win==NULL)return;    if(win==NULL)return;
   if(win->extra->type==TP_EDIT)    if(win->extra->type==CC_TP_EDIT)
   {    {
     char *er;      char *er;
     er=(char*)realloc(win->extra->edit.text,strlen((const char*)text)+1);      er=(char*)realloc(win->extra->edit.text,strlen((const char*)text)+1);
Line 910  void set_text(WIN *win,char *text)
Line 910  void set_text(WIN *win,char *text)
     strcpy((char*)win->extra->edit.text,(const char*)text);      strcpy((char*)win->extra->edit.text,(const char*)text);
     redrawclientwin(win);      redrawclientwin(win);
   }    }
   else if(win->extra->type==TP_TEXT)    else if(win->extra->type==CC_TP_TEXT)
   {    {
     win->extra->text.text=text;      win->extra->text.text=text;
     redrawclientwin(win);      redrawclientwin(win);
   }    }
   else if((win->extra->type==TP_COMBO)&&(win->extra->combo.edit!=NULL))    else if((win->extra->type==CC_TP_COMBO)&&(win->extra->combo.edit!=NULL))
   {    {
     set_text(win->extra->combo.edit,text);      set_text(win->extra->combo.edit,text);
   }    }
   else if(win->extra->type==TP_DIALOG)    else if(win->extra->type==CC_TP_DIALOG)
   {    {
     win->extra->dialog.caption=text;      win->extra->dialog.caption=text;
     redrawclientwin(win);      redrawclientwin(win);
Line 929  void set_text(WIN *win,char *text)
Line 929  void set_text(WIN *win,char *text)
 char *get_text(WIN *win)  char *get_text(WIN *win)
 {  {
   if(win==NULL)return;    if(win==NULL)return;
   if(win->extra->type==TP_EDIT)    if(win->extra->type==CC_TP_EDIT)
   {    {
     return win->extra->edit.text;      return win->extra->edit.text;
   }    }
   else if(win->extra->type==TP_TEXT)    else if(win->extra->type==CC_TP_TEXT)
   {    {
     return win->extra->text.text;      return win->extra->text.text;
   }    }
   else if(win->extra->type==TP_DIALOG)    else if(win->extra->type==CC_TP_DIALOG)
   {    {
     return win->extra->dialog.caption;      return win->extra->dialog.caption;
   }    }
Line 946  char *get_text(WIN *win)
Line 946  char *get_text(WIN *win)
 void set_pos(WIN *win,long pos)  void set_pos(WIN *win,long pos)
 {  {
   if(win==NULL);    if(win==NULL);
   if(win->extra->type==TP_EDIT)    if(win->extra->type==CC_TP_EDIT)
   {    {
     win->extra->edit.curpos=pos;      win->extra->edit.curpos=pos;
     redrawclientwin(win);      redrawclientwin(win);
   }    }
   else if(win->extra->type==TP_SCROLL)    else if(win->extra->type==CC_TP_SCROLL)
   {    {
     win->extra->scroll.pos=pos;      win->extra->scroll.pos=pos;
     redrawclientwin(win);      redrawclientwin(win);
     if(win->extra->scroll.change!=NULL)win->extra->scroll.change(win);      if(win->extra->scroll.change!=NULL)win->extra->scroll.change(win);
   }    }
   else if(win->extra->type==TP_COMBO)    else if(win->extra->type==CC_TP_COMBO)
   {    {
     setcomboactiveitem(&win->extra->combo,win->extra->combo.activeline,pos);      setcomboactiveitem(&win->extra->combo,win->extra->combo.activeline,pos);
     win->extra->combo.activeline=pos;      win->extra->combo.activeline=pos;
     redrawclientwin(win);      redrawclientwin(win);
     if(win->extra->combo.change!=NULL)win->extra->combo.change(win);      if(win->extra->combo.change!=NULL)win->extra->combo.change(win);
   }    }
   else if(win->extra->type==TP_LIST)    else if(win->extra->type==CC_TP_LIST)
   {    {
     SCROLL *vscroll=&win->extra->list.vscroll->extra->scroll;      SCROLL *vscroll=&win->extra->list.vscroll->extra->scroll;
     if(pos<vscroll->pos)vscroll->pos=pos;      if(pos<vscroll->pos)vscroll->pos=pos;
Line 975  void set_pos(WIN *win,long pos)
Line 975  void set_pos(WIN *win,long pos)
     redrawclientwin(win);      redrawclientwin(win);
     if(win->extra->list.change!=NULL)win->extra->list.change(win);      if(win->extra->list.change!=NULL)win->extra->list.change(win);
   }    }
   else if(win->extra->type==TP_STATUS)    else if(win->extra->type==CC_TP_STATUS)
   {    {
     win->extra->status.pos=pos;      win->extra->status.pos=pos;
     redrawclientwin(win);      redrawclientwin(win);
Line 984  void set_pos(WIN *win,long pos)
Line 984  void set_pos(WIN *win,long pos)
   
 long get_pos(WIN *win)  long get_pos(WIN *win)
 {  {
   if(win==NULL)return NOCHANGE;    if(win==NULL)return CC_NOCHANGE;
   if(win->extra->type==TP_EDIT)    if(win->extra->type==CC_TP_EDIT)
   {    {
     return win->extra->edit.curpos;      return win->extra->edit.curpos;
   }    }
   else if(win->extra->type==TP_SCROLL)    else if(win->extra->type==CC_TP_SCROLL)
   {    {
     return win->extra->scroll.pos;      return win->extra->scroll.pos;
   }    }
   else if(win->extra->type==TP_COMBO)    else if(win->extra->type==CC_TP_COMBO)
   {    {
     return win->extra->combo.activeline;      return win->extra->combo.activeline;
   }    }
   else if(win->extra->type==TP_LIST)    else if(win->extra->type==CC_TP_LIST)
   {    {
     return win->extra->list.activeline;      return win->extra->list.activeline;
   }    }
   else if(win->extra->type==TP_STATUS)    else if(win->extra->type==CC_TP_STATUS)
   {    {
     return win->extra->status.pos;      return win->extra->status.pos;
   }    }
   else if(win->extra->type==TP_MENU)    else if(win->extra->type==CC_TP_MENU)
   {    {
     return win->extra->menu.activeline;      return win->extra->menu.activeline;
   }    }
   return NOCHANGE;    return CC_NOCHANGE;
 }  }
   
 void set_list(WIN *win,GList *list)  void set_list(WIN *win,GList *list)
 {  {
   if(win==NULL)return;    if(win==NULL)return;
   if(win->extra->type==TP_LIST)    if(win->extra->type==CC_TP_LIST)
   {    {
     LIST *llist=&win->extra->list;      LIST *llist=&win->extra->list;
     llist->lines=list;      llist->lines=list;
     setuplistparams(win);      setuplistparams(win);
     redrawclientwin(win);      redrawclientwin(win);
   }    }
   else if(win->extra->type==TP_COMBO)    else if(win->extra->type==CC_TP_COMBO)
   {    {
     win->extra->combo.list->extra->list.lines=list;      win->extra->combo.list->extra->list.lines=list;
     redrawclientwin(win);      redrawclientwin(win);
   }    }
   else if(win->extra->type==TP_MENU)    else if(win->extra->type==CC_TP_MENU)
   {    {
     win->extra->menu.lines=list;      win->extra->menu.lines=list;
     redraw();      redraw();
Line 1037  void set_list(WIN *win,GList *list)
Line 1037  void set_list(WIN *win,GList *list)
 GList *get_list(WIN *win)  GList *get_list(WIN *win)
 {  {
   if(win==NULL)return;    if(win==NULL)return;
   if(win->extra->type==TP_LIST)    if(win->extra->type==CC_TP_LIST)
   {    {
     return win->extra->list.lines;      return win->extra->list.lines;
   }    }
   else if(win->extra->type==TP_COMBO)    else if(win->extra->type==CC_TP_COMBO)
   {    {
     return win->extra->combo.list->extra->list.lines;      return win->extra->combo.list->extra->list.lines;
   }    }
   else if(win->extra->type==TP_MENU)    else if(win->extra->type==CC_TP_MENU)
   {    {
     return win->extra->menu.lines;      return win->extra->menu.lines;
   }    }
Line 1054  GList *get_list(WIN *win)
Line 1054  GList *get_list(WIN *win)
 void set_hl_downtext(WIN *text)  void set_hl_downtext(WIN *text)
 {  {
   if(text!=NULL)    if(text!=NULL)
     if(text->extra->type!=TP_TEXT)return;      if(text->extra->type!=CC_TP_TEXT)return;
   hldowntext=text;    hldowntext=text;
 }  }
   
Line 1067  void set_menu(WIN *win,WIN *menu)
Line 1067  void set_menu(WIN *win,WIN *menu)
 {  {
   if(menu!=NULL)    if(menu!=NULL)
   {    {
     if((menu->extra->type!=TP_MENU)||(menu->extra->menu.vert))return;      if((menu->extra->type!=CC_TP_MENU)||(menu->extra->menu.vert))return;
     if(menu->parent!=NULL)      if(menu->parent!=NULL)
     {      {
       WIN *parent=menu->parent;        WIN *parent=menu->parent;
       if(parent->extra->type==TP_DIALOG)        if(parent->extra->type==CC_TP_DIALOG)
       {        {
         DIALOG *dialog=&parent->extra->dialog;          DIALOG *dialog=&parent->extra->dialog;
         if(dialog->menu==menu)dialog->menu=NULL;          if(dialog->menu==menu)dialog->menu=NULL;
Line 1083  void set_menu(WIN *win,WIN *menu)
Line 1083  void set_menu(WIN *win,WIN *menu)
   {    {
     hlmenu=menu;      hlmenu=menu;
   }    }
   else if(win->extra->type==TP_DIALOG)    else if(win->extra->type==CC_TP_DIALOG)
   {    {
     win->extra->dialog.menu=menu;      win->extra->dialog.menu=menu;
     if(menu!=NULL)if(menu->parent!=win)setparent(menu,win);      if(menu!=NULL)if(menu->parent!=win)setparent(menu,win);
Line 1096  WIN *get_menu(WIN *win)
Line 1096  WIN *get_menu(WIN *win)
   {    {
     return hlmenu;      return hlmenu;
   }    }
   else if(win->extra->type==TP_DIALOG)    else if(win->extra->type==CC_TP_DIALOG)
   {    {
     return win->extra->dialog.menu;      return win->extra->dialog.menu;
   }    }
Line 1116  void set_resize_proc(WIN *win,void (*res
Line 1116  void set_resize_proc(WIN *win,void (*res
 {  {
   if(win!=NULL)    if(win!=NULL)
   {    {
     if(win->extra->type==TP_DIALOG)win->extra->dialog.resize=(void*)resize;      if(win->extra->type==CC_TP_DIALOG)win->extra->dialog.resize=(void*)resize;
   }    }
   else resizescreen=(void*)resize;    else resizescreen=(void*)resize;
 }  }
Line 1125  void *get_resize_proc(WIN *win)
Line 1125  void *get_resize_proc(WIN *win)
 {  {
   if(win!=NULL)    if(win!=NULL)
   {    {
     if(win->extra->type==TP_DIALOG)return win->extra->dialog.resize;      if(win->extra->type==CC_TP_DIALOG)return win->extra->dialog.resize;
   }    }
   else return resizescreen;    else return resizescreen;
 }  }
Line 1136  void set_parent(WIN *win,WIN *parent)
Line 1136  void set_parent(WIN *win,WIN *parent)
   client_to_screen(win,&x,&y);    client_to_screen(win,&x,&y);
   setparent(win,parent);    setparent(win,parent);
   screen_to_client(win,&x,&y);    screen_to_client(win,&x,&y);
   if(!move_win(win,win->x+x,win->y+y,NOCHANGE,NOCHANGE,NOCHANGE))redraw();    if(!move_win(win,win->x+x,win->y+y,CC_NOCHANGE,CC_NOCHANGE,CC_NOCHANGE))redraw();
 }  }
   
 WIN *get_parent(WIN *win)  WIN *get_parent(WIN *win)
Line 1240  void get_client_size(WIN *win,long *x,lo
Line 1240  void get_client_size(WIN *win,long *x,lo
   if(win!=NULL)    if(win!=NULL)
   {    {
     long dy=0;      long dy=0;
     if(win->extra->type==TP_DIALOG)      if(win->extra->type==CC_TP_DIALOG)
     {      {
       dy++;        dy++;
       if(win->extra->dialog.menu!=NULL)dy++;        if(win->extra->dialog.menu!=NULL)dy++;
     }      }
     if(vx!=NULL)*vx=win->vx-(win->extra->type!=TP_DIALOG?0:2);      if(vx!=NULL)*vx=win->vx-(win->extra->type!=CC_TP_DIALOG?0:2);
     if(vy!=NULL)*vy=win->vy-dy-1;      if(vy!=NULL)*vy=win->vy-dy-1;
     if(x!=NULL)*x=win->extra->type!=TP_DIALOG?0:1;      if(x!=NULL)*x=win->extra->type!=CC_TP_DIALOG?0:1;
     if(y!=NULL)*y=dy;      if(y!=NULL)*y=dy;
   }    }
   else    else
Line 1262  void get_client_size(WIN *win,long *x,lo
Line 1262  void get_client_size(WIN *win,long *x,lo
 bool send_message(WIN *win,long x,long y,unsigned short key)  bool send_message(WIN *win,long x,long y,unsigned short key)
 {  {
   if(!isactive(win))return false;    if(!isactive(win))return false;
   if(((key&KKMASK)>=CCOFFSET)&&((key&KKMASK)<KKOFFSET))return dosendkeymessage(win,key);    if(((key&CC_MASK_KEY)>=CC_OFFSET_C)&&((key&CC_MASK_KEY)<CC_OFFSET_K))return dosendkeymessage(win,key);
   else if(((key&KKMASK)>=KKOFFSET)&&((key&KKMASK)<MMOFFSET))return dosendsyskeymessage(win,key);    else if(((key&CC_MASK_KEY)>=CC_OFFSET_K)&&((key&CC_MASK_KEY)<CC_OFFSET_M))return dosendsyskeymessage(win,key);
   else if(((key&KKMASK)>=MMOFFSET)&&((key&KKMASK)<XXOFFSET))return dosendmousemessage(win,x,y,key);    else if(((key&CC_MASK_KEY)>=CC_OFFSET_M)&&((key&CC_MASK_KEY)<CC_OFFSET_X))return dosendmousemessage(win,x,y,key);
 }  }
   
 void delete_win(WIN *win)  void delete_win(WIN *win)
Line 1281  char get_win_type(WIN *win)
Line 1281  char get_win_type(WIN *win)
 bool move_win(WIN *win,long x,long y,long vx,long vy,long state)  bool move_win(WIN *win,long x,long y,long vx,long vy,long state)
 {  {
   if(win==NULL)return false;    if(win==NULL)return false;
   if(x==NOCHANGE)x=win->x;    if(x==CC_NOCHANGE)x=win->x;
   if(y==NOCHANGE)y=win->y;    if(y==CC_NOCHANGE)y=win->y;
   if(vx==NOCHANGE)vx=win->vx;    if(vx==CC_NOCHANGE)vx=win->vx;
   if(vy==NOCHANGE)vy=win->vy;    if(vy==CC_NOCHANGE)vy=win->vy;
   if((win->extra->type==TP_DIALOG)&&    if((win->extra->type==CC_TP_DIALOG)&&
      (win->extra->dialog.sizeok!=NULL))win->extra->dialog.sizeok(win,&x,&y,&vx,&vy);       (win->extra->dialog.sizeok!=NULL))win->extra->dialog.sizeok(win,&x,&y,&vx,&vy);
   if(win->extra->type==TP_DIALOG)    if(win->extra->type==CC_TP_DIALOG)
   {    {
     if(state==NOCHANGE)state=win->extra->dialog.state;      if(state==CC_NOCHANGE)state=win->extra->dialog.state;
     if((state<0)||(state>SV_IN_MAXSTATE))return false;      if((state<0)||(state>CC_SV_IN_MAXSTATE))return false;
     if(state==SV_MAXIMIZED)      if(state==CC_SV_MAXIMIZED)
     {      {
       if(win->extra->dialog.state!=SV_MAXIMIZED)        if(win->extra->dialog.state!=CC_SV_MAXIMIZED)
       {        {
         get_client_size(win->parent,&x,&y,&vx,&vy);          get_client_size(win->parent,&x,&y,&vx,&vy);
       }        }
Line 1305  bool move_win(WIN *win,long x,long y,lon
Line 1305  bool move_win(WIN *win,long x,long y,lon
         vy=win->vy;          vy=win->vy;
       }        }
     }      }
     else if(state==SV_MINIMIZED)      else if(state==CC_SV_MINIMIZED)
     {      {
       if(win->extra->dialog.state==SV_MAXIMIZED)        if(win->extra->dialog.state==CC_SV_MAXIMIZED)
       {        {
         vx=win->extra->dialog.tmpvx;          vx=win->extra->dialog.tmpvx;
         x=win->extra->dialog.tmpx;          x=win->extra->dialog.tmpx;
Line 1315  bool move_win(WIN *win,long x,long y,lon
Line 1315  bool move_win(WIN *win,long x,long y,lon
       }        }
       vy=1;        vy=1;
     }      }
     else if(state==SV_NORMAL)      else if(state==CC_SV_NORMAL)
     {      {
       if(win->extra->dialog.state==SV_MAXIMIZED)        if(win->extra->dialog.state==CC_SV_MAXIMIZED)
       {        {
         vx=win->extra->dialog.tmpvx;          vx=win->extra->dialog.tmpvx;
         vy=win->extra->dialog.tmpvy;          vy=win->extra->dialog.tmpvy;
         x=win->extra->dialog.tmpx;          x=win->extra->dialog.tmpx;
         y=win->extra->dialog.tmpy;          y=win->extra->dialog.tmpy;
       }        }
       else if(win->extra->dialog.state==SV_MINIMIZED)        else if(win->extra->dialog.state==CC_SV_MINIMIZED)
       {        {
         vy=win->extra->dialog.tmpvy;          vy=win->extra->dialog.tmpvy;
       }        }
Line 1334  bool move_win(WIN *win,long x,long y,lon
Line 1334  bool move_win(WIN *win,long x,long y,lon
   if(vx<1)vx=1;    if(vx<1)vx=1;
   if(vy<1)vy=1;    if(vy<1)vy=1;
   if((win->vx==vx)&&(win->vy==vy)&&(win->x==x)&&(win->y==y)&&    if((win->vx==vx)&&(win->vy==vy)&&(win->x==x)&&(win->y==y)&&
      (win->extra->type==TP_DIALOG?win->extra->dialog.state==state:true))return false;       (win->extra->type==CC_TP_DIALOG?win->extra->dialog.state==state:true))return false;
   if(win->extra->type==TP_DIALOG)    if(win->extra->type==CC_TP_DIALOG)
   {    {
     if(win->extra->dialog.state==SV_NORMAL)      if(win->extra->dialog.state==CC_SV_NORMAL)
     {      {
       if(state==SV_MAXIMIZED)        if(state==CC_SV_MAXIMIZED)
       {        {
         win->extra->dialog.tmpvx=win->vx;          win->extra->dialog.tmpvx=win->vx;
         win->extra->dialog.tmpvy=win->vy;          win->extra->dialog.tmpvy=win->vy;
         win->extra->dialog.tmpx=win->x;          win->extra->dialog.tmpx=win->x;
         win->extra->dialog.tmpy=win->y;          win->extra->dialog.tmpy=win->y;
       }        }
       else if(state==SV_MINIMIZED)        else if(state==CC_SV_MINIMIZED)
       {        {
         win->extra->dialog.tmpvy=win->vy;          win->extra->dialog.tmpvy=win->vy;
       }        }
     }      }
     if(win->extra->dialog.state==SV_MINIMIZED)      if(win->extra->dialog.state==CC_SV_MINIMIZED)
     {      {
       if(state==SV_MAXIMIZED)        if(state==CC_SV_MAXIMIZED)
       {        {
         win->extra->dialog.tmpvx=win->vx;          win->extra->dialog.tmpvx=win->vx;
         win->extra->dialog.tmpx=win->x;          win->extra->dialog.tmpx=win->x;
Line 1371  bool move_win(WIN *win,long x,long y,lon
Line 1371  bool move_win(WIN *win,long x,long y,lon
   win->fly=y;    win->fly=y;
   win->frx=pvx+px-x-vx;    win->frx=pvx+px-x-vx;
   win->fry=pvy+py-y-vy;    win->fry=pvy+py-y-vy;
   if(win->extra->type==TP_DIALOG)    if(win->extra->type==CC_TP_DIALOG)
   {    {
     win->extra->dialog.state=state;      win->extra->dialog.state=state;
     if(state==SV_NORMAL)      if(state==CC_SV_NORMAL)
     {      {
       if((win->extra->dialog.style&ST_DI_HASMAXIMIZE)==ST_DI_HASMAXIMIZE)        if((win->extra->dialog.style&CC_ST_DI_HASMAXIMIZE)==CC_ST_DI_HASMAXIMIZE)
         win->extra->dialog.bmaximize->extra->button.text="O";          win->extra->dialog.bmaximize->extra->button.text="O";
       if((win->extra->dialog.style&ST_DI_HASMINIMIZE)==ST_DI_HASMINIMIZE)        if((win->extra->dialog.style&CC_ST_DI_HASMINIMIZE)==CC_ST_DI_HASMINIMIZE)
         win->extra->dialog.bminimize->extra->button.text=".";          win->extra->dialog.bminimize->extra->button.text=".";
     }      }
     else if(state==SV_MAXIMIZED)      else if(state==CC_SV_MAXIMIZED)
     {      {
       if((win->extra->dialog.style&ST_DI_HASMAXIMIZE)==ST_DI_HASMAXIMIZE)        if((win->extra->dialog.style&CC_ST_DI_HASMAXIMIZE)==CC_ST_DI_HASMAXIMIZE)
         win->extra->dialog.bmaximize->extra->button.text="o";          win->extra->dialog.bmaximize->extra->button.text="o";
       if((win->extra->dialog.style&ST_DI_HASMINIMIZE)==ST_DI_HASMINIMIZE)        if((win->extra->dialog.style&CC_ST_DI_HASMINIMIZE)==CC_ST_DI_HASMINIMIZE)
         win->extra->dialog.bminimize->extra->button.text=".";          win->extra->dialog.bminimize->extra->button.text=".";
     }      }
     else if(state==SV_MINIMIZED)      else if(state==CC_SV_MINIMIZED)
     {      {
       if((win->extra->dialog.style&ST_DI_HASMAXIMIZE)==ST_DI_HASMAXIMIZE)        if((win->extra->dialog.style&CC_ST_DI_HASMAXIMIZE)==CC_ST_DI_HASMAXIMIZE)
         win->extra->dialog.bmaximize->extra->button.text="O";          win->extra->dialog.bmaximize->extra->button.text="O";
       if((win->extra->dialog.style&ST_DI_HASMINIMIZE)==ST_DI_HASMINIMIZE)        if((win->extra->dialog.style&CC_ST_DI_HASMINIMIZE)==CC_ST_DI_HASMINIMIZE)
         win->extra->dialog.bminimize->extra->button.text="o";          win->extra->dialog.bminimize->extra->button.text="o";
     }      }
     if(win->extra->dialog.resize!=NULL)win->extra->dialog.resize(win->vx,win->vy);      if(win->extra->dialog.resize!=NULL)win->extra->dialog.resize(win->vx,win->vy);
Line 1429  WIN *create_win(WIN *parent,long x,long
Line 1429  WIN *create_win(WIN *parent,long x,long
   ne->user=NULL;    ne->user=NULL;
   switch(extra->type)    switch(extra->type)
   {    {
     case TP_TEXT:size=sizeof(TEXT);break;      case CC_TP_TEXT:size=sizeof(TEXT);break;
     case TP_EDIT:size=sizeof(EDIT);break;      case CC_TP_EDIT:size=sizeof(EDIT);break;
     case TP_BUTTON:size=sizeof(BUTTON);break;      case CC_TP_BUTTON:size=sizeof(BUTTON);break;
     case TP_COMBO:size=sizeof(COMBO);break;      case CC_TP_COMBO:size=sizeof(COMBO);break;
     case TP_LIST:size=sizeof(LIST);break;      case CC_TP_LIST:size=sizeof(LIST);break;
     case TP_STATUS:size=sizeof(STATUS);break;      case CC_TP_STATUS:size=sizeof(STATUS);break;
     case TP_SCROLL:size=sizeof(SCROLL);break;      case CC_TP_SCROLL:size=sizeof(SCROLL);break;
     case TP_PAINT:size=sizeof(PAINT);break;      case CC_TP_PAINT:size=sizeof(PAINT);break;
     case TP_MENU:size=sizeof(MENU);break;      case CC_TP_MENU:size=sizeof(MENU);break;
     case TP_DIALOG:size=sizeof(DIALOG);break;      case CC_TP_DIALOG:size=sizeof(DIALOG);break;
     case TP_FADE:size=sizeof(FADE);break;      case TP_FADE:size=sizeof(FADE);break;
   }    }
   ne->extra=(UNION*)malloc(size);    ne->extra=(UNION*)malloc(size);
Line 1471  WIN *create_win(WIN *parent,long x,long
Line 1471  WIN *create_win(WIN *parent,long x,long
       }        }
     }      }
   }    }
   if(extra->type==TP_TEXT)    if(extra->type==CC_TP_TEXT)
   {    {
     if(ne->vy>1)ne->vy=1;      if(ne->vy>1)ne->vy=1;
   }    }
   else if(extra->type==TP_EDIT)    else if(extra->type==CC_TP_EDIT)
   {    {
     ne->extra->edit.curpos=0;      ne->extra->edit.curpos=0;
     ne->extra->edit.maskpos=-1;      ne->extra->edit.maskpos=-1;
Line 1483  WIN *create_win(WIN *parent,long x,long
Line 1483  WIN *create_win(WIN *parent,long x,long
     ne->extra->edit.text=(unsigned char*)malloc(1);      ne->extra->edit.text=(unsigned char*)malloc(1);
     ne->extra->edit.text[0]='\0';      ne->extra->edit.text[0]='\0';
   }    }
   else if(extra->type==TP_SCROLL)    else if(extra->type==CC_TP_SCROLL)
   {    {
     SCROLL *scroll;      SCROLL *scroll;
     scroll=&ne->extra->scroll;      scroll=&ne->extra->scroll;
Line 1502  WIN *create_win(WIN *parent,long x,long
Line 1502  WIN *create_win(WIN *parent,long x,long
       if(ne->vy>1)ne->vy=1;        if(ne->vy>1)ne->vy=1;
     }      }
   }    }
   else if(extra->type==TP_BUTTON)    else if(extra->type==CC_TP_BUTTON)
   {    {
     BUTTON *button;      BUTTON *button;
     button=&ne->extra->button;      button=&ne->extra->button;
     button->status=TS_UP;      button->status=TS_UP;
   }    }
   else if(extra->type==TP_LIST)    else if(extra->type==CC_TP_LIST)
   {    {
     PSCROLL scroll;      PSCROLL scroll;
     LIST *list=&ne->extra->list;      LIST *list=&ne->extra->list;
     scroll.type=TP_SCROLL;      scroll.type=CC_TP_SCROLL;
     scroll.pos=0;      scroll.pos=0;
     scroll.cnt=1;      scroll.cnt=1;
     scroll.change=scrollincombochangeproc;      scroll.change=scrollincombochangeproc;
Line 1528  WIN *create_win(WIN *parent,long x,long
Line 1528  WIN *create_win(WIN *parent,long x,long
     list->vscroll=create_win(ne,ne->vx-1,1,1,ne->vy-2,(PUNION*)&scroll,0,NULL);      list->vscroll=create_win(ne,ne->vx-1,1,1,ne->vy-2,(PUNION*)&scroll,0,NULL);
     scroll.vert=false;      scroll.vert=false;
     list->hscroll=create_win(ne,1,ne->vy-1,ne->vx-2,1,(PUNION*)&scroll,0,NULL);      list->hscroll=create_win(ne,1,ne->vy-1,ne->vx-2,1,(PUNION*)&scroll,0,NULL);
     if(extra->list.combotyp==CT_COMBO)      if(extra->list.combotyp==CC_LI_COMBO)
     {      {
       PUNION fade;        PUNION fade;
       fade.type=TP_FADE;        fade.type=TP_FADE;
       list->hfade=create_win(ne,2,ne->vy,ne->vx,1,(PUNION*)&fade,ST_VISIBLE,NULL);        list->hfade=create_win(ne,2,ne->vy,ne->vx,1,(PUNION*)&fade,CC_ST_VISIBLE,NULL);
       list->vfade=create_win(ne,ne->vx>1?ne->vx:ne->vx+1,1,ne->vx>1?2:1,ne->vy-1,(PUNION*)&fade,ST_VISIBLE,NULL);        list->vfade=create_win(ne,ne->vx>1?ne->vx:ne->vx+1,1,ne->vx>1?2:1,ne->vy-1,(PUNION*)&fade,CC_ST_VISIBLE,NULL);
     }      }
     else      else
     {      {
Line 1541  WIN *create_win(WIN *parent,long x,long
Line 1541  WIN *create_win(WIN *parent,long x,long
       list->vfade=NULL;        list->vfade=NULL;
     }      }
   }    }
   else if(extra->type==TP_COMBO)    else if(extra->type==CC_TP_COMBO)
   {    {
     PLIST list;      PLIST list;
     COMBO *combo=&ne->extra->combo;      COMBO *combo=&ne->extra->combo;
     long x,y;      long x,y;
     if(ne->vy>1)ne->vy=1;      if(ne->vy>1)ne->vy=1;
     x=-1;y=ne->vy;      x=-1;y=ne->vy;
     list.type=TP_LIST;      list.type=CC_TP_LIST;
     list.activeline=0;      list.activeline=0;
     list.lines=NULL;      list.lines=NULL;
     list.combotyp=CT_COMBO;      list.combotyp=CC_LI_COMBO;
     list.change=NULL;      list.change=NULL;
     list.dblclk=combodblclkproc;      list.dblclk=combodblclkproc;
     combo->pushed=SC_UP;      combo->pushed=SC_UP;
     combo->scroll=0;      combo->scroll=0;
     combo->activeitem=NULL;      combo->activeitem=NULL;
     combo->list=create_win(ne,x,y,ne->vx+2,ne->extra->combo.lstvy,(PUNION*)&list,ST_TOP_WIN,NULL);      combo->list=create_win(ne,x,y,ne->vx+2,ne->extra->combo.lstvy,(PUNION*)&list,CC_ST_TOP_WIN,NULL);
     if((style&ST_CO_WITH_EDIT)==ST_CO_WITH_EDIT)      if((style&CC_ST_CO_WITH_EDIT)==CC_ST_CO_WITH_EDIT)
     {      {
       PEDIT edit;        PEDIT edit;
       edit.type=TP_EDIT;        edit.type=CC_TP_EDIT;
       combo->edit=create_win(ne,0,0,ne->vx-1,1,(PUNION*)&edit,ST_VISIBLE,claeditacel);        combo->edit=create_win(ne,0,0,ne->vx-1,1,(PUNION*)&edit,CC_ST_VISIBLE,claeditacel);
     }      }
     else      else
       combo->edit=NULL;        combo->edit=NULL;
   }    }
   else if(extra->type==TP_STATUS)    else if(extra->type==CC_TP_STATUS)
   {    {
     PSTATUS *status=&extra->status;      PSTATUS *status=&extra->status;
     if(extra->status.vert)      if(extra->status.vert)
Line 1579  WIN *create_win(WIN *parent,long x,long
Line 1579  WIN *create_win(WIN *parent,long x,long
       if(ne->vy>1)ne->vy=1;        if(ne->vy>1)ne->vy=1;
     }      }
   }    }
   else if(extra->type==TP_MENU)    else if(extra->type==CC_TP_MENU)
   {    {
     MENU *menu=&ne->extra->menu;      MENU *menu=&ne->extra->menu;
     menu->activeline=-1;      menu->activeline=-1;
Line 1587  WIN *create_win(WIN *parent,long x,long
Line 1587  WIN *create_win(WIN *parent,long x,long
     {      {
       PUNION fade;        PUNION fade;
       fade.type=TP_FADE;        fade.type=TP_FADE;
       ne->style|=ST_TOP_WIN;        ne->style|=CC_ST_TOP_WIN;
       menu->hfade=create_win(ne,2,ne->vy,ne->vx,1,(PUNION*)&fade,ST_VISIBLE,NULL);        menu->hfade=create_win(ne,2,ne->vy,ne->vx,1,(PUNION*)&fade,CC_ST_VISIBLE,NULL);
       menu->vfade=create_win(ne,ne->vx>1?ne->vx:ne->vx+1,1,ne->vx>1?2:1,ne->vy-1,(PUNION*)&fade,ST_VISIBLE,NULL);        menu->vfade=create_win(ne,ne->vx>1?ne->vx:ne->vx+1,1,ne->vx>1?2:1,ne->vy-1,(PUNION*)&fade,CC_ST_VISIBLE,NULL);
     }      }
   }    }
   else if(extra->type==TP_DIALOG)    else if(extra->type==CC_TP_DIALOG)
   {    {
     DIALOG *dialog=&ne->extra->dialog;      DIALOG *dialog=&ne->extra->dialog;
     dialog->state=SV_NORMAL;      dialog->state=CC_SV_NORMAL;
     PBUTTON button;      PBUTTON button;
     button.type=TP_BUTTON;      button.type=CC_TP_BUTTON;
     button.style=BT_NORMAL;      button.style=CC_BT_NORMAL;
     button.checked=false;      button.checked=false;
     button.hasfocus=false;      button.hasfocus=false;
     long n=3;      long n=3;
Line 1606  WIN *create_win(WIN *parent,long x,long
Line 1606  WIN *create_win(WIN *parent,long x,long
     button.push=bclosepush;      button.push=bclosepush;
     dialog->bclose=create_win(ne,ne->vx-n,0,1,1,(PUNION*)&button,0,NULL);      dialog->bclose=create_win(ne,ne->vx-n,0,1,1,(PUNION*)&button,0,NULL);
     n++;      n++;
     if((extra->dialog.style&ST_DI_HASMAXIMIZE)==ST_DI_HASMAXIMIZE)      if((extra->dialog.style&CC_ST_DI_HASMAXIMIZE)==CC_ST_DI_HASMAXIMIZE)
     {      {
       button.text="O";        button.text="O";
       button.push=bmaximizepush;        button.push=bmaximizepush;
Line 1614  WIN *create_win(WIN *parent,long x,long
Line 1614  WIN *create_win(WIN *parent,long x,long
       n++;        n++;
     }      }
     else dialog->bmaximize=NULL;      else dialog->bmaximize=NULL;
     if((extra->dialog.style&ST_DI_HASMINIMIZE)==ST_DI_HASMINIMIZE)      if((extra->dialog.style&CC_ST_DI_HASMINIMIZE)==CC_ST_DI_HASMINIMIZE)
     {      {
       button.text=".";        button.text=".";
       button.push=bminimizepush;        button.push=bminimizepush;
Line 1623  WIN *create_win(WIN *parent,long x,long
Line 1623  WIN *create_win(WIN *parent,long x,long
     else dialog->bminimize=NULL;      else dialog->bminimize=NULL;
     FADE fade;      FADE fade;
     fade.type=TP_FADE;      fade.type=TP_FADE;
     dialog->hfade=create_win(ne,2,ne->vy,ne->vx,1,(PUNION*)&fade,ST_VISIBLE,NULL);      dialog->hfade=create_win(ne,2,ne->vy,ne->vx,1,(PUNION*)&fade,CC_ST_VISIBLE,NULL);
     dialog->vfade=create_win(ne,ne->vx>1?ne->vx:ne->vx+1,1,ne->vx>1?2:1,ne->vy-1,(PUNION*)&fade,ST_VISIBLE,NULL);      dialog->vfade=create_win(ne,ne->vx>1?ne->vx:ne->vx+1,1,ne->vx>1?2:1,ne->vy-1,(PUNION*)&fade,CC_ST_VISIBLE,NULL);
   }    }
   set_win_params(ne,extra);    set_win_params(ne,extra);
   if((style&ST_VISIBLE)==ST_VISIBLE)show_win(ne,true);    if((style&CC_ST_VISIBLE)==CC_ST_VISIBLE)show_win(ne,true);
   return ne;    return ne;
 }  }
   
Line 1637  void set_win_params(WIN *win,PUNION *par
Line 1637  void set_win_params(WIN *win,PUNION *par
   win->extra->type=params->type;    win->extra->type=params->type;
   switch(params->type)    switch(params->type)
   {    {
     case TP_TEXT:settextparams(win,params);break;      case CC_TP_TEXT:settextparams(win,params);break;
     case TP_EDIT:seteditparams(win,params);break;      case CC_TP_EDIT:seteditparams(win,params);break;
     case TP_BUTTON:setbuttonparams(win,params);break;      case CC_TP_BUTTON:setbuttonparams(win,params);break;
     case TP_SCROLL:setscrollparams(win,params);break;      case CC_TP_SCROLL:setscrollparams(win,params);break;
     case TP_COMBO:setcomboparams(win,params);break;      case CC_TP_COMBO:setcomboparams(win,params);break;
     case TP_LIST:setlistparams(win,params);break;      case CC_TP_LIST:setlistparams(win,params);break;
     case TP_STATUS:setstatusparams(win,params);break;      case CC_TP_STATUS:setstatusparams(win,params);break;
     case TP_PAINT:setpaintparams(win,params);break;      case CC_TP_PAINT:setpaintparams(win,params);break;
     case TP_MENU:setmenuparams(win,params);break;      case CC_TP_MENU:setmenuparams(win,params);break;
     case TP_DIALOG:setdialogparams(win,params);break;      case CC_TP_DIALOG:setdialogparams(win,params);break;
   }    }
   redrawclientwin(win);    redrawclientwin(win);
 }  }
Line 1657  void get_win_params(WIN *win,PUNION *par
Line 1657  void get_win_params(WIN *win,PUNION *par
   params->type=win->extra->type;    params->type=win->extra->type;
   switch(params->type)    switch(params->type)
   {    {
     case TP_TEXT:gettextparams(win,params);break;      case CC_TP_TEXT:gettextparams(win,params);break;
     case TP_EDIT:geteditparams(win,params);break;      case CC_TP_EDIT:geteditparams(win,params);break;
     case TP_BUTTON:getbuttonparams(win,params);break;      case CC_TP_BUTTON:getbuttonparams(win,params);break;
     case TP_SCROLL:getscrollparams(win,params);break;      case CC_TP_SCROLL:getscrollparams(win,params);break;
     case TP_COMBO:getcomboparams(win,params);break;      case CC_TP_COMBO:getcomboparams(win,params);break;
     case TP_LIST:getlistparams(win,params);break;      case CC_TP_LIST:getlistparams(win,params);break;
     case TP_STATUS:getstatusparams(win,params);break;      case CC_TP_STATUS:getstatusparams(win,params);break;
     case TP_PAINT:getpaintparams(win,params);break;      case CC_TP_PAINT:getpaintparams(win,params);break;
     case TP_MENU:getmenuparams(win,params);break;      case CC_TP_MENU:getmenuparams(win,params);break;
     case TP_DIALOG:getdialogparams(win,params);break;      case CC_TP_DIALOG:getdialogparams(win,params);break;
   }    }
 }  }
   
Line 1683  void message_pump()
Line 1683  void message_pump()
   static MEVENT event;    static MEVENT event;
   bool isevent;    bool isevent;
   Gpm_Event ev;    Gpm_Event ev;
   mousex=NOCHANGE;    mousex=CC_NOCHANGE;
   mousey=NOCHANGE;    mousey=CC_NOCHANGE;
   res=6;    res=6;
   mod=0;    mod=0;
   key=getch();    key=getch();
Line 1693  void message_pump()
Line 1693  void message_pump()
   {    {
     if(ioctl(0,TIOCLINUX,&res)>=0)      if(ioctl(0,TIOCLINUX,&res)>=0)
     {      {
       if((res&SHIFT_PRESSED)==SHIFT_PRESSED)mod|=MD_SHIFT;        if((res&SHIFT_PRESSED)==SHIFT_PRESSED)mod|=CC_D_SHIFT;
       if((res&CTRL_PRESSED)==CTRL_PRESSED)mod|=MD_CTRL;        if((res&CTRL_PRESSED)==CTRL_PRESSED)mod|=CC_D_CTRL;
       if(((res&ALTL_PRESSED)==ALTL_PRESSED)||((res&ALTR_PRESSED)==ALTR_PRESSED))        if(((res&ALTL_PRESSED)==ALTL_PRESSED)||((res&ALTR_PRESSED)==ALTR_PRESSED))
       {        {
         mod|=MD_ALT;          mod|=CC_D_ALT;
         if(key==27)key=getch();          if(key==27)key=getch();
       }        }
     }      }
Line 1708  void message_pump()
Line 1708  void message_pump()
       else        else
       {        {
         key=temp;          key=temp;
         mod|=MD_ALT;          mod|=CC_D_ALT;
       }        }
     }      }
   }    }

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