[PD-cvs] SF.net SVN: pure-data:[10702] branches/pd-devel/0.41.4/src

eighthave at users.sourceforge.net eighthave at users.sourceforge.net
Sat Jan 31 17:26:44 CET 2009


Revision: 10702
          http://pure-data.svn.sourceforge.net/pure-data/?rev=10702&view=rev
Author:   eighthave
Date:     2009-01-31 16:26:44 +0000 (Sat, 31 Jan 2009)

Log Message:
-----------
- more locale tweaks and some example code for getting langauge code from the
  registry on windows

- find panel sketch

Modified Paths:
--------------
    branches/pd-devel/0.41.4/src/pd.tk
    branches/pd-devel/0.41.4/src/pd_menucommands.tcl

Modified: branches/pd-devel/0.41.4/src/pd.tk
===================================================================
--- branches/pd-devel/0.41.4/src/pd.tk	2009-01-31 03:55:42 UTC (rev 10701)
+++ branches/pd-devel/0.41.4/src/pd.tk	2009-01-31 16:26:44 UTC (rev 10702)
@@ -147,6 +147,16 @@
 
 proc load_locale {} {
 	::msgcat::mcload [file join [file dirname [info script]] locale]
+
+	# for Windows
+	#set locale "en"  ;# Use whatever is right for your app
+	#if {[catch {package require registry}]} {
+	#		tk_messageBox -icon error -message "Could not get locale from registry"
+	#} else {
+	#	set locale [string tolower \
+	#		[string range \
+	#		[registry get {HKEY_CURRENT_USER\Control Panel\International} sLanguage] 0 1] ]
+	#}
 }
 
 # this proc gets the internal font name associated with each size

Modified: branches/pd-devel/0.41.4/src/pd_menucommands.tcl
===================================================================
--- branches/pd-devel/0.41.4/src/pd_menucommands.tcl	2009-01-31 03:55:42 UTC (rev 10701)
+++ branches/pd-devel/0.41.4/src/pd_menucommands.tcl	2009-01-31 16:26:44 UTC (rev 10702)
@@ -49,30 +49,51 @@
 # various panels
 
 proc ::pd_menucommands::menu_message_panel {} {
-	if {[winfo exists .message]} {
+	if {[winfo exists .send_message]} {
+		wm deiconify .send_message
 		raise .message
 	} else {
 		# TODO insert real message panel here
-		toplevel .message
-		wm title .message "Message..."
-		::pd_bindings::panel_bindings .message
-		frame .message.frame
-		label .message.label -text "message" -width 30 -height 15
-		pack .message.label .message.frame -side top -expand yes -fill both
+		toplevel .send_message
+		wm title .send_message [_ "Send Message..."]
+		wm resizable .send_message 0 0
+		::pd_bindings::panel_bindings .send_message "send_message"
+		frame .send_message.frame
+		label .send_message.label -text "message" -width 30 -height 15
+		pack .send_message.label .send_message.frame -side top -expand yes -fill both
 	}
 }
 
 proc ::pd_menucommands::menu_find_panel {mytoplevel} {
 	if {[winfo exists .find]} {
+		wm deiconify .find
 		raise .find
 	} else {
 		# TODO insert real find panel here
 		toplevel .find
-		wm title .find "Find..."
-		::pd_bindings::panel_bindings .find
-		frame .find.frame
-		label .find.label -text "find" -width 30 -height 15
-		pack .find.label .find.frame -side top -expand yes -fill both
+		wm title .find [_ "Find"]
+		wm geometry .find =475x125+150+150
+		wm resizable .find 0 0
+		if {[catch {wm attributes .find -topmost}]} {puts stderr ".find -topmost failed"}
+		. config -bg green
+		::pd_bindings::panel_bindings .find "find"
+
+		label .find.label -text [_ "Search for:"]
+		entry .find.entry -width 54 -font 18 -textvariable find_string \
+			-highlightthickness 2 -highlightcolor blue -relief sunken
+		focus .find.entry
+		pack .find.label .find.entry -side top -padx 10
+
+		frame .find.buttonframe -background yellow
+		button .find.button -text [_ "Find"] -default active -width 9 \
+			-command "find_ok $mytoplevel"
+		if {$::windowingsystem eq "x11"} {
+			button .find.close -text [_ "Close"] -default normal -width 9 \
+				-command "find_cancel $mytoplevel"
+			pack .find.buttonframe .find.button .find.close -side right -padx 10 -pady 15
+		} else {
+			pack .find.buttonframe .find.button -side right -padx 10 -pady 15
+		}
 	}
 	# TODO this panel should probably receive <FocusIn> events so that it will
 	# find in which ever window has focus then "OK' is clicked.  It will need
@@ -82,12 +103,13 @@
 
 proc ::pd_menucommands::menu_font_panel {mytoplevel} {
 	if {[winfo exists .font]} {
+		wm deiconify .font
 		raise .font
 	} else {
 		# TODO insert real preference panel here
 		toplevel .font
-		wm title .font "Font"
-		::pd_bindings::panel_bindings .font
+		wm title .font [_ "Font"]
+		::pd_bindings::panel_bindings .font "font"
 		frame .font.frame
 		label .font.label -text "font" -width 30 -height 15
 		pack .font.label .font.frame -side top -expand yes -fill both
@@ -100,8 +122,8 @@
 	} else {
 		# TODO insert real preference panel here
 		toplevel .preferences
-		wm title .preferences "Preferences"
-		::pd_bindings::panel_bindings .preferences
+		wm title .preferences [_ "Preferences"]
+		::pd_bindings::panel_bindings .preferences "preferences"
 		frame .preferences.frame
 		label .preferences.label -text "preferences" -width 30 -height 15
 		pack .preferences.label .preferences.frame -side top -expand yes -fill both


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Pd-cvs mailing list