[q-lang-cvs] qcalc qcalc.q,1.166,1.167
Brought to you by:
agraef
From: Albert G. <ag...@us...> - 2007-11-18 05:22:26
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv841 Modified Files: qcalc.q Log Message: bugfix: must queue user interactions with GUI elements during evaluations for later processing Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.166 retrieving revision 1.167 diff -C2 -d -r1.166 -r1.167 *** qcalc.q 18 Nov 2007 03:55:03 -0000 1.166 --- qcalc.q 18 Nov 2007 05:22:22 -0000 1.167 *************** *** 721,724 **** --- 721,747 ---- if N < 5; + /* Queue GUI updates for later processing during evaluations. */ + + def GUIQ = ref []; + + queue_update (I,J) + = GUIQ := [(I,J)|get GUIQ]; + + do_queued_updates + if not null (get GUIQ): + = GUIQ := [] || + dowith gui_action (map gui_elem Q) Q || + process_sel2 W + where Q = nub $ sort indexcmp $ get GUIQ, + W = zipwith append Q (map (get CELLS!) Q) + if get STATE = 4; + = GUIQ := [] otherwise; + otherwise: = (); + + nub [] = []; + nub [X] = [X]; + nub [X,X|Xs] = nub [X|Xs]; + nub [X,Y|Xs] = [X|nub [Y|Xs]] otherwise; + /* Timer processing. */ *************** *** 752,755 **** --- 775,779 ---- digest_loop = digest S || digest_loop where S = get MSGS if #MSGS>0; + = do_queued_updates otherwise; /* State of the inferior Q process: 0 = uninitialized or exited, 1 = *************** *** 1169,1172 **** --- 1193,1200 ---- gui_elem (I,J); = (); + where (I,J) = real_index (I,J) + if not is_global and then not is_recursive: + = queue_update (I,J) if is_gui_elem (I,J); + = (); /* FIXME: If we created a GUI object in the edited cell, it will be destroyed *************** *** 1251,1257 **** gui_update X (I,J) _ where (I,J) = real_index (I,J) ! if is_global and then not is_recursive and then not is_nil X: = if (I,J)<>real_current_cell then set_current_cell (I,J) || ! process_gui2 (I,J) X || digest_loop; check_editing = EDITED := true || --- 1279,1287 ---- gui_update X (I,J) _ where (I,J) = real_index (I,J) ! if not is_recursive and then not is_nil X: = if (I,J)<>real_current_cell then set_current_cell (I,J) || ! process_gui2 (I,J) X || digest_loop ! if is_global; ! = queue_update (I,J) otherwise; check_editing = EDITED := true || |