[q-lang-cvs] qcalc qcalc.q,1.197,1.198
Brought to you by:
agraef
From: Albert G. <ag...@us...> - 2007-11-28 09:55:28
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25618 Modified Files: qcalc.q Log Message: make printing work with label and pixmap elements Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.197 retrieving revision 1.198 diff -C2 -d -r1.197 -r1.198 *** qcalc.q 28 Nov 2007 08:25:55 -0000 1.197 --- qcalc.q 28 Nov 2007 09:55:24 -0000 1.198 *************** *** 2542,2545 **** --- 2542,2547 ---- sel_cval (I,J) else "", + B = is_gui_elem (I,J) and then gui_hasrichtext (gui_elem (I,J)), + T = if B then S else htmlquote S, (N,M) = cell_span (I,J), SP = if (N>1) or else (M>1) then *************** *** 2548,2556 **** = if null F then sprintf "<td %s>%s</td>" ! (join " " ["align=right"|SP],htmlquote S) else sprintf "<td %s><p align=right>%s</p><p><i>%s</i></p></td>" ! (tuple [join " " SP|map htmlquote [S,F]]) ! if checknum 'X where 'X = valq S; = sprintf "<td %s><img src=\"%s\"> <i>%s</i></td>" (join " " SP,htmlquote $ which "pixmaps/flag.png", --- 2550,2558 ---- = if null F then sprintf "<td %s>%s</td>" ! (join " " ["align=right"|SP],S) else sprintf "<td %s><p align=right>%s</p><p><i>%s</i></p></td>" ! (tuple [join " " SP|[S,htmlquote F]]) ! if checknum 'X where 'X = valq S if not B; = sprintf "<td %s><img src=\"%s\"> <i>%s</i></td>" (join " " SP,htmlquote $ which "pixmaps/flag.png", *************** *** 2561,2568 **** if not null F then sprintf "<i>%s</i>" (hd L) else strcat L) else sprintf "<td %s><p>%s</p><p><i>%s</i></p></td>" (tuple [join " " SP|L]) ! where L = map htmlquote $ filter (neg null) [S,F]; /* Exit the application. */ --- 2563,2573 ---- if not null F then sprintf "<i>%s</i>" (hd L) else strcat L) + else if B then + sprintf "<td %s>%s<p><i>%s</i></p></td>" + (tuple [join " " SP|L]) else sprintf "<td %s><p>%s</p><p><i>%s</i></p></td>" (tuple [join " " SP|L]) ! where L = filter (neg null) [T,htmlquote F]; /* Exit the application. */ *************** *** 2893,2900 **** gui_set_slider); "MyLabel", (label_gui, ! gui_get_nop,gui_getc_nop, gui_set_label); "MyPixmap", (pixmap_gui, ! gui_get_nop,gui_getc_nop, gui_set_pixmap); "MyPushButton", (pushbutton_gui, --- 2898,2905 ---- gui_set_slider); "MyLabel", (label_gui, ! gui_get_nop,gui_getc_label, gui_set_label); "MyPixmap", (pixmap_gui, ! gui_get_nop,gui_getc_pixmap, gui_set_pixmap); "MyPushButton", (pushbutton_gui, *************** *** 2962,2965 **** --- 2967,2975 ---- /* Get the value in string form. */ + gui_hasrichtext X + = (C="MyLabel") or (C="MyPixmap") + where C:String = gui_class X; + = false otherwise; + gui_getcval X = GV X where C:String = gui_class X, (_,_,GV,_) = GUI_TYPES!C; // = printf "unknown GUI element %s\n" (class_name X) || ""; *************** *** 2992,2995 **** --- 3002,3011 ---- = str $ qt X "value" (); + gui_getc_label X + = qt X "text" (); + + gui_getc_pixmap X + = htmlquote "<<pixmap>>"; + /* Set the value of a GUI element from a string. */ |