[q-lang-cvs] qcalc Makefile,1.12,1.13 qcalc.q,1.182,1.183
Brought to you by:
agraef
From: Albert G. <ag...@us...> - 2007-11-24 10:27:39
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4394 Modified Files: Makefile qcalc.q Log Message: Esc now also switches the table between read-write and read-only mode (the latter facilitates the selection of a range of cells containing GUI elements); also added a corresponding indicator (tiny lock symbol) to the status line Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.182 retrieving revision 1.183 diff -C2 -d -r1.182 -r1.183 *** qcalc.q 23 Nov 2007 23:46:41 -0000 1.182 --- qcalc.q 24 Nov 2007 10:22:50 -0000 1.183 *************** *** 190,200 **** qt TIMER "start" 100, // some pixmaps ! [FLAG, RES, TASKB, TASKA, NULLPM] = map (qt_new "QPixmap") [which "pixmaps/flag.png", which "pixmaps/1rightarrow.png", which "pixmaps/1rightarrow.png", which "pixmaps/1rightarrow-green.png", ()], TASKPM = [TASKB,TASKA], // dictionary of edited and computed cells CELLS = ref emptyhdict, EVAL = ref emptyhdict, XREF = ref emptyhdict, --- 190,205 ---- qt TIMER "start" 100, // some pixmaps ! [FLAG, RES, TASKB, TASKA, LOCKED, UNLOCKED, NULLPM] = map (qt_new "QPixmap") [which "pixmaps/flag.png", which "pixmaps/1rightarrow.png", which "pixmaps/1rightarrow.png", which "pixmaps/1rightarrow-green.png", + which "pixmaps/locked.png", + which "pixmaps/unlocked.png", ()], TASKPM = [TASKB,TASKA], + // read-only indicator in the status bar + ROSTAT = qt_new "QLabel" nil, + _ = qt ROSTAT "setPixmap" UNLOCKED || qt STATUS "addWidget" (ROSTAT,0,true), // dictionary of edited and computed cells CELLS = ref emptyhdict, EVAL = ref emptyhdict, XREF = ref emptyhdict, *************** *** 1305,1308 **** --- 1310,1317 ---- where (I,J) = real_current_cell if qt TABW "currentPageIndex" () = 0: + = qt TABLE "setReadOnly" false || + qt ROSTAT "setPixmap" UNLOCKED || + fail // falls through + if qt TABLE "isReadOnly" (); = // nuke the current cell clear_cell (I,J) || *************** *** 1320,1323 **** --- 1329,1336 ---- where (I,J) = real_index (I,J) if qt TABW "currentPageIndex" () = 0: + = qt TABLE "setReadOnly" false || + qt ROSTAT "setPixmap" UNLOCKED || + fail // falls through + if qt TABLE "isReadOnly" (); = if not qt TABLE "isEditing" () then edit_cell (I,J) *************** *** 1345,1357 **** set_current_cell (if I+M<N then (I+M,J) else (0,J+1)) where (M,_) = cell_span (I,J) ! if (qt TABLE "hasFocus" () or else ! qt TABLE "isEditing" ()); ! cancel _ _ _ = end_edit false (I,J) || finish_edit false (I,J) if not is_gui_elem (I,J) and then ! qt TABLE "isEditing" () and then ! (qt TABW "currentPageIndex" () = 0) ! where _ = LAST_EDIT := (), (I,J) = real_current_cell; gui_update X (I,J) _ --- 1358,1376 ---- set_current_cell (if I+M<N then (I+M,J) else (0,J+1)) where (M,_) = cell_span (I,J) ! if qt TABLE "hasFocus" () or else ! qt TABLE "isEditing" (); ! cancel _ _ _ ! where _ = LAST_EDIT := (), (I,J) = real_current_cell ! if qt TABW "currentPageIndex" () = 0: ! = end_edit false (I,J) || finish_edit false (I,J) if not is_gui_elem (I,J) and then ! qt TABLE "isEditing" (); ! = qt TABLE "setReadOnly" (not RO) || ! qt ROSTAT "setPixmap" (if RO then UNLOCKED else LOCKED) || ! qt TABLE "setFocus" () ! where RO = qt TABLE "isReadOnly" () ! otherwise; gui_update X (I,J) _ *************** *** 1390,1394 **** = qt X "setFocus" () if not is_nil X ! where X:QtObject = qt TABLE "cellWidget" (I,J); next_cell _ _ _ = set_current_cell (I,J) --- 1409,1414 ---- = qt X "setFocus" () if not is_nil X ! where X:QtObject = qt TABLE "cellWidget" (I,J) ! if not qt TABLE "isReadOnly" (); next_cell _ _ _ = set_current_cell (I,J) Index: Makefile =================================================================== RCS file: /cvsroot/q-lang/qcalc/Makefile,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Makefile 15 Nov 2007 00:10:35 -0000 1.12 --- Makefile 24 Nov 2007 10:22:50 -0000 1.13 *************** *** 15,19 **** appdir = $(pkgdatadir)/apps/$(app) ! PIXMAPS = pixmaps/qcalc.png pixmaps/flag.png pixmaps/1rightarrow.png pixmaps/1rightarrow-green.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 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 |