q-lang-cvs Mailing List for Q - Equational Programming Language (Page 12)
Brought to you by:
agraef
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(106) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(219) |
Feb
(152) |
Mar
|
Apr
(92) |
May
(45) |
Jun
(3) |
Jul
|
Aug
(3) |
Sep
(111) |
Oct
(52) |
Nov
|
Dec
|
2005 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(2) |
May
(23) |
Jun
(46) |
Jul
(158) |
Aug
(22) |
Sep
|
Oct
(26) |
Nov
(11) |
Dec
(49) |
2006 |
Jan
(57) |
Feb
(196) |
Mar
(10) |
Apr
(41) |
May
(149) |
Jun
(308) |
Jul
(11) |
Aug
(25) |
Sep
(15) |
Oct
|
Nov
|
Dec
(15) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
(15) |
May
(204) |
Jun
(112) |
Jul
(7) |
Aug
(16) |
Sep
(134) |
Oct
(313) |
Nov
(262) |
Dec
(83) |
2008 |
Jan
(81) |
Feb
(83) |
Mar
(21) |
Apr
|
May
|
Jun
(1) |
Jul
(2) |
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Albert G. <ag...@us...> - 2007-12-01 23:23:54
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31343 Modified Files: calclib.q Log Message: bugfixes Index: calclib.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/calclib.q,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** calclib.q 1 Dec 2007 09:59:37 -0000 1.51 --- calclib.q 1 Dec 2007 23:23:50 -0000 1.52 *************** *** 549,554 **** where (H,SEM,'_) = get YYTASKS!(I,J): // task is alive and kicking, update it with the new data ! = post SEM '(taskbutton (S,INIT) X) || yyset (I,J) INIT ! where 'X = subst 'X if isthread H and then active H; // zombie: kill it, then restart --- 549,555 ---- where (H,SEM,'_) = get YYTASKS!(I,J): // task is alive and kicking, update it with the new data ! = YYTASKS := insert (get YYTASKS) (I,J;H,SEM,'X) || ! post SEM '(taskbutton (S,INIT) Y) || yyset (I,J) INIT ! where 'Y = subst 'X if isthread H and then active H; // zombie: kill it, then restart |
From: Albert G. <ag...@us...> - 2007-12-01 12:36:05
|
Update of /cvsroot/q-lang/q In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19005 Modified Files: ChangeLog Log Message: update ChangeLog Index: ChangeLog =================================================================== RCS file: /cvsroot/q-lang/q/ChangeLog,v retrieving revision 1.306 retrieving revision 1.307 diff -C2 -d -r1.306 -r1.307 *** ChangeLog 27 Oct 2007 18:55:53 -0000 1.306 --- ChangeLog 1 Dec 2007 12:35:57 -0000 1.307 *************** *** 1,2 **** --- 1,10 ---- + 2007-12-01 Albert Graef <Dr....@t-...> + + * src/qm.c, src/qmfuns.c (qmfreads): get rid of the reads mutex + + This doesn't seem to serve any real purpose any more, and is a + very bad idea anyway. So let's see how well we can live without + it. + 2007-10-27 Albert Graef <Dr....@t-...> |
From: Albert G. <ag...@us...> - 2007-12-01 12:30:13
|
Update of /cvsroot/q-lang/q/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv13574/src Modified Files: qm.c qmfuns.c Log Message: get rid of the global reads mutex (experimental) Index: qm.c =================================================================== RCS file: /cvsroot/q-lang/q/src/qm.c,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** qm.c 15 Oct 2007 10:15:39 -0000 1.91 --- qm.c 1 Dec 2007 12:29:57 -0000 1.92 *************** *** 239,249 **** pthread_mutex_lock(&input_mutex); #if 0 ! /* NOTE: We don't lock the tty and parse mutexes, since that would suspend a ! fork in a background thread when the interpreter sits waiting in the main ! loop. */ pthread_mutex_lock(&tty_mutex); pthread_mutex_lock(&parse_mutex); - #endif pthread_mutex_lock(&reads_mutex); if (nused > 1) for (thr = thr0+1; thr < thr0+nthreads; thr++) --- 239,249 ---- pthread_mutex_lock(&input_mutex); #if 0 ! /* NOTE: We don't lock the tty, parse and reads mutexes, since that would ! suspend a fork in a background thread when some other thread (or the main ! loop) sits waiting reading from a tty or file. */ pthread_mutex_lock(&tty_mutex); pthread_mutex_lock(&parse_mutex); pthread_mutex_lock(&reads_mutex); + #endif if (nused > 1) for (thr = thr0+1; thr < thr0+nthreads; thr++) *************** *** 265,270 **** pthread_mutex_unlock(&tty_mutex); pthread_mutex_unlock(&parse_mutex); - #endif pthread_mutex_unlock(&reads_mutex); if (nused > 1) for (thr = thr0+1; thr < thr0+nthreads; thr++) --- 265,270 ---- pthread_mutex_unlock(&tty_mutex); pthread_mutex_unlock(&parse_mutex); pthread_mutex_unlock(&reads_mutex); + #endif if (nused > 1) for (thr = thr0+1; thr < thr0+nthreads; thr++) Index: qmfuns.c =================================================================== RCS file: /cvsroot/q-lang/q/src/qmfuns.c,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** qmfuns.c 3 Oct 2007 02:59:36 -0000 1.81 --- qmfuns.c 1 Dec 2007 12:29:57 -0000 1.82 *************** *** 4487,4492 **** --- 4487,4494 ---- release_lock(); if (fp == stdin) acquire_tty(); + #if 0 pthread_mutex_lock(&reads_mutex); #endif + #endif while((r = fgets(t, MAXSTRLEN, fp)) && *t && t[(l = strlen(t))-1] != '\n') { *************** *** 4502,4506 **** --- 4504,4510 ---- free(s); #ifdef USE_THREADS + #if 0 pthread_mutex_unlock(&reads_mutex); + #endif if (fp == stdin) release_tty(); acquire_lock(); *************** *** 4513,4517 **** --- 4517,4523 ---- t[l-1] = 0; #ifdef USE_THREADS + #if 0 pthread_mutex_unlock(&reads_mutex); + #endif if (fp == stdin) release_tty(); acquire_lock(); |
From: Albert G. <ag...@us...> - 2007-12-01 09:59:42
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv17287 Modified Files: calclib.q Log Message: comment changes Index: calclib.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/calclib.q,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** calclib.q 30 Nov 2007 22:25:18 -0000 1.50 --- calclib.q 1 Dec 2007 09:59:37 -0000 1.51 *************** *** 41,53 **** public matrix KEY Xs, rowvect KEY Xs, colvect KEY Xs; ! /* Definition of GUI elements in table cells. Currently supported are (rich) ! text labels, pixmaps, checkboxes, comboboxes (both non-editable and ! editable), spinboxes, horizontal and vertical sliders, push buttons and ! toggle buttons. You can find examples for all of these in the ! guiexamples.qcalc spreadsheet included in the QCalc distribution. */ public label ARGS, pixmap ARGS, checkbox ARGS, combobox ARGS, comboedit ARGS, spinbox ARGS, hslider ARGS, vslider ARGS, pushbutton ARGS, togglebutton ARGS; /* The action button is a special push button which has an associated Q expression (special argument) to be evaluated in the inferior Q process --- 41,57 ---- public matrix KEY Xs, rowvect KEY Xs, colvect KEY Xs; ! /* Basic GUI elements. Currently supported are (rich) text labels, pixmaps, ! checkboxes, comboboxes (both non-editable and editable), spinboxes, ! horizontal and vertical sliders, push buttons and toggle buttons. You can ! find examples for all of these in the guiexamples.qcalc spreadsheet ! included in the QCalc distribution. */ public label ARGS, pixmap ARGS, checkbox ARGS, combobox ARGS, comboedit ARGS, spinbox ARGS, hslider ARGS, vslider ARGS, pushbutton ARGS, togglebutton ARGS; + /* Advanced GUI elements. Currently supported are action buttons, task buttons + and task windows. See guiexamples.qcalc for examples showing how to use + these. */ + /* The action button is a special push button which has an associated Q expression (special argument) to be evaluated in the inferior Q process *************** *** 71,79 **** the task's cell which can be operated directly by the task in the inferior Q process. The id of the parent window is available inside the task with ! the task_winid function. In addition, messages of the form (W:Int,H:Int) ! are delivered via the task_input semaphore (see above) whenever the size of ! the parent window changes, and the task_params function (see above) can be ! used to extract arguments from a quoted taskwindow call (which is sent to ! the task when the task window cell is recomputed). */ public special taskwindow X; --- 75,81 ---- the task's cell which can be operated directly by the task in the inferior Q process. The id of the parent window is available inside the task with ! the task_winid function, and messages of the form (W:Int,H:Int) are ! delivered via the task_input semaphore (see above) whenever the size of the ! parent window changes. */ public special taskwindow X; |
From: Albert G. <ag...@us...> - 2007-12-01 09:31:58
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14439 Modified Files: qcalc.q Log Message: bugfixes Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.208 retrieving revision 1.209 diff -C2 -d -r1.208 -r1.209 *** qcalc.q 1 Dec 2007 08:54:53 -0000 1.208 --- qcalc.q 1 Dec 2007 09:31:52 -0000 1.209 *************** *** 2808,2812 **** taskwindow_gui (I,J) X:QtObject () ! = (); label_gui (I,J) () (S,A) --- 2808,2812 ---- taskwindow_gui (I,J) X:QtObject () ! = send_expr '(yywin (I,J) ~(qt X "winId" ())); label_gui (I,J) () (S,A) |
From: Albert G. <ag...@us...> - 2007-12-01 08:54:56
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11394 Modified Files: qcalc.q Log Message: bugfixes Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.207 retrieving revision 1.208 diff -C2 -d -r1.207 -r1.208 *** qcalc.q 30 Nov 2007 22:23:43 -0000 1.207 --- qcalc.q 1 Dec 2007 08:54:53 -0000 1.208 *************** *** 2798,2804 **** mytaskwindow_gui (I,J) = qt X "setBackgroundMode" (qt_val "Qt" "PaletteBase") || ! send_expr '(yywin (I,J) ID) || ! qt TABLE "setCellWidget" (I,J,X) || IT ! where ID = qt X "winId" () if not is_nil IT and then not is_nil X where X:QtObject = qt_object "QWidget" TABLE --- 2798,2804 ---- mytaskwindow_gui (I,J) = qt X "setBackgroundMode" (qt_val "Qt" "PaletteBase") || ! qt TABLE "setCellWidget" (I,J,X) || ! // make sure to get the window id *after* setCellWidget() ! send_expr '(yywin (I,J) ~(qt X "winId" ())) || IT if not is_nil IT and then not is_nil X where X:QtObject = qt_object "QWidget" TABLE |
From: Albert G. <ag...@us...> - 2007-11-30 22:38:41
|
Update of /cvsroot/q-lang/qcalc/examples In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv482 Modified Files: eds-example.qcalc Log Message: latest eds-example.qcalc from Eddie Rucker Index: eds-example.qcalc =================================================================== RCS file: /cvsroot/q-lang/qcalc/examples/eds-example.qcalc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** eds-example.qcalc 26 Nov 2007 21:31:53 -0000 1.1 --- eds-example.qcalc 30 Nov 2007 22:38:38 -0000 1.2 *************** *** 1,4 **** ! // qcalc 1.0, created Mon Nov 26 22:17:41 2007 -*-Q-*- -*- coding: UTF-8 -*- ! // [((0,0),"Take the gamma of B1:"),((0,1),"4.3"),((0,2),"gamma B1 ="),((0,3),"= gamma 4.3"),((1,0),"Factorial is based on gamma:"),((1,1),"8"),((1,2),"factorial B2 ="),((1,3),"= factorial B2"),((3,0),"How many ways can we choose"),((3,1),"Size of group:"),((3,2),"8"),((3,3),"Answer:"),((3,4),"= permutations C4 C5"),((4,0),"some elements from a set when order"),((4,1),"Number to choose:"),((4,2),"4"),((5,0),"is important."),((7,0),"How many ways can we choose"),((7,1),"Size of group:"),((7,2),"8"),((7,3),"Answer:"),((7,4),"= combinations C8 C9"),((8,0),"some elements from a set when order"),((8,1),"Number to choose:"),((8,2),"4"),((9,0),"is *not* important."),((11,0),"Binomial Distribution"),((11,1),"Times coin tossed:"),((11,2),"3"),((11,3),"Answer:"),((11,4),"= binomialDist C12 C13 C14"),((12,0),"A coin is tossed C12 times. What is"),((12,1),"Number of Heads:"),((12,2),"2"),((13,0),"the probability of getting exactly "),((13,1),"Prob. of a Head:"),((13,2),".5"),((14,0),"C13 heads"),((16,0),"Dates"),((16,1),"Values"),((16,2),"Percent Change"),((17,0),"2000"),((17,1),"10"),((18,0),"2001"),((18,1),"15"),((18,2),"= 100*percentChange B18 B19"),((19,0),"2002"),((19,1),"12"),((19,2),"= 100*percentChange B19 B20"),((20,0),"2003"),((20,1),"16"),((20,2),"= 100*percentChange B20 B21"),((21,0),"2004"),((21,1),"19"),((21,2),"= 100*percentChange B21 B22"),((23,0),"Given a set of numbers"),((23,1),"Numbers"),((24,0),"we can find the following:"),((24,1),"3"),((25,1),"2"),((26,1),"4"),((27,1),"5"),((28,1),"3"),((29,1),"4"),((30,1),"2"),((31,1),"3"),((32,1),"2"),((33,0),"Mean:"),((33,1),"= mean B25:B33"),((34,0),"Mode:"),((34,1),"= mode (sort (<) B25:B33)"),((35,0),"Median:"),((35,1),"= median B25:B33"),((36,0),"Lower Quartile:"),((36,1),"= lowerQuartile B25:B33"),((37,0),"Upper Quartile:"),((37,1),"= upperQuartile B25:B33"),((38,0),"Range:"),((38,1),"= range B25:B33"),((39,0),"Population Variance:"),((39,1),"= populationVariance B25:B33"),((40,0),"Population Standard Deviation:"),((40,1),"= populationSTD B25:B33"),((41,0),"Sample Variance:"),((41,1),"= sampleVariance B25:B33"),((42,0),"Sample Standard Deviation:"),((42,1),"= sampleSTD B25:B33"),((44,0),"Find outliers of a group"),((44,1),"Numbers"),((45,1),"1"),((46,1),"30"),((47,1),"3"),((48,1),"-20"),((49,1),"5"),((50,1),"6"),((51,1),"7"),((52,0),"outliers = "),((52,1),"= outliers (sort (<) B46:B52)"),((54,0),"Regression"),((54,1),"X"),((54,2),"Y"),((55,0),"Find the best fitting line for the"),((55,1),"1"),((55,2),"4"),((56,0),"points to the right."),((56,1),"2"),((56,2),"6"),((57,1),"3"),((57,2),"7"),((58,1),"4"),((58,2),"9"),((59,1),"5"),((59,2),"12"),((60,1),"7"),((60,2),"13"),((62,0),"Least Squares:"),((62,1),"= regression B56:B61 C56:C61"),((63,0),"Value of regression at point B63"),((63,1),"9"),((63,2),"= regression B56:B61 C56:C61 B64"),((64,0),"correlation of coefficient"),((64,1),"= correlation B56:B61 C56:C61"),((65,0),"SSE"),((65,1),"= _SSE B56:B61 C56:C61"),((66,0),"MSE"),((66,1),"= _MSE B56:B61 C56:C61"),((68,0),"Assuming a Normal distribution"),((69,0),"Mean:"),((69,1),"30"),((70,0),"Standard Deviation:"),((70,1),"5"),((71,1),"23"),((71,2),"41"),((72,0),"Probability X is between B71 and C71"),((72,1),"= normal (zScore B72 B70 B71) (zScore C72 B70 B71)"),((73,0),"Probability X is above B71"),((73,1),"= normalAbove (zScore B72 B70 C72)"),((74,0),"Probability X is below B71"),((74,1),"= normalBelow (zScore B72 B70 B71)")] // [] // [(0,380),(1,181),(2,164),(3,117),(4,117)] --- 1,4 ---- ! // qcalc 1.0, created Mon Nov 5 14:55:11 2007 -*-Q-*- -*- coding: UTF-8 -*- ! // [((0,0),"Take the gamma of B1:"),((0,1),"4.3"),((0,2),"gamma B1 ="),((0,3),"= gamma 4.3"),((1,0),"Factorial is based on gamma:"),((1,1),"8"),((1,2),"factorial B2 ="),((1,3),"= factorial B2"),((3,0),"How many ways can we choose"),((3,1),"Size of group:"),((3,2),"8"),((3,3),"Answer:"),((3,4),"= permutations C4 C5"),((4,0),"some elements from a set when order"),((4,1),"Number to choose:"),((4,2),"4"),((5,0),"is important."),((7,0),"How many ways can we choose"),((7,1),"Size of group:"),((7,2),"8"),((7,3),"Answer:"),((7,4),"= combinations C8 C9"),((8,0),"some elements from a set when order"),((8,1),"Number to choose:"),((8,2),"4"),((9,0),"is *not* important."),((11,0),"Binomial Distribution"),((11,1),"Times coin tossed:"),((11,2),"3"),((11,3),"Answer:"),((11,4),"= binomialDist C12 C13 C14"),((12,0),"A coin is tossed C12 times. What is"),((12,1),"Number of Heads:"),((12,2),"2"),((13,0),"the probability of geting exactly "),((13,1),"Prob. of a Head:"),((13,2),".5"),((14,0),"C13 heads"),((16,0),"Dates"),((16,1),"Values"),((16,2),"Percent Change"),((17,0),"2000"),((17,1),"10"),((18,0),"2001"),((18,1),"15"),((18,2),"= 100*percentChange B18 B19"),((19,0),"2002"),((19,1),"12"),((19,2),"= 100*percentChange B19 B20"),((20,0),"2003"),((20,1),"16"),((20,2),"= 100*percentChange B20 B21"),((21,0),"2004"),((21,1),"19"),((21,2),"= 100*percentChange B21 B22"),((23,0),"Given a set of numbers"),((23,1),"Numbers"),((24,0),"we can find the following:"),((24,1),"3"),((25,1),"2"),((26,1),"4"),((27,1),"5"),((28,1),"3"),((29,1),"4"),((30,1),"2"),((31,1),"3"),((32,1),"2"),((33,0),"Mean:"),((33,1),"= mean B25:B33"),((34,0),"Mode:"),((34,1),"= mode (sort (<) B25:B33)"),((35,0),"Median:"),((35,1),"= median B25:B33"),((36,0),"Lower Quartile:"),((36,1),"= lowerQuartile B25:B33"),((37,0),"Upper Quartile:"),((37,1),"= upperQuartile B25:B33"),((38,0),"Range:"),((38,1),"= range B25:B33"),((39,0),"Population Variance:"),((39,1),"= populationVariance B25:B33"),((40,0),"Population Standard Deviation:"),((40,1),"= populationSTD B25:B33"),((41,0),"Sample Variance:"),((41,1),"= sampleVariance B25:B33"),((42,0),"Sample Standard Deviation:"),((42,1),"= sampleSTD B25:B33"),((44,0),"Find outliers of a group"),((44,1),"Numbers"),((45,1),"1"),((46,1),"30"),((47,1),"3"),((48,1),"-20"),((49,1),"5"),((50,1),"6"),((51,1),"7"),((52,0),"outliers = "),((52,1),"= outliers (sort (<) B46:B52)"),((54,0),"Regression"),((54,1),"X"),((54,2),"Y"),((55,0),"Find the best fitting line for the"),((55,1),"1"),((55,2),"4"),((56,0),"points to the right."),((56,1),"2"),((56,2),"6"),((57,1),"3"),((57,2),"7"),((58,1),"4"),((58,2),"9"),((59,1),"5"),((59,2),"12"),((60,1),"7"),((60,2),"13"),((62,0),"Least Squares:"),((62,1),"= regression B56:B61 C56:C61"),((63,0),"Value of regression at point B63"),((63,1),"9"),((63,2),"= regression B56:B61 C56:C61 B64"),((64,0),"correlation of coefficient"),((64,1),"= correlation B56:B61 C56:C61"),((65,0),"SSE"),((65,1),"= _SSE B56:B61 C56:C61"),((66,0),"MSE"),((66,1),"= _MSE B56:B61 C56:C61"),((68,0),"Assuming a Normal distribution"),((69,0),"Mean:"),((69,1),"30"),((70,0),"Standard Deviation:"),((70,1),"5"),((71,1),"23"),((71,2),"41"),((72,0),"Probability X is between B71 and C71"),((72,1),"= normal (zScore B72 B70 B71) (zScore C72 B70 B71)"),((73,0),"Probability X is above B71"),((73,1),"= normalAbove (zScore B72 B70 C72)"),((74,0),"Probability X is below B71"),((74,1),"= normalBelow (zScore B72 B70 B71)")] // [] // [(0,380),(1,181),(2,164),(3,117),(4,117)] *************** *** 20,25 **** mean, mode, range, sampleVariance, populationVariance, sampleSTD, populationSTD, correlation, integrate, regression, _SXY, _SSE, _MSE, zScore, ! normal, normalBelow, normalAbove, gamma, factorial, permutations, combinations, ! binomialDist, beta, erf, efc; /* remove elements of Y from X (like set difference) --- 20,25 ---- mean, mode, range, sampleVariance, populationVariance, sampleSTD, populationSTD, correlation, integrate, regression, _SXY, _SSE, _MSE, zScore, ! normal, normalBelow, normalAbove, gamma, factorial, permutations, ! combinations, binomialDist, beta, erf, erfc; /* remove elements of Y from X (like set difference) *************** *** 154,158 **** = ((sum (map sqr L)) - (sqr (sum L))/N) / N where N = #L; ! /* population standard of L */ populationSTD L:List = sqrt (populationVariance L); --- 154,158 ---- = ((sum (map sqr L)) - (sqr (sum L))/N) / N where N = #L; ! /* population standard deviation of L */ populationSTD L:List = sqrt (populationVariance L); *************** *** 266,270 **** /* normal A B => probability of P(A<X<B) */ ! normal = integrate normalPDF; normalBelow Z:Real --- 266,270 ---- /* normal A B => probability of P(A<X<B) */ ! normal A B = integrate normalPDF A B; normalBelow Z:Real |
From: Albert G. <ag...@us...> - 2007-11-30 22:25:21
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27125 Modified Files: calclib.q Log Message: add cvs id Index: calclib.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/calclib.q,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** calclib.q 30 Nov 2007 21:47:07 -0000 1.49 --- calclib.q 30 Nov 2007 22:25:18 -0000 1.50 *************** *** 2,5 **** --- 2,7 ---- /* calclib.q: qcalc support operations */ + /* $Id$ */ + /* This module provides some useful support functions for use in QCalc spreadsheets. You need to import this if you want to use any of the |
From: Albert G. <ag...@us...> - 2007-11-30 22:23:47
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv26124 Modified Files: qcalc.q Log Message: bugfixes Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.206 retrieving revision 1.207 diff -C2 -d -r1.206 -r1.207 *** qcalc.q 30 Nov 2007 21:47:07 -0000 1.206 --- qcalc.q 30 Nov 2007 22:23:43 -0000 1.207 *************** *** 1232,1241 **** if (I,J) = real_index (I,J): = // clean up GUI element in the inferior process ! gui_clear (I,J) || clear_cell1 (I,J) || // make sure that edit mode is cleared, too if eq (real_index (I1,J1)) (I,J) then qt TABLE "setEditMode" (qt_val "QTable" "NotEditing",I1,J1) ! where X:QtObject = gui_elem (I,J), ! (I1,J1) = current_edited; = clear_cell1 (I,J) otherwise; --- 1232,1243 ---- if (I,J) = real_index (I,J): = // clean up GUI element in the inferior process ! gui_clear X (I,J) || clear_cell1 (I,J) || // make sure that edit mode is cleared, too if eq (real_index (I1,J1)) (I,J) then qt TABLE "setEditMode" (qt_val "QTable" "NotEditing",I1,J1) ! where (I1,J1) = current_edited, ! X:QtObject = gui_elem (I,J); ! = gui_clear X (I,J) || clear_cell1 (I,J) ! where X:QtObject = gui_elem (I,J); = clear_cell1 (I,J) otherwise; |
From: Albert G. <ag...@us...> - 2007-11-30 21:47:13
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28523 Modified Files: calclib.q qcalc.q Log Message: bugfixes Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.205 retrieving revision 1.206 diff -C2 -d -r1.205 -r1.206 *** qcalc.q 30 Nov 2007 13:42:15 -0000 1.205 --- qcalc.q 30 Nov 2007 21:47:07 -0000 1.206 *************** *** 2792,2795 **** --- 2792,2798 ---- private yywin KEY MSG; taskwindow_gui (I,J) () () + = local (mytaskwindow_gui (I,J)) if is_global; + = mytaskwindow_gui (I,J) otherwise; + mytaskwindow_gui (I,J) = qt X "setBackgroundMode" (qt_val "Qt" "PaletteBase") || send_expr '(yywin (I,J) ID) || Index: calclib.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/calclib.q,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** calclib.q 30 Nov 2007 13:04:35 -0000 1.48 --- calclib.q 30 Nov 2007 21:47:07 -0000 1.49 *************** *** 87,90 **** --- 87,92 ---- var YYDATA = ref emptyhdict, YYKEY = ref (); + var YYTASKS = ref emptyhdict, YYTLD = ref emptyhdict; + public yymain, yyval KEY, yyset KEY VAL, yyclear KEY, yytask KEY MSG, yywin KEY MSG, yyaction KEY, yyclearaction KEY; *************** *** 92,101 **** private yyloop, yyout X, yyerror X; - private task_index; - /* index and friends. */ ! index = (I,J) where (I,J) = get YYKEY; ! = (I,J) where (I,J) = task_index; row = I where (I,J) = index; column = J where (I,J) = index; --- 94,101 ---- private yyloop, yyout X, yyerror X; /* index and friends. */ ! index = (I,J) where (I,J|_) = get YYTLD!thread_no this_thread; ! = (I,J) where (I,J) = get YYKEY; row = I where (I,J) = index; column = J where (I,J) = index; *************** *** 190,194 **** label (S:String,A:String) = printf "\f+++ Label: %s %s\n" (str (I,J),str (S,A)) || ! flush || yyset (I,J) S || S where (I,J) = get YYKEY; --- 190,194 ---- label (S:String,A:String) = printf "\f+++ Label: %s %s\n" (str (I,J),str (S,A)) || ! flush || yyset (I,J) S where (I,J) = get YYKEY; *************** *** 202,206 **** pixmap (S:String,A:String,B:Int) = printf "\f+++ Pixmap: %s %s\n" (str (I,J),str (S,A,B)) || ! flush || yyset (I,J) S || S where (I,J) = get YYKEY; --- 202,206 ---- pixmap (S:String,A:String,B:Int) = printf "\f+++ Pixmap: %s %s\n" (str (I,J),str (S,A,B)) || ! flush || yyset (I,J) S where (I,J) = get YYKEY; *************** *** 361,371 **** printf "\f+++ Actionbutton: %s %s\n" (str (I,J),str (S,ICON,str INIT)) || ! flush || yyset (I,J) INIT || INIT where (I,J) = get YYKEY; /* The task button. */ - var YYTASKS = ref emptyhdict, YYTLD = ref emptyhdict; - special task_expr_params ~Xs X; --- 361,369 ---- printf "\f+++ Actionbutton: %s %s\n" (str (I,J),str (S,ICON,str INIT)) || ! flush || yyset (I,J) INIT where (I,J) = get YYKEY; /* The task button. */ special task_expr_params ~Xs X; *************** *** 382,386 **** task_input = SEM where (I,J,SEM:Semaphore|_) = get YYTLD!thread_no this_thread; - task_index = (I,J) where (I,J|_) = get YYTLD!thread_no this_thread; private begin_task ARGS, end_task ARGS, fini_task X ARGS; --- 380,383 ---- *************** *** 390,393 **** --- 387,399 ---- = taskbutton (S,false) X; taskbutton (S:String,INIT:Bool) X + where (I,J|_) = get YYTLD!thread_no this_thread, + (H:Thread,SEM,'_) = get YYTASKS!(I,J): + // request by a task to replace itself with a new task + = // update the button + do (setval (I,J)) [S,INIT] || + // update the task data + YYTASKS := insert (get YYTASKS) (I,J;H,SEM,'X) || + // send the startup message and tail-execute the new thread + post SEM INIT || yyset (I,J) INIT || X; where (I,J) = get YYKEY: // update existing task *************** *** 395,400 **** // start up a new task = YYTASKS := insert (get YYTASKS) (I,J;H,SEM,'X) || ! post SEM INIT || ! yyset (I,J) INIT || INIT where SEM:Semaphore = semaphore, H:Thread = --- 401,405 ---- // start up a new task = YYTASKS := insert (get YYTASKS) (I,J;H,SEM,'X) || ! post SEM INIT || yyset (I,J) INIT where SEM:Semaphore = semaphore, H:Thread = *************** *** 403,415 **** thread (begin_task (I,J,SEM) || do_task X (I,J,SEM) || end_task (I,J,SEM)); - if active H where (I,J|_) = get YYTLD!thread_no this_thread, - (H:Thread,SEM,'_) = get YYTASKS!(I,J): - // request by a task to replace itself with a new task - = // update the button - do (setval (I,J)) [S,INIT] || - // update the task data - YYTASKS := insert (get YYTASKS) (I,J;H,SEM,'X) || - // send the startup message and tail-execute the new thread - post SEM INIT || yyset (I,J) INIT || X; /* Watchdogs for the beginning and end of a task. */ --- 408,411 ---- *************** *** 449,452 **** --- 445,451 ---- taskwindow X + where (I,J|_) = get YYTLD!thread_no this_thread: + // request by a task to replace itself with a new task + = yyset (I,J) () || X; where (I,J) = get YYKEY: // update existing task *************** *** 454,466 **** // start up a new task = YYTASKS := insert (get YYTASKS) (I,J;H,SEM) || ! yyset (I,J) () || () where SEM:Semaphore = semaphore, H:Thread = printf "\f+++ Taskwindow: %s\n" $ str (I,J) || thread (init_task (I,J,SEM) || do_task X (I,J,SEM)); - if active H where (I,J|_) = get YYTLD!thread_no this_thread, - (H:Thread,SEM) = get YYTASKS!(I,J): - // request by a task to replace itself with a new task - = yyset (I,J) () || X; /* Our actual window id is sent by the parent process via the SEM semaphore --- 453,461 ---- // start up a new task = YYTASKS := insert (get YYTASKS) (I,J;H,SEM) || ! yyset (I,J) () where SEM:Semaphore = semaphore, H:Thread = printf "\f+++ Taskwindow: %s\n" $ str (I,J) || thread (init_task (I,J,SEM) || do_task X (I,J,SEM)); /* Our actual window id is sent by the parent process via the SEM semaphore *************** *** 494,499 **** yyset KEY VAL = //printf "INTERP: SET %s := %s\n" (cellstr KEY,str VAL) || flush || ! YYDATA := insert (get YYDATA) (KEY,VAL) || YYKEY := () || VAL ! where VAL = YYKEY := KEY || VAL; yyclear KEY = //printf "INTERP: CLEAR %s\n" (cellstr KEY) || flush || --- 489,493 ---- yyset KEY VAL = //printf "INTERP: SET %s := %s\n" (cellstr KEY,str VAL) || flush || ! YYDATA := insert (get YYDATA) (KEY,VAL) || VAL; yyclear KEY = //printf "INTERP: CLEAR %s\n" (cellstr KEY) || flush || *************** *** 532,539 **** where (H,SEM,'X) = get YYTASKS!(I,J): // thread is still alive and kicking; pass the message ! = post SEM B if isthread H and then active H; // thread has terminated and is activated again, restart it = YYTASKS := insert (get YYTASKS) (I,J;H,SEM,'X) || ! post SEM B where SEM:Semaphore = semaphore, H:Thread = --- 526,533 ---- where (H,SEM,'X) = get YYTASKS!(I,J): // thread is still alive and kicking; pass the message ! = post SEM $ yyset (I,J) B if isthread H and then active H; // thread has terminated and is activated again, restart it = YYTASKS := insert (get YYTASKS) (I,J;H,SEM,'X) || ! post SEM $ yyset (I,J) B where SEM:Semaphore = semaphore, H:Thread = *************** *** 543,547 **** // thread has terminated and is deactivated, put it in limbo = YYTASKS := insert (get YYTASKS) (I,J;(),(),'X) || ! YYTLD := delete (get YYTLD) (thread_no H) if isthread H; --- 537,541 ---- // thread has terminated and is deactivated, put it in limbo = YYTASKS := insert (get YYTASKS) (I,J;(),(),'X) || ! YYTLD := delete (get YYTLD) (thread_no H) || yyset (I,J) B if isthread H; *************** *** 551,555 **** where (H,SEM,'_) = get YYTASKS!(I,J): // task is alive and kicking, update it with the new data ! = post SEM '(taskbutton (S,INIT) X) || INIT where 'X = subst 'X if isthread H and then active H; --- 545,549 ---- where (H,SEM,'_) = get YYTASKS!(I,J): // task is alive and kicking, update it with the new data ! = post SEM '(taskbutton (S,INIT) X) || yyset (I,J) INIT where 'X = subst 'X if isthread H and then active H; *************** *** 574,581 **** /* Process task window resize messages. */ ! yywin (I:Int,J:Int) (W:Int,H:Int) where (H,SEM) = get YYTASKS!(I,J): // thread is still alive and kicking; pass the message ! = post SEM (W,H) if isthread H and then active H; /* Update a task window with new data. */ --- 568,575 ---- /* Process task window resize messages. */ ! yywin (I:Int,J:Int) (WD:Int,HT:Int) where (H,SEM) = get YYTASKS!(I,J): // thread is still alive and kicking; pass the message ! = post SEM (WD,HT) if isthread H and then active H; /* Update a task window with new data. */ *************** *** 584,588 **** where (H,SEM) = get YYTASKS!(I,J): // task is alive and kicking, update it with the new data ! = post SEM '(taskwindow X) || () where 'X = subst 'X if isthread H and then active H; --- 578,582 ---- where (H,SEM) = get YYTASKS!(I,J): // task is alive and kicking, update it with the new data ! = post SEM '(taskwindow X) || yyset (I,J) () where 'X = subst 'X if isthread H and then active H; |
From: Albert G. <ag...@us...> - 2007-11-30 13:42:19
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv15785 Modified Files: qcalc.q Log Message: bugfix: automatically abort a running computation when the main window gets closed Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.204 retrieving revision 1.205 diff -C2 -d -r1.204 -r1.205 *** qcalc.q 30 Nov 2007 13:20:49 -0000 1.204 --- qcalc.q 30 Nov 2007 13:42:15 -0000 1.205 *************** *** 708,711 **** --- 708,715 ---- def ABORTED = ref false; + check_aborted = true if get ABORTED; + = ABORTED := true || true if qt MAIN "isHidden" (); + = false otherwise; + begin_compute = ABORTED := false; end_compute = ABORTED := false || normal_cursor; *************** *** 1014,1018 **** // No output yet, take a short nap and try again. = startup_loop (H,PID,MASTER) ! if local (qt APP "processEvents" 100) || not get ABORTED; // User aborted compilation, bail out. = fini_interp || statusmsg "Compilation aborted" || false; --- 1018,1022 ---- // No output yet, take a short nap and try again. = startup_loop (H,PID,MASTER) ! if local (qt APP "processEvents" 100) || not check_aborted; // User aborted compilation, bail out. = fini_interp || statusmsg "Compilation aborted" || false; *************** *** 3758,3762 **** = () otherwise; results_loop T0 U [(I,J)|V] ! if get ABORTED: // user aborted the computation, flag all remaining cells = do flag [(I,J)|V]; --- 3762,3766 ---- = () otherwise; results_loop T0 U [(I,J)|V] ! if check_aborted: // user aborted the computation, flag all remaining cells = do flag [(I,J)|V]; *************** *** 3882,3886 **** end_recursive || local (qt APP "processEvents" 100) || ! begin_recursive || get ABORTED; = results_loop T0 U [(I,J)|V] otherwise; --- 3886,3890 ---- end_recursive || local (qt APP "processEvents" 100) || ! begin_recursive || check_aborted; = results_loop T0 U [(I,J)|V] otherwise; |
From: Albert G. <ag...@us...> - 2007-11-30 13:21:00
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6615 Modified Files: qcalc.q Log Message: bugfix: timer must not process any queued GUI updates in local mode Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.203 retrieving revision 1.204 diff -C2 -d -r1.203 -r1.204 *** qcalc.q 30 Nov 2007 13:04:35 -0000 1.203 --- qcalc.q 30 Nov 2007 13:20:49 -0000 1.204 *************** *** 827,840 **** not null (get REDO_LIST) else ! qt EDIT "isRedoAvailable" (); ! ! /* In local mode we only do the minimally necessary processing here. */ ! ! digest_loop = digest_loop2 if is_global; ! = do_queued_updates otherwise; ! digest_loop2 = do_queued_updates || fail; // falls through ! = digest S || digest_loop2 where S = get MSGS if #MSGS>0; ! = digest X || digest_loop2 where X = get CBQ if #CBQ>0; = () otherwise; --- 827,836 ---- not null (get REDO_LIST) else ! qt EDIT "isRedoAvailable" () ! if is_global; ! digest_loop = do_queued_updates || fail; // falls through ! = digest S || digest_loop where S = get MSGS if #MSGS>0; ! = digest X || digest_loop where X = get CBQ if #CBQ>0; = () otherwise; |
From: Albert G. <ag...@us...> - 2007-11-30 13:04:47
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31126 Modified Files: calclib.q qcalc.q Log Message: add task window element (experimental) Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.202 retrieving revision 1.203 diff -C2 -d -r1.202 -r1.203 *** qcalc.q 29 Nov 2007 02:13:38 -0000 1.202 --- qcalc.q 30 Nov 2007 13:04:35 -0000 1.203 *************** *** 909,912 **** --- 909,918 ---- IT:QtObject = make_gui taskbutton_gui (I,J) (TEXT,INIT); + = process_sel2 [(I,J,IT)] + where [K] = regex "" + "^\\+\\+\\+ Taskwindow: (\\([0-9]+,[0-9]+\\))$" S + (reg 1), + (I,J) = val K, + IT:QtObject = make_gui taskwindow_gui (I,J) (); = qt X "setIconSet" ICONSET || procmsg (I,J) (Y<>0) where [(K,S)] = regex "" *************** *** 2784,2787 **** --- 2790,2808 ---- qt X "setPageStep" STEP || qt X "setValue" INIT; + private yywin KEY MSG; + taskwindow_gui (I,J) () () + = qt X "setBackgroundMode" (qt_val "Qt" "PaletteBase") || + send_expr '(yywin (I,J) ID) || + qt TABLE "setCellWidget" (I,J,X) || IT + where ID = qt X "winId" () + if not is_nil IT and then not is_nil X + where X:QtObject = qt_object "QWidget" TABLE + "MyTaskWindow" (I,J) [("resizeEvent",gui_update)] [] [], + IT:QtObject = make_table_item (I,J,X,ref "") + (qt_val "QTableItem" "Never"); + + taskwindow_gui (I,J) X:QtObject () + = (); + label_gui (I,J) () (S,A) = qt X "setBackgroundMode" (qt_val "Qt" "PaletteBase") || *************** *** 2918,2921 **** --- 2939,2945 ---- gui_get_togglebutton,gui_getc_togglebutton, gui_set_taskbutton); + "MyTaskWindow", (taskwindow_gui, + gui_get_nop,gui_getc_taskwindow, + gui_set_taskwindow); "MyActionButton", (actionbutton_gui, gui_get_nop,gui_getc_actionbutton, *************** *** 3002,3005 **** --- 3026,3035 ---- = "" otherwise; + gui_getc_taskwindow X + = fformat S + where (I,J) = qt_data X, (R:Ref|_) = gui_data (I,J), + S:String = get R; + = "" otherwise; + gui_getc_spinbox X = qt X "cleanText" (); *************** *** 3053,3056 **** --- 3083,3090 ---- where (I,J) = qt_data X, (R:Ref|_) = gui_data (I,J); + gui_set_taskwindow X S + = R := S + where (I,J) = qt_data X, (R:Ref|_) = gui_data (I,J); + gui_set_taskbutton X S = if checkstr 'Y then *************** *** 3130,3139 **** private yyeval KEY X, yyset KEY X, yyclear X, yyval KEY, yytask KEY MSG, ! yyaction KEY, yyclearaction KEY; gui_action X (I,J) where C:String = gui_class X: ! = send_expr '(yytask (I,J) ~(qt X "isOn" ())) if C = "MyTaskButton"; = send_expr '(yyaction (I,J)) if C = "MyActionButton"; --- 3164,3177 ---- private yyeval KEY X, yyset KEY X, yyclear X, yyval KEY, yytask KEY MSG, ! yywin KEY MSG, yyaction KEY, yyclearaction KEY; gui_action X (I,J) where C:String = gui_class X: ! = send_expr '(yytask (I,J) B) ! where B = qt X "isOn" () if C = "MyTaskButton"; + = send_expr '(yywin (I,J) (W,H)) + where (W,H) = (qt X "width" (),qt X "height" ()) + if C = "MyTaskWindow"; = send_expr '(yyaction (I,J)) if C = "MyActionButton"; *************** *** 3141,3147 **** // process (also check that the value is transferable) submit_val (I,J) Y ! if checkval Y ! where Y = gui_getval X ! if gui_hasval X; gui_clear X (I,J) --- 3179,3183 ---- // process (also check that the value is transferable) submit_val (I,J) Y ! if checkval Y where Y = gui_getval X if gui_hasval X; gui_clear X (I,J) *************** *** 3149,3152 **** --- 3185,3190 ---- = send_expr '(yytask (I,J) ()) if C = "MyTaskButton"; + = send_expr '(yywin (I,J) ()) || cell_setval (I,J) () + if C = "MyTaskWindow"; = send_expr '(yyclearaction (I,J)) || cell_setval (I,J) () if C = "MyActionButton"; *************** *** 3833,3836 **** --- 3871,3880 ---- (I1,J1) = val K1, (S1,A1,B1) = val S1, IT:QtObject = make_gui pixmap_gui (I1,J1) (S1,A1,B1); + = results_loop T0 (insert U ((I1,J1),IT)) [(I,J)|V] + where [K1] = regex "" + "^\\+\\+\\+ Taskwindow: (\\([0-9]+,[0-9]+\\))$" S + (reg 1), + (I1,J1) = val K1, + IT:QtObject = make_gui taskwindow_gui (I1,J1) (); // anything else just gets passed to the digest function, and we try again = local (digest S) || results_loop T0 U [(I,J)|V]; Index: calclib.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/calclib.q,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** calclib.q 28 Nov 2007 08:18:37 -0000 1.47 --- calclib.q 30 Nov 2007 13:04:35 -0000 1.48 *************** *** 60,68 **** actions on the button inside QCalc, and the task_params function can be used to extract arguments from a quoted taskbutton call (which is sent to ! the task when the button gets updated). */ public special taskbutton ~ARGS X, task_params X; public task_input; /* Implementation. *********************************************************/ --- 60,81 ---- actions on the button inside QCalc, and the task_params function can be used to extract arguments from a quoted taskbutton call (which is sent to ! the task when the task button cell is recomputed). */ public special taskbutton ~ARGS X, task_params X; public task_input; + /* The task window works pretty much like a task button, minus the toggle + button functionality. Instead, it provides an empty parent window inside + the task's cell which can be operated directly by the task in the inferior + Q process. The id of the parent window is available inside the task with + the task_winid function. In addition, messages of the form (W:Int,H:Int) + are delivered via the task_input semaphore (see above) whenever the size of + the parent window changes, and the task_params function (see above) can be + used to extract arguments from a quoted taskwindow call (which is sent to + the task when the task window cell is recomputed). */ + + public special taskwindow X; + public task_winid; + /* Implementation. *********************************************************/ *************** *** 75,79 **** public yymain, yyval KEY, yyset KEY VAL, yyclear KEY, yytask KEY MSG, ! yyaction KEY, yyclearaction KEY; public special yyeval ~KEY VAL; private yyloop, yyout X, yyerror X; --- 88,92 ---- public yymain, yyval KEY, yyset KEY VAL, yyclear KEY, yytask KEY MSG, ! yywin KEY MSG, yyaction KEY, yyclearaction KEY; public special yyeval ~KEY VAL; private yyloop, yyout X, yyerror X; *************** *** 353,357 **** /* The task button. */ ! var YYTASKS = ref emptyhdict, YYSEM = ref emptyhdict; special task_expr_params ~Xs X; --- 366,370 ---- /* The task button. */ ! var YYTASKS = ref emptyhdict, YYTLD = ref emptyhdict; special task_expr_params ~Xs X; *************** *** 367,374 **** = Xs otherwise; ! task_input = SEM ! where (I,J,SEM) = get YYSEM!thread_no this_thread; ! task_index = (I,J) ! where (I,J,SEM) = get YYSEM!thread_no this_thread; private begin_task ARGS, end_task ARGS, fini_task X ARGS; --- 380,386 ---- = Xs otherwise; ! task_input = SEM where (I,J,SEM:Semaphore|_) = ! get YYTLD!thread_no this_thread; ! task_index = (I,J) where (I,J|_) = get YYTLD!thread_no this_thread; private begin_task ARGS, end_task ARGS, fini_task X ARGS; *************** *** 391,395 **** thread (begin_task (I,J,SEM) || do_task X (I,J,SEM) || end_task (I,J,SEM)); ! if active H where (I,J,_) = get YYSEM!thread_no this_thread, (H:Thread,SEM,'_) = get YYTASKS!(I,J): // request by a task to replace itself with a new task --- 403,407 ---- thread (begin_task (I,J,SEM) || do_task X (I,J,SEM) || end_task (I,J,SEM)); ! if active H where (I,J|_) = get YYTLD!thread_no this_thread, (H:Thread,SEM,'_) = get YYTASKS!(I,J): // request by a task to replace itself with a new task *************** *** 404,408 **** begin_task (I,J,SEM) ! = YYSEM := insert (get YYSEM) (thread_no this_thread,(I,J,SEM)) || printf "\f+++ Taskstate: %s 1\n" (str (I,J)) || flush; --- 416,420 ---- begin_task (I,J,SEM) ! = YYTLD := insert (get YYTLD) (thread_no this_thread,(I,J,SEM)) || printf "\f+++ Taskstate: %s 1\n" (str (I,J)) || flush; *************** *** 426,429 **** --- 438,476 ---- = () otherwise; + /* The task window. */ + + task_winid = ID where (I,J,SEM,ID:Int) = get YYTLD!thread_no this_thread; + + task_params '(taskwindow X) + = tuple ARGS + where ARGS:List = catch () (task_expr_params [] 'X); + + private init_task ARGS; + + taskwindow X + where (I,J) = get YYKEY: + // update existing task + = yywin (I,J) 'X if member (get YYTASKS) (I,J); + // start up a new task + = YYTASKS := insert (get YYTASKS) (I,J;H,SEM) || + yyset (I,J) () || () + where SEM:Semaphore = semaphore, + H:Thread = + printf "\f+++ Taskwindow: %s\n" $ str (I,J) || + thread (init_task (I,J,SEM) || do_task X (I,J,SEM)); + if active H where (I,J|_) = get YYTLD!thread_no this_thread, + (H:Thread,SEM) = get YYTASKS!(I,J): + // request by a task to replace itself with a new task + = yyset (I,J) () || X; + + /* Our actual window id is sent by the parent process via the SEM semaphore + using a yywin call (see below) when it processes the "Taskwindow" + message. We store this value in the thread-local data so that the task can + access it using task_winid. */ + + init_task (I,J,SEM) + = YYTLD := insert (get YYTLD) + (thread_no this_thread,(I,J,SEM,get SEM)); + /* Internals. */ *************** *** 496,500 **** // thread has terminated and is deactivated, put it in limbo = YYTASKS := insert (get YYTASKS) (I,J;(),(),'X) || ! YYSEM := delete (get YYSEM) (thread_no H) if isthread H; --- 543,547 ---- // thread has terminated and is deactivated, put it in limbo = YYTASKS := insert (get YYTASKS) (I,J;(),(),'X) || ! YYTLD := delete (get YYTLD) (thread_no H) if isthread H; *************** *** 515,519 **** where (H,SEM,'X) = get YYTASKS!(I,J): = cancel H || YYTASKS := delete (get YYTASKS) (I,J) || ! YYSEM := delete (get YYSEM) (thread_no H) || yyclear (I,J) if isthread H; = YYTASKS := delete (get YYTASKS) (I,J) || yyclear (I,J); --- 562,597 ---- where (H,SEM,'X) = get YYTASKS!(I,J): = cancel H || YYTASKS := delete (get YYTASKS) (I,J) || ! YYTLD := delete (get YYTLD) (thread_no H) || yyclear (I,J) if isthread H; = YYTASKS := delete (get YYTASKS) (I,J) || yyclear (I,J); + + /* Initialize a window task (set up the window id). */ + + yywin (I:Int,J:Int) ID:Int + = post SEM ID + where (H,SEM:Semaphore) = get YYTASKS!(I,J); + + /* Process task window resize messages. */ + + yywin (I:Int,J:Int) (W:Int,H:Int) + where (H,SEM) = get YYTASKS!(I,J): + // thread is still alive and kicking; pass the message + = post SEM (W,H) if isthread H and then active H; + + /* Update a task window with new data. */ + + yywin (I:Int,J:Int) 'X + where (H,SEM) = get YYTASKS!(I,J): + // task is alive and kicking, update it with the new data + = post SEM '(taskwindow X) || () + where 'X = subst 'X + if isthread H and then active H; + // zombie: kill it, then restart + = yywin (I,J) () || taskwindow X; + + /* Kill a task window. */ + + yywin (I:Int,J:Int) () + = cancel H || YYTASKS := delete (get YYTASKS) (I,J) || + YYTLD := delete (get YYTLD) (thread_no H) || yyclear (I,J) + where (H:Thread,ID) = get YYTASKS!(I,J); |
From: Albert G. <ag...@us...> - 2007-11-29 02:13:41
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv3743 Modified Files: qcalc.q Log Message: bugfixes Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.201 retrieving revision 1.202 diff -C2 -d -r1.201 -r1.202 *** qcalc.q 29 Nov 2007 02:02:22 -0000 1.201 --- qcalc.q 29 Nov 2007 02:13:38 -0000 1.202 *************** *** 3012,3016 **** gui_getc_pixmap X ! = sprintf "<img src=%s/>" (str S) where (I,J) = qt_data X, (R:Ref|_) = gui_data (I,J), S:String = get R; --- 3012,3016 ---- gui_getc_pixmap X ! = sprintf "<img src=\"%s\"/>" (htmlquote S) where (I,J) = qt_data X, (R:Ref|_) = gui_data (I,J), S:String = get R; |
From: Albert G. <ag...@us...> - 2007-11-29 02:02:26
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28473 Modified Files: qcalc.q Log Message: render pixmap elements in printout Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.200 retrieving revision 1.201 diff -C2 -d -r1.200 -r1.201 *** qcalc.q 29 Nov 2007 01:15:50 -0000 1.200 --- qcalc.q 29 Nov 2007 02:02:22 -0000 1.201 *************** *** 2848,2852 **** X:QtObject = qt_object "QLabel" TABLE "MyPixmap" (I,J) [] [] [], ! IT:QtObject = make_table_item (I,J,X) (qt_val "QTableItem" "Never"); --- 2848,2852 ---- X:QtObject = qt_object "QLabel" TABLE "MyPixmap" (I,J) [] [] [], ! IT:QtObject = make_table_item (I,J,X,ref S) (qt_val "QTableItem" "Never"); *************** *** 2856,2863 **** = qt X "setPixmap" NULLPM || qt X "setMovie" NULLMOV || ! qt X SET PM || qt X "setAlignment" (alignment A) || qt X "setScaledContents" (B=1) ! where (CLS,SET) = if B=2 then ("QMovie","setMovie") else ("QPixmap","setPixmap"), --- 2856,2864 ---- = qt X "setPixmap" NULLPM || qt X "setMovie" NULLMOV || ! R := S || qt X SET PM || qt X "setAlignment" (alignment A) || qt X "setScaledContents" (B=1) ! where (R:Ref|_) = gui_data (I,J), ! (CLS,SET) = if B=2 then ("QMovie","setMovie") else ("QPixmap","setPixmap"), *************** *** 3011,3015 **** gui_getc_pixmap X ! = htmlquote "<<pixmap>>"; /* Set the value of a GUI element from a string. */ --- 3012,3019 ---- gui_getc_pixmap X ! = sprintf "<img src=%s/>" (str S) ! where (I,J) = qt_data X, (R:Ref|_) = gui_data (I,J), ! S:String = get R; ! = htmlquote "<<pixmap>>" otherwise; /* Set the value of a GUI element from a string. */ *************** *** 3079,3086 **** gui_set_pixmap X S ! = qt X "setPixmap" PM ! where PM = ! if null Y then NULLPM ! else qt_new "QPixmap" Y if checkstr 'Y where 'Y = valq S; --- 3083,3090 ---- gui_set_pixmap X S ! = R := S || qt X "setPixmap" PM ! where S = Y, ! (I,J) = qt_data X, (R:Ref|_) = gui_data (I,J), ! PM = if null S then NULLPM else qt_new "QPixmap" S if checkstr 'Y where 'Y = valq S; |
From: Albert G. <ag...@us...> - 2007-11-29 01:15:55
|
Update of /cvsroot/q-lang/qcalc/examples In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv5236/examples Modified Files: guiexamples.qcalc Log Message: also set the MIME source path, so that relative paths in rich text elements work, too Index: guiexamples.qcalc =================================================================== RCS file: /cvsroot/q-lang/qcalc/examples/guiexamples.qcalc,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** guiexamples.qcalc 28 Nov 2007 23:55:20 -0000 1.15 --- guiexamples.qcalc 29 Nov 2007 01:15:50 -0000 1.16 *************** *** 1,4 **** // qcalc 1.0, created Thu Nov 29 00:59:29 2007 -*-Q-*- -*- coding: UTF-8 -*- ! // [((0,1),"GUI element"),((0,2),"Value"),((0,3),"Display"),((2,0),"Checkbox"),((2,1),"= checkbox (\"test\",true)"),((2,2),"= B3"),((2,3),"= checkbox (\"test\",B3)"),((4,0),"Combobox"),((4,1),"= combobox ([\"apples\",\"bananas\",\"oranges\"],\"oranges\")"),((4,2),"= B5"),((4,3),"= combobox ([\"apples\",\"bananas\",\"oranges\"],B5)"),((5,0),"Comboedit"),((5,1),"= comboedit ([\"apples\",\"bananas\",\"oranges\"],\"bananas\")"),((5,2),"= B6"),((5,3),"= comboedit ([\"apples\",\"bananas\",\"oranges\"],B6)"),((6,0),"Int Spinbox"),((6,1),"= spinbox (0,100,5,40)"),((6,2),"= B7"),((6,3),"= spinbox (0,100,5,B7)"),((7,0),"Float Spinbox"),((7,1),"= spinbox (0.0,10.0,0.5,4.0)"),((7,2),"= B8"),((7,3),"= spinbox (0.0,10.0,0.5,B8)"),((9,0),"Spinbox with special value"),((9,1),"= spinbox (-1,10,1,0,\"Any\")"),((9,2),"= B10"),((9,3),"= spinbox (-1,10,1,B10,\"Any\")"),((10,0),"Spinbox with prefix"),((10,1),"= spinbox (-0.1,10,0.1,0,\"Any\",\"$ \")"),((10,2),"= B11"),((10,3),"= spinbox (-0.1,10,0.1,B11,\"Any\",\"$ \")"),((11,0),"Spinbox with suffix"),((11,1),"= spinbox (-1,72,1,10,\"Any\",\"\",\"pt\")"),((11,2),"= B12"),((11,3),"= spinbox (-1,72,1,B12,\"Any\",\"\",\"pt\")"),((13,0),"Horizontal slider"),((13,1),"= hslider (0,100,1,50)"),((13,2),"= B14"),((13,3),"= hslider (0,100,1,B14)"),((14,0),"Vertical slider"),((14,1),"= vslider (0,100,1,50)"),((14,2),"= B15"),((14,3),"= vslider (0,100,1,B15)"),((16,0),"Pushbutton"),((16,1),"= pushbutton \"Push me!\""),((16,2),"= B17"),((16,3),"N/A"),((17,0),"Pushbutton with icon"),((17,1),"= pushbutton (\"Push me!\",which \"../pixmaps/1rightarrow.png\")"),((17,2),"= B18"),((17,3),"N/A"),((18,0),"Togglebutton with icon"),((18,1),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\")"),((18,2),"= B19"),((18,3),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\",B19)"),((20,0),"\"Buddies\" (linked elements)"),((20,1),"= hslider (0,100,1,D21)"),((20,2),"= B21"),((20,3),"= spinbox (0,100,1,B21)"),((22,0),("Alternative \"remote control\" of GUI elements using setval",1,4)),((24,0),"GUI element A (click here)"),((24,1),"Transfer A -> B"),((24,2),"GUI element B (display)"),((24,3),"Value of B"),((26,0),"= checkbox \"A\""),((26,1),"= setval 'C27 A27"),((26,2),"= checkbox \"B\""),((26,3),"= C27"),((27,0),"= spinbox (-0.1,10,0.1,0,\"Any\")"),((27,1),"= setval 'C28 A28"),((27,2),"= spinbox (-0.1,10,0.1,0,\"Any\")"),((27,3),"= C28"),((28,0),"= spinbox (-5,100,5,40,\"Any\")"),((28,1),"= setval 'C29 A29"),((28,2),"= spinbox (-1,100,1,40,\"Any\")"),((28,3),"= C29"),((29,0),"= combobox ([\"apples\",\"bananas\",\"oranges\"],\"oranges\")"),((29,1),"= setval 'C30 A30"),((29,2),"= combobox ([\"apples\",\"bananas\",\"oranges\"],\"oranges\")"),((29,3),"= C30"),((30,0),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\")"),((30,1),"= setval 'C31 A31"),((30,2),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\")"),((30,3),"= C31"),((32,0),("Task button example. Shows how to operate a Q thread using a toggle button. See the script tab for the Q code implementing this example.",1,4)),((34,0),"Seconds for countdown:"),((34,1),"= spinbox (1,60,1,10)"),((35,0),"Push here to start counting:"),((35,1),"= taskbutton \"&Run me!\" (task B35)"),((35,2),"= spinbox (0,999999)"),((37,0),"Action button example:"),((37,1),"= actionbutton \"Random &number\" random"),((37,2),"= B38"),((39,0),"An \"open file\" action:"),((39,1),"= open_file"),((40,0),"The file you chose:"),((40,1),("",1,3)),((42,0),("= label \"<center><h1>Labels and Pixmaps</h1></center>\"",2,3)),((45,0),("= label (sprintf \"<big><b>%s</b></big>\" C46,C47)",2,2)),((45,2),"= comboedit [\"Hello, world!\",\"Richtext!\"]"),((46,2),"= combobox [\"a\",\"c\",\"l\",\"r\",\"t\",\"b\",\"ca\",\"cc\",\"cl\",\"cr\",\"ta\",\"tc\",\"tl\",\"tr\",\"ba\",\"bc\",\"bl\",\"br\"]"),((47,0),("= A46",1,2)),((49,0),("= pixmap (which $ \"../pixmaps/\"++C50,C53,if C52 then 2 else if C51 then 1 else 0)",4,2)),((49,2),"= comboedit [\"floppybuddy.gif\",\"1rightarrow.png\",\"flag.png\"]"),((50,2),"= checkbox \"Scale\""),((51,2),"= checkbox \"Animate\""),((52,2),"= combobox [\"a\",\"c\",\"l\",\"r\",\"t\",\"b\",\"ca\",\"cc\",\"cl\",\"cr\",\"ta\",\"tc\",\"tl\",\"tr\",\"ba\",\"bc\",\"bl\",\"br\"]"),((54,0),"Embed pixmap as a label:"),((56,0),("= label (sprintf \"<img src=%s/> <big><b>Pixmap with label!</b></big>\" $ str $ which $ \"../pixmaps/\"++C57,C58)",4,2)),((56,2),"= comboedit [\"floppybuddy.gif\",\"1rightarrow.png\",\"flag.png\"]"),((57,2),"= combobox [\"a\",\"c\",\"l\",\"r\",\"t\",\"b\",\"ca\",\"cc\",\"cl\",\"cr\",\"ta\",\"tc\",\"tl\",\"tr\",\"ba\",\"bc\",\"bl\",\"br\"]")] // [(14,55),(32,35)] // [(0,162),(1,116),(2,139),(3,125)] --- 1,4 ---- // qcalc 1.0, created Thu Nov 29 00:59:29 2007 -*-Q-*- -*- coding: UTF-8 -*- ! // [((0,1),"GUI element"),((0,2),"Value"),((0,3),"Display"),((2,0),"Checkbox"),((2,1),"= checkbox (\"test\",true)"),((2,2),"= B3"),((2,3),"= checkbox (\"test\",B3)"),((4,0),"Combobox"),((4,1),"= combobox ([\"apples\",\"bananas\",\"oranges\"],\"oranges\")"),((4,2),"= B5"),((4,3),"= combobox ([\"apples\",\"bananas\",\"oranges\"],B5)"),((5,0),"Comboedit"),((5,1),"= comboedit ([\"apples\",\"bananas\",\"oranges\"],\"bananas\")"),((5,2),"= B6"),((5,3),"= comboedit ([\"apples\",\"bananas\",\"oranges\"],B6)"),((6,0),"Int Spinbox"),((6,1),"= spinbox (0,100,5,40)"),((6,2),"= B7"),((6,3),"= spinbox (0,100,5,B7)"),((7,0),"Float Spinbox"),((7,1),"= spinbox (0.0,10.0,0.5,4.0)"),((7,2),"= B8"),((7,3),"= spinbox (0.0,10.0,0.5,B8)"),((9,0),"Spinbox with special value"),((9,1),"= spinbox (-1,10,1,0,\"Any\")"),((9,2),"= B10"),((9,3),"= spinbox (-1,10,1,B10,\"Any\")"),((10,0),"Spinbox with prefix"),((10,1),"= spinbox (-0.1,10,0.1,0,\"Any\",\"$ \")"),((10,2),"= B11"),((10,3),"= spinbox (-0.1,10,0.1,B11,\"Any\",\"$ \")"),((11,0),"Spinbox with suffix"),((11,1),"= spinbox (-1,72,1,10,\"Any\",\"\",\"pt\")"),((11,2),"= B12"),((11,3),"= spinbox (-1,72,1,B12,\"Any\",\"\",\"pt\")"),((13,0),"Horizontal slider"),((13,1),"= hslider (0,100,1,50)"),((13,2),"= B14"),((13,3),"= hslider (0,100,1,B14)"),((14,0),"Vertical slider"),((14,1),"= vslider (0,100,1,50)"),((14,2),"= B15"),((14,3),"= vslider (0,100,1,B15)"),((16,0),"Pushbutton"),((16,1),"= pushbutton \"Push me!\""),((16,2),"= B17"),((16,3),"N/A"),((17,0),"Pushbutton with icon"),((17,1),"= pushbutton (\"Push me!\",\"../pixmaps/1rightarrow.png\")"),((17,2),"= B18"),((17,3),"N/A"),((18,0),"Togglebutton with icon"),((18,1),"= togglebutton (\"Toggle me!\",\"../pixmaps/flag.png\")"),((18,2),"= B19"),((18,3),"= togglebutton (\"Toggle me!\",\"../pixmaps/flag.png\",B19)"),((20,0),"\"Buddies\" (linked elements)"),((20,1),"= hslider (0,100,1,D21)"),((20,2),"= B21"),((20,3),"= spinbox (0,100,1,B21)"),((22,0),("Alternative \"remote control\" of GUI elements using setval",1,4)),((24,0),"GUI element A (click here)"),((24,1),"Transfer A -> B"),((24,2),"GUI element B (display)"),((24,3),"Value of B"),((26,0),"= checkbox \"A\""),((26,1),"= setval 'C27 A27"),((26,2),"= checkbox \"B\""),((26,3),"= C27"),((27,0),"= spinbox (-0.1,10,0.1,0,\"Any\")"),((27,1),"= setval 'C28 A28"),((27,2),"= spinbox (-0.1,10,0.1,0,\"Any\")"),((27,3),"= C28"),((28,0),"= spinbox (-5,100,5,40,\"Any\")"),((28,1),"= setval 'C29 A29"),((28,2),"= spinbox (-1,100,1,40,\"Any\")"),((28,3),"= C29"),((29,0),"= combobox ([\"apples\",\"bananas\",\"oranges\"],\"oranges\")"),((29,1),"= setval 'C30 A30"),((29,2),"= combobox ([\"apples\",\"bananas\",\"oranges\"],\"oranges\")"),((29,3),"= C30"),((30,0),"= togglebutton (\"Toggle me!\",\"../pixmaps/flag.png\")"),((30,1),"= setval 'C31 A31"),((30,2),"= togglebutton (\"Toggle me!\",\"../pixmaps/flag.png\")"),((30,3),"= C31"),((32,0),("Task button example. Shows how to operate a Q thread using a toggle button. See the script tab for the Q code implementing this example.",1,4)),((34,0),"Seconds for countdown:"),((34,1),"= spinbox (1,60,1,10)"),((35,0),"Push here to start counting:"),((35,1),"= taskbutton \"&Run me!\" (task B35)"),((35,2),"= spinbox (0,999999)"),((37,0),"Action button example:"),((37,1),"= actionbutton \"Random &number\" random"),((37,2),"= B38"),((39,0),"An \"open file\" action:"),((39,1),"= open_file"),((40,0),"The file you chose:"),((40,1),("",1,3)),((42,0),("= label \"<center><h1>Labels and Pixmaps</h1></center>\"",2,3)),((45,0),("= label (sprintf \"<big><b>%s</b></big>\" C46,C47)",2,2)),((45,2),"= comboedit [\"Hello, world!\",\"Richtext!\"]"),((46,2),"= combobox [\"a\",\"c\",\"l\",\"r\",\"t\",\"b\",\"ca\",\"cc\",\"cl\",\"cr\",\"ta\",\"tc\",\"tl\",\"tr\",\"ba\",\"bc\",\"bl\",\"br\"]"),((47,0),("= A46",1,2)),((49,0),("= pixmap (\"../pixmaps/\"++C50,C53,if C52 then 2 else if C51 then 1 else 0)",4,2)),((49,2),"= comboedit [\"floppybuddy.gif\",\"1rightarrow.png\",\"flag.png\"]"),((50,2),"= checkbox \"Scale\""),((51,2),"= checkbox \"Animate\""),((52,2),"= combobox [\"a\",\"c\",\"l\",\"r\",\"t\",\"b\",\"ca\",\"cc\",\"cl\",\"cr\",\"ta\",\"tc\",\"tl\",\"tr\",\"ba\",\"bc\",\"bl\",\"br\"]"),((54,0),"Embed pixmap as a label:"),((56,0),("= label (sprintf \"<img src=%s/> <big><b>Pixmap with label!</b></big>\" $ str $ \"../pixmaps/\"++C57,C58)",4,2)),((56,2),"= comboedit [\"floppybuddy.gif\",\"1rightarrow.png\",\"flag.png\"]"),((57,2),"= combobox [\"a\",\"c\",\"l\",\"r\",\"t\",\"b\",\"ca\",\"cc\",\"cl\",\"cr\",\"ta\",\"tc\",\"tl\",\"tr\",\"ba\",\"bc\",\"bl\",\"br\"]")] // [(14,55),(32,35)] // [(0,162),(1,116),(2,139),(3,125)] |
From: Albert G. <ag...@us...> - 2007-11-29 01:15:55
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv5236 Modified Files: qcalc.q Log Message: also set the MIME source path, so that relative paths in rich text elements work, too Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.199 retrieving revision 1.200 diff -C2 -d -r1.199 -r1.200 *** qcalc.q 29 Nov 2007 00:59:27 -0000 1.199 --- qcalc.q 29 Nov 2007 01:15:50 -0000 1.200 *************** *** 968,973 **** // clear the log qt LOG "setText" "" || clearmsg || ! // go to the new directory chdir PWD || // give the interpreter some time to start and read the // message queue until either the interpreter process has --- 968,976 ---- // clear the log qt LOG "setText" "" || clearmsg || ! // go to the new directory and change the MIME source path ! // accordingly chdir PWD || + qt (qt "QMimeSourceFactory" "defaultFactory" ()) + "setFilePath" [PWD] || // give the interpreter some time to start and read the // message queue until either the interpreter process has |
From: Albert G. <ag...@us...> - 2007-11-29 00:59:31
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28749 Modified Files: qcalc.q Log Message: chdir to the spreadsheet directory when opening a spreadsheet, so that relative paths to pixmaps etc. work without any ado Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.198 retrieving revision 1.199 diff -C2 -d -r1.198 -r1.199 *** qcalc.q 28 Nov 2007 09:55:24 -0000 1.198 --- qcalc.q 29 Nov 2007 00:59:27 -0000 1.199 *************** *** 250,254 **** ("/qcalc/text/highlighting", HL)] || save_recent_files DEFAULTS ! where // get hold of the application defaults DEFAULTS = qt_new "QSettings" (), _ = qt DEFAULTS "setPath" --- 250,254 ---- ("/qcalc/text/highlighting", HL)] || save_recent_files DEFAULTS ! where // get hold of the application defaults DEFAULTS = qt_new "QSettings" (), _ = qt DEFAULTS "setPath" *************** *** 968,971 **** --- 968,973 ---- // clear the log qt LOG "setText" "" || clearmsg || + // go to the new directory + chdir PWD || // give the interpreter some time to start and read the // message queue until either the interpreter process has |
From: Albert G. <ag...@us...> - 2007-11-29 00:36:53
|
Update of /cvsroot/q-lang/qcalc/doc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv17371/doc Modified Files: qcalc.xml Log Message: update documentation Index: qcalc.xml =================================================================== RCS file: /cvsroot/q-lang/qcalc/doc/qcalc.xml,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** qcalc.xml 29 Nov 2007 00:19:17 -0000 1.22 --- qcalc.xml 29 Nov 2007 00:36:49 -0000 1.23 *************** *** 523,527 **** <para> ! Note that, no matter what the purported "start/stopped" status of the button is, the user can always check whether the task associated with the button is currently up and running by taking a look at the arrow symbol shown on the button. If the task is currently executing (even if it hasn't been "started" by pushing down the button yet), the arrow symbol will be "lit" in green, otherwise it will be greyed out. Also note that in the latter case, if the thread has exited when the user starts it by pressing the button, the task will be restarted automatically and will initially be fed with the message <literal>true</literal> to indicate that it should now go ahead with its business. </para> --- 523,527 ---- <para> ! Note that, no matter what the purported "started/stopped" status of the button is, the user can always check whether the task associated with the button is currently up and running by taking a look at the arrow symbol shown on the button. If the task is currently executing (even if it hasn't been "started" by pushing down the button yet), the arrow symbol will be "lit" in green, otherwise it will be greyed out. Also note that in the latter case, if the thread has exited when the user starts it by pressing the button, the task will be restarted automatically and will initially be fed with the message <literal>true</literal> to indicate that it should now go ahead with its business. </para> |
From: Albert G. <ag...@us...> - 2007-11-29 00:19:20
|
Update of /cvsroot/q-lang/qcalc/doc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8006 Modified Files: qcalc.xml Added Files: guiexamples2.png guiexamples3.png Log Message: update documentation --- NEW FILE: guiexamples3.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: guiexamples2.png --- (This appears to be a binary file; contents omitted.) Index: qcalc.xml =================================================================== RCS file: /cvsroot/q-lang/qcalc/doc/qcalc.xml,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** qcalc.xml 25 Nov 2007 13:43:12 -0000 1.21 --- qcalc.xml 29 Nov 2007 00:19:17 -0000 1.22 *************** *** 325,337 **** <para> ! These functions allow you to populate spreadsheet cells with basic GUI elements. </para> <para> ! <literal>public checkbox ARGS, combobox ARGS, comboedit ARGS, spinbox ARGS, hslider ARGS, vslider ARGS, pushbutton ARGS, togglebutton ARGS;</literal> </para> <para> ! Currently supported widget types are checkboxes, comboboxes (both non-editable and editable), spinboxes, horizontal and vertical sliders, push buttons and toggle buttons. The argument tuple <literal>ARGS</literal> depends on the specific kind of widget: </para> --- 325,382 ---- <para> ! QCalc provides a fairly comprehensive set of functions which allow you to populate spreadsheet cells with various useful GUI elements: </para> <para> ! <literal>public label ARGS, pixmap ARGS, checkbox ARGS, combobox ARGS, comboedit ARGS, spinbox ARGS, hslider ARGS, vslider ARGS, pushbutton ARGS, togglebutton ARGS;</literal> </para> <para> ! The currently supported widget types are text labels, pixmaps, checkboxes, comboboxes (both non-editable and editable), spinboxes, horizontal and vertical sliders, push buttons and toggle buttons. The argument tuple <literal>ARGS</literal> depends on the specific kind of widget, as detailed below. ! </para> ! ! <para> ! NOTE: These functions will <emphasis>not</emphasis> work if they are run asynchronously (i.e., in a secondary Q thread of the user script). They <emphasis>must</emphasis> be executed, either directly or indirectly, from a formula in a spreadsheet cell. ! </para> ! ! <para> ! The following GUI elements are used to display formatted text and pixmaps in a cell: ! </para> ! ! <itemizedlist> ! ! <listitem> ! <para> ! <literal>label S</literal> or <literal>label (S,A)</literal>, where <literal>S</literal> is the text (a string) to be shown, and <literal>A</literal> (optionally) denotes the alignment of the text within the cell. The text is actually a Qt "rich text" element, which may contain a limited set of html tags as described on the QStyleSheet page in the Qt manual. Hence this element allows you to have formatted text in a cell, as well as embedded images. ! </para> ! <para> ! The alignment is specified as a string of at most two characters specifying the horizontal and/or vertical alignment, respectively. The known horizontal alignments are <literal>"a"</literal> ("auto", which may be either "left" or "right" depending on the current locale), <literal>"c"</literal> (center), <literal>"l"</literal> (left) and <literal>"r"</literal> (right), the vertical alignments are <literal>"c"</literal> (center), <literal>"t"</literal> (top) and <literal>"b"</literal> (bottom). A singleton <literal>"c"</literal> denotes both horizontal and vertical alignment. The horizontal alignment defaults to <literal>"a"</literal>, the vertical alignment to <literal>"c"</literal>. ! </para> ! </listitem> ! ! <listitem> ! <para> ! <literal>pixmap S</literal> or <literal>pixmap (S,A,B)</literal>, where <literal>S</literal> is the name of a pixmap file to be shown, <literal>A</literal> denotes the alignment (specified in the same fashion as with labels, see above), and <literal>B</literal> is a numeric value indicating the desired rendering of the pixmap. The possible values for the <literal>B</literal> parameter are 1 ("scaled", i.e., the pixmap is scaled to fill all the available space in the cell), 2 ("animated", which can be used to animate a pixmap in mng or gif format consisting of multiple images), and 0 (no scaling or animation, which is also the default). Both the <literal>A</literal> and <literal>B</literal> parameters are optional. ! </para> ! <para> ! Note that label elements can also have embedded pixmaps (employing the <literal><img></literal> tag) and thus offer pretty much the same functionality, minus the animation feature. On the other hand, labels are much more versatile in that you can combine text and images and that they also give you more options for the placement and scaling of images. Dedicated pixmap elements are most useful for showing animated mng and gif images. ! </para> ! </listitem> ! ! </itemizedlist> ! ! <para> ! Here is a screenshot showing the label and pixmap elements in a spreadsheet: ! <screenshot> ! <graphic fileref="guiexamples2.png" align="center"/> ! </screenshot> ! </para> ! ! <para> ! Text label and pixmap elements are normally used for display purposes only, but the corresponding cells do have a value which can be queried in other formulas, which is the text of the element or the name of the pixmap as a string, respectively. The <literal>S</literal>, <literal>A</literal> and <literal>B</literal> parameters can also be computed values, and in addition the text or filename can be changed with <literal>setval</literal> and friends, to update the cell contents dynamically, as described in further detail below. ! </para> ! ! <para> ! The remaining GUI elements are typically used for value input in various forms: </para> *************** *** 411,415 **** <para> ! The following screenshot shows some of the GUI elements in action: <screenshot> <graphic fileref="guiexamples.png" align="center"/> --- 456,460 ---- <para> ! The following screenshot shows some of these GUI elements in action: <screenshot> <graphic fileref="guiexamples.png" align="center"/> *************** *** 418,426 **** <para> ! NOTE: These functions will <emphasis>not</emphasis> work if they are run asynchronously (i.e., in a secondary Q thread of the user script). They <emphasis>must</emphasis> be executed, either directly or indirectly, from a formula in a spreadsheet cell. ! </para> ! ! <para> ! The parameters of all GUI elements can be computed values which may also depend on other cell values (including other GUI elements). In this case the GUI element will be updated automatically whenever any of the requisite cells changes. In particular, you can also use GUI elements to <emphasis>display</emphasis> values from other cells by specifying the corresponding cell as the INIT parameter of the widget, or you can define "buddies" which always change values in concert, like a slider and an associated spinbox. </para> --- 463,467 ---- <para> ! The parameters of all GUI elements can be computed values which may also depend on other cell values (including other GUI elements). In this case the GUI element will be updated automatically whenever any of the requisite cells changes. In particular, you can also use GUI elements to <emphasis>display</emphasis> values from other cells by specifying the corresponding cell as the <literal>INIT</literal> parameter of the widget, or you can define "buddies" which always change values in concert, like a slider and an associated spinbox. </para> *************** *** 486,490 **** <para> ! Examples for the use of action and task buttons can be found in the <filename>guiexamples.qcalc</filename> spreadsheet included in the QCalc distribution. </para> --- 527,534 ---- <para> ! Examples for the use of action and task buttons can be found in the <filename>guiexamples.qcalc</filename> spreadsheet included in the QCalc distribution. The screenshot below shows these elements in action. ! <screenshot> ! <graphic fileref="guiexamples3.png" align="center"/> ! </screenshot> </para> |
From: Albert G. <ag...@us...> - 2007-11-28 23:55:24
|
Update of /cvsroot/q-lang/qcalc/examples In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27669 Modified Files: guiexamples.qcalc Log Message: update GUI examples Index: guiexamples.qcalc =================================================================== RCS file: /cvsroot/q-lang/qcalc/examples/guiexamples.qcalc,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** guiexamples.qcalc 28 Nov 2007 09:53:12 -0000 1.14 --- guiexamples.qcalc 28 Nov 2007 23:55:20 -0000 1.15 *************** *** 1,4 **** ! // qcalc 1.0, created Wed Nov 28 10:08:35 2007 -*-Q-*- -*- coding: UTF-8 -*- ! // [((0,1),"GUI element"),((0,2),"Value"),((0,3),"Display"),((2,0),"Checkbox"),((2,1),"= checkbox (\"test\",true)"),((2,2),"= B3"),((2,3),"= checkbox (\"test\",B3)"),((4,0),"Combobox"),((4,1),"= combobox ([\"apples\",\"bananas\",\"oranges\"],\"oranges\")"),((4,2),"= B5"),((4,3),"= combobox ([\"apples\",\"bananas\",\"oranges\"],B5)"),((5,0),"Comboedit"),((5,1),"= comboedit ([\"apples\",\"bananas\",\"oranges\"],\"bananas\")"),((5,2),"= B6"),((5,3),"= comboedit ([\"apples\",\"bananas\",\"oranges\"],B6)"),((6,0),"Int Spinbox"),((6,1),"= spinbox (0,100,5,40)"),((6,2),"= B7"),((6,3),"= spinbox (0,100,5,B7)"),((7,0),"Float Spinbox"),((7,1),"= spinbox (0.0,10.0,0.5,4.0)"),((7,2),"= B8"),((7,3),"= spinbox (0.0,10.0,0.5,B8)"),((9,0),"Spinbox with special value"),((9,1),"= spinbox (-1,10,1,0,\"Any\")"),((9,2),"= B10"),((9,3),"= spinbox (-1,10,1,B10,\"Any\")"),((10,0),"Spinbox with prefix"),((10,1),"= spinbox (-0.1,10,0.1,0,\"Any\",\"$ \")"),((10,2),"= B11"),((10,3),"= spinbox (-0.1,10,0.1,B11,\"Any\",\"$ \")"),((11,0),"Spinbox with suffix"),((11,1),"= spinbox (-1,72,1,10,\"Any\",\"\",\"pt\")"),((11,2),"= B12"),((11,3),"= spinbox (-1,72,1,B12,\"Any\",\"\",\"pt\")"),((13,0),"Horizontal slider"),((13,1),"= hslider (0,100,1,50)"),((13,2),"= B14"),((13,3),"= hslider (0,100,1,B14)"),((14,0),"Vertical slider"),((14,1),"= vslider (0,100,1,50)"),((14,2),"= B15"),((14,3),"= vslider (0,100,1,B15)"),((16,0),"Pushbutton"),((16,1),"= pushbutton \"Push me!\""),((16,2),"= B17"),((16,3),"N/A"),((17,0),"Pushbutton with icon"),((17,1),"= pushbutton (\"Push me!\",which \"../pixmaps/1rightarrow.png\")"),((17,2),"= B18"),((17,3),"N/A"),((18,0),"Togglebutton with icon"),((18,1),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\")"),((18,2),"= B19"),((18,3),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\",B19)"),((20,0),"\"Buddies\" (linked elements)"),((20,1),"= hslider (0,100,1,D21)"),((20,2),"= B21"),((20,3),"= spinbox (0,100,1,B21)"),((22,0),("Alternative \"remote control\" of GUI elements using setval",1,4)),((24,0),"GUI element A (click here)"),((24,1),"Transfer A -> B"),((24,2),"GUI element B (display)"),((24,3),"Value of B"),((26,0),"= checkbox \"A\""),((26,1),"= setval 'C27 A27"),((26,2),"= checkbox \"B\""),((26,3),"= C27"),((27,0),"= spinbox (-0.1,10,0.1,0,\"Any\")"),((27,1),"= setval 'C28 A28"),((27,2),"= spinbox (-0.1,10,0.1,0,\"Any\")"),((27,3),"= C28"),((28,0),"= spinbox (-5,100,5,40,\"Any\")"),((28,1),"= setval 'C29 A29"),((28,2),"= spinbox (-1,100,1,40,\"Any\")"),((28,3),"= C29"),((29,0),"= combobox ([\"apples\",\"bananas\",\"oranges\"],\"oranges\")"),((29,1),"= setval 'C30 A30"),((29,2),"= combobox ([\"apples\",\"bananas\",\"oranges\"],\"oranges\")"),((29,3),"= C30"),((30,0),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\")"),((30,1),"= setval 'C31 A31"),((30,2),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\")"),((30,3),"= C31"),((32,0),("Task button example. Shows how to operate a Q thread using a toggle button. See the script tab for the Q code implementing this example.",1,4)),((34,0),"Seconds for countdown:"),((34,1),"= spinbox (1,60,1,10)"),((35,0),"Push here to start counting:"),((35,1),"= taskbutton \"&Run me!\" (task B35)"),((35,2),"= spinbox (0,999999)"),((37,0),"Action button example:"),((37,1),"= actionbutton \"Random &number\" random"),((37,2),"= B38"),((39,0),"An \"open file\" action:"),((39,1),"= open_file"),((40,0),"The file you chose:"),((40,1),("",1,3)),((42,0),("= label \"<center><h1>Labels and Pixmaps</h1></center>\"",2,3)),((45,0),("= label (sprintf \"<big><b>%s</b></big>\" C46,C47)",2,2)),((45,2),"= comboedit [\"Hello, world!\",\"Richtext!\"]"),((46,2),"= combobox [\"a\",\"c\",\"l\",\"r\",\"t\",\"b\",\"ca\",\"cc\",\"cl\",\"cr\",\"ta\",\"tc\",\"tl\",\"tr\",\"ba\",\"bc\",\"bl\",\"br\"]"),((47,0),("= A46",1,2)),((49,0),("= pixmap (which $ \"../pixmaps/\"++C50,C53,if C52 then 2 else if C51 then 1 else 0)",4,2)),((49,2),"= comboedit [\"floppybuddy.gif\",\"1rightarrow.png\",\"flag.png\"]"),((50,2),"= checkbox \"Scale\""),((51,2),"= checkbox \"Animate\""),((52,2),"= combobox [\"a\",\"c\",\"l\",\"r\",\"t\",\"b\",\"ca\",\"cc\",\"cl\",\"cr\",\"ta\",\"tc\",\"tl\",\"tr\",\"ba\",\"bc\",\"bl\",\"br\"]"),((54,0),"Embed pixmap as a label:"),((56,0),("= label (sprintf \"<img src=%s/>\" $ which $ \"../pixmaps/\"++C57,C58)",4,2)),((56,2),"= comboedit [\"floppybuddy.gif\",\"1rightarrow.png\",\"flag.png\"]"),((57,2),"= combobox [\"a\",\"c\",\"l\",\"r\",\"t\",\"b\",\"ca\",\"cc\",\"cl\",\"cr\",\"ta\",\"tc\",\"tl\",\"tr\",\"ba\",\"bc\",\"bl\",\"br\"]")] // [(14,55),(32,35)] // [(0,162),(1,116),(2,139),(3,125)] --- 1,4 ---- ! // qcalc 1.0, created Thu Nov 29 00:59:29 2007 -*-Q-*- -*- coding: UTF-8 -*- ! // [((0,1),"GUI element"),((0,2),"Value"),((0,3),"Display"),((2,0),"Checkbox"),((2,1),"= checkbox (\"test\",true)"),((2,2),"= B3"),((2,3),"= checkbox (\"test\",B3)"),((4,0),"Combobox"),((4,1),"= combobox ([\"apples\",\"bananas\",\"oranges\"],\"oranges\")"),((4,2),"= B5"),((4,3),"= combobox ([\"apples\",\"bananas\",\"oranges\"],B5)"),((5,0),"Comboedit"),((5,1),"= comboedit ([\"apples\",\"bananas\",\"oranges\"],\"bananas\")"),((5,2),"= B6"),((5,3),"= comboedit ([\"apples\",\"bananas\",\"oranges\"],B6)"),((6,0),"Int Spinbox"),((6,1),"= spinbox (0,100,5,40)"),((6,2),"= B7"),((6,3),"= spinbox (0,100,5,B7)"),((7,0),"Float Spinbox"),((7,1),"= spinbox (0.0,10.0,0.5,4.0)"),((7,2),"= B8"),((7,3),"= spinbox (0.0,10.0,0.5,B8)"),((9,0),"Spinbox with special value"),((9,1),"= spinbox (-1,10,1,0,\"Any\")"),((9,2),"= B10"),((9,3),"= spinbox (-1,10,1,B10,\"Any\")"),((10,0),"Spinbox with prefix"),((10,1),"= spinbox (-0.1,10,0.1,0,\"Any\",\"$ \")"),((10,2),"= B11"),((10,3),"= spinbox (-0.1,10,0.1,B11,\"Any\",\"$ \")"),((11,0),"Spinbox with suffix"),((11,1),"= spinbox (-1,72,1,10,\"Any\",\"\",\"pt\")"),((11,2),"= B12"),((11,3),"= spinbox (-1,72,1,B12,\"Any\",\"\",\"pt\")"),((13,0),"Horizontal slider"),((13,1),"= hslider (0,100,1,50)"),((13,2),"= B14"),((13,3),"= hslider (0,100,1,B14)"),((14,0),"Vertical slider"),((14,1),"= vslider (0,100,1,50)"),((14,2),"= B15"),((14,3),"= vslider (0,100,1,B15)"),((16,0),"Pushbutton"),((16,1),"= pushbutton \"Push me!\""),((16,2),"= B17"),((16,3),"N/A"),((17,0),"Pushbutton with icon"),((17,1),"= pushbutton (\"Push me!\",which \"../pixmaps/1rightarrow.png\")"),((17,2),"= B18"),((17,3),"N/A"),((18,0),"Togglebutton with icon"),((18,1),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\")"),((18,2),"= B19"),((18,3),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\",B19)"),((20,0),"\"Buddies\" (linked elements)"),((20,1),"= hslider (0,100,1,D21)"),((20,2),"= B21"),((20,3),"= spinbox (0,100,1,B21)"),((22,0),("Alternative \"remote control\" of GUI elements using setval",1,4)),((24,0),"GUI element A (click here)"),((24,1),"Transfer A -> B"),((24,2),"GUI element B (display)"),((24,3),"Value of B"),((26,0),"= checkbox \"A\""),((26,1),"= setval 'C27 A27"),((26,2),"= checkbox \"B\""),((26,3),"= C27"),((27,0),"= spinbox (-0.1,10,0.1,0,\"Any\")"),((27,1),"= setval 'C28 A28"),((27,2),"= spinbox (-0.1,10,0.1,0,\"Any\")"),((27,3),"= C28"),((28,0),"= spinbox (-5,100,5,40,\"Any\")"),((28,1),"= setval 'C29 A29"),((28,2),"= spinbox (-1,100,1,40,\"Any\")"),((28,3),"= C29"),((29,0),"= combobox ([\"apples\",\"bananas\",\"oranges\"],\"oranges\")"),((29,1),"= setval 'C30 A30"),((29,2),"= combobox ([\"apples\",\"bananas\",\"oranges\"],\"oranges\")"),((29,3),"= C30"),((30,0),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\")"),((30,1),"= setval 'C31 A31"),((30,2),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\")"),((30,3),"= C31"),((32,0),("Task button example. Shows how to operate a Q thread using a toggle button. See the script tab for the Q code implementing this example.",1,4)),((34,0),"Seconds for countdown:"),((34,1),"= spinbox (1,60,1,10)"),((35,0),"Push here to start counting:"),((35,1),"= taskbutton \"&Run me!\" (task B35)"),((35,2),"= spinbox (0,999999)"),((37,0),"Action button example:"),((37,1),"= actionbutton \"Random &number\" random"),((37,2),"= B38"),((39,0),"An \"open file\" action:"),((39,1),"= open_file"),((40,0),"The file you chose:"),((40,1),("",1,3)),((42,0),("= label \"<center><h1>Labels and Pixmaps</h1></center>\"",2,3)),((45,0),("= label (sprintf \"<big><b>%s</b></big>\" C46,C47)",2,2)),((45,2),"= comboedit [\"Hello, world!\",\"Richtext!\"]"),((46,2),"= combobox [\"a\",\"c\",\"l\",\"r\",\"t\",\"b\",\"ca\",\"cc\",\"cl\",\"cr\",\"ta\",\"tc\",\"tl\",\"tr\",\"ba\",\"bc\",\"bl\",\"br\"]"),((47,0),("= A46",1,2)),((49,0),("= pixmap (which $ \"../pixmaps/\"++C50,C53,if C52 then 2 else if C51 then 1 else 0)",4,2)),((49,2),"= comboedit [\"floppybuddy.gif\",\"1rightarrow.png\",\"flag.png\"]"),((50,2),"= checkbox \"Scale\""),((51,2),"= checkbox \"Animate\""),((52,2),"= combobox [\"a\",\"c\",\"l\",\"r\",\"t\",\"b\",\"ca\",\"cc\",\"cl\",\"cr\",\"ta\",\"tc\",\"tl\",\"tr\",\"ba\",\"bc\",\"bl\",\"br\"]"),((54,0),"Embed pixmap as a label:"),((56,0),("= label (sprintf \"<img src=%s/> <big><b>Pixmap with label!</b></big>\" $ str $ which $ \"../pixmaps/\"++C57,C58)",4,2)),((56,2),"= comboedit [\"floppybuddy.gif\",\"1rightarrow.png\",\"flag.png\"]"),((57,2),"= combobox [\"a\",\"c\",\"l\",\"r\",\"t\",\"b\",\"ca\",\"cc\",\"cl\",\"cr\",\"ta\",\"tc\",\"tl\",\"tr\",\"ba\",\"bc\",\"bl\",\"br\"]")] // [(14,55),(32,35)] // [(0,162),(1,116),(2,139),(3,125)] |
From: Albert G. <ag...@us...> - 2007-11-28 16:02:13
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16832 Modified Files: Makefile Log Message: add label and pixmap examples Index: Makefile =================================================================== RCS file: /cvsroot/q-lang/qcalc/Makefile,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Makefile 24 Nov 2007 10:22:50 -0000 1.13 --- Makefile 28 Nov 2007 16:02:08 -0000 1.14 *************** *** 15,19 **** appdir = $(pkgdatadir)/apps/$(app) ! PIXMAPS = pixmaps/qcalc.png pixmaps/flag.png pixmaps/1rightarrow.png pixmaps/1rightarrow-green.png pixmaps/locked.png pixmaps/unlocked.png DISTFILES = Makefile COPYING README calclib.q $(app).desktop $(app).q *.ui $(PIXMAPS) doc/Makefile doc/*.html doc/*.png doc/*.xml doc/*.texi doc/texinfo.tex examples/*.qcalc examples/*.q --- 15,19 ---- appdir = $(pkgdatadir)/apps/$(app) ! PIXMAPS = pixmaps/qcalc.png pixmaps/flag.png pixmaps/1rightarrow.png pixmaps/1rightarrow-green.png pixmaps/locked.png pixmaps/unlocked.png pixmaps/floppybuddy.gif DISTFILES = Makefile COPYING README calclib.q $(app).desktop $(app).q *.ui $(PIXMAPS) doc/Makefile doc/*.html doc/*.png doc/*.xml doc/*.texi doc/texinfo.tex examples/*.qcalc examples/*.q |
From: Albert G. <ag...@us...> - 2007-11-28 16:02:13
|
Update of /cvsroot/q-lang/qcalc/pixmaps In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16832/pixmaps Added Files: floppybuddy.gif Log Message: add label and pixmap examples --- NEW FILE: floppybuddy.gif --- (This appears to be a binary file; contents omitted.) |
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. */ |
From: Albert G. <ag...@us...> - 2007-11-28 09:53:16
|
Update of /cvsroot/q-lang/qcalc/examples In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv24948 Modified Files: guiexamples.qcalc Log Message: add label and pixmap examples Index: guiexamples.qcalc =================================================================== RCS file: /cvsroot/q-lang/qcalc/examples/guiexamples.qcalc,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** guiexamples.qcalc 23 Nov 2007 22:41:30 -0000 1.13 --- guiexamples.qcalc 28 Nov 2007 09:53:12 -0000 1.14 *************** *** 1,4 **** ! // qcalc 1.0, created Sat Nov 17 19:27:00 2007 -*-Q-*- -*- coding: UTF-8 -*- ! // [((0,1),"GUI element"),((0,2),"Value"),((0,3),"Display"),((2,0),"Checkbox"),((2,1),"= checkbox (\"test\",true)"),((2,2),"= B3"),((2,3),"= checkbox (\"test\",B3)"),((4,0),"Combobox"),((4,1),"= combobox ([\"apples\",\"bananas\",\"oranges\"],\"oranges\")"),((4,2),"= B5"),((4,3),"= combobox ([\"apples\",\"bananas\",\"oranges\"],B5)"),((5,0),"Comboedit"),((5,1),"= comboedit ([\"apples\",\"bananas\",\"oranges\"],\"bananas\")"),((5,2),"= B6"),((5,3),"= comboedit ([\"apples\",\"bananas\",\"oranges\"],B6)"),((6,0),"Int Spinbox"),((6,1),"= spinbox (0,100,5,40)"),((6,2),"= B7"),((6,3),"= spinbox (0,100,5,B7)"),((7,0),"Float Spinbox"),((7,1),"= spinbox (0.0,10.0,0.5,4.0)"),((7,2),"= B8"),((7,3),"= spinbox (0.0,10.0,0.5,B8)"),((9,0),"Spinbox with special value"),((9,1),"= spinbox (-1,10,1,0,\"Any\")"),((9,2),"= B10"),((9,3),"= spinbox (-1,10,1,B10,\"Any\")"),((10,0),"Spinbox with prefix"),((10,1),"= spinbox (-0.1,10,0.1,0,\"Any\",\"$ \")"),((10,2),"= B11"),((10,3),"= spinbox (-0.1,10,0.1,B11,\"Any\",\"$ \")"),((11,0),"Spinbox with suffix"),((11,1),"= spinbox (-1,72,1,10,\"Any\",\"\",\"pt\")"),((11,2),"= B12"),((11,3),"= spinbox (-1,72,1,B12,\"Any\",\"\",\"pt\")"),((13,0),"Horizontal slider"),((13,1),"= hslider (0,100,1,50)"),((13,2),"= B14"),((13,3),"= hslider (0,100,1,B14)"),((14,0),"Vertical slider"),((14,1),"= vslider (0,100,1,50)"),((14,2),"= B15"),((14,3),"= vslider (0,100,1,B15)"),((16,0),"Pushbutton"),((16,1),"= pushbutton \"Push me!\""),((16,2),"= B17"),((16,3),"N/A"),((17,0),"Pushbutton with icon"),((17,1),"= pushbutton (\"Push me!\",which \"../pixmaps/1rightarrow.png\")"),((17,2),"= B18"),((17,3),"N/A"),((18,0),"Togglebutton with icon"),((18,1),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\")"),((18,2),"= B19"),((18,3),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\",B19)"),((20,0),"\"Buddies\" (linked elements)"),((20,1),"= hslider (0,100,1,D21)"),((20,2),"= B21"),((20,3),"= spinbox (0,100,1,B21)"),((22,0),("Alternative \"remote control\" of GUI elements using setval",1,4)),((24,0),"GUI element A (click here)"),((24,1),"Transfer A -> B"),((24,2),"GUI element B (display)"),((24,3),"Value of B"),((26,0),"= checkbox \"A\""),((26,1),"= setval 'C27 A27"),((26,2),"= checkbox \"B\""),((26,3),"= C27"),((27,0),"= spinbox (-0.1,10,0.1,0,\"Any\")"),((27,1),"= setval 'C28 A28"),((27,2),"= spinbox (-0.1,10,0.1,0,\"Any\")"),((27,3),"= C28"),((28,0),"= spinbox (-5,100,5,40,\"Any\")"),((28,1),"= setval 'C29 A29"),((28,2),"= spinbox (-1,100,1,40,\"Any\")"),((28,3),"= C29"),((29,0),"= combobox ([\"apples\",\"bananas\",\"oranges\"],\"oranges\")"),((29,1),"= setval 'C30 A30"),((29,2),"= combobox ([\"apples\",\"bananas\",\"oranges\"],\"oranges\")"),((29,3),"= C30"),((30,0),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\")"),((30,1),"= setval 'C31 A31"),((30,2),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\")"),((30,3),"= C31"),((32,0),("Task button example. Shows how to operate a Q thread using a toggle button. See the script tab for the Q code implementing this example.",1,4)),((34,0),"Seconds for countdown:"),((34,1),"= spinbox (1,60,1,10)"),((35,0),"Push here to start counting:"),((35,1),"= taskbutton \"&Run me!\" (task B35)"),((35,2),"= spinbox (0,999999)"),((37,0),"Action button example:"),((37,1),"= actionbutton \"Random &number\" random"),((37,2),"= B38"),((39,0),"An \"open file\" action:"),((39,1),"= open_file"),((40,0),"The file you chose:"),((40,1),("",1,3))] // [(14,55),(32,35)] // [(0,162),(1,116),(2,139),(3,125)] --- 1,4 ---- ! // qcalc 1.0, created Wed Nov 28 10:08:35 2007 -*-Q-*- -*- coding: UTF-8 -*- ! // [((0,1),"GUI element"),((0,2),"Value"),((0,3),"Display"),((2,0),"Checkbox"),((2,1),"= checkbox (\"test\",true)"),((2,2),"= B3"),((2,3),"= checkbox (\"test\",B3)"),((4,0),"Combobox"),((4,1),"= combobox ([\"apples\",\"bananas\",\"oranges\"],\"oranges\")"),((4,2),"= B5"),((4,3),"= combobox ([\"apples\",\"bananas\",\"oranges\"],B5)"),((5,0),"Comboedit"),((5,1),"= comboedit ([\"apples\",\"bananas\",\"oranges\"],\"bananas\")"),((5,2),"= B6"),((5,3),"= comboedit ([\"apples\",\"bananas\",\"oranges\"],B6)"),((6,0),"Int Spinbox"),((6,1),"= spinbox (0,100,5,40)"),((6,2),"= B7"),((6,3),"= spinbox (0,100,5,B7)"),((7,0),"Float Spinbox"),((7,1),"= spinbox (0.0,10.0,0.5,4.0)"),((7,2),"= B8"),((7,3),"= spinbox (0.0,10.0,0.5,B8)"),((9,0),"Spinbox with special value"),((9,1),"= spinbox (-1,10,1,0,\"Any\")"),((9,2),"= B10"),((9,3),"= spinbox (-1,10,1,B10,\"Any\")"),((10,0),"Spinbox with prefix"),((10,1),"= spinbox (-0.1,10,0.1,0,\"Any\",\"$ \")"),((10,2),"= B11"),((10,3),"= spinbox (-0.1,10,0.1,B11,\"Any\",\"$ \")"),((11,0),"Spinbox with suffix"),((11,1),"= spinbox (-1,72,1,10,\"Any\",\"\",\"pt\")"),((11,2),"= B12"),((11,3),"= spinbox (-1,72,1,B12,\"Any\",\"\",\"pt\")"),((13,0),"Horizontal slider"),((13,1),"= hslider (0,100,1,50)"),((13,2),"= B14"),((13,3),"= hslider (0,100,1,B14)"),((14,0),"Vertical slider"),((14,1),"= vslider (0,100,1,50)"),((14,2),"= B15"),((14,3),"= vslider (0,100,1,B15)"),((16,0),"Pushbutton"),((16,1),"= pushbutton \"Push me!\""),((16,2),"= B17"),((16,3),"N/A"),((17,0),"Pushbutton with icon"),((17,1),"= pushbutton (\"Push me!\",which \"../pixmaps/1rightarrow.png\")"),((17,2),"= B18"),((17,3),"N/A"),((18,0),"Togglebutton with icon"),((18,1),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\")"),((18,2),"= B19"),((18,3),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\",B19)"),((20,0),"\"Buddies\" (linked elements)"),((20,1),"= hslider (0,100,1,D21)"),((20,2),"= B21"),((20,3),"= spinbox (0,100,1,B21)"),((22,0),("Alternative \"remote control\" of GUI elements using setval",1,4)),((24,0),"GUI element A (click here)"),((24,1),"Transfer A -> B"),((24,2),"GUI element B (display)"),((24,3),"Value of B"),((26,0),"= checkbox \"A\""),((26,1),"= setval 'C27 A27"),((26,2),"= checkbox \"B\""),((26,3),"= C27"),((27,0),"= spinbox (-0.1,10,0.1,0,\"Any\")"),((27,1),"= setval 'C28 A28"),((27,2),"= spinbox (-0.1,10,0.1,0,\"Any\")"),((27,3),"= C28"),((28,0),"= spinbox (-5,100,5,40,\"Any\")"),((28,1),"= setval 'C29 A29"),((28,2),"= spinbox (-1,100,1,40,\"Any\")"),((28,3),"= C29"),((29,0),"= combobox ([\"apples\",\"bananas\",\"oranges\"],\"oranges\")"),((29,1),"= setval 'C30 A30"),((29,2),"= combobox ([\"apples\",\"bananas\",\"oranges\"],\"oranges\")"),((29,3),"= C30"),((30,0),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\")"),((30,1),"= setval 'C31 A31"),((30,2),"= togglebutton (\"Toggle me!\",which \"../pixmaps/flag.png\")"),((30,3),"= C31"),((32,0),("Task button example. Shows how to operate a Q thread using a toggle button. See the script tab for the Q code implementing this example.",1,4)),((34,0),"Seconds for countdown:"),((34,1),"= spinbox (1,60,1,10)"),((35,0),"Push here to start counting:"),((35,1),"= taskbutton \"&Run me!\" (task B35)"),((35,2),"= spinbox (0,999999)"),((37,0),"Action button example:"),((37,1),"= actionbutton \"Random &number\" random"),((37,2),"= B38"),((39,0),"An \"open file\" action:"),((39,1),"= open_file"),((40,0),"The file you chose:"),((40,1),("",1,3)),((42,0),("= label \"<center><h1>Labels and Pixmaps</h1></center>\"",2,3)),((45,0),("= label (sprintf \"<big><b>%s</b></big>\" C46,C47)",2,2)),((45,2),"= comboedit [\"Hello, world!\",\"Richtext!\"]"),((46,2),"= combobox [\"a\",\"c\",\"l\",\"r\",\"t\",\"b\",\"ca\",\"cc\",\"cl\",\"cr\",\"ta\",\"tc\",\"tl\",\"tr\",\"ba\",\"bc\",\"bl\",\"br\"]"),((47,0),("= A46",1,2)),((49,0),("= pixmap (which $ \"../pixmaps/\"++C50,C53,if C52 then 2 else if C51 then 1 else 0)",4,2)),((49,2),"= comboedit [\"floppybuddy.gif\",\"1rightarrow.png\",\"flag.png\"]"),((50,2),"= checkbox \"Scale\""),((51,2),"= checkbox \"Animate\""),((52,2),"= combobox [\"a\",\"c\",\"l\",\"r\",\"t\",\"b\",\"ca\",\"cc\",\"cl\",\"cr\",\"ta\",\"tc\",\"tl\",\"tr\",\"ba\",\"bc\",\"bl\",\"br\"]"),((54,0),"Embed pixmap as a label:"),((56,0),("= label (sprintf \"<img src=%s/>\" $ which $ \"../pixmaps/\"++C57,C58)",4,2)),((56,2),"= comboedit [\"floppybuddy.gif\",\"1rightarrow.png\",\"flag.png\"]"),((57,2),"= combobox [\"a\",\"c\",\"l\",\"r\",\"t\",\"b\",\"ca\",\"cc\",\"cl\",\"cr\",\"ta\",\"tc\",\"tl\",\"tr\",\"ba\",\"bc\",\"bl\",\"br\"]")] // [(14,55),(32,35)] // [(0,162),(1,116),(2,139),(3,125)] |