[q-lang-cvs] qcalc qcalc.q,1.175,1.176
Brought to you by:
agraef
From: Albert G. <ag...@us...> - 2007-11-23 12:40:13
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4324 Modified Files: qcalc.q Log Message: fix keyboard focus issues, add 'Next/Previous cell' and 'Toggle view' operations Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.175 retrieving revision 1.176 diff -C2 -d -r1.175 -r1.176 *** qcalc.q 23 Nov 2007 09:39:02 -0000 1.175 --- qcalc.q 23 Nov 2007 12:40:04 -0000 1.176 *************** *** 57,60 **** --- 57,62 ---- "editReturn()", accept2; "editCancel()", cancel; + "editNextCell()", next_cell; + "editPrevCell()", prev_cell; "editMergeCells()", merge_cells; "editDissociateCells()", dissociate_cells; *************** *** 110,113 **** --- 112,117 ---- "findNext()", find_next; "findReplace()", find_repl; + "viewToggle()", toggle_view; + "tabChanged()", tab_changed; "timer()", timer], CONN = qt_object "QObject" () "Receiver" () [] SLOTS [], *************** *** 606,609 **** --- 610,618 ---- if qt TABW "currentPageIndex" () = 0; + show_other = qt TABW "setCurrentPage" 0 + if qt TABW "currentPageIndex" () = 1; + = qt TABW "setCurrentPage" 1 + otherwise; + /* 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 *************** *** 638,644 **** def CBQ = semaphore; ! def WL = [abort,activate,eval,gui_update,popup, ! text_changed,linenumbermsg,indent], ! BL1 = [eval,gui_update], BL2 = [timer]; qt_invoke OBJ SLOT ARGS --- 647,653 ---- def CBQ = semaphore; ! def WL = [abort,activate,eval,gui_update,popup,next_cell,prev_cell, ! text_changed,linenumbermsg,indent,toggle_view,tab_changed], ! BL1 = [activate,eval,gui_update], BL2 = [timer]; qt_invoke OBJ SLOT ARGS *************** *** 707,710 **** --- 716,728 ---- /* Callbacks. */ + toggle_view _ _ _ + = show_other; + + tab_changed _ _ _ + = qt TABLE "setFocus" () + if qt TABW "currentPageIndex" () = 0; + = qt EDIT "setFocus" () + otherwise; + abort _ _ _ = ABORTED := true; *************** *** 1321,1326 **** gui_update X (I,J) _ where (I,J) = real_index (I,J) if 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; --- 1339,1343 ---- gui_update X (I,J) _ where (I,J) = real_index (I,J) if not is_nil X: ! = process_gui2 (I,J) X || digest_loop if is_global; = queue_update (I,J) otherwise; *************** *** 1357,1360 **** --- 1374,1394 ---- where X:QtObject = qt TABLE "cellWidget" (I,J); + next_cell _ _ _ = set_current_cell (I,J) + where (I,J) = check_editing || current_cell, + N = num_rows, M = num_cols, + (I,J) = if J+1<M then (I,J+1) + else if I+1<N then (I+1,0) + else (I,J) + if qt TABW "currentPageIndex" () = 0; + = qt EDIT "insert" "\t" otherwise; + + prev_cell _ _ _ = set_current_cell (I,J) + where (I,J) = check_editing || current_cell, + N = num_rows, M = num_cols, + (I,J) = if J>0 then (I,J-1) + else if I>0 then (I-1,M-1) + else (I,J) + if qt TABW "currentPageIndex" () = 0; + /* These are related to the script editor. */ |