| version 1.3, 2005/11/29 18:46:31 |
version 1.4, 2005/12/01 18:52:29 |
| Line 183 bool claeditacel(WIN *sender,long x,long |
|
| Line 183 bool claeditacel(WIN *sender,long x,long |
|
| return ret; |
return ret; |
| } |
} |
| |
|
| |
void scrollincombochangeproc(WIN *sender) |
| |
{ |
| |
redrawclientwin(sender->parent); |
| |
} |
| |
|
| |
long fadecolor(long chr) |
| |
{ |
| |
char cb,cf; |
| |
short pair; |
| |
cb=C_BLACK; |
| |
cf=C_WHITE; |
| |
pair=cb&0x7; |
| |
pair<<=3; |
| |
pair+=cf; |
| |
if(pair==7)pair=0;else if(pair==0)pair=7; |
| |
init_pair(pair,cf,cb); |
| |
return chr&~A_BOLD&~A_REVERSE&~A_COLOR|COLOR_PAIR(pair); |
| |
} |
| |
|
| void setuplistparams(WIN *win) |
void setuplistparams(WIN *win) |
| { |
{ |
| LIST *list=&win->extra->list; |
LIST *list=&win->extra->list; |
| Line 200 void setuplistparams(WIN *win) |
|
| Line 219 void setuplistparams(WIN *win) |
|
| list->numlines=g_list_length(list->lines); |
list->numlines=g_list_length(list->lines); |
| if((list->activeline>=0)&&(list->activeline<list->numlines)) |
if((list->activeline>=0)&&(list->activeline<list->numlines)) |
| list->activeitem=g_list_nth(list->lines,list->activeline); |
list->activeitem=g_list_nth(list->lines,list->activeline); |
| |
list->oldscrollpos=list->vscroll->extra->scroll.pos; |
| |
list->scrollupitem=g_list_nth(list->lines,list->oldscrollpos); |
| if(list->combotyp!=CT_TABLE) |
if(list->combotyp!=CT_TABLE) |
| { |
{ |
| list->maxitemlen=0; |
list->maxitemlen=0; |
| Line 214 void setuplistparams(WIN *win) |
|
| Line 235 void setuplistparams(WIN *win) |
|
| } |
} |
| else |
else |
| { |
{ |
| GSList *sc; |
|
| long i; |
|
| sc=list->lencells; |
|
| list->maxitemlen=-1; |
|
| while(sc!=NULL) |
|
| { |
|
| list->maxitemlen+=(long)sc->data+1; |
|
| sc=g_slist_next(sc); |
|
| i++; |
|
| } |
|
| if(list->maxitemlen<0)list->maxitemlen=0; |
|
| } |
|
| if(list->combotyp==CT_TABLE) |
|
| { |
|
| long i; |
long i; |
| if(list->lencells!=NULL)g_slist_free(list->lencells); |
if(list->lencells!=NULL)g_slist_free(list->lencells); |
| for(i=0;i<g_slist_length((GSList*)list->lines->data);i++) |
for(i=0;i<g_slist_length((GSList*)list->lines->data);i++) |
| Line 253 void setuplistparams(WIN *win) |
|
| Line 260 void setuplistparams(WIN *win) |
|
| } |
} |
| lines=g_list_next(lines); |
lines=g_list_next(lines); |
| } |
} |
| |
sc=list->lencells; |
| |
list->maxitemlen=-1; |
| |
while(sc!=NULL) |
| |
{ |
| |
list->maxitemlen+=(long)sc->data+1; |
| |
sc=g_slist_next(sc); |
| |
i++; |
| |
} |
| |
if(list->maxitemlen<0)list->maxitemlen=0; |
| } |
} |
| } |
} |
| |
|
| Line 603 void combodblclkproc(WIN *sender) |
|
| Line 619 void combodblclkproc(WIN *sender) |
|
| if(sender->parent->extra->type==TP_COMBO) |
if(sender->parent->extra->type==TP_COMBO) |
| { |
{ |
| COMBO *combo=&sender->parent->extra->combo; |
COMBO *combo=&sender->parent->extra->combo; |
| combo->activeline=sender->extra->list.activeline; |
long i=sender->extra->list.activeline; |
| |
setcomboactiveitem(combo,combo->activeline,i); |
| |
combo->activeline=i; |
| combo->scroll=0; |
combo->scroll=0; |
| if(combo->change!=NULL)combo->change(sender->parent); |
if(combo->change!=NULL)combo->change(sender->parent); |
| } |
} |
| Line 611 void combodblclkproc(WIN *sender) |
|
| Line 629 void combodblclkproc(WIN *sender) |
|
| |
|
| void buttontimer(TIMER *sender) |
void buttontimer(TIMER *sender) |
| { |
{ |
| redraw(); |
redrawclientwin(sender->win); |
| del_timer(sender); |
del_timer(sender); |
| } |
} |
| |
|
| Line 942 void doneredraw() |
|
| Line 960 void doneredraw() |
|
| if(mouseactive==MOUSE_GPM)redrawmouse=0; |
if(mouseactive==MOUSE_GPM)redrawmouse=0; |
| } |
} |
| |
|
| |
void redrawclientwin(WIN *win) |
| |
{ |
| |
if(!winexist(win))return; |
| |
if(win==NULL)return; |
| |
if((win->style&ST_AUTOXSIZE)||(win->style&ST_AUTOYSIZE)){redraw();return;} |
| |
if(!isvisible(win))return; |
| |
drawwin(win,false); |
| |
long x=0,y=0,j,i,z; |
| |
attr_t *data=win->windata; |
| |
CMAP *map=cmap; |
| |
client_to_screen(win,&x,&y); |
| |
wredrawln(stdscr,y,win->vy); |
| |
for(j=y;j<y+win->vy;j++) |
| |
{ |
| |
map=cmap+j*screenx+x; |
| |
for(i=x;i<x+win->vx;i++) |
| |
{ |
| |
if(map->win==win) |
| |
{ |
| |
z=*data; |
| |
if(map->fade)z=fadecolor(z); |
| |
mvaddch(j,i,z); |
| |
} |
| |
map++; |
| |
data++; |
| |
} |
| |
} |
| |
doneredraw(); |
| |
} |
| |
|
| int redraw() |
int redraw() |
| { |
{ |
| WIN *win; |
WIN *win; |
| Line 1119 void checkwin(WIN *win) |
|
| Line 1167 void checkwin(WIN *win) |
|
| } |
} |
| else if(win->extra->type==TP_COMBO) |
else if(win->extra->type==TP_COMBO) |
| { |
{ |
| long poz,maxlen=0,numlines=0; |
long maxlen,numlines; |
| COMBO *combo=&win->extra->combo; |
COMBO *combo=&win->extra->combo; |
| GList *lines=combo->list->extra->list.lines; |
LIST *list=&combo->list->extra->list; |
| if(lines!=NULL)numlines=g_list_length(lines); |
numlines=list->numlines; |
| while(lines!=NULL) |
maxlen=list->maxitemlen; |
| { |
|
| if(lines->data==NULL)continue; |
|
| poz=strlen(lines->data); |
|
| if(poz>maxlen)maxlen=poz; |
|
| lines=g_list_next(lines); |
|
| } |
|
| if((win->style&ST_AUTOXSIZE)==ST_AUTOXSIZE)win->vx=maxlen+1; |
if((win->style&ST_AUTOXSIZE)==ST_AUTOXSIZE)win->vx=maxlen+1; |
| } |
} |
| else if(win->extra->type==TP_LIST) |
else if(win->extra->type==TP_LIST) |
| Line 1195 int drawwin(WIN *win,bool dorefresh) |
|
| Line 1237 int drawwin(WIN *win,bool dorefresh) |
|
| case TP_PAINT:drawwinpaint(win);break; |
case TP_PAINT:drawwinpaint(win);break; |
| case TP_MENU:drawwinmenu(win,wx);break; |
case TP_MENU:drawwinmenu(win,wx);break; |
| case TP_DIALOG:drawwindialog(win,wx);break; |
case TP_DIALOG:drawwindialog(win,wx);break; |
| case TP_FADE:drawwinfade(win,x,y);dorefresh=false; |
case TP_FADE:drawwinfade(win,x,y);break; |
| } |
} |
| if(dorefresh)mrefresh(win); |
if(dorefresh)mrefresh(win); |
| } |
} |