version 1.1 | | version 1.2 |
---|
| | |
i++; | | i++; |
} while (node); | | } while (node); |
| | |
height = --i * FONTSIZE; | | height = --i * FontSize; |
width = self->core.width; | | width = self->core.width; |
| | |
/*** do request from parent container ***/ | | /*** do request from parent container ***/ |
| | |
static void Insert(Widget w,XEvent *e,String *argv,Cardinal *argc) | | static void Insert(Widget w,XEvent *e,String *argv,Cardinal *argc) |
{ | | { |
CrListWidget self = (CrListWidget)w; | | CrListWidget self = (CrListWidget)w; |
CrListCall ret = GetYCall(w, e->xbutton.y / FONTSIZE); | | CrListCall ret = GetYCall(w, e->xbutton.y / FontSize); |
| | |
if (!self->crList.insertCallbacks) | | if (!self->crList.insertCallbacks) |
return; | | return; |
| | |
static void Select(Widget new,XEvent *e,String *argv,Cardinal *argc) | | static void Select(Widget new,XEvent *e,String *argv,Cardinal *argc) |
{ | | { |
CrListWidget self = (CrListWidget)new; | | CrListWidget self = (CrListWidget)new; |
CrListCall ret = GetYCall(new, e->xbutton.y / FONTSIZE); | | CrListCall ret = GetYCall(new, e->xbutton.y / FontSize); |
| | |
if (ret->index < 0) return; | | if (ret->index < 0) return; |
debug1("%s-Select()\n",self->core.name); | | debug1("%s-Select()\n",self->core.name); |
| | |
static void Delete(Widget new,XEvent *e,String *argv,Cardinal *argc) | | static void Delete(Widget new,XEvent *e,String *argv,Cardinal *argc) |
{ | | { |
CrListWidget self = (CrListWidget)new; | | CrListWidget self = (CrListWidget)new; |
CrListCall ret = GetYCall(new, e->xbutton.y / FONTSIZE); | | CrListCall ret = GetYCall(new, e->xbutton.y / FontSize); |
| | |
if (ret->index < 0 || !self->crList.deleteCallbacks) | | if (ret->index < 0 || !self->crList.deleteCallbacks) |
return; | | return; |
| | |
| | |
if (region) { | | if (region) { |
XClipBox(region,&rect); | | XClipBox(region,&rect); |
rect.height = rect.height / FONTSIZE + 2; | | rect.height = rect.height / FontSize + 2; |
rect.y /= FONTSIZE; | | rect.y /= FontSize; |
XClearArea(XtDisplay(w),XtWindow(w), 0, rect.y * FONTSIZE, | | XClearArea(XtDisplay(w),XtWindow(w), 0, rect.y * FontSize, |
0, rect.height * FONTSIZE - 1, False); | | 0, rect.height * FontSize - 1, False); |
} else { | | } else { |
rect.y = 0; | | rect.y = 0; |
XClearWindow (XtDisplay(w),XtWindow(w)); | | XClearWindow (XtDisplay(w),XtWindow(w)); |
| | |
for (y = rect.y; node && (!region || rect.height--); y++) { | | for (y = rect.y; node && (!region || rect.height--); y++) { |
debug2 ("%s Drawing %s\n", self->core.name,node->name); | | debug2 ("%s Drawing %s\n", self->core.name,node->name); |
/*DrawObject(w,0,y,node);*/ | | /*DrawObject(w,0,y,node);*/ |
FaceDraw (w, self->crList.gc, node->face, 0, y * FONTSIZE); | | FaceDraw (w, self->crList.gc, node->face, 0, y * FontSize); |
XDrawString(XtDisplay(w),XtWindow(w), | | XDrawString(XtDisplay(w),XtWindow(w), |
self->crList.normal_GC | | self->crList.normal_GC |
/*DefaultGCOfScreen(XtScreen(w))*/, | | /*DefaultGCOfScreen(XtScreen(w))*/, |
FONTSIZE + 8, y * FONTSIZE + 16, | | FontSize + 8, y * FontSize + 16, |
node->name,strlen(node->name)); | | node->name,strlen(node->name)); |
node = self->crList.next | | node = self->crList.next |
((XtPointer)self->crList.caller, (XtPointer)node); | | ((XtPointer)self->crList.caller, (XtPointer)node); |