diff options
Diffstat (limited to 'lib/environment.tcl')
-rw-r--r--[-rwxr-xr-x] | lib/environment.tcl | 941 |
1 files changed, 613 insertions, 328 deletions
diff --git a/lib/environment.tcl b/lib/environment.tcl index 33af4a3..c64f41b 100755..100644 --- a/lib/environment.tcl +++ b/lib/environment.tcl @@ -2,7 +2,7 @@ # Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) ############################################################################ -# Copyright (C) 2007-2009 by Martin Ošmera # +# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # # This program is free software; you can redistribute it and#or modify # @@ -21,6 +21,11 @@ # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # ############################################################################ +# >>> File inclusion guard +if { ! [ info exists _ENVIRONMENT_TCL ] } { +set _ENVIRONMENT_TCL _ +# <<< File inclusion guard + # -------------------------------------------------------------------------- # DESCRIPTION # * Defines some settings and procedures @@ -40,6 +45,15 @@ if {![X::restore_session]} { set show_welcome_dialog 1 } +# Restore spell checker configuration from the last session +if {${::PROGRAM_AVAILABLE(hunspell)}} { + set ::Editor::spellchecker_enabled ${::CONFIG(SPELL_CHECK_ENABLED)} + set ::Editor::spellchecker_dictionary ${::CONFIG(SPELL_CHECK_DICTIONARY)} +} else { + set ::Editor::spellchecker_enabled 0 + set ::Editor::spellchecker_dictionary {} +} + # Some key shortcuts for main window bind . <Control-Key-1> {manipulate_panel {sim} ; break} bind . <Control-Key-2> {manipulate_panel {graph} ; break} @@ -62,6 +76,7 @@ bind . <Control-Key-0> {manipulate_panel {sub} ; break} # General widget bindings bind Menu <Button> {+catch {%W configure -cursor left_ptr}} +bind Text <ButtonPress-1> {+focus %W} bind Text <Control-d> {} bind Text <Control-b> {} bind Text <Control-a> {} @@ -74,6 +89,7 @@ bind Text <KP_Enter> "[bind Text <Return>]; break" bind Text <Control-Key-z> {catch {%W edit undo}; break} bind Text <Control-Key-Z> {catch {%W edit redo}; break} bind Text <Control-Key-c> {tk_textCopy %W; break} +bind Text <Control-Key-C> {tk_textCopy %W; break} bind Text <Control-Key-x> {tk_textCut %W; break} bind Text <Control-Key-v> { catch { @@ -104,19 +120,25 @@ bind Entry <Control-Key-a> {%W selection range 0 end; break} bind TEntry <Control-Key-a> {%W selection range 0 end; break} # Dynamic help (Bwidget) -DynamicHelp::configure -font [font create -size -14 -family {helvetica}] -delay 500 -background {#FFFFDD} +DynamicHelp::configure -font [font create -size [expr {int(-14 * $::font_size_factor)}] -family {helvetica}] -delay 500 -background {#FFFFDD} # General purpose fonts set smallfont_color {#5599DD} -set smallfont [font create -size -10 -family {helvetica} -weight normal] -set smallfont_bold [font create -size -10 -family {helvetica} -weight bold] +set smallfont [font create -size [expr {int(-10 * $::font_size_factor)}] -family {helvetica} -weight normal] +set smallfont_bold [font create -size [expr {int(-10 * $::font_size_factor)}] -family {helvetica} -weight bold] # LOAD PROGRAM ICONS # ----------------------------- -foreach directory {16x16 22x22 32x32} ns {16 22 32} { +foreach directory {16x16 22x22 32x32 flag} ns {16 22 32 flag} { namespace eval ::ICONS::${ns} {} - foreach filename [glob "${::LIB_DIRNAME}/../icons/${directory}/*.png"] { - set filename [file normalize $filename] + if {!$::MICROSOFT_WINDOWS} { + # Use glob + set list_of_icons [glob "${::ROOT_DIRNAME}/icons/${directory}/*.png"] + } else { + # Use ZIP Virtual File System (freeWrap) + set list_of_icons [zvfs::list "${::ROOT_DIRNAME}/icons/${directory}/*.png"] + } + foreach filename $list_of_icons { set iconname [file tail $filename] regexp {^\w+} $iconname iconname if {[catch { @@ -134,45 +156,55 @@ tk appname "mcu8051ide" wm command . "mcu8051ide $argv" wm client . [info hostname] tk scaling 1.0 -tk_setPalette \ - activeBackground {#EEEEEE} \ - foreground {#000000} \ - selectColor {#FFFFFF} \ - activeForeground {#0000DD} \ - highlightBackground {#EEEEEE} \ - selectBackground {#9999BB} \ - background {#EEEEEE} \ - highlightColor {#000000} \ - selectForeground {#FFFFFF} \ - disabledForeground {#888888} \ - insertBackground {#000000} \ - troughColor {#EEEEEE} +tk_setPalette \ + activeBackground ${::COMMON_BG_COLOR} \ + foreground {#000000} \ + selectColor {#FFFFFF} \ + activeForeground {#0000DD} \ + highlightBackground ${::COMMON_BG_COLOR} \ + selectBackground {#9999BB} \ + background ${::COMMON_BG_COLOR} \ + highlightColor {#000000} \ + selectForeground {#FFFFFF} \ + disabledForeground {#888888} \ + insertBackground {#000000} \ + troughColor ${::COMMON_BG_COLOR} wm title . "MCU 8051 IDE" wm state . normal +wm minsize . 640 480 wm geometry . $::CONFIG(WINDOW_GEOMETRY) -if {!$::MICROSOFT_WINDOWS} { - # There is no such thing on Windows OS - wm attributes . -zoomed $::CONFIG(WINDOW_ZOOMED) +if {$::CONFIG(WINDOW_ZOOMED)} { + if {!$::MICROSOFT_WINDOWS} { + wm attributes . -zoomed $::CONFIG(WINDOW_ZOOMED) + } else { + wm state . zoomed + + # Without this help windows won't work properly on MS Windows + after idle { + update + wm geometry . [wm geometry .] + } + } } wm protocol . WM_DELETE_WINDOW {::X::__exit} wm iconphoto . ::ICONS::16::mcu8051ide -. configure -bg {#EEEEEE} +. configure -bg ${::COMMON_BG_COLOR} # Dynamic Data Exchange on Microsoft Windows if {$::MICROSOFT_WINDOWS} { dde servername -force -- [tk appname] } -ttk::style theme use clam +ttk::style theme use ${::GLOBAL_CONFIG(wstyle)} # - ttk set TTK_COMMON_BG {#E0E0E0} ttk::style configure TFrame \ - -background {#EEEEEE} + -background ${::COMMON_BG_COLOR} ttk::style configure TNotebook \ - -background {#EEEEEE} \ + -background ${::COMMON_BG_COLOR} \ -fieldbackground {red} ttk::style map TNotebook \ -background [list \ @@ -181,8 +213,8 @@ ttk::style map TNotebook \ pressed green \ ] -font configure TkTextFont -family {helvetica} -size -12 -weight {normal} -font configure TkDefaultFont -family {helvetica} -size -12 -weight {normal} +font configure TkTextFont -family {helvetica} -size [expr {int(-12 * $::font_size_factor)}] -weight {normal} +font configure TkDefaultFont -family {helvetica} -size [expr {int(-12 * $::font_size_factor)}] -weight {normal} ttk::style configure StringNotFound.TEntry \ -fieldbackground {#FFDDDD} @@ -229,15 +261,16 @@ ttk::style map Simulator_watchdogEntry_2.TEntry \ -foreground [list readonly {#888888}] ttk::style configure TLabelframe \ - -background {#EEEEEE} + -background ${::COMMON_BG_COLOR} ttk::style configure TLabel \ - -background {#EEEEEE} + -background ${::COMMON_BG_COLOR} ttk::style configure TButton \ -background $TTK_COMMON_BG \ -padding 0 ttk::style configure RedBg.TButton \ - -padding 0 + -padding 0 \ + -font [font create -family $::DEFAULT_FIXED_FONT -size -12 -weight {normal}] ttk::style map RedBg.TButton \ -background [list \ active {#FFBBBB} \ @@ -248,7 +281,8 @@ ttk::style map RedBg.TButton \ !active {#000000} \ ] ttk::style configure GreenBg.TButton \ - -padding 0 + -padding 0 \ + -font [font create -family $::DEFAULT_FIXED_FONT -size -12 -weight {normal}] ttk::style map GreenBg.TButton \ -background [list \ active {#BBFFBB} \ @@ -259,26 +293,26 @@ ttk::style map GreenBg.TButton \ !active {#000000} \ ] -ttk::style configure Flat.TButton \ - -background {#EEEEEE} \ - -padding 0 \ - -borderwidth 1 \ +ttk::style configure Flat.TButton \ + -background ${::COMMON_BG_COLOR} \ + -padding 0 \ + -borderwidth 1 \ -relief flat ttk::style map Flat.TButton \ -relief [list active raised] \ - -background [list disabled {#EEEEEE}] + -background [list disabled ${::COMMON_BG_COLOR}] ttk::style configure TMenubutton \ -padding 0 \ -background $TTK_COMMON_BG ttk::style configure Flat.TMenubutton \ -padding 0 \ - -background {#EEEEEE} \ + -background ${::COMMON_BG_COLOR}\ -borderwidth 1 \ -relief flat ttk::style map Flat.TMenubutton \ -relief [list active raised] \ - -background [list disabled {#EEEEEE}] + -background [list disabled ${::COMMON_BG_COLOR}] ttk::style configure FlatWhite.TButton \ -padding 0 \ @@ -290,23 +324,23 @@ ttk::style map FlatWhite.TButton \ -background [list disabled {#FFFFFF}] ttk::style configure ToolButton.TButton \ - -background {#EEEEEE} \ + -background ${::COMMON_BG_COLOR}\ -padding 1 \ -borderwidth 1 \ -relief flat ttk::style map ToolButton.TButton \ -relief [list active raised] \ - -background [list disabled {#EEEEEE}] + -background [list disabled ${::COMMON_BG_COLOR}] ttk::style configure TCombobox \ -background $TTK_COMMON_BG \ - -fieldfont [font create -family {helvetica} -size -12 -weight {normal}] -ttk::style map TCombobox \ - -foreground [list disabled {#888888}] \ - -fieldbackground [list \ - readonly $TTK_COMMON_BG \ - disabled {#EEEEEE} \ - {!readonly !disabled} {#FFFFFF} \ + -fieldfont [font create -family {helvetica} -size [expr {int(-12 * $::font_size_factor)}] -weight {normal}] +ttk::style map TCombobox \ + -foreground [list disabled {#888888}] \ + -fieldbackground [list \ + readonly $TTK_COMMON_BG \ + disabled ${::COMMON_BG_COLOR} \ + {!readonly !disabled} {#FFFFFF} \ ] ttk::style configure TScrollbar \ @@ -322,16 +356,19 @@ ttk::style map TScale \ ] ttk::style configure TProgressbar \ - -background $TTK_COMMON_BG \ - -troughcolor {#F8F8F8} + -background {#CCCCFF} \ + -troughcolor $TTK_COMMON_BG + +ttk::style configure GreenBg.TSpinbox -fieldbackground {#CCFFCC} +ttk::style configure RedBg.TSpinbox -fieldbackground {#FFCCCC} -update idle +update idletasks ## Widget styles # Load images for checkbuttons and radiobuttons foreach i {raoff raon choff chon} { if {[catch { - image create photo ::ICONS::$i -file "${::LIB_DIRNAME}/../icons/other/$i.png" -format png + image create photo ::ICONS::$i -file "${::ROOT_DIRNAME}/icons/other/$i.png" -format png } result]} then { puts stderr {} puts -nonewline stderr $result @@ -339,73 +376,81 @@ foreach i {raoff raon choff chon} { } } # - Menu -option add *Menu.activeForeground {#FFFFFF} userDefault +if {!${::MICROSOFT_WINDOWS}} { + option add *Menu.background {#F8F8F8} userDefault + option add *Menu.relief raised userDefault + option add *Menu.borderWidth 1 userDefault +} else { + option add *Menu.background {#FFFFFF} userDefault + option add *Menu.relief flat userDefault + option add *Menu.borderWidth 0 userDefault +} option add *Menu.activeBackground {#8888DD} userDefault +option add *Menu.activeForeground {#FFFFFF} userDefault +option add *Menu.font [font create -family {helvetica} -size [expr {int(-12 * $::font_size_factor)}] -weight {normal}] userDefault option add *Menu.activeBorderWidth 1 userDefault option add *Menu.cursor left_ptr userDefault option add *Menu.tearOff 0 userDefault -option add *Menu.borderWidth 1 userDefault -option add *Menu.relief raised userDefault -option add *Menu.background {#F8F8F8} userDefault -option add *Menu.font [font create -family {helvetica} -size -12 -weight {normal}] userDefault # - Label option add *Label.highlightThickness 0 userDefault # - Entry option add *Entry.highlightThickness 0 userDefault option add *Entry.BorderWidth 1 userDefault -option add *Entry.font [font create -family {helvetica} -size -12 -weight {normal}] userDefault +option add *Entry.font [font create -family {helvetica} -size [expr {int(-12 * $::font_size_factor)}] -weight {normal}] userDefault # - Text option add *Text.Background {#FFFFFF} userDefault option add *Text.highlightThickness 0 userDefault option add *Text.BorderWidth 1 userDefault option add *Text.Relief sunken userDefault -option add *Text.font [font create -family {helvetica} -size -12 -weight {normal}] userDefault +option add *Text.font [font create -family {helvetica} -size [expr {int(-12 * $::font_size_factor)}] -weight {normal}] userDefault # - Spinbox option add *Spinbox.Background {#FFFFFF} userDefault option add *Spinbox.highlightThickness 0 userDefault +option add *Spinbox.ExportSelection 0 userDefault # - Scrollbar option add *Scrollbar.activeBackground {#8888FF} userDefault option add *Scrollbar.BorderWidth 1 userDefault -option add *Scrollbar.Background {#EEEEEE} userDefault -option add *Scrollbar.troughColor {#EEEEEE} userDefault +option add *Scrollbar.Background ${::COMMON_BG_COLOR} userDefault +option add *Scrollbar.troughColor ${::COMMON_BG_COLOR} userDefault option add *Scrollbar.Relief sunken userDefault option add *Scrollbar.activeRelief raised userDefault option add *Scrollbar.elementBorderWidth 1 userDefault # - Button option add *Button.activeForeground {#0000DD} interactive -option add *Button.font [font create -family {helvetica} -size -12 -weight {normal}] userDefault +option add *Button.font [font create -family {helvetica} -size [expr {int(-12 * $::font_size_factor)}] -weight {normal}] userDefault # - Radiobutton option add *Radiobutton.BorderWidth 0 userDefault option add *Radiobutton.Image ::ICONS::raoff userDefault option add *Radiobutton.SelectImage ::ICONS::raon userDefault -option add *Radiobutton.selectColor {#EEEEEE} userDefault +option add *Radiobutton.selectColor ${::COMMON_BG_COLOR} userDefault option add *Radiobutton.Compound left userDefault option add *Radiobutton.IndicatorOn 0 userDefault -option add *Radiobutton.font [font create -family {helvetica} -size -12 -weight {normal}] userDefault +option add *Radiobutton.font [font create -family {helvetica} -size [expr {int(-12 * $::font_size_factor)}] -weight {normal}] userDefault # - Checkbutton option add *Checkbutton.BorderWidth 0 userDefault option add *Checkbutton.Image ::ICONS::choff userDefault option add *Checkbutton.SelectImage ::ICONS::chon userDefault -option add *Checkbutton.selectColor {#EEEEEE} userDefault +option add *Checkbutton.selectColor ${::COMMON_BG_COLOR} userDefault option add *Checkbutton.Compound left userDefault option add *Checkbutton.IndicatorOn 0 userDefault -option add *Radiobutton.font [font create -family {helvetica} -size -12 -weight {normal}] userDefault +option add *Radiobutton.font [font create -family {helvetica} -size [expr {int(-12 * $::font_size_factor)}] -weight {normal}] userDefault # - Scale option add *Scale.activeBackground {#8888FF} userDefault # - NoteBook -option add *NoteBook.font [font create -family {helvetica} -size -12 -weight {normal}] userDefault -option add *NoteBook.Background {#EEEEEE} userDefault -option add *NoteBook.ActiveBackground {#EEEEEE} userDefault +option add *NoteBook.font [font create -family {helvetica} -size [expr {int(-12 * $::font_size_factor)}] -weight {normal}] userDefault +option add *NoteBook.Background ${::COMMON_BG_COLOR} userDefault +option add *NoteBook.ActiveBackground {#AAAADD} userDefault # - TopLevel and Frame -option add *Toplevel.Background {#EEEEEE} userDefault -option add *Frame.Background {#EEEEEE} userDefault -option add *PagesManager.Background {#EEEEEE} userDefault +option add *Toplevel.Background ${::COMMON_BG_COLOR} userDefault +option add *Frame.Background ${::COMMON_BG_COLOR} userDefault +option add *PagesManager.Background ${::COMMON_BG_COLOR} userDefault # - Others ... -option add *Panedwindow.Background {#EEEEEE} userDefault -option add *Listbox.Background {#EEEEEE} userDefault -option add *Button.Background {#EEEEEE} userDefault -option add *Label.Background {#EEEEEE} userDefault -option add *Canvas.Background {#EEEEEE} userDefault +option add *Panedwindow.Background ${::COMMON_BG_COLOR} userDefault +option add *Listbox.Background ${::COMMON_BG_COLOR} userDefault +option add *Button.Background ${::COMMON_BG_COLOR} userDefault +option add *Label.Background ${::COMMON_BG_COLOR} userDefault +option add *Canvas.Background ${::COMMON_BG_COLOR} userDefault +option add *ComboBox.ExportSelection 0 userDefault # MEMORY CELL HELP WINDOW @@ -441,7 +486,7 @@ proc create_help_window {root val addr} { # Create logical frame structure set ::HELPWINDOW [frame ${root}help_window -bd 0 -bg {#BBBBFF} -padx 2 -pady 2] - pack [frame ${::HELPWINDOW}.top] -fill x -expand 1 + pack [frame ${::HELPWINDOW}.top -bg {#BBBBFF}] -fill x -expand 1 pack [label ${::HELPWINDOW}.top.img -bg {#BBBBFF}] -side left pack [label ${::HELPWINDOW}.top.tit -bg {#BBBBFF}] -side left -fill x -expand 1 pack [frame ${::HELPWINDOW}.msg -bg {#FFFFFF}] -fill both -expand 1 @@ -457,7 +502,7 @@ proc create_help_window {root val addr} { if {[lindex $addr 1] == {BIT}} { set help_window_for_bit 1 create_help_window_bit [lindex $addr 0] - } { + } else { set help_window_for_bit 0 create_help_window_byte $val } @@ -487,7 +532,7 @@ proc create_help_window_bit {addr} { set x0 40 set y0 0 - set y1 11 + set y1 16 # Create 8 bit rectangles in the canvas for {set i 7} {$i >= 0} {incr i -1} { @@ -497,17 +542,18 @@ proc create_help_window_bit {addr} { if {[${::X::actualProject} getBit $bit_addr]} { set fill $::BitMap::one_fill set outline $::BitMap::one_outline - } { + } else { set fill $::BitMap::zero_fill set outline $::BitMap::zero_outline } # Create label for the bit - $canvas create text [expr {$x0 + 6}] $y0 \ - -text $i -anchor n -font $::Simulator_GUI::smallfont \ + $canvas create text [expr {$x0 + 6}] $y0 \ + -text $i \ + -anchor n \ + -font $::Simulator_GUI::smallfont \ -fill $::Simulator_GUI::small_color - # Create bit rectagle set help_window_bit($i) [$canvas create \ rectangle $x0 $y1 \ @@ -536,7 +582,7 @@ proc create_help_window_bit {addr} { # Create arrow pointing to the bit set arr_pos [expr {47 + ((7 - $bit_number) * 14)}] set help_window_bit(A) [$canvas create line \ - 40 45 $arr_pos 45 $arr_pos 24 \ + 40 45 $arr_pos 45 $arr_pos 29 \ -arrow last -fill black \ ] } @@ -561,8 +607,8 @@ proc create_help_window_byte {val} { set dec [NumSystem::hex2dec $val] # Character if {$dec > 31 && $dec < 127} { - set char [subst "\\u00$val"] - } { + set char [subst -nocommands "\\u00$val"] + } else { set char {} } # Binary @@ -703,7 +749,7 @@ proc help_window_update {addr new_value} { if {$help_window_for_bit} { help_window_update_bit [lindex $addr 0] $new_value - } { + } else { help_window_update_byte $addr $new_value } } @@ -725,7 +771,7 @@ proc help_window_update_bit {addr new_value} { if {[${::X::actualProject} getBit $bit_addr]} { set fill $::BitMap::one_fill set outline $::BitMap::one_outline - } { + } else { set fill $::BitMap::zero_fill set outline $::BitMap::zero_outline } @@ -751,8 +797,8 @@ proc help_window_update_byte {addr new_value} { set dec [NumSystem::hex2dec $new_value] # Character if {$dec > 31 && $dec < 127} { - set char [subst "\\u00$new_value"] - } { + set char [subst -nocommands "\\u00$new_value"] + } else { set char {} } # Binary @@ -807,7 +853,7 @@ proc help_window_show {X Y} { # Ensure than help window wont exceed boundaries of the main window if {$help_window_for_bit} { if {$x_coord > ($x_lim - 160)} {incr x_coord -170} - } { + } else { if {$x_coord > ($x_lim - 100)} {incr x_coord -110} } if {$y_coord > ($y_lim - 100)} {incr y_coord -110} @@ -823,31 +869,56 @@ proc help_window_show {X Y} { # GENERAL PURPOSE PROCEDURES # ----------------------------- -## - # +## Create a new toplevel window with a progress bar within + # @parm Widget window_path - Chosen path for the new window + # @parm Widget transient - Parent of the window + # @parm String textvariable - Variable contaning the message + # @parm String text - A string to display as the message in the window + # (meaningful only when no textvariable was specified) + # @parm Int maximum - Maximum value for the progress bar + # @parm String title - Title on the window + # @parm Image iconphoto - Image to display in the window + # (previously created with "image create" command) + # @parm String abort_text - Text to display in the abort button (default: "Abort") + # @parm String abort_command - Command to invoke when abort button is pressed + # (empty string means do not display abort the button) # @return void -proc create_progress_bar {window_path transient textvariable text variable maximum title iconphoto abort_text abort_command} { +proc create_progress_bar {window_path transient textvariable text variable maximum title iconphoto {abort_text {}} {abort_command {}}} { + # Create a new top level windows toplevel $window_path + + # Display the image pack [label $window_path.image \ -image ::ICONS::32::user_away \ ] -side left -anchor n -padx 10 -pady 15 + + # Create and show a frame where other widgets will be shown in pack [frame $window_path.f] -side right -fill both + + # Create widget containing the message if {$textvariable != {}} { pack [label $window_path.f.label \ -textvariable $textvariable \ ] -anchor w -padx 5 -pady 5 - } { + } else { pack [label $window_path.f.label \ -text $text \ ] -anchor w -padx 5 -pady 5 } + + # Create the progress bar widget pack [ttk::progressbar $window_path.f.progressbar \ -mode determinate \ -length 330 \ -maximum $maximum \ -variable $variable \ ] -fill x -padx 5 -pady 5 + + # Create the abort button if {$abort_command != {}} { + if {$abort_text == {}} { + set abort_text [mc "Abort"] + } pack [ttk::button $window_path.f.button \ -compound left \ -image ::ICONS::16::cancel \ @@ -856,9 +927,11 @@ proc create_progress_bar {window_path transient textvariable text variable maxim ] -padx 5 -pady 5 -anchor e } + # Set window parameters wm title $window_path $title wm transient $window_path $transient wm iconphoto $window_path $iconphoto + wm resizable $window_path 0 0 update catch { raise $window_path @@ -896,25 +969,92 @@ proc enc2name {enc} { } } +## Create hyperlink tag in the specifid text widget + # @parm Widget widget - Target + # @return void +set hyperlink_cur_orig {} +proc create_link_tag_in_text_widget {widget} { + $widget tag configure hyperlink_normal -foreground #0055FF -underline 1 + $widget tag configure hyperlink_over -foreground #0055FF -underline 0 + + $widget tag bind hyperlink_normal <Enter> { + set range [%W tag nextrange hyperlink_normal {@%x,%y linestart}] + if {$range != {}} { + set ::hyperlink_cur_orig [%W cget -cursor] + %W tag remove hyperlink_normal [lindex $range 0] [lindex $range 1] + %W tag add hyperlink_over [lindex $range 0] [lindex $range 1] + %W configure -cursor hand2 + } + } + $widget tag bind hyperlink_over <Leave> { + set range [%W tag nextrange hyperlink_over {0.0}] + if {$range != {}} { + %W tag remove hyperlink_over [lindex $range 0] [lindex $range 1] + %W tag add hyperlink_normal [lindex $range 0] [lindex $range 1] + %W configure -cursor $::hyperlink_cur_orig + } + } + $widget tag bind hyperlink_over <Button-1> { + set range [%W tag nextrange hyperlink_over {0.0}] + if {$range != {}} { + set url [%W get [lindex $range 0] [lindex $range 1]] + if {[regexp {[\w\.]+@[\w\.]+} $url]} { + set url "mailto:$url" + } + ::X::open_uri $url + } + } +} + +## Automatically convert all strings beginning with "http://" to hypertext tags + # @parm Widget widget - Target text widget + # @return void +proc convert_all_https_to_links {widget} { + foreach re [list {http://[^\s]+} {[\w\.]+@[\w\.]+}] { + set idx {1.0} + set end {1.0} + set org {1.0} + set s {} + + while {1} { + set org $idx + set idx [$widget search -forwards -regexp -nocase $re $end] + + if {$idx == {} || [$widget compare $org >= $idx]} { + break + } + + if {![regexp $re [$widget get $idx [list $idx lineend]] s]} { + break + } + + set s [string length $s] + set end [$widget index [list $idx + $s c]] + + $widget tag add hyperlink_normal $idx $end + } + } +} + ## Load global configuration # @return void proc loadApplicationConfiguration {} { # Load configuration file if {$::CLI_OPTION(config_file) == {}} { Settings settings ${::CONFIG_DIR} "config.conf" - } { + } else { Settings settings \ [file dirname $::CLI_OPTION(config_file)] \ [file tail $::CLI_OPTION(config_file)] } - # If configuration file is unavaliable -> invoke error message + # If configuration file is unavailable -> invoke error message if {![settings isReady]} { tk_messageBox \ -type ok \ -icon error \ -title [mc "Permission denied"] \ - -message [mc "Unable to save config file"] + -message [mc "Unable to save configuration file"] } # Reset settings to defaults @@ -924,43 +1064,43 @@ proc loadApplicationConfiguration {} { settings clear # Editor configuration - configDialogs::editor::getSettings - configDialogs::editor::save_config + configDialogues::editor::getSettings + configDialogues::editor::save_config # Right panel settings - configDialogs::rightPanel::getSettings - configDialogs::rightPanel::save_config + configDialogues::rightPanel::getSettings + configDialogues::rightPanel::save_config # Compiler configuration - configDialogs::compiler::getSettings - configDialogs::compiler::save_config + configDialogues::compiler::getSettings + configDialogues::compiler::save_config # Main tool bar set ::ICONBAR_CURRENT ${::ICONBAR_DEFAULT} - configDialogs::toolbar::save_config + configDialogues::toolbar::save_config # Custom commands - configDialogs::custom_commands::save_config + configDialogues::custom_commands::save_config # Shortcuts - configDialogs::shortcuts::load_config - configDialogs::shortcuts::getSettings - configDialogs::shortcuts::save_config + configDialogues::shortcuts::load_config + configDialogues::shortcuts::getSettings + configDialogues::shortcuts::save_config # Simulator configuration - configDialogs::simulator::getSettings - configDialogs::simulator::save_config + configDialogues::simulator::getSettings + configDialogues::simulator::save_config # Terminal emulator if {!$::MICROSOFT_WINDOWS} { ;# There is no terminal emulator on Windows - configDialogs::terminal::getSettings - configDialogs::terminal::save_config + configDialogues::terminal::getSettings + configDialogues::terminal::save_config } # Load settings - } { - configDialogs::editor::load_config ;# Editor configuration - configDialogs::rightPanel::load_config ;# Right panel settings - configDialogs::compiler::load_config ;# Compiler configuration - configDialogs::toolbar::load_config ;# Main tool bar - configDialogs::custom_commands::load_config ;# Custom commands - configDialogs::shortcuts::load_config ;# Shortcuts - configDialogs::simulator::load_config ;# Simulator + } else { + configDialogues::editor::load_config ;# Editor configuration + configDialogues::rightPanel::load_config ;# Right panel settings + configDialogues::compiler::load_config ;# Compiler configuration + configDialogues::toolbar::load_config ;# Main tool bar + configDialogues::custom_commands::load_config ;# Custom commands + configDialogues::shortcuts::load_config ;# Shortcuts + configDialogues::simulator::load_config ;# Simulator if {!$::MICROSOFT_WINDOWS} { ;# There is no terminal emulator on Windows - configDialogs::terminal::load_config ;# Terminal emulator + configDialogues::terminal::load_config ;# Terminal emulator } } } @@ -980,62 +1120,62 @@ set false_selection_dis 0 # @parm String what_to_do - ID of tab to activate # @return void proc manipulate_panel {what_to_do} { - if {![llength ${X::openedProjects}] || ${X::actualProject} == {}} { + if {![llength ${::X::openedProjects}] || ${::X::actualProject} == {}} { return } switch -- $what_to_do { {sim} { ;# "Bottom / Simulator" - ${X::actualProject} bottomNB_show_up Simulator + ${::X::actualProject} bottomNB_show_up Simulator } {graph} { ;# "Bottom" / "Graph" - ${X::actualProject} bottomNB_show_up Graph + ${::X::actualProject} bottomNB_show_up Graph } {mess} { ;# "Bottom / Messages" - ${X::actualProject} bottomNB_show_up Messages + ${::X::actualProject} bottomNB_show_up Messages } {todo} { ;# "Bottom / Todo" - ${X::actualProject} bottomNB_show_up Todo + ${::X::actualProject} bottomNB_show_up Todo } {calc} { ;# "Bottom / Calculator" - ${X::actualProject} bottomNB_show_up Calculator + ${::X::actualProject} bottomNB_show_up Calculator } {bsh} { ;# "Bottom / Show_Hide" - ${X::actualProject} bottomNB_show_hide + ${::X::actualProject} bottomNB_show_hide } {book} { ;# "Right / Bookmarks" - ${X::actualProject} rightPanel_show_up Bookmarks + ${::X::actualProject} rightPanel_show_up Bookmarks } {brk} { ;# "Right / Breakpoints" - ${X::actualProject} rightPanel_show_up Breakpoints + ${::X::actualProject} rightPanel_show_up Breakpoints } {wtch} { ;# "Right / Watches" - ${X::actualProject} rightPanel_show_up Watches + ${::X::actualProject} rightPanel_show_up Watches } {ins} { ;# "Right / Instruction details" - ${X::actualProject} rightPanel_show_up Instruction + ${::X::actualProject} rightPanel_show_up Instruction } {sub} { ;# "Right / Subprograms" - ${X::actualProject} rightPanel_show_up Subprograms + ${::X::actualProject} rightPanel_show_up Subprograms } {rsh} { ;# "Right / Show_Hide" - ${X::actualProject} right_panel_show_hide + ${::X::actualProject} right_panel_show_hide } {lsh} { ;# "Left / Show_Hide" - ${X::actualProject} filelist_show_hide + ${::X::actualProject} filelist_show_hide } {open} { ;# "Left / Opened files" - ${X::actualProject} filelist_show_up opened_files + ${::X::actualProject} filelist_show_up opened_files } {proj} { ;# "Left / Project files" - ${X::actualProject} filelist_show_up project_files + ${::X::actualProject} filelist_show_up project_files } - {fsb} { ;# "Left / Filesystem browser" - ${X::actualProject} filelist_show_up fs_browser + {fsb} { ;# "Left / File system browser" + ${::X::actualProject} filelist_show_up fs_browser } - {sfr} { ;# "Left / Filesystem browser" - ${X::actualProject} filelist_show_up sfr_watches + {sfr} { ;# "Left / File system browser" + ${::X::actualProject} filelist_show_up sfr_watches } } } @@ -1050,8 +1190,9 @@ proc manipulate_panel {what_to_do} { # } # @parm String path - menu root # @parm Bool tearoff - tearoff menu on/off (default: false) + # @parm String trg_ns = "::" - Target namespace (for i18n) # @return Bool - return code -proc menuFactory {pattern path tearoff cmdPrefix shortcuts options} { +proc menuFactory {pattern path tearoff cmdPrefix shortcuts options {trg_ns {::}}} { # Create menu widget eval "menu $path -tearoff $tearoff $options" @@ -1070,12 +1211,16 @@ proc menuFactory {pattern path tearoff cmdPrefix shortcuts options} { set menu(5) "::ICONS::16::$menu(5)" } + # Do i18n + set menu(1) [namespace eval $trg_ns "mc {$menu(1)}"] + set menu(6) [namespace eval $trg_ns "mc {$menu(6)}"] + # Adjust accelerator value set menu(2) [adjust_menu_accelerator $menu(2)] # Create menu command $path add command \ - -label [mc $menu(1)] \ + -label $menu(1) \ -accelerator $menu(2) \ -underline $menu(3) \ -command "$cmdPrefix$menu(4)" \ @@ -1084,7 +1229,7 @@ proc menuFactory {pattern path tearoff cmdPrefix shortcuts options} { # Status bar tip if {$menu(6) != {}} { set itemIndex [$path index end] - menu_Sbar_add $path $itemIndex [mc $menu(6)] + menu_Sbar_add $path $itemIndex $menu(6) bind $path <<MenuSelect>> "menu_Sbar $path \[%W index active\]" bind $path <Leave> {Sbar {}} } @@ -1096,12 +1241,16 @@ proc menuFactory {pattern path tearoff cmdPrefix shortcuts options} { set menu(5) "${cmdPrefix}$menu(5)" } + # Do i18n + set menu(1) [namespace eval $trg_ns "mc {$menu(1)}"] + set menu(7) [namespace eval $trg_ns "mc {$menu(7)}"] + # Adjust accelerator value set menu(2) [adjust_menu_accelerator $menu(2)] # Create radio button item $path add radiobutton \ - -label [mc $menu(1)] \ + -label $menu(1) \ -accelerator $menu(2) \ -variable $menu(3) \ -value $menu(4) \ @@ -1111,12 +1260,12 @@ proc menuFactory {pattern path tearoff cmdPrefix shortcuts options} { -indicatoron 0 \ -image ::ICONS::raoff \ -selectimage ::ICONS::raon \ - -selectcolor {#EEEEEE} + -selectcolor ${::COMMON_BG_COLOR} # Status bar tip if {$menu(7) != {}} { set itemIndex [$path index end] - menu_Sbar_add $path $itemIndex [mc $menu(7)] + menu_Sbar_add $path $itemIndex $menu(7) bind $path <<MenuSelect>> "menu_Sbar $path \[%W index active\]" bind $path <Leave> {Sbar {}} } @@ -1126,12 +1275,17 @@ proc menuFactory {pattern path tearoff cmdPrefix shortcuts options} { if {$menu(7) != {}} { set menu(7) "${cmdPrefix}$menu(7)" } + + # Do i18n + set menu(1) [namespace eval $trg_ns "mc {$menu(1)}"] + set menu(8) [namespace eval $trg_ns "mc {$menu(8)}"] + # Adjust accelerator value set menu(2) [adjust_menu_accelerator $menu(2)] # Create checkbutton item $path add checkbutton \ - -label [mc $menu(1)] \ + -label $menu(1) \ -accelerator $menu(2) \ -variable $menu(3) \ -onvalue $menu(4) \ @@ -1142,11 +1296,11 @@ proc menuFactory {pattern path tearoff cmdPrefix shortcuts options} { -image ::ICONS::choff \ -indicatoron 0 \ -selectimage ::ICONS::chon \ - -selectcolor {#EEEEEE} + -selectcolor ${::COMMON_BG_COLOR} # Status bar tip if {$menu(8) != {}} { set itemIndex [$path index end] - menu_Sbar_add $path $itemIndex [mc $menu(8)] + menu_Sbar_add $path $itemIndex $menu(8) bind $path <<MenuSelect>> "menu_Sbar $path \[%W index active\]" bind $path <Leave> {Sbar {}} } @@ -1156,14 +1310,16 @@ proc menuFactory {pattern path tearoff cmdPrefix shortcuts options} { set menu(4) "$path$menu(4)" # Create new menu for cascade if {$menu(7) != {}} { - menuFactory $menu(7) $menu(4) $menu(5) $cmdPrefix $menu(6) $options + menuFactory $menu(7) $menu(4) $menu(5) $cmdPrefix $menu(6) $options $trg_ns } + # Do i18n + set menu(1) [namespace eval $trg_ns "mc {$menu(1)}"] # Item icon if {$menu(3) != {}} { set menu(3) "::ICONS::16::$menu(3)" } # Add cascade to this menu - $path add cascade -label [mc $menu(1)] -underline $menu(2) \ + $path add cascade -label $menu(1) -underline $menu(2) \ -image $menu(3) -menu $menu(4) -compound left } {} {return} @@ -1188,7 +1344,7 @@ proc ena_dis_menu_buttons {EnaDis pattern} { # Determinate state if {$EnaDis} { set state normal - } { + } else { set state disabled } # Set state @@ -1209,7 +1365,7 @@ proc ena_dis_iconBar_buttons {EnaDis pathPrefix buttonList} { # Determinate state if {$EnaDis} { set state normal - } { + } else { set state disabled } # Set state @@ -1228,9 +1384,10 @@ proc ena_dis_iconBar_buttons {EnaDis pathPrefix buttonList} { # {?name? ?helptext? ?imageName? ?command? [?statusTip?]} # {separator} # } + # @parm String trg_ns = "::" - Target namespace (for i18n) # @return void set iconBarFactory_sep_index 0 ;# Separator index -proc iconBarFactory {container cmdPrefix pathPrefix imageNS pattern} { +proc iconBarFactory {container cmdPrefix pathPrefix imageNS pattern {trg_ns {::}}} { global iconBarFactory_sep_index ;# Separator index # Parse pattern @@ -1256,12 +1413,12 @@ proc iconBarFactory {container cmdPrefix pathPrefix imageNS pattern} { -image "$imageNS$parm(2)" \ -style ToolButton.TButton \ ] - DynamicHelp::add $buttonWidget -text $parm(1) + ::DynamicHelp::add $buttonWidget -text [namespace eval $trg_ns "mc {[lindex $button 1]}"] # Pack it pack $buttonWidget -in $container -side left -padx 2 # Set status bar tip if {[llength $button] == 5} { - setStatusTip -widget $buttonWidget -text [lindex $button 4] + setStatusTip -widget $buttonWidget -text [namespace eval $trg_ns "mc {[lindex $button 4]}"] } } } @@ -1317,6 +1474,7 @@ proc show_statusbar_history {} { # @parm String txt - initial text # @return void proc makeStatusbar {txt} { + # Button "Set syntax validation level" pack [frame .statusbarF -height 30p] -fill x -expand 0 -side bottom pack [ttk::button .statusbarVB \ -style TButton \ @@ -1324,19 +1482,49 @@ proc makeStatusbar {txt} { -compound left \ -width 6 \ ] -in .statusbarF -side left - DynamicHelp::add .statusbarVB -text [mc "Change validation level"] + DynamicHelp::add .statusbarVB -text [mc "Change level of syntax validation."] bind .statusbarVB <Button-3> {change_validation_level {down}; break} bind .statusbarVB <Button-1> {change_validation_level {up}; break} - pack [ArrowButton .statusbarF.arr_but \ - -dir top -clean 2 -bd 0 \ - -helptext [mc "Show statusbar history"] \ - -command {show_statusbar_history} \ - -height 14 -width 14 -bg {#eeeeee} \ + # This function was not yet ported to MS Windows + if {!$::MICROSOFT_WINDOWS} { + # Button "Configure spell checking" + pack [ttk::menubutton .statusbarSB \ + -style TButton \ + -compound left \ + -width 6 \ + -direction above \ + -menu .spell_checker_conf_menu \ + -image ::ICONS::flag::empty \ + -text "none" \ + ] -in .statusbarF -side left + if {${::PROGRAM_AVAILABLE(hunspell)}} { + DynamicHelp::add .statusbarSB -text [mc "Configure spell checker"] + } else { + DynamicHelp::add .statusbarSB -text [mc "Spell checker (hunspell) is not available."] + .statusbarSB configure -state disabled + } + } + + # Button "Show status bar history" + pack [ArrowButton .statusbarF.arr_but \ + -dir top -clean 2 -bd 0 \ + -helptext [mc "Show status bar history"] \ + -command {show_statusbar_history} \ + -height 14 -width 14 -bg ${::COMMON_BG_COLOR} \ ] -side left -padx 7 - setStatusTip -widget .statusbarF.arr_but -text [mc "Show statusbar history"] - pack [label .statusbarL -text $txt -anchor w -justify left] \ + setStatusTip -widget .statusbarF.arr_but -text [mc "Show status bar history"] + + # Status bar + pack [label .statusbarL -text $txt -anchor w -justify left] \ -in .statusbarF -side left -fill x -expand 1 + # MCU currently in use + pack [label .statusbarMCU -text "" -cursor hand2 -anchor e -justify right -fg {#000000}] \ + -in .statusbarF -side right -padx 5 + DynamicHelp::add .statusbarMCU -text [mc "MCU chosen for simulation"] + bind .statusbarMCU <Enter> {%W configure -fg {#0000DD}} + bind .statusbarMCU <Leave> {%W configure -fg {#000000}} + bind .statusbarMCU <Button-1> {::X::__proj_edit 1} } set sbarAfterId {} ;# Sbar timer ID set status_bar_history {} ;# Sbar history @@ -1381,7 +1569,7 @@ proc change_validation_level {arg} { set ::CsyntaxHighlight::validation_L1 0 ;# Bool: Basic validation enabled set ::ASMsyntaxHighlight::validation_L0 0 ;# Bool: Basic validation enabled set ::ASMsyntaxHighlight::validation_L1 0 ;# Bool: Advancet validation enabled - } { + } else { .statusbarVB configure -text " $::CONFIG(VALIDATION_LEVEL)" .statusbarVB configure -style TButton setStatusTip -widget .statusbarVB -text [mc "Current validation level: %s" $::CONFIG(VALIDATION_LEVEL)] @@ -1394,7 +1582,7 @@ proc change_validation_level {arg} { if {$::CONFIG(VALIDATION_LEVEL) == 2} { set ::ASMsyntaxHighlight::validation_L1 1 ;# Bool: Advancet validation enabled set ::CsyntaxHighlight::validation_L1 1 ;# Bool: Basic validation enabled - } { + } else { set ::ASMsyntaxHighlight::validation_L1 0 ;# Bool: Advancet validation enabled set ::CsyntaxHighlight::validation_L1 0 ;# Bool: Basic validation enabled } @@ -1466,7 +1654,7 @@ proc simulator_Sbar {txt mode object} { if {![string length $txt]} { return } - pack [label .simulator_Sbar -text $txt -fg {#DD8800} -cursor hand1] -in .statusbarF -side right + pack [label .simulator_Sbar -text $txt -fg {#DD8800} -cursor hand2] -in .statusbarF -side right if {$mode} { bind .simulator_Sbar <Enter> {%W configure -fg {#0000DD}} bind .simulator_Sbar <Leave> {%W configure -fg {#DD8800}} @@ -1557,6 +1745,9 @@ proc menu_Sbar_add {menu item text} { # @parm Widget menu - ID of the menu # @return void proc menu_Sbar_remove {menu} { + if {$menu == {}} { + return + } # Determinate menu index set idx [lsearch ${::menuSbar_menus} $menu] if {$idx == -1} { @@ -1584,7 +1775,7 @@ proc menu_Sbar {menu item} { } if {[lsearch $::menuSbar_items($menu) $item] != -1} { Sbar -freeze $::menuSbar_texts(${menu},${item}) - } { + } else { Sbar {} } } @@ -1626,7 +1817,7 @@ set SHORTCUTS_LIST { {statistics} {{} ::X::__statistics {} {File statistics}} {fullscreen} {{Control-Key-XF86_Switch_VT_11} ::X::__toggle_fullscreen window_fullscreen - {Toggle fullscreen mode}} + {Toggle full screen mode}} } {project {Project management} {} {proj_new} {{} ::X::__proj_new filenew {New project}} @@ -1692,22 +1883,30 @@ set SHORTCUTS_LIST { {resume} {{} ::X::__resume resume {Simulator: Resume}} {intrmon} {{} ::X::__interrupt_monitor kcmdf - {Interrupt monitor}} + {Interrupt Monitor}} + {uartmon} {{} ::X::__uart_monitor __blockdevice + {UART Monitor}} {stopwatch} {{} ::X::__stopwatch_timer player_time {Stopwatch}} } {virtual_hw {Virtual HW} {} {ledpanel} {{} {::X::__vhw_LED_panel} ledpanel - {LED panel}} + {LED Panel}} {leddisplay} {{} {::X::__vhw_LED_display} leddisplay - {LED display}} + {LED Display}} {ledmatrix} {{} {::X::__vhw_LED_matrix} ledmatrix - {LED matrix}} + {LED Matrix}} + {hd44780} {{} {::X::__vhw_HD44780} hd44780 + {LCD display controlled by HD44780}} {mleddisplay} {{} {::X::__vhw_M_LED_display} mleddisplay {Multiplexed LED display}} {simplekeypad} {{} {::X::__vhw_keys} simplekeypad - {Simple keypad}} + {Simple Keypad}} {matrixkeypad} {{} {::X::__vhw_matrix_keypad} matrixkeypad - {Matrix keypad}} + {Matrix Keypad}} + {ds1620} {{} {::X::__ds1620} ds1620 + {DS1620 thermometer}} + {fintr} {{} {::X::__vhw_file_interface} compfile1 + {File Interface}} {vhw_open} {{} {::X::__open_VHW} fileopen {Open}} {vhw_load} {{} {::X::__load_VHW} fileimport @@ -1725,6 +1924,8 @@ set SHORTCUTS_LIST { {Compile this file only}} {disasm} {{} ::X::__disasm disasm {Disassemble}} + {d52} {{} ::X::__d52 d52 + {Disassemble with D52}} {auto_indent} {{} ::X::__reformat_code filter {Auto indent}} {change_case} {{} ::X::__change_letter_case change_case @@ -1763,24 +1964,28 @@ set SHORTCUTS_LIST { {hexeditor} {{} ::X::__hexeditor ascii {Hex Editor}} {symb_view} {{} ::X::__symb_view symbol - {Symbol table}} + {Symbol Table}} {8seg} {{} ::X::__eightsegment 8seg - {8-segment editor}} + {8-Segment Editor}} {ascii_c} {{} ::X::__ascii_chart math_matrix - {ASCII chart}} + {ASCII Chart}} + {toi} {{} ::X::__table_of_instructions fsview + {8051 Instruction Table}} {notes} {{} ::X::__notes pencil - {Scribble notepad}} - {bc} {{} ::X::__base_convertor kaboodleloop - {Base Convertor}} + {Scribble Notepad}} + {bc} {{} ::X::__base_converter kaboodleloop + {Base Converter}} {rs232} {{} ::X::__rs232debugger chardevice {UART/RS232 Debugger}} } {help {Help} {} {about} {{} ::X::__about mcu8051ide {About dialog}} - {welcome} {{} ::X::__welcome_dialog {} - {Welcome dialog}} - {tips} {{} ::X::__tip_of_the_day help - {Tip of the day}} + {welcome} {{} ::X::__welcome_dialog info + {Welcome Dialog}} + {tips} {{} ::X::__tip_of_the_day help + {Tip of the Day}} + {hbook} {{Key-F1} ::X::__handbook contents + {Handbook}} } {messages {Messages text} {Control-Key-c Control-Key-a} {clear_mess} {{} {$this clear_messages_text} editdelete {Clear messages}} @@ -1799,7 +2004,7 @@ set SHORTCUTS_LIST { {italic} {Control-Key-i {$this TodoProc_italic} text_italic {Italic text}} {strike} {Control-Key-q {$this TodoProc_strike} text_strike - {Striketrought text}} + {Strikethrough text}} {under} {Control-Key-u {$this TodoProc_under} text_under {Underline text}} {edrase} {Control-Key-e {$this TodoProc_eraser} eraser @@ -1823,7 +2028,7 @@ set SHORTCUTS_LIST { {Move down}} {bottom} {{} {$this rightPanel_watch_move_bottom} bottom {Move to bottom}} - {remove} {{Control-Delete} {$this rightPanel_watch_remove} button_cancel + {remove} {{Control-Delete} {$this rightPanel_watch_remove} button_cancel {Remove}} {remove_all} {{} {$this rightPanel_watch_clear} editdelete {Remove all}} @@ -1917,6 +2122,9 @@ set SHORTCUTS_LIST { {Block selection mode}} } } +# Intentionally hidden functions, these haven't been fully implemented yet +# virtual_hw: {vuterm} {{} {::X::__vhw_UART_terminal} _chardevice +# {Virtual UART termnal}} ## Traslate menu accelerator string to human readable key sequence # @parm String value - string to translate (for instance: $main:quit) @@ -2079,9 +2287,9 @@ set MAINMENU { {command "Find" "$edit:find" 0 {X::__find} "find" "Find a string in the text"} {command "Find next" "$edit:find_next" 5 {X::__find_next} "1downarrow" - "Find next occurence of search string"} + "Find next occurrence of search string"} {command "Find previous" "$edit:find_prev" 10 {X::__find_prev} "1uparrow" - "Find previous occurence of search string"} + "Find previous occurrence of search string"} {separator} {command "Replace" "$edit:replace" 0 {X::__replace} "" "Replace some string with another"} @@ -2102,7 +2310,7 @@ set MAINMENU { {cascade "View" 0 "" .display false 1 { {checkbutton "Read only mode" "$sim:readonly" {::editor_RO_MODE} 1 0 5 {::X::switch_editor_RO_MODE} - "Set current editor to readonly/normal mode"} + "Set current editor to read only/normal mode"} {command "Switch to command line" "$edit:cmd_line" 7 {X::__switch_to_cmd_line} "" "Switch to editor command line"} {separator} @@ -2130,8 +2338,8 @@ set MAINMENU { ""} }} {separator} - {command "Fullscreen mode" "$main:fullscreen" 0 {X::__toggle_fullscreen} - "window_fullscreen" "Toggle fullscreen mode"} + {command "Full screen mode" "$main:fullscreen" 0 {X::__toggle_fullscreen} + "window_fullscreen" "Toggle full screen mode"} {separator} {command "Clear messages panel" "$messages:clear_mess" 0 {X::__clear_messages_text} "editdelete" "Clear messages panel"} @@ -2163,23 +2371,21 @@ set MAINMENU { "launch_this" "Start simulator engine and load current file only"} {separator} {command "Step back" "$sim:stepback" 5 {X::__stepback} - "undo" "Step program back by 1 inctruction"} + "undo" "Step program back by 1 instruction"} {command "Step" "$sim:step" 3 {X::__step} - "goto" "Step program by 1 inctruction"} + "goto" "Step program by 1 instruction"} {command "Step over" "$sim:stepover" 5 {X::__stepover} "goto2" "Step program by 1 line of code"} {command "Animate" "$sim:animate" 0 {X::__animate} "1rightarrow" "Run program and show results after each change"} {command "Run" "$sim:run" 2 {X::__run} - "2rightarrow" "Run program and show results periodicaly in some interval"} + "2rightarrow" "Run program and show results periodically in some interval"} {separator} {command "Hiberante program" "$sim:hiberante" 0 {X::__hibernate} "bar5" "Save current state of simulator engine to a file for future resumption"} {command "Resume hibernated program" "$sim:resume" 4 {X::__resume} "resume" "Resume hibernated program"} {separator} - {command "Interrupt monitor" "$sim:intrmon" 6 {X::__interrupt_monitor} - "kcmdf" "Dialog in which you can controll MCU interrupts"} {command "Stopwatch" "$sim:stopwatch" 4 {X::__stopwatch_timer} "player_time" "Configurable stopwatch timer which can stop simulation on various conditions"} {separator} @@ -2208,7 +2414,7 @@ set MAINMENU { {command "Show Data EEPROM" "$sim:show_eeprom" 5 {X::__show_eeprom} "kcmmemory_P" "Invoke hex editor with data EEPROM"} {command "Show EEPROM write buffer" "$sim:show_eem_wb" 14 {X::__show_eeprom_write_buffer} - "kcmmemory_B" "Invoke hexeditor editor with data EEPROM write buffer"} + "kcmmemory_B" "Invoke hex editor editor with data EEPROM write buffer"} {separator} {cascade "Reset" 0 "rebuild" .virtual_mcu_reset false 1 { {command "Only SFR" "$sim:reset-" 0 {X::__reset -} @@ -2220,20 +2426,41 @@ set MAINMENU { {command "Random values" "$sim:resete" 0 {X::__reset r} "rebuild" "Reset all internal registers to random values"} }} + {separator} + {command "Interrupt monitor" "$sim:intrmon" 6 {X::__interrupt_monitor} + "kcmdf" "Dialog in which you can control MCU interrupts"} }} {cascade "Virtual HW" 8 "" .virtual_hw false 1 { - {command "LED panel" "$virtual_hw:ledpanel" 2 {X::__vhw_LED_panel} + {command "LED Panel" "$virtual_hw:ledpanel" 2 {X::__vhw_LED_panel} "ledpanel" ""} - {command "LED display" "$virtual_hw:leddisplay" 10 {X::__vhw_LED_display} + {command "LED Display" "$virtual_hw:leddisplay" 10 {X::__vhw_LED_display} "leddisplay" ""} - {command "LED matrix" "$virtual_hw:ledmatrix" 4 {X::__vhw_LED_matrix} + {command "LED Matrix" "$virtual_hw:ledmatrix" 4 {X::__vhw_LED_matrix} "ledmatrix" ""} - {command "Multiplexed LED display" "$virtual_hw:mleddisplay" 1 {X::__vhw_M_LED_display} + {command "Multiplexed LED Display" "$virtual_hw:mleddisplay" 1 {X::__vhw_M_LED_display} "mleddisplay" ""} - {command "Simple keypad" "$virtual_hw:simplekeypad" 1 {X::__vhw_keys} + {command "Simple Keypad" "$virtual_hw:simplekeypad" 1 {X::__vhw_keys} "simplekeypad" ""} - {command "Matrix keypad" "$virtual_hw:matrixkeypad" 7 {X::__vhw_matrix_keypad} + {command "Matrix Keypad" "$virtual_hw:matrixkeypad" 7 {X::__vhw_matrix_keypad} "matrixkeypad" ""} + {cascade "LCD display (HD44780)" 13 "hd44780" .hd44780 false 1 { + {command "1 × 8" "" 0 {X::__vhw_HD44780 {1 8}} + "hd44780" "LCD display controlled by HD44780"} + {command "2 × 8" "" 0 {X::__vhw_HD44780 {2 8}} + "hd44780" "LCD display controlled by HD44780"} + {command "2 × 16" "" 0 {X::__vhw_HD44780 {2 16}} + "hd44780" "LCD display controlled by HD44780"} + {command "2 × 20" "" 0 {X::__vhw_HD44780 {2 20}} + "hd44780" "LCD display controlled by HD44780"} + {command "2 × 40" "" 0 {X::__vhw_HD44780 {2 40}} + "hd44780" "LCD display controlled by HD44780"} + {command "Any" "" 0 {X::__vhw_HD44780} + "hd44780" "LCD display controlled by HD44780"} + }} + {command "DS1620 temperature sensor" "$virtual_hw:ds1620" 8 {X::__vhw_ds1620} + "ds1620" "Simulated DS1620 thermometer"} + {command "File Interface" "$virtual_hw:fintr" 1 {X::__vhw_file_interface} + "compfile1" "Read & Write GPIO states from/to a file"} {separator} {command "Open" "$virtual_hw:vhw_open" 0 {X::__open_VHW} "fileopen" "Load VHW connections from a file"} @@ -2249,7 +2476,6 @@ set MAINMENU { "filesave" "Save current VHW connections to a file"} {command "Save as" "$virtual_hw:vhw_saveas" 1 {X::__save_as_VHW} "filesaveas" "Save current VHW connections under a different name"} - {separator} {command "Remove all" "$virtual_hw:vhw_remove_all" 0 {X::__remove_all_VHW} "editdelete" "Remove all VHW"} @@ -2283,7 +2509,7 @@ set MAINMENU { {command "Document current function" "$tools:doc_cur_f" 4 {X::__document_current_func} "" "Create doxygen documentation for function on current line"} {command "Run doxywizard" "$tools:doxywizard" 7 {X::__run_doxywizard} - "" "Run doxygen frondend"} + "" "Run doxygen front-end"} {command "Clear C API documentation" "$tools:clr_doc" 8 {X::__clear_documentation} "" "Remove C API documentation created by doxygen"} {command "Build C API documentation" "$tools:doxygen" 9 {X::__generate_documentation} @@ -2311,64 +2537,80 @@ set MAINMENU { {command "Normalize Intel 8 hex file" "$utilities:normalize_hex" 0 {X::__normalize_hex} "hh" "Reformat the given IHEX8"} {separator} - {command "Hex editor" "$utilities:hexeditor" 1 {X::__hexeditor} + {command "Hex Editor" "$utilities:hexeditor" 1 {X::__hexeditor} "ascii" "Invoke project independent hexadecimal editor with capacity of 64KB"} - {command "Symbol table" "$utilities:symb_view" 7 {X::__symb_view} + {command "Symbol Table" "$utilities:symb_view" 7 {X::__symb_view} "symbol" "Assembly language symbol table viewer"} - {command "8-segment editor" "$utilities:8seg" 4 {X::__eightsegment} - "8seg" "8-segment LED display editor"} - {command "ASCII chart" "$utilities:ascii_c" 0 {X::__ascii_chart} - "math_matrix" "ASCII chart"} + {command "8-Segment Editor" "$utilities:8seg" 4 {X::__eightsegment} + "8seg" "8-Segment LED Display Editor"} + {command "ASCII Chart" "$utilities:ascii_c" 0 {X::__ascii_chart} + "math_matrix" "ASCII Chart"} + {command "8051 Instruction Table" "$utilities:toi" 0 {X::__table_of_instructions} + "fsview" "Interactive table of 8051 instructions"} {separator} - {command "Scribble notepad" "$utilities:notes" 10 {X::__notes} + {command "Scribble Notepad" "$utilities:notes" 10 {X::__notes} "pencil" ""} - {command "Base convertor" "$utilities:bc" 5 {X::__base_convertor} + {command "Base Converter" "$utilities:bc" 5 {X::__base_converter} "kaboodleloop" ""} - {command "Special calculator" "" 1 {X::__spec_calc} + {command "Special Calculator" "" 1 {X::__spec_calc} "xcalc" ""} {separator} {command "UART/RS232 Debugger" "$utilities:rs232" 2 {X::__rs232debugger} "chardevice" ""} }} {cascade "Configure" 0 "" .configure false 0 { - {command "Configure Editor" "" 0 {::configDialogs::editor::mkDialog} + {command "Configure Editor" "" 0 {::configDialogues::editor::mkDialog} "configure" "Editor configuration (colors, fonts, highlighting, etc.)"} - {command "Configure Compiler" "" 1 {::configDialogs::compiler::mkDialog} + {command "Configure Compiler" "" 1 {::configDialogues::compiler::mkDialog} "configure" "Various compilation options"} - {command "Configure Simulator" "" 12 {::configDialogs::simulator::mkDialog} + {command "Configure Simulator" "" 12 {::configDialogues::simulator::mkDialog} "configure" "Opens simulator configuration dialog"} - {command "Configure Right Panel" "" 2 {::configDialogs::rightPanel::mkDialog} + {command "Configure Right Panel" "" 2 {::configDialogues::rightPanel::mkDialog} "configure" - "Right panel configration (instruction details colors)"} - {command "Configure Main Toolbar" "" 3 {::configDialogs::toolbar::mkDialog} + "Right panel configuration (instruction details colors)"} + {command "Configure Main Toolbar" "" 3 {::configDialogues::toolbar::mkDialog} "configure_toolbars" "Adjust content of the main toolbar (under main menu)"} - {command "Edit custom commands" "" 3 {::configDialogs::custom_commands::mkDialog} + {command "Edit custom commands" "" 3 {::configDialogues::custom_commands::mkDialog} "configure" - "Set or modify user defined commads"} - {command "Configure shortcuts" "" 10 {::configDialogs::shortcuts::mkDialog} + "Set or modify user defined commands"} + {command "Configure shortcuts" "" 10 {::configDialogues::shortcuts::mkDialog} "configure_shortcuts" "Set or modify key shortcuts"} - {command "Configure terminal emulator" "" 12 {::configDialogs::terminal::mkDialog} + {command "Configure terminal emulator" "" 12 {::configDialogues::terminal::mkDialog} "terminal" "Configure embedded terminal emulator -- RXVT-UNICODE"} - {command "Configure MCU 8051 IDE" "" 4 {::configDialogs::global::mkDialog} + {command "Configure MCU 8051 IDE" "" 4 {::configDialogues::global::mkDialog} "mcu8051ide" "Invoke global configuration dialog"} }} {cascade "Help" 0 "" .help false 1 { {command "About" "$help:about" 0 {X::__about} - "kcmmemory" "About MCU 8051 IDE"} - {command "Welcome dialog" "$help:welcome" 0 {X::__welcome_dialog} - "" "Invoke dialog which you have seen on the first start"} - {command "Tip of the day" "$help:tips" 0 {X::__tip_of_the_day} - "" "Some tips about how to use this program more efficiently"} + "mcu8051ide" "About MCU 8051 IDE"} + {command "Welcome Dialog" "$help:welcome" 0 {X::__welcome_dialog} + "info" "Invoke dialog which you have seen on the first start"} + {command "Tip of the Day" "$help:tips" 0 {X::__tip_of_the_day} + "idea" "Some tips about how to use this program more efficiently"} + {separator} + {command "Project web page" "" 8 {::X::__web_page} + "html" ""} + {command "Report a bug" "" 9 {::X::__bug_report} + "bug" ""} + {separator} + {command "ASEM-51 manual" "" 0 {::X::__asem51_manual} + "asem51" ""} + {command "SDCC manual" "" 0 {::X::__sdcc_manual} + "sdcc" ""} + {separator} + {command "Handbook" "" 0 {::X::__handbook} + "contents" ""} }} } -# This belongs to the "Virtual MCU" +# Intentionally hidden functions, these haven't been fully implemented yet +# This belongs to the "Virtual MCU": # {separator} # {cascade "Functional diagrams" 0 "blockdevice" .virtual_mcu_fd false 1 { # {command "Timer/Counter 0" "" 14 {X::__functional_diagram 0} @@ -2389,13 +2631,19 @@ set MAINMENU { # "flag" ""} # }} # {separator} -# {command "Virtual UART termnal" "" 8 {X::__virtual_terminal u} -# "chardevice" ""} # {command "Virtual SPI termnal" "" 9 {X::__virtual_terminal s} # "chardevice" ""} # +# Virtual MCU: {command "UART Monitor" "$sim:uartmon" 1 {X::__uart_monitor} +# "__blockdevice" "Dialog in which you can control UART operations"} +# +# Virtual HW: {command "Virtual UART terminal" "$virtual_hw:vuterm" 8 {X::__vhw_UART_terminal} +# "_chardevice" "Simulated UART terminal connected to the MCU simulator"} +# +# Tools: {command "Disassemble with D52" "$tools:d52" 15 {X::__d52} +# "d52" ""} +# {separator} # - ## (Re)Draw main menu # @return void @@ -2410,8 +2658,15 @@ proc mainmenu_redraw {} { } # Create main menu . configure -menu .mainMenu - menuFactory $MAINMENU .mainMenu 0 {} 0 {} - .mainMenu configure -bd 0 -bg {#EEEEEE} -activeforeground {#6666FF} -activebackground {#EEEEEE} -activeborderwidth 1 + menuFactory $MAINMENU .mainMenu 0 {} 0 {} [namespace current] + if {!${::MICROSOFT_WINDOWS}} { + .mainMenu configure \ + -activeborderwidth 1 \ + -bg ${::COMMON_BG_COLOR} \ + -activeforeground {#6666FF} \ + -activebackground ${::COMMON_BG_COLOR} \ + -bd 0 + } # Restore lists of recent files for {set i 0} {$i < 3} {incr i} { @@ -2429,18 +2684,19 @@ proc mainmenu_redraw {} { iso8859-6 iso8859-7 iso8859-8 iso8859-9 iso8859-10 iso8859-13 iso8859-14 iso8859-15 iso8859-16 - } { - .mainMenu.tools.encoding add radiobutton \ - -label [enc2name $enc] \ - -value $enc \ - -accelerator [string toupper $enc] \ - -variable ::editor_encoding \ - -command {::X::change_encoding} \ - -indicatoron 0 \ - -compound left \ - -image ::ICONS::raoff \ - -selectimage ::ICONS::raon \ - -selectcolor {#EEEEEE} + } \ + { + .mainMenu.tools.encoding add radiobutton \ + -label [mc [enc2name $enc]] \ + -value $enc \ + -accelerator [string toupper $enc] \ + -variable ::editor_encoding \ + -command {::X::change_encoding} \ + -indicatoron 0 \ + -compound left \ + -image ::ICONS::raoff \ + -selectimage ::ICONS::raon \ + -selectcolor ${::COMMON_BG_COLOR} } .mainMenu.tools.encoding entryconfigure 0 -foreground {#0000FF} -underline 0 @@ -2457,17 +2713,20 @@ proc mainmenu_redraw {} { -compound left \ -image ::ICONS::raoff \ -selectimage ::ICONS::raon \ - -selectcolor {#EEEEEE} + -selectcolor ${::COMMON_BG_COLOR} } # Window geometry correction wm geometry . $::CONFIG(WINDOW_GEOMETRY) - update idle + update idletasks + if {!$::MICROSOFT_WINDOWS && $::CONFIG(WINDOW_ZOOMED)} { + wm attributes . -zoomed $::CONFIG(WINDOW_ZOOMED) + } # Enable / Disable menu items if {${::X::project_menu_locked}} { ::X::Lock_project_menu - } { + } else { ::X::disena_simulator_menu ${::X::actualProject} if {![lindex ${::X::simulator_enabled} ${::X::actualProjectIdx}]} { ::X::Lock_simulator_menu @@ -2483,10 +2742,9 @@ proc mainmenu_redraw {} { .mainMenu.tools delete [::mc "Custom command 2"] .mainMenu.tools delete [::mc "Run doxywizard"] .mainMenu.tools delete [::mc "Clear C API documentation"] - .mainMenu.tools delete [::mc "Build C API documentation"] } - # Disable menu items which are not avaliable when external editor used + # Disable menu items which are not available when external editor used ::X::adjust_mm_and_tb_ext_editor } @@ -2505,9 +2763,9 @@ menuFactory { show_hide_main_toolbar } "2uparrow" "Hide main toolbar"} {command "Configure Toolbar" "" 0 - {::configDialogs::toolbar::mkDialog} + {::configDialogues::toolbar::mkDialog} "configure_toolbars" "Configure main toolbar"} -} $TOOLBAR_FRAME.menu 0 {} 0 {} +} $TOOLBAR_FRAME.menu 0 {} 0 {} [namespace current] bind .mainIconBar <ButtonRelease-3> "tk_popup $TOOLBAR_FRAME.menu %X %Y" # Create popup menu for custom commands @@ -2516,13 +2774,13 @@ menuFactory { {set ::CONFIG(TOOLBAR_VISIBLE) 0; show_hide_main_toolbar} "2uparrow" "Hide main toolbar"} {command "Configure Toolbar" "" 0 - {::configDialogs::toolbar::mkDialog} + {::configDialogues::toolbar::mkDialog} "configure_toolbars" "Configure main toolbar"} {separator} - {command "Configure cutom commands" "" 1 - {::configDialogs::custom_commands::mkDialog ${::CUTOM_CMD_MENU_CMD_INDEX}} - "configure" "Invoke cutom commands configuration dialog"} -} $TOOLBAR_FRAME.cutom_cmd_menu 0 {} 0 {} + {command "Configure custom commands" "" 1 + {::configDialogues::custom_commands::mkDialog ${::CUSTOM_CMD_MENU_CMD_INDEX}} + "configure" "Invoke custom commands configuration dialog"} +} $TOOLBAR_FRAME.custom_cmd_menu 0 {} 0 {} [namespace current] # Create show button Label $TOOLBAR_FRAME.show_label \ @@ -2534,8 +2792,8 @@ bind $TOOLBAR_FRAME.show_label <Button-1> { show_hide_main_toolbar } -# Help variable for 'cutom_cmd_menu' -- index of selected command -set CUTOM_CMD_MENU_CMD_INDEX 0 +# Help variable for 'custom_cmd_menu' -- index of selected command +set CUSTOM_CMD_MENU_CMD_INDEX 0 ## Definition of all possoble items for main icon bar # format: { @@ -2573,9 +2831,9 @@ set ICONBAR_ICONS { {find} { "Find a string in the text" {find} {find} {find} {Find a string in the text}} {findnext} { "Find next" {1downarrow} {1downarrow} - {find_next} {Find next occurence of search string}} + {find_next} {Find next occurrence of search string}} {findprev} { "Find previous" {1uparrow} {1uparrow} - {find_prev} {Find previous occurence of search string}} + {find_prev} {Find previous occurrence of search string}} {replace} { "Replace" {find} {find} {replace} "Replace some string with another"} {goto} { "Jump to line" {goto} {goto} @@ -2609,7 +2867,9 @@ set ICONBAR_ICONS { {show_eeprom} { "Show data EEPROM" {memory_P} {kcmmemory_P} {show_eeprom} "Invoke hex editor with data EEPROM"} {show_eem_wr_b} { "Show EEPROM write buffer" {memory_B} {kcmmemory_B} - {show_eeprom_write_buffer} "Invoke hexeditor editor with data EEPROM write buffer"} + {show_eeprom_write_buffer} "Invoke hex editor editor with data EEPROM write buffer"} + {stack} { "Show stack" {memory_ST} {kcmmemory_ST} + {stack_monitor} "Invoke MCU stack monitor"} {start_sim} { "Start / Shutdown simulator" {fork} {launch} {initiate_sim} {Load debug file into simulator engine}} {start_sim0} { "Debug this file only" {fork_this} {launch_this} @@ -2629,7 +2889,7 @@ set ICONBAR_ICONS { {resume} { "Resume program" {resume} {resume} {resume} "Resume hibernated program"} {intrmon} { "Interrupt monitor" {kcmdf} {kcmdf} - {interrupt_monitor} "Dialog in which you can controll MCU interrupts"} + {interrupt_monitor} "Dialog in which you can control MCU interrupts"} {stopwatch} { "Stopwatch" {history} {player_time} {stopwatch_timer} "Configurable stopwatch timer which stop simulation on various conditions"} {clear_hg} { "Clear highlight" {editclear} {editclear} @@ -2642,12 +2902,14 @@ set ICONBAR_ICONS { {disasm} "Disassemble object code and open new editor with the result"} {hexeditor} { "Hex Editor" {binary} {ascii} {hexeditor} "Invoke project independent hexadecimal editor with capacity of 64KB"} - {symbol_tbl} { "Symbol table" {symbol} {symbol} + {symbol_tbl} { "Symbol Table" {symbol} {symbol} {symb_view} "Assembly language symbol table viewer"} - {8seg} { "8-segment editor" {8seg} {8seg} - {eightsegment} "8-segment LED display editor"} - {ascii_c} { "ASCII chart" {math_matrix} {math_matrix} - {ascii_chart} "ASCII chart"} + {8seg} { "8-Segment Editor" {8seg} {8seg} + {eightsegment} "8-Segment LED display editor"} + {ascii_c} { "ASCII Chart" {math_matrix} {math_matrix} + {ascii_chart} "ASCII Chart"} + {toi} { "8051 Instruction Table" {fsview} {fsview} + {table_of_instructions} "Interactive table of 8051 instructions"} {reformat_code} { "Auto indent" {filter} {filter} {reformat_code} "Reformat source code (Indention level ...)"} {change_case} { "Change letter case" {change_case} {change_case} @@ -2666,6 +2928,8 @@ set ICONBAR_ICONS { {exec_custom_cmd 2} {}} {about} { "About" {mcu8051ide} {mcu8051ide} {about} "About MCU 8051 IDE"} + {hbook} { "Handbook" contents contents + {handbook} "Display the documentation for MCU 8051 IDE"} {forward} { "Forward" {forward} {1rightarrow} {next_editor} "Switch to the next editor"} {back} { "Back" {back} {1leftarrow} @@ -2677,52 +2941,64 @@ set ICONBAR_ICONS { {line2addr} { "Jump to line" {goto} {goto} {simulator_set_PC_by_line} "Translate line number to address in program memory and set PC to that address"} {stepback} { "Step back" {undo} {undo} - {stepback} "Step program back by 1 inctruction"} - {notes} { "Scribble notepad" {pencil} {pencil} - {notes} "Scribble notepad"} - {ledpanel} { "LED panel" {ledpanel} {ledpanel} - {vhw_LED_panel} "LED panel"} - {leddisplay} { "LED display" {leddisplay} {leddisplay} - {vhw_LED_display} "LED display"} - {ledmatrix} { "LED matrix" {ledmatrix} {ledmatrix} - {vhw_LED_matrix} "LED matrix"} - {mleddisplay} { "Multiplexed LED display" {mleddisplay} {mleddisplay} - {vhw_M_LED_display} "Multiplexed LED display"} - {simplekeypad} { "Simple keypad" {simplekeypad} {simplekeypad} - {vhw_keys} "Simple keypad"} - {matrixkeypad} { "Matrix keypad" {matrixkeypad} {matrixkeypad} - {vhw_matrix_keypad} "Matrix keypad"} - {vhw_open} { "VHW Open" {fileopen} {fileopen} + {stepback} "Step program back by 1 instruction"} + {notes} { "Scribble Notepad" {pencil} {pencil} + {notes} "Scribble Notepad"} + {ledpanel} { "LED Panel" {ledpanel} {ledpanel} + {vhw_LED_panel} "LED Panel"} + {leddisplay} { "LED Display" {leddisplay} {leddisplay} + {vhw_LED_display} "LED Display"} + {ledmatrix} { "LED Matrix" {ledmatrix} {ledmatrix} + {vhw_LED_matrix} "LED Matrix"} + {mleddisplay} { "Multiplexed LED Display" {mleddisplay} {mleddisplay} + {vhw_M_LED_display} "Multiplexed LED Display"} + {simplekeypad} { "Simple Keypad" {simplekeypad} {simplekeypad} + {vhw_keys} "Simple Keypad"} + {matrixkeypad} { "Matrix Keypad" {matrixkeypad} {matrixkeypad} + {vhw_matrix_keypad} "Matrix Keypad"} + {hd44780} { "LCD display (HD44780)" {hd44780} {hd44780} + {vhw_HD44780} "LCD display controlled by HD44780"} + {ds1620} { "DS1620 thermometer" {ds1620} {ds1620} + {vhw_ds1620} "Simulated DS1620 temperature sensor"} + {fintr} { "File Interface" {compfile1} {compfile1} + {vhw_file_interface} "Read & Write GPIO states from/to a file"} + {vhw_open} { "VHW Open" {fileopen} {fileopen} {open_VHW} "Load VHW connections from a file"} - {vhw_load} { "VHW Load" {fileimport} {fileimport} + {vhw_load} { "VHW Load" {fileimport} {fileimport} {load_VHW} "Import VHW connections from a file"} - {vhw_save} { "VHW Save" {filesave} {filesave} + {vhw_save} { "VHW Save" {filesave} {filesave} {save_VHW} "Save current VHW connections to a file"} - {vhw_saveas} { "VHW Save as" {filesaveas} {filesaveas} + {vhw_saveas} { "VHW Save as" {filesaveas} {filesaveas} {save_as_VHW} "Save current VHW connections under a different name"} - {vhw_remove_all} { "VHW Remove all" {editdelete} {editdelete} + {vhw_remove_all} { "VHW Remove all" {editdelete} {editdelete} {remove_all_VHW} "Remove all VHW"} - {bc} { "Base Convertor" {kaboodleloop} {kaboodleloop} - {base_convertor} "Base Convertor"} - {fullscreen} { "Toggle fullscreen mode" {window_fullscreen} {window_fullscreen} - {toggle_fullscreen} "Fullscreen mode"} - {spec_calc} { "Special calculator" {xcalc} {xcalc} - {spec_calc} "Special calculator"} - {stack} { "Show stack" {memory_ST} {kcmmemory_ST} - {stack_monitor} "Invoke MCU stack monitor"} - {rs232} { "UART/RS232 Debugger" {_chardevice} {chardevice} + {bc} { "Base Converter" {kaboodleloop} {kaboodleloop} + {base_converter} "Base Converter"} + {fullscreen} { "Toggle full screen mode" {window_fullscreen} {window_fullscreen} + {toggle_fullscreen} "Full screen mode"} + {spec_calc} { "Special Calculator" {xcalc} {xcalc} + {spec_calc} "Special Calculator"} + {rs232} { "UART/RS232 Debugger" {_chardevice} {chardevice} {rs232debugger} "UART/RS232 Debugger"} } +# Intentionally hidden functions, these haven't been fully implemented yet +# {uartmon} { "UART monitor" {__blockdevice} {__blockdevice} +# {uart_monitor} "Dialog in which you can control UART operations"} +# {d52} { "Disassemble with D52" {d52} {d52} +# {d52} "Disassemble object code using D52 disassembler"} +# {vuterm} { "Virtual UART terminal" {chardevice} {_chardevice} +# {vhw_UART_terminal} "Simulated UART terminal connected to the MCU simulator"} ## Definition of default main icon bar # format: { # item_ID item_ID ... # } set ICONBAR_DEFAULT { - new open | save save_as save_all | close exit | fullscreen | - project_new project_open | find goto | hibernate resume | - custom0 custom1 | leddisplay matrixkeypad | notes | assemble | - start_sim step stepback + new open | save save_as save_all + | close exit | fullscreen | project_new project_open + | find goto | hibernate resume | custom0 + custom1 | leddisplay matrixkeypad | notes | assemble + | start_sim step stepback } ## Definition of icons current main icon bar @@ -2731,7 +3007,7 @@ set ICONBAR_DEFAULT { # } set ICONBAR_CURRENT {} -## (Re)draw icon bar acording to $ICONBAR_CURRENT +## (Re)draw icon bar according to $ICONBAR_CURRENT # @return void proc iconbar_redraw {} { ::toolbar::iconbar_redraw @@ -2793,12 +3069,13 @@ namespace eval toolbar { if {[regexp {^custom\d+$} $key]} { regexp {\d+} $key num setStatusTip -widget $button -text [mc "Custom command %s: %s" $num $::X::custom_command_desc($num)] + ::DynamicHelp::add $button -text [mc "Custom command %s: %s" $num $::X::custom_command_desc($num)] bind $button <ButtonRelease-3> [subst { - set CUTOM_CMD_MENU_CMD_INDEX $num - tk_popup $::TOOLBAR_FRAME.cutom_cmd_menu %X %Y + set CUSTOM_CMD_MENU_CMD_INDEX $num + tk_popup $::TOOLBAR_FRAME.custom_cmd_menu %X %Y }] # For normal commands - } { + } else { setStatusTip -widget $button -text [mc [lindex $def 4]] bind $button <ButtonRelease-3> {tk_popup $::TOOLBAR_FRAME.menu %X %Y} } @@ -2820,7 +3097,7 @@ namespace eval toolbar { } } -## Show/Hide main toolbar acording to value of config variable TOOLBAR_VISIBLE +## Show/Hide main toolbar according to value of config variable TOOLBAR_VISIBLE # @return void proc show_hide_main_toolbar {} { # Show the toolbar @@ -2833,7 +3110,7 @@ proc show_hide_main_toolbar {} { pack forget $::TOOLBAR_FRAME.show_label } # Hide the toolbar - } { + } else { catch { ${::X::actualProject} bottomNB_move_pane_up -11 } @@ -2874,7 +3151,7 @@ menuFactory { {command {Clear} {} 1 "GPM_entry_clear" {editdelete} {}} {separator} {command {Select all} {Ctrl+A} 0 "GPM_entry_selall" {} {}} -} .gpm_entry_menu 0 {} 0 {} +} .gpm_entry_menu 0 {} 0 {} [namespace current] # Menu for text widgets menuFactory { {command {Undo} {Ctrl+Z} 0 "GPM_text_undo" {undo} {}} @@ -2886,7 +3163,7 @@ menuFactory { {command {Clear} {} 1 "GPM_text_clear" {editdelete} {}} {separator} {command {Select all} {Ctrl+A} 0 "GPM_text_selall" {} {}} -} .gpm_text_menu 0 {} 0 {} +} .gpm_text_menu 0 {} 0 {} [namespace current] # Widget identifiers set GPM_entry_widget {} ;# Entry widget @@ -2921,7 +3198,7 @@ proc GPM_entry_key_menu {Widget} { [expr {[winfo rooty $Widget] + [lindex $bbox 1] + 10}] } -## Enable/Disable popup menu items acording to state of the widget +## Enable/Disable popup menu items according to state of the widget # For entry widgets. Auxiliary procedure for 'GPM_entry_popup' and 'GPM_entry_key_menu' # @return void proc GPM_entry_menu_disena {} { @@ -2936,7 +3213,7 @@ proc GPM_entry_menu_disena {} { .gpm_entry_menu entryconfigure [::mc "Cut"] -state normal } .gpm_entry_menu entryconfigure [::mc "Copy"] -state normal - } { + } else { .gpm_entry_menu entryconfigure [::mc "Cut"] -state disabled .gpm_entry_menu entryconfigure [::mc "Copy"] -state disabled } @@ -2974,7 +3251,7 @@ proc GPM_text_key_menu {Widget} { [expr {[winfo rooty $Widget] + [lindex $bbox 1] + 10}] } -## Enable/Disable popup menu items acording to state of the widget +## Enable/Disable popup menu items according to state of the widget # For text widgets. Auxiliary procedure for 'GPM_text_popup' and 'GPM_text_key_menu' # @return void proc GPM_text_menu_disena {} { @@ -3152,13 +3429,15 @@ proc GPM_text_selall {} { } } -# FINALIZE BASIC ENVIROMENT INITIALIZATION +# FINALIZE BASIC ENVIRONMENT INITIALIZATION # ----------------------------------------- show_hide_main_toolbar ;# Show/Hide Main toolbar pack [frame .mainFrame] -fill both -expand 1 ;# Frame for central widget +::Editor::refresh_available_dictionaries ;# Refresh list of available spell checker dictionaries makeStatusbar {} ;# Create status bar +::Editor::adjust_spell_checker_config_button ;# Adjust spell checker configuration button to current spell checker configuration change_validation_level $::CONFIG(VALIDATION_LEVEL) ;# Restore previous validation level -::X::initialize ;# Intialize X NS +::X::initialize ;# Initialize X NS ::KIFSD::FSD::load_config_array $::CONFIG(KIFSD_CONFIG) ;# Restore configuration of file selection dialog ::HexEditDlg::loadConfig $::CONFIG(HEXEDIT_CONFIG) ;# Restore hexaeditor configuration ::KIFSD::FSD::set_bookmark_change_command {::X::refresh_bookmarks_in_fs_browsers} @@ -3169,16 +3448,22 @@ if {$show_welcome_dialog} { set X::critical_procedure_in_progress 0 X::__welcome_dialog set X::critical_procedure_in_progress 1 -} elseif {${GLOBAL_CONFIG(tips)}} { +} elseif {${::GLOBAL_CONFIG(tips)}} { X::__tip_of_the_day } # Create project notebook # ----------------------------------------- -NoteBook .mainFrame.mainNB -side top -arcradius 4 -bd 1 -bg {#EEEEEE} +set ::main_nb [ModernNoteBook .mainFrame.mainNB -autohide 1] # Project details window -.mainFrame.mainNB bindtabs <Enter> {::X::create_project_details} -.mainFrame.mainNB bindtabs <Motion> {::X::project_details_move} -.mainFrame.mainNB bindtabs <Leave> {::X::close_project_details} -.mainFrame.mainNB bindtabs <ButtonRelease-3> {::X::invoke_project_menu %X %Y} +${::main_nb} bindtabs <Enter> {::X::create_project_details} +${::main_nb} bindtabs <Motion> {::X::project_details_move} +${::main_nb} bindtabs <Leave> {::X::close_project_details} +${::main_nb} bindtabs <ButtonRelease-3> {::X::invoke_project_menu %X %Y} + +bind Menu <Map> ::X::remove_all_help_windows + +# >>> File inclusion guard +} +# <<< File inclusion guard |