[q-lang-cvs] qcalc qcalc.q,1.186,1.187
Brought to you by:
agraef
From: Albert G. <ag...@us...> - 2007-11-25 13:26:52
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1217 Modified Files: qcalc.q Log Message: add separate statusbar widget for line number display Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.186 retrieving revision 1.187 diff -C2 -d -r1.186 -r1.187 *** qcalc.q 25 Nov 2007 12:55:38 -0000 1.186 --- qcalc.q 25 Nov 2007 13:26:48 -0000 1.187 *************** *** 199,204 **** ()], 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 --- 199,209 ---- ()], TASKPM = [TASKB,TASKA], + // line number indicator in the status bar + LSTAT = qt_new "QLabel" (sprintf "L %d" 1,nil), + _ = qt LSTAT "setMinimumWidth" $ text_width LSTAT "L 9999" || + qt STATUS "addWidget" (LSTAT,0,true), // 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 *************** *** 334,337 **** --- 339,344 ---- /* Helper functions for string manipulation. */ + text_width W S = qt FM "width" S where FM = qt W "fontMetrics" (); + special regsub ~OPTS ~REGEX ~S EXPR; regsub OPTS REGEX S EXPR *************** *** 598,605 **** where G = get GLOBAL; ! /* Set or unset the "locked" indicator in the status line. */ ! mode_indicator B ! = qt ROSTAT "setPixmap" (if B then LOCKED else UNLOCKED); /* Status updates of task buttons. Process events so that the arrow indicator --- 605,615 ---- where G = get GLOBAL; ! /* Set the line number indicator. */ ! linemsg N = qt LSTAT "setText" $ sprintf "L %d" N; ! ! /* Set or unset the "locked" indicator. */ ! ! modemsg B = qt ROSTAT "setPixmap" (if B then LOCKED else UNLOCKED); /* Status updates of task buttons. Process events so that the arrow indicator *************** *** 1316,1321 **** if qt TABW "currentPageIndex" () = 0: = qt TABLE "setReadOnly" false || ! mode_indicator false || ! fail // falls through if qt TABLE "isReadOnly" (); = // nuke the current cell --- 1326,1330 ---- if qt TABW "currentPageIndex" () = 0: = qt TABLE "setReadOnly" false || ! modemsg false || fail // falls through if qt TABLE "isReadOnly" (); = // nuke the current cell *************** *** 1335,1340 **** if qt TABW "currentPageIndex" () = 0: = qt TABLE "setReadOnly" false || ! mode_indicator false || ! fail // falls through if qt TABLE "isReadOnly" (); = if not qt TABLE "isEditing" () then --- 1344,1348 ---- if qt TABW "currentPageIndex" () = 0: = qt TABLE "setReadOnly" false || ! modemsg false || fail // falls through if qt TABLE "isReadOnly" (); = if not qt TABLE "isEditing" () then *************** *** 1375,1380 **** if not is_gui_elem (I,J) and then qt TABLE "isEditing" (); ! = qt TABLE "setReadOnly" RO || ! mode_indicator RO || qt TABLE "setFocus" () where RO = not qt TABLE "isReadOnly" () --- 1383,1387 ---- if not is_gui_elem (I,J) and then qt TABLE "isEditing" (); ! = qt TABLE "setReadOnly" RO || modemsg RO || qt TABLE "setFocus" () where RO = not qt TABLE "isReadOnly" () *************** *** 1442,1446 **** linenumbermsg _ _ N ! = statusmsg $ sprintf "Line %d" (N+1); /* More script editor operations. */ --- 1449,1453 ---- linenumbermsg _ _ N ! = linemsg (N+1); /* More script editor operations. */ |