Thread: [q-lang-cvs] qcalc qcalc.q,1.111,1.112
Brought to you by:
agraef
From: Albert G. <ag...@us...> - 2007-11-08 21:31:04
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8192 Modified Files: qcalc.q Log Message: more code refactoring and bugfixes; also added some optional code useful for debugging slot invocations Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** qcalc.q 8 Nov 2007 05:17:44 -0000 1.111 --- qcalc.q 8 Nov 2007 21:30:58 -0000 1.112 *************** *** 305,316 **** where P = qt MAIN "pos" (); - /* Uncomment this for debugging purposes. */ - - // @1 - // qt_invoke OBJ SLOT ARGS - // = printf "invoke: %s %s %s\n" (str OBJ,str SLOT,str ARGS) || - // fail if neq SLOT timer; - // @0 - /* Helper functions for string manipulation. */ --- 305,308 ---- *************** *** 552,555 **** --- 544,588 ---- manual A _ _ _ = assistant (which "doc/qdoc.html"++A); + /* This flag is set iff we're processing events in the global loop. If it is + unset, we're being invoked recursively through a local event loop, in which + most operations (except aborting an evaluation) are temporarily disabled. */ + + def GLOBAL = ref true; + + is_global = get GLOBAL; + begin_local = GLOBAL := false; + end_local = GLOBAL := true; + + special local X; + local X = begin_local || X || end_local; + + /* Similarly, evaluations triggered by updates of cell and GUI elements are + inhibited during recursive edits and while an evaluation is already in + progress. */ + + def RECURSIVE = ref false; + + is_recursive = get RECURSIVE; + begin_recursive = RECURSIVE := true; + end_recursive = RECURSIVE := false; + + special recursive X; + recursive X = begin_recursive || X || end_recursive; + + @1 + /* Our last line of defence: Override qt_invoke to reject any "unsafe" + callbacks (i.e., everything except abort) during evaluations. */ + + qt_invoke OBJ SLOT ARGS + = _FAIL_ if is_recursive and then neq SLOT abort; + @0 + + /* Uncomment this for debugging purposes. (Qt/Q needs to be configured with + -DDEBUG_INVOKE to make this work.) */ + + // debug_invoke OBJ SLOT ARGS + // = printf "qt_invoke: %s %s %s\n" (str OBJ,str SLOT,str ARGS) + // if neq SLOT timer; + /* Allow the user to abort a runaway computation. */ *************** *** 571,582 **** abort _ _ _ = ABORTED := true; - /* Evaluations triggered by updates of cell and GUI elements are inhibited - during recursive edits. */ - - def REDIT = ref false, LAST_EDIT = ref (); - - special recursive X; - recursive X = REDIT := true || X || REDIT := false; - /* XXXFIXME: A horrible kludge to set the current cell to the one which holds one of our GUI elements if it gets the focus. Unfortunately, this isn't --- 604,607 ---- *************** *** 615,619 **** do check_lastW (get LASTW) || LASTW := [] || check_focus 0 (qt APP "focusWidget" ()) || ! digest_loop where HAVE_TABLE = (qt TABW "currentPageIndex" () = 0), --- 640,644 ---- do check_lastW (get LASTW) || LASTW := [] || check_focus 0 (qt APP "focusWidget" ()) || ! if not is_recursive then digest_loop where HAVE_TABLE = (qt TABW "currentPageIndex" () = 0), *************** *** 632,646 **** // where HAVE_TEXT = neg null $ qt CLIP "text" $ // qt_val "QClipboard" "Clipboard" ! if global; ! ! /* This flag is set iff we're processing events in the global loop. If it is ! unset, we're being invoked recursively through a local event loop, in which ! most operations (except aborting an evaluation) are temporarily disabled. */ ! ! def GLOBAL = ref true; ! ! global = get GLOBAL; ! begin_local = GLOBAL := false; ! end_local = GLOBAL := true; digest_loop = digest S || digest_loop where S = get MSGS if #MSGS>0; --- 657,661 ---- // where HAVE_TEXT = neg null $ qt CLIP "text" $ // qt_val "QClipboard" "Clipboard" ! if is_global; digest_loop = digest S || digest_loop where S = get MSGS if #MSGS>0; *************** *** 701,707 **** = if null S0 then delete_cells (I,J) else insert_cells ((I,J),S0) || ! clear_cell (I,J) || set_cell (I,J) S || ! //delete_eval (I,J) || ! S0 where (S0,S1) = unquote S; --- 716,720 ---- = if null S0 then delete_cells (I,J) else insert_cells ((I,J),S0) || ! clear_cell (I,J) || set_cell (I,J) S || S0 where (S0,S1) = unquote S; *************** *** 738,742 **** where RES = waitmsg "Compiling..." || init_interp, _ = highlight_rebuild_cache ! if global; init_interp = TASK := (TMP|NEW_TASK) || --- 751,755 ---- where RES = waitmsg "Compiling..." || init_interp, _ = highlight_rebuild_cache ! if is_global; init_interp = TASK := (TMP|NEW_TASK) || *************** *** 782,787 **** // No output yet, take a short nap and try again. = startup_loop (H,PID,MASTER) ! if begin_local || qt APP "processEvents" 100 || ! end_local || not get ABORTED; // User aborted compilation, bail out. = fini_interp || statusmsg "Compilation aborted" || false; --- 795,799 ---- // 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; *************** *** 845,850 **** /* Editing table cells and evaluation. */ eval _ _ (I,J) ! if global and then not get REDIT: = process_gui (I,J) X || digest_loop where X:QtObject = gui_elem (I,J); --- 857,864 ---- /* Editing table cells and evaluation. */ + def LAST_EDIT = ref (); + eval _ _ (I,J) ! if is_global and then not is_recursive: = process_gui (I,J) X || digest_loop where X:QtObject = gui_elem (I,J); *************** *** 862,866 **** edit S D () where (I,J) = current_cell ! if global and then (qt TABW "currentPageIndex" () = 0): = LAST_EDIT := (I,J) || insert_cells ((I,J),true) || --- 876,880 ---- edit S D () where (I,J) = current_cell ! if is_global and then (qt TABW "currentPageIndex" () = 0): = LAST_EDIT := (I,J) || insert_cells ((I,J),true) || *************** *** 883,891 **** qt TABLE "editCell" (I,J) where (S,_,_) = get EVAL!(I,J) ! if global and then not is_gui_elem (I,J) and then (qt TABW "currentPageIndex" () = 0); accept _ _ _ ! where (I,J) = current_cell if global: = doprocess (I,J) || digest_loop if is_gui_elem (I,J); --- 897,905 ---- qt TABLE "editCell" (I,J) where (S,_,_) = get EVAL!(I,J) ! if is_global and then not is_gui_elem (I,J) and then (qt TABW "currentPageIndex" () = 0); accept _ _ _ ! where (I,J) = current_cell if is_global: = doprocess (I,J) || digest_loop if is_gui_elem (I,J); *************** *** 901,905 **** accept2 S D A where (I,J) = current_cell, N = num_rows ! if global and then (qt TABW "currentPageIndex" () = 0): = gui_enter (I,J) X where X:QtObject = gui_elem (I,J); --- 915,919 ---- accept2 S D A where (I,J) = current_cell, N = num_rows ! if is_global and then (qt TABW "currentPageIndex" () = 0): = gui_enter (I,J) X where X:QtObject = gui_elem (I,J); *************** *** 921,928 **** (qt TABW "currentPageIndex" () = 0) where (I,J) = current_cell ! if global; ! gui_update X (I,J) _ if global and then not get REDIT: ! = if (I,J)<>current_cell then (qt TABLE "setCurrentCell" (I,J) || qt TABLE "clearSelection" ()) || --- 935,944 ---- (qt TABW "currentPageIndex" () = 0) where (I,J) = current_cell ! if is_global; ! gui_update X (I,J) _ ! if is_global and then not is_recursive and then not is_nil X: ! = puts "gui_update\n" || ! if (I,J)<>current_cell then (qt TABLE "setCurrentCell" (I,J) || qt TABLE "clearSelection" ()) || *************** *** 944,951 **** activate _ _ (I,J) ! = updatemsg (I,J) if check_editing || global; clicked _ _ (I,J) ! = updatemsg (I,J) if global; updatemsg (I,J) = statusmsg $ sprintf "%s%d = %s" (colstr J,I+1,S) --- 960,967 ---- activate _ _ (I,J) ! = updatemsg (I,J) if check_editing || is_global; clicked _ _ (I,J) ! = updatemsg (I,J) if is_global; updatemsg (I,J) = statusmsg $ sprintf "%s%d = %s" (colstr J,I+1,S) *************** *** 992,999 **** def REPLS = ref 0; ! find _ _ _ if global: = find_dg || REPLS := 0 || find_clearmsg || show_editor; ! find_prev _ _ _ if global: = savestr FIND_TEXT S || find_statusmsg "Found previous occurrence" || --- 1008,1015 ---- def REPLS = ref 0; ! find _ _ _ if is_global: = find_dg || REPLS := 0 || find_clearmsg || show_editor; ! find_prev _ _ _ if is_global: = savestr FIND_TEXT S || find_statusmsg "Found previous occurrence" || *************** *** 1008,1012 **** otherwise; ! find_next _ _ _ if global: = savestr FIND_TEXT S || find_statusmsg "Found next occurrence" || --- 1024,1028 ---- otherwise; ! find_next _ _ _ if is_global: = savestr FIND_TEXT S || find_statusmsg "Found next occurrence" || *************** *** 1026,1030 **** REPLS := 0 otherwise; ! find_repl X D A if global: = qt EDIT "insert" S || REPLS := get REPLS+1 || savestr REPL_TEXT S0 || --- 1042,1046 ---- REPLS := 0 otherwise; ! find_repl X D A if is_global: = qt EDIT "insert" S || REPLS := get REPLS+1 || savestr REPL_TEXT S0 || *************** *** 1088,1092 **** /* Various editing operations. */ ! edit_undo _ _ _ if global: = undo || updatemsg (I,J) where (I,J) = current_cell --- 1104,1108 ---- /* Various editing operations. */ ! edit_undo _ _ _ if is_global: = undo || updatemsg (I,J) where (I,J) = current_cell *************** *** 1096,1100 **** if qt TABW "currentPageIndex" () = 1; ! edit_redo _ _ _ if global: = redo || updatemsg (I,J) where (I,J) = current_cell --- 1112,1116 ---- if qt TABW "currentPageIndex" () = 1; ! edit_redo _ _ _ if is_global: = redo || updatemsg (I,J) where (I,J) = current_cell *************** *** 1104,1108 **** if qt TABW "currentPageIndex" () = 1; ! insert_row _ _ _ if global: = adjust_rows (N+2) || EDITED := true || update_title || process_sel SEL || --- 1120,1124 ---- if qt TABW "currentPageIndex" () = 1; ! insert_row _ _ _ if is_global: = adjust_rows (N+2) || EDITED := true || update_title || process_sel SEL || *************** *** 1119,1123 **** if qt TABW "currentPageIndex" () = 0; ! delete_row _ _ _ if global: = EDITED := true || update_title || process_sel SEL || --- 1135,1139 ---- if qt TABW "currentPageIndex" () = 0; ! delete_row _ _ _ if is_global: = EDITED := true || update_title || process_sel SEL || *************** *** 1134,1138 **** if qt TABW "currentPageIndex" () = 0; ! insert_col _ _ _ if global: = adjust_cols (N+2) || EDITED := true || update_title || process_sel SEL || --- 1150,1154 ---- if qt TABW "currentPageIndex" () = 0; ! insert_col _ _ _ if is_global: = adjust_cols (N+2) || EDITED := true || update_title || process_sel SEL || *************** *** 1149,1153 **** if qt TABW "currentPageIndex" () = 0; ! delete_col _ _ _ if global: = EDITED := true || update_title || process_sel SEL || --- 1165,1169 ---- if qt TABW "currentPageIndex" () = 0; ! delete_col _ _ _ if is_global: = EDITED := true || update_title || process_sel SEL || *************** *** 1209,1213 **** = (I<N) and then (J<M); ! del _ _ _ if global: = EDITED := get EDITED or else not null CELLS || update_title || --- 1225,1229 ---- = (I<N) and then (J<M); ! del _ _ _ if is_global: = EDITED := get EDITED or else not null CELLS || update_title || *************** *** 1221,1225 **** if qt TABW "currentPageIndex" () = 1; ! cut _ _ _ if global: = EDITED := get EDITED or else not null CELLS || update_title || --- 1237,1241 ---- if qt TABW "currentPageIndex" () = 1; ! cut _ _ _ if is_global: = EDITED := get EDITED or else not null CELLS || update_title || *************** *** 1234,1238 **** if qt TABW "currentPageIndex" () = 1; ! copy _ _ _ if global: = set_clipboard X S where SEL = check_editing || selection, --- 1250,1254 ---- if qt TABW "currentPageIndex" () = 1; ! copy _ _ _ if is_global: = set_clipboard X S where SEL = check_editing || selection, *************** *** 1242,1246 **** if qt TABW "currentPageIndex" () = 1; ! copy_selection _ _ _ if global: = set_clipboard2 S where S = sel_cellcvals SEL --- 1258,1262 ---- if qt TABW "currentPageIndex" () = 1; ! copy_selection _ _ _ if is_global: = set_clipboard2 S where S = sel_cellcvals SEL *************** *** 1250,1254 **** if qt TABW "currentPageIndex" () = 0; ! paste _ _ _ if global: = EDITED := get EDITED or else not null SEL || adjust_table (N,M) || --- 1266,1270 ---- if qt TABW "currentPageIndex" () = 0; ! paste _ _ _ if is_global: = EDITED := get EDITED or else not null SEL || adjust_table (N,M) || *************** *** 1269,1273 **** if qt TABW "currentPageIndex" () = 1; ! paste_text _ _ _ if global: = EDITED := get EDITED or else not null SEL || update_title || process_sel SEL || --- 1285,1289 ---- if qt TABW "currentPageIndex" () = 1; ! paste_text _ _ _ if is_global: = EDITED := get EDITED or else not null SEL || update_title || process_sel SEL || *************** *** 1283,1287 **** if qt TABW "currentPageIndex" () = 0; ! fill _ _ _ if global: = EDITED := true || update_title || process_sel $ tl $ cat $ fill_vals VALS || --- 1299,1303 ---- if qt TABW "currentPageIndex" () = 0; ! fill _ _ _ if is_global: = EDITED := true || update_title || process_sel $ tl $ cat $ fill_vals VALS || *************** *** 1516,1520 **** where FONT = qt_new "QFont" (); ! choose_font _ _ _ if global: = do (flip set_font FONT) (if qt TABW "currentPageIndex" () = 0 then [TABLE] --- 1532,1536 ---- where FONT = qt_new "QFont" (); ! choose_font _ _ _ if is_global: = do (flip set_font FONT) (if qt TABW "currentPageIndex" () = 0 then [TABLE] *************** *** 1525,1529 **** (FONT,true) = font_dg FONT; ! enlarge_font _ _ _ if global: = statusmsg $ sprintf "New point size: %dpt" $ change_pointsize succ TABLE --- 1541,1545 ---- (FONT,true) = font_dg FONT; ! enlarge_font _ _ _ if is_global: = statusmsg $ sprintf "New point size: %dpt" $ change_pointsize succ TABLE *************** *** 1534,1538 **** otherwise; ! reduce_font _ _ _ if global: = statusmsg $ sprintf "New point size: %dpt" $ change_pointsize pred TABLE --- 1550,1554 ---- otherwise; ! reduce_font _ _ _ if is_global: = statusmsg $ sprintf "New point size: %dpt" $ change_pointsize pred TABLE *************** *** 1543,1552 **** otherwise; ! increase_prec _ _ _ if global: = FPREC := get FPREC+1 || FFORMAT := sprintf "%%0.%dg" (get FPREC) || do update_fformat $ list $ get CELLS; ! decrease_prec _ _ _ if global: = FPREC := get FPREC-1 || FFORMAT := sprintf "%%0.%dg" (get FPREC) || --- 1559,1568 ---- otherwise; ! increase_prec _ _ _ if is_global: = FPREC := get FPREC+1 || FFORMAT := sprintf "%%0.%dg" (get FPREC) || do update_fformat $ list $ get CELLS; ! decrease_prec _ _ _ if is_global: = FPREC := get FPREC-1 || FFORMAT := sprintf "%%0.%dg" (get FPREC) || *************** *** 1565,1569 **** save S D A = save_as S D A if eq (get FILENAME) (); ! save _ _ _ if global: = EDITED := false || qt EDIT "setModified" false || update_title || --- 1581,1585 ---- save S D A = save_as S D A if eq (get FILENAME) (); ! save _ _ _ if is_global: = EDITED := false || qt EDIT "setModified" false || update_title || *************** *** 1598,1602 **** = (I1<I2) or else (I1=I2) and then (J1<J2); ! save_as X D A if global: = FILENAME := S || save X D A if not isfile (fopen S "r") or else --- 1614,1618 ---- = (I1<I2) or else (I1=I2) and then (J1<J2); ! save_as X D A if is_global: = FILENAME := S || save X D A if not isfile (fopen S "r") or else *************** *** 1612,1616 **** if not null NAME where NAME:String = open_dg ! if check_editing || check_edited if global: = () where () = open_file NAME; = msgbox $ sprintf --- 1628,1632 ---- if not null NAME where NAME:String = open_dg ! if check_editing || check_edited if is_global: = () where () = open_file NAME; = msgbox $ sprintf *************** *** 1623,1627 **** recent_file I _ _ _ if not null NAME where NAME:String = get FILES!(I-1) ! if check_editing || check_edited if global: = () where () = open_file NAME; = msgbox $ sprintf --- 1639,1643 ---- recent_file I _ _ _ if not null NAME where NAME:String = get FILES!(I-1) ! if check_editing || check_edited if is_global: = () where () = open_file NAME; = msgbox $ sprintf *************** *** 1639,1645 **** --- 1655,1663 ---- if RES then digest_loop || statusmsg "Done" || + qt TIMER "start" 300 || () where OLD_KEYS = keys $ get CELLS, _ = // initializations + qt TIMER "stop" () || CELLS := emptyhdict || EVAL := emptyhdict || *************** *** 1727,1731 **** ROWS = [0..num_rows-1], COLS = [0..num_cols-1] ! if check_editing || check_edited if global; /* Encoding tag. FIXME: This currently requires nl_langinfo to get the system --- 1745,1749 ---- ROWS = [0..num_rows-1], COLS = [0..num_cols-1] ! if check_editing || check_edited if is_global; /* Encoding tag. FIXME: This currently requires nl_langinfo to get the system *************** *** 2002,2006 **** bail_out _ _ _ = qt APP "exit" 1 ! if check_editing || check_edited if global; edited = get EDITED or else qt EDIT "isModified" (); --- 2020,2024 ---- bail_out _ _ _ = qt APP "exit" 1 ! if check_editing || check_edited if is_global; edited = get EDITED or else qt EDIT "isModified" (); *************** *** 2577,2585 **** if get STATE=4; ! collect_results U [] // we're finished; process any pending cell updates ! = if not null U then ! post MSGS $ zipwith append (keys U) (vals U); ! collect_results U [(I,J)|V] if get ABORTED: // user aborted the computation, flag all remaining cells --- 2595,2606 ---- if get STATE=4; ! collect_results U V ! = begin_recursive || results_loop U V || end_recursive; ! ! results_loop U [] // we're finished; process any pending cell updates ! = post MSGS $ zipwith append (keys U) (vals U) if not null U; ! = () otherwise; ! results_loop U [(I,J)|V] if get ABORTED: // user aborted the computation, flag all remaining cells *************** *** 2591,2604 **** where S:String = try2 MSGS: // evaluation succeeded, we're good ! = update_cell (I,J) S || collect_results U V where [S] = regex "" "^\\+\\+\\+ Result: (.*)$" S (reg 1); // errors during evaluation (these get the red flag) = flag (I,J) || ! collect_results U V if (S = "+++ Syntax error.") or else not null (regex "" "^\\+\\+\\+ Exception: (.*)$" S ()); /* Asynchronous message to change a cell. We update the cell right now, but defer triggering of dependent cells until we have finished processing. */ ! = collect_results (insert U ((I1,J1),X)) [(I,J)|V] where X = process_update2 (I1,J1) S1 where [(K1,S1)] = regex "" --- 2612,2625 ---- where S:String = try2 MSGS: // evaluation succeeded, we're good ! = update_cell (I,J) S || results_loop U V where [S] = regex "" "^\\+\\+\\+ Result: (.*)$" S (reg 1); // errors during evaluation (these get the red flag) = flag (I,J) || ! results_loop U V if (S = "+++ Syntax error.") or else not null (regex "" "^\\+\\+\\+ Exception: (.*)$" S ()); /* Asynchronous message to change a cell. We update the cell right now, but defer triggering of dependent cells until we have finished processing. */ ! = results_loop (insert U ((I1,J1),X)) [(I,J)|V] where X = process_update2 (I1,J1) S1 where [(K1,S1)] = regex "" *************** *** 2606,2616 **** (reg 1,reg 2), (I1,J1) = val K1; ! /* Messages to create GUI elements in cells. Note that we inhibit recursive ! updates during initialization of the GUI elements, to prevent looping on ! cascades of update messages. */ ! = recursive (qt IT "setChecked" INIT) || qt TABLE "setItem" (I1,J1,IT) || insert_cells ((I1,J1),IT) || ! collect_results (insert U ((I1,J1),IT)) [(I,J)|V] where [(K1,S1)] = regex "" "^\\+\\+\\+ Checkbox: (\\([0-9]+,[0-9]+\\)) (.*)$" S --- 2627,2635 ---- (reg 1,reg 2), (I1,J1) = val K1; ! /* Messages to create GUI elements in cells. */ ! = qt IT "setChecked" INIT || qt TABLE "setItem" (I1,J1,IT) || insert_cells ((I1,J1),IT) || ! results_loop (insert U ((I1,J1),IT)) [(I,J)|V] where [(K1,S1)] = regex "" "^\\+\\+\\+ Checkbox: (\\([0-9]+,[0-9]+\\)) (.*)$" S *************** *** 2621,2625 **** qt TABLE "setCellWidget" (I1,J1,X) || insert_cells ((I1,J1),IT) || ! collect_results (insert U ((I1,J1),IT)) [(I,J)|V] where [(K1,S1)] = regex "" "^\\+\\+\\+ Pushbutton: (\\([0-9]+,[0-9]+\\)) (.*)$" S --- 2640,2644 ---- qt TABLE "setCellWidget" (I1,J1,X) || insert_cells ((I1,J1),IT) || ! results_loop (insert U ((I1,J1),IT)) [(I,J)|V] where [(K1,S1)] = regex "" "^\\+\\+\\+ Pushbutton: (\\([0-9]+,[0-9]+\\)) (.*)$" S *************** *** 2648,2652 **** qt TABLE "setCellWidget" (I1,J1,X) || insert_cells ((I1,J1),IT) || ! collect_results (insert U ((I1,J1),IT)) [(I,J)|V] where [(K1,S1)] = regex "" "^\\+\\+\\+ Togglebutton: (\\([0-9]+,[0-9]+\\)) (.*)$" S --- 2667,2671 ---- qt TABLE "setCellWidget" (I1,J1,X) || insert_cells ((I1,J1),IT) || ! results_loop (insert U ((I1,J1),IT)) [(I,J)|V] where [(K1,S1)] = regex "" "^\\+\\+\\+ Togglebutton: (\\([0-9]+,[0-9]+\\)) (.*)$" S *************** *** 2668,2678 **** _ = qt_connect X (SIGNAL "toggled(bool)") X (SLOT "guiUpdate()") || - qt_connect X (SIGNAL "released()") - X (SLOT "guiUpdate()") || qt IT "setReplaceable" false; ! = recursive (qt IT "setCurrentItem" INIT) || qt TABLE "setItem" (I1,J1,IT) || insert_cells ((I1,J1),IT) || ! collect_results (insert U ((I1,J1),IT)) [(I,J)|V] where [(K1,S1)] = regex "" "^\\+\\+\\+ Combobox: (\\([0-9]+,[0-9]+\\)) (.*)$" S --- 2687,2695 ---- _ = qt_connect X (SIGNAL "toggled(bool)") X (SLOT "guiUpdate()") || qt IT "setReplaceable" false; ! = qt IT "setCurrentItem" INIT || qt TABLE "setItem" (I1,J1,IT) || insert_cells ((I1,J1),IT) || ! results_loop (insert U ((I1,J1),IT)) [(I,J)|V] where [(K1,S1)] = regex "" "^\\+\\+\\+ Combobox: (\\([0-9]+,[0-9]+\\)) (.*)$" S *************** *** 2680,2687 **** (I1,J1) = val K1, (SL,INIT) = val S1, IT = qt_new "QComboTableItem" (TABLE,SL,false); ! = recursive (qt IT "setCurrentItem" INIT) || qt TABLE "setItem" (I1,J1,IT) || insert_cells ((I1,J1),IT) || ! collect_results (insert U ((I1,J1),IT)) [(I,J)|V] where [(K1,S1)] = regex "" "^\\+\\+\\+ Comboedit: (\\([0-9]+,[0-9]+\\)) (.*)$" S --- 2697,2704 ---- (I1,J1) = val K1, (SL,INIT) = val S1, IT = qt_new "QComboTableItem" (TABLE,SL,false); ! = qt IT "setCurrentItem" INIT || qt TABLE "setItem" (I1,J1,IT) || insert_cells ((I1,J1),IT) || ! results_loop (insert U ((I1,J1),IT)) [(I,J)|V] where [(K1,S1)] = regex "" "^\\+\\+\\+ Comboedit: (\\([0-9]+,[0-9]+\\)) (.*)$" S *************** *** 2689,2704 **** (I1,J1) = val K1, (SL,INIT) = val S1, IT = qt_new "QComboTableItem" (TABLE,SL,true); ! = recursive ! (qt X "setValue" INIT || ! if not null SPECIAL then ! qt X "setSpecialValueText" SPECIAL || ! if not null PREF then ! qt X "setPrefix" PREF || ! if not null SUFF then ! qt X "setSuffix" SUFF) || qt TABLE "setItem" (I1,J1,IT) || qt TABLE "setCellWidget" (I1,J1,X) || insert_cells ((I1,J1),IT) || ! collect_results (insert U ((I1,J1),IT)) [(I,J)|V] where [(K1,S1)] = regex "" "^\\+\\+\\+ Spinbox: (\\([0-9]+,[0-9]+\\)) (.*)$" S --- 2706,2720 ---- (I1,J1) = val K1, (SL,INIT) = val S1, IT = qt_new "QComboTableItem" (TABLE,SL,true); ! = qt X "setValue" INIT || ! if not null SPECIAL then ! qt X "setSpecialValueText" SPECIAL || ! if not null PREF then ! qt X "setPrefix" PREF || ! if not null SUFF then ! qt X "setSuffix" SUFF || qt TABLE "setItem" (I1,J1,IT) || qt TABLE "setCellWidget" (I1,J1,X) || insert_cells ((I1,J1),IT) || ! results_loop (insert U ((I1,J1),IT)) [(I,J)|V] where [(K1,S1)] = regex "" "^\\+\\+\\+ Spinbox: (\\([0-9]+,[0-9]+\\)) (.*)$" S *************** *** 2721,2729 **** qt X "setValidator" nil || qt IT "setReplaceable" false; ! = recursive (qt X "setLineStep" LSTEP) || qt TABLE "setItem" (I1,J1,IT) || qt TABLE "setCellWidget" (I1,J1,X) || insert_cells ((I1,J1),IT) || ! collect_results (insert U ((I1,J1),IT)) [(I,J)|V] where [(K1,S1)] = regex "" "^\\+\\+\\+ Slider: (\\([0-9]+,[0-9]+\\)) (.*)$" S --- 2737,2745 ---- qt X "setValidator" nil || qt IT "setReplaceable" false; ! = qt X "setLineStep" LSTEP || qt TABLE "setItem" (I1,J1,IT) || qt TABLE "setCellWidget" (I1,J1,X) || insert_cells ((I1,J1),IT) || ! results_loop (insert U ((I1,J1),IT)) [(I,J)|V] where [(K1,S1)] = regex "" "^\\+\\+\\+ Slider: (\\([0-9]+,[0-9]+\\)) (.*)$" S *************** *** 2745,2758 **** qt IT "setReplaceable" false; // anything else just gets passed to the digest function, and we try again ! = begin_local || digest S || end_local || ! collect_results U [(I,J)|V]; otherwise: /* No result yet. Process some pending GUI events, to give the user a chance to abort the computation. */ = do flag [(I,J)|V] ! if wait_cursor || begin_local || ! qt APP "processEvents" 100 || ! end_local || get ABORTED; ! = collect_results U [(I,J)|V] otherwise; /* Note that we try the semaphore *two* times before we give up and hand it --- 2761,2772 ---- qt IT "setReplaceable" false; // anything else just gets passed to the digest function, and we try again ! = local (digest S) || results_loop U [(I,J)|V]; otherwise: /* No result yet. Process some pending GUI events, to give the user a chance to abort the computation. */ = do flag [(I,J)|V] ! if wait_cursor || local (qt APP "processEvents" 100) || ! get ABORTED; ! = results_loop U [(I,J)|V] otherwise; /* Note that we try the semaphore *two* times before we give up and hand it |