浏览代码

Add files via upload

Dan Nuggetsman 3 月之前
父节点
当前提交
a5cacbb371
共有 5 个文件被更改,包括 22 次插入17 次删除
  1. 1 1
      edit.tcl
  2. 9 9
      file.tcl
  3. 1 1
      menu.tcl
  4. 8 3
      radxide.tcl
  5. 3 3
      tree.tcl

+ 1 - 1
edit.tcl

@@ -317,7 +317,7 @@ namespace eval edit {
     
     namespace upvar ::radxide dan dan
     
-    tk_messageBox -title $dan(TITLE) -icon info -message "Please check 'radxide.tcl' to customize any variable."   
+    tk_messageBox -title $dan(TITLE) -icon info -message "Please check 'radxide.tcl' to customize any variable." -parent $dan(WIN)  
 	}
 
 # ________________________ UnIndent _________________________ #

+ 9 - 9
file.tcl

@@ -148,14 +148,14 @@ namespace eval file {
 				{{Project Files}    {.radx}       }
 				{{All Files}        *             }
 		}
-		set oriprojectpath [tk_getSaveFile -initialdir $dan(WORKDIR) -filetypes $types]
+		set oriprojectpath [tk_getSaveFile -initialdir $dan(WORKDIR) -filetypes $types -parent $dan(WIN)]
 
 		if {$oriprojectpath ne ""} {
 		
 		  # Check: Parent path must equal to Working Dir..
 		  if {[string range $oriprojectpath 0 [expr [string last "/" $oriprojectpath]-1]] ne $dan(WORKDIR)} {
 			
-        tk_messageBox -title $dan(TITLE) -icon error -message "Project must be inside the Working Dir!"			
+        tk_messageBox -title $dan(TITLE) -icon error -message "Project must be inside the Working Dir!"	-parent $dan(WIN)		
 			  return
 			  
 			}
@@ -177,7 +177,7 @@ namespace eval file {
 		  # Check: Project existance..
 		  if {[file exists $oriprojectpath] || [file exists $project(PATH)]} {
 			
-        tk_messageBox -title $dan(TITLE) -icon error -message "Project already exists!"			
+        tk_messageBox -title $dan(TITLE) -icon error -message "Project already exists!"	-parent $dan(WIN)		
 			  return
 			  
 			}
@@ -218,14 +218,14 @@ namespace eval file {
 				{{Project Files}    {.radx}       }
 				{{All Files}        *             }
 		}
-		set oriprojectpath [tk_getOpenFile -initialdir $dan(WORKDIR) -filetypes $types]
+		set oriprojectpath [tk_getOpenFile -initialdir $dan(WORKDIR) -filetypes $types -parent $dan(WIN)]
 
 		if {$oriprojectpath ne ""} {
 		
 		  # Check: Parent path must equal to Working Dir..
 		  if {[string range $oriprojectpath 0 [expr [string last "/" $oriprojectpath]-1]] ne $dan(WORKDIR)} {
 			
-        tk_messageBox -title $dan(TITLE) -icon error -message "Project must be inside the Working Dir!"			
+        tk_messageBox -title $dan(TITLE) -icon error -message "Project must be inside the Working Dir!"	-parent $dan(WIN)	
 			  return
 			  
 			}
@@ -244,7 +244,7 @@ namespace eval file {
 			#project_root=/home/pocahontas/.radxwork/Pippo
 			
 			if [catch {open $oriprojectpath} in] {
-	      tk_messageBox -title $dan(TITLE) -icon error -message "Cannot open $projectname."
+	      tk_messageBox -title $dan(TITLE) -icon error -message "Cannot open $projectname." -parent $dan(WIN)
       	return
       }   
       set project(ROOT) ""
@@ -303,14 +303,14 @@ namespace eval file {
 										{{INC Files}        {.inc}        }
 										{{All Files}        *             }
 								}
-								set orifilepath [tk_getSaveFile -initialdir $initialdir -initialfile $initialfile -filetypes $types -defaultextension .php]
+								set orifilepath [tk_getSaveFile -initialdir $initialdir -initialfile $initialfile -filetypes $types -defaultextension .php -parent $dan(WIN).fra]
 								
 								if {$orifilepath eq ""} {return}
 								
 								# Check: Parent path must equal to Working Dir..
 								if {([string first $project(ROOT)/Private $orifilepath] eq -1) && ([string first $project(ROOT)/Public $orifilepath] eq -1)} {
 								
-			      tk_messageBox -title $dan(TITLE) -icon error -message "File must be saved inside a valid destination in the Working Dir ($project(ROOT)) !"			
+			      tk_messageBox -title $dan(TITLE) -icon error -message "File must be saved inside a valid destination in the Working Dir ($project(ROOT)) !"	-parent $dan(WIN).fr		
 										return
 								}			
 			
@@ -325,7 +325,7 @@ namespace eval file {
 		  set stxt [string trim [$t get 1.0 end]]
 	    
 	   if {![file writable $fname]} { 
-      tk_messageBox -title $dan(TITLE) -icon error -message "File not writable!"			
+      tk_messageBox -title $dan(TITLE) -icon error -message "File not writable!" -parent $dan(WIN)			
 	   } else {
   		   ::radxide::filelib::saveFile $fname $stxt
   		    }

+ 1 - 1
menu.tcl

@@ -64,7 +64,7 @@ namespace eval menu {
 		$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 $version\n\n\nMIT Licence.\n\n\nCopyright (c) 5 Mode\n\nThis software is provided AS-IS.\n\nAuthors:\n2023-2024 RADXIDE, Daniele Bonini\n2021-2023 Alited, Alex Plotnikov\n2018-2021 Tcler's Wiki\n\nhttps://5mode.com\n\n___________________________________\n\nWork dir:\n$dan(WORKDIR)\n\nOS: $os\n\n\n"}
+		$m3 add command -label About -command { tk_messageBox -title $dan(TITLE) -icon info -message "\n\nRADXIDE ver $version\n\n\nMIT Licence.\n\n\nCopyright (c) 5 Mode\n\nThis software is provided AS-IS.\n\nAuthors:\n2023-2024 RADXIDE, Daniele Bonini\n2021-2023 Alited, Alex Plotnikov\n2018-2021 Tcler's Wiki\n\nhttps://5mode.com\n\n___________________________________\n\nWork dir:\n$dan(WORKDIR)\n\nOS: $os\n\n\n" -parent $dan(WIN)}
     return $m
 	}
 

+ 8 - 3
radxide.tcl

@@ -28,7 +28,7 @@
 #
 ###########################################################
 
-set version "1.5.6" 
+set version "1.5.8" 
 set os "$::tcl_platform(os) $::tcl_platform(osVersion)"
 
 package provide radxide $version
@@ -67,6 +67,8 @@ namespace eval radxide {
      exit 0
   }   
   
+  # To restore at deployment time..
+  #
   set dan(WORKDIR) "$userhome/.radxwork"  ;# working dir
   
   # Check workdir existance..
@@ -217,9 +219,12 @@ namespace eval radxide {
     #   res - result of running of main window
     #   ask - if "yes", requests the confirmation of the exit
     
+    namespace upvar ::radxide dan dan
+
     set answer [tk_messageBox -message "Really quit RADXIDE?" \
         -icon question -type yesno \
-        -detail "Select \"Yes\" to make the application exit"]
+        -detail "Select \"Yes\" to make the application exit" \
+        -parent $dan(WIN)]
         
     switch -- $answer {
        yes exit 0
@@ -285,7 +290,7 @@ if {[catch {set res [radxide::main::_run]} err]} {
   set msg "\nERROR in radxide:"
   puts \n$msg\n\n$::errorInfo\n
   set msg "$msg\n\n$err\n\nPlease, inform authors.\nDetails are in stdout."
-  tk_messageBox -title $dan(TITLE) -icon error -message $msg
+  tk_messageBox -title $dan(TITLE) -icon error -message $msg -parent $dan(WIN)
   exit 2
 }
 

+ 3 - 3
tree.tcl

@@ -720,13 +720,13 @@ namespace eval tree {
 		lassign [$tree item $ID -values] -> fname isfile
 		if {![file exists $fname]} {
 		
-				tk_messageBox -title $dan(TITLE) -icon error -message "File doesn't exist!"
+				tk_messageBox -title $dan(TITLE) -icon error -message "File doesn't exist!" -parent $dan(WIN)
 	  	return		
 	  	
 	 }	 else {
 		
 		 	if {[file size $fname] > $dan(MAXFILESIZE)} {
-				  tk_messageBox -title $dan(TITLE) -icon error -message "File exceed MAXFILESIZE=$dan(MAXFILESIZE)"
+				  tk_messageBox -title $dan(TITLE) -icon error -message "File exceed MAXFILESIZE=$dan(MAXFILESIZE)" -parent $dan(WIN)
 	  			return
 				 }
 		
@@ -761,7 +761,7 @@ namespace eval tree {
 							  
 					 # after idle {alited::bar::BAR draw; alited::tree::UpdateFileTree}
 				 } else {	 
- 			  tk_messageBox -title $dan(TITLE) -icon error -message "File is binary or a folder!"
+ 			  tk_messageBox -title $dan(TITLE) -icon error -message "File is binary or a folder!" -parent $dan(WIN)
 	  			return
 				 }
 		 }