Browse Source

Add files via upload

Capitan Cloud 1 year ago
parent
commit
f12c1c1233
4 changed files with 48 additions and 21 deletions
  1. 25 10
      edit.tcl
  2. 7 7
      menu.tcl
  3. 1 1
      radxide.tcl
  4. 15 3
      win.tcl

+ 25 - 10
edit.tcl

@@ -65,7 +65,7 @@ namespace eval edit {
 
 		  #tk_messageBox -title $dan(TITLE) -icon info -message "Go To Line"
 		  
-		  set args "-buttons {butSearch SEARCH ::radxide::win::GotoLineOK butCANCEL CANCEL ::radxide::win::GotoLineCancel}"
+		  set args "-buttons {butGo GO ::radxide::win::GotoLineOK butCANCEL CANCEL ::radxide::win::GotoLineCancel}"
 		     
 		  catch {lassign [::radxide::win::input "GotoLine" {} "Go to Line" [list \
 		    ent "{} {} {-w 28}" "{$ln}"] \
@@ -75,29 +75,44 @@ namespace eval edit {
 	
 # ________________________ makeCopy _________________________ #
 
-	proc makeCopy {win} {
-    # Copy from the textPane to the clipboard
+	proc makeCopy {} {
+    # Copy from the editor to the clipboard
     #clipboard clear
     #clipboard append $txt
-    tk_textCopy $win
+    
+    namespace upvar ::radxide dan dan
+    
+    set t $dan(TEXT)
+    
+    tk_textCopy $t
 	}
 
 #_________________________ makeCut ________________________ #
 
-	proc makeCut {win} {
-    # Cut from the textPane to the clipboard
+	proc makeCut {} {
+    # Cut from the editor to the clipboard
     #set canvas %W
     #eval [clipboard get -type TkCanvasItem]
-    tk_textCut $win    
+
+    namespace upvar ::radxide dan dan
+    
+    set t $dan(TEXT)
+    
+    tk_textCut $t
 	}
 	
 #_________________________ makePaste ________________________ #
 
-	proc makePaste {win} {
-    # Paste from the clipboard to the textPane
+	proc makePaste {} {
+    # Paste from the clipboard to the editor
     #set canvas %W
     #eval [clipboard get -type TkCanvasItem]
-    tk_textPaste $win    
+    
+    namespace upvar ::radxide dan dan
+    
+    set t $dan(TEXT)
+    
+    tk_textPaste $t    
 	}
 
 #_________________________ setup ________________________ #

+ 7 - 7
menu.tcl

@@ -59,16 +59,16 @@ namespace eval menu {
 		set m2 [menu $m.edit -tearoff 0]
 		set menu(EDIT) $m2
 		$m add cascade -label Help -menu $m.help
-		$m2 add command -label Copy -command { ::radxide::menu::edit::makeCopy .danwin.fra.text }  -accelerator Ctrl+C -state disabled
-		$m2 add command -label Paste -command { ::radxide::menu::edit::makePaste .danwin.fra.text } -accelerator Ctrl+P -state disabled
-		$m2 add command -label Cut -command { ::radxide::menu::edit::makeCut .danwin.fra.text } -accelerator Ctrl+X -state disabled
+		$m2 add command -label Copy -command { ::radxide::menu::edit::makeCopy }  -accelerator Ctrl+C -state disabled
+		$m2 add command -label Paste -command { ::radxide::menu::edit::makePaste } -accelerator Ctrl+P -state disabled
+		$m2 add command -label Cut -command { ::radxide::menu::edit::makeCut } -accelerator Ctrl+X -state disabled
 		$m2 add separator
 		$m2 add command -label Find -command { ::radxide::menu::edit::find } -accelerator Ctrl+F -state disabled
 		$m2 add command -label "Go to Line" -command { ::radxide::menu::edit::GotoLine } -accelerator Ctrl+G -state disabled
 		$m2 add separator
 		$m2 add command -label Options -command { ::radxide::menu::edit::setup } 
 		set m3 [menu $m.help -tearoff 0]
-		$m3 add command -label About -command { tk_messageBox -title $dan(TITLE) -icon info -message "\n\nRADXIDE ver 1.1.4\n\n\nMIT Licence.\n\n\nCopyrights (c) 2023-2024 5 Mode http://5mode.com\n\nThe software is provided AS-IS.\n\nAuthors:\n2023-2024 RADXIDE, Daniele Bonini\n2021-2023 Alited, Alex Plotnikov\n\n\n"}
+		$m3 add command -label About -command { tk_messageBox -title $dan(TITLE) -icon info -message "\n\nRADXIDE ver 1.1.5\n\n\nMIT Licence.\n\n\nCopyright (c) 5 Mode\n\nThe software is provided AS-IS.\n\nAuthors:\n2023-2024 RADXIDE, Daniele Bonini\n2021-2023 Alited, Alex Plotnikov\n\nhttps://5mode.com\n\n\n"}
     return $m
 	}
 
@@ -82,9 +82,9 @@ namespace eval menu {
  	  bind $ctrl "<Control-o>" { ::radxide::menu::file::openProject }
  	  bind $ctrl "<Control-Alt-x>" { ::radxide::menu::file::closeProject }
  	  bind $ctrl "<Control-q>" { ::radxide::menu::file::quit }
- 	  bind $ctrl "<Control-c>" "::radxide::menu::edit::makeCopy $ctrl"
- 	  bind $ctrl "<Control-p>" "::radxide::menu::edit::makePaste $ctrl"
- 	  bind $ctrl "<Control-x>" "::radxide::menu::edit::makeCut $ctrl"
+ 	  bind $ctrl "<Control-c>" "::radxide::menu::edit::makeCopy"
+ 	  bind $ctrl "<Control-p>" "::radxide::menu::edit::makePaste"
+ 	  bind $ctrl "<Control-x>" "::radxide::menu::edit::makeCut"
  	  bind $ctrl "<Control-f>" "::radxide::menu::edit::find"
 		bind $ctrl "<Control-g>" "::radxide::menu::edit::GotoLine"
 		

+ 1 - 1
radxide.tcl

@@ -28,7 +28,7 @@
 #
 ###########################################################
 
-package provide radxide 1.1.4
+package provide radxide 1.1.5
 
 set _ [package require Tk]
 wm withdraw .

+ 15 - 3
win.tcl

@@ -51,7 +51,8 @@ namespace eval win {
 #  set data(docheck) yes 
   set Foundstr {}   ;# current found string
   set HLstring {}   ;# current selected string
-        
+  set Widgetopts [list]
+  
   set _Defaults [dict create \
     bts {{} {}} \
     but {{} {}} \
@@ -685,10 +686,12 @@ namespace eval win {
     #   varopt - a variable option
     # The *varopt* refers to a variable part such as tvar, lvar:
     #  * -inpval option means an initial value of the field
-    #  * -retpos option has p1:p2 format (e.g. 0:10) to cut a substring \
-    from a returned value
+    #  * -retpos option has p1:p2 format (e.g. 0:10) to cut a substring from a returned value
     # Returns *attrs* without -inpval and -retpos options.
 
+    # xxx
+    variable Widgetopts
+
     lassign [parseOptions $attrs $varopt {} -retpos {} -inpval {}] \
       vn rp iv
     if {[string first {-state disabled} $attrs]<0 && $vn ne {}} {
@@ -734,6 +737,10 @@ namespace eval win {
   ; proc contFCO {fline opts edge args} {
       # Given a file's line and options,
       # cuts a substring from the line.
+      
+      # xxx
+      variable Widgetopts
+      
       lassign [parseOptionsFile 1 $opts {*}$args] opts
       lassign $opts - - - div1 - div2 - pos - len - RE - ret
       set ldv1 [string length $div1]
@@ -1125,6 +1132,9 @@ namespace eval win {
     # Makes output values for some widgets (lbx, fco).
     # Some i/o widgets need a special method to get their returned values.
 
+    # xxx
+    variable Widgetopts
+
     foreach aop $Widgetopts {
       lassign $aop optnam vn v1 v2
       switch -glob -- $optnam {
@@ -1429,6 +1439,8 @@ namespace eval win {
     # Initializes input and clears variables made in previous session.
 
     variable _savedvv
+    # xxx   
+    variable Widgetopts
 
     foreach {vn vv} $_savedvv {
       catch {unset $vn}