From 47aa8b00b2b11df13a100489e0f904a4947177ef Mon Sep 17 00:00:00 2001 From: Andrej Shadura Date: Tue, 8 May 2018 15:59:31 +0200 Subject: Import Upstream version 1.4.7 --- lib/bottompanel/bottomnotebook.tcl | 291 ++++++++++++++++--------------------- lib/bottompanel/calculator.tcl | 291 ++++++++++++++++++++++--------------- lib/bottompanel/cvarsview.tcl | 142 ++++++++++-------- lib/bottompanel/find_in_files.tcl | 133 ++++++++++------- lib/bottompanel/graph.tcl | 171 ++++++++++++++++------ lib/bottompanel/graph_wdg.tcl | 97 ++++++++----- lib/bottompanel/messages.tcl | 172 +++++++++++++++------- lib/bottompanel/terminal.tcl | 49 +++++-- lib/bottompanel/todo.tcl | 258 ++++++++++++++++++-------------- 9 files changed, 942 insertions(+), 662 deletions(-) mode change 100755 => 100644 lib/bottompanel/bottomnotebook.tcl mode change 100755 => 100644 lib/bottompanel/calculator.tcl mode change 100755 => 100644 lib/bottompanel/cvarsview.tcl mode change 100755 => 100644 lib/bottompanel/find_in_files.tcl mode change 100755 => 100644 lib/bottompanel/graph.tcl mode change 100755 => 100644 lib/bottompanel/graph_wdg.tcl mode change 100755 => 100644 lib/bottompanel/messages.tcl mode change 100755 => 100644 lib/bottompanel/terminal.tcl mode change 100755 => 100644 lib/bottompanel/todo.tcl (limited to 'lib/bottompanel') diff --git a/lib/bottompanel/bottomnotebook.tcl b/lib/bottompanel/bottomnotebook.tcl old mode 100755 new mode 100644 index 463f93d..d4d1293 --- a/lib/bottompanel/bottomnotebook.tcl +++ b/lib/bottompanel/bottomnotebook.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 _BOTTOMNOTEBOOK_TCL ] } { +set _BOTTOMNOTEBOOK_TCL _ +# <<< File inclusion guard + # -------------------------------------------------------------------------- # DESCRIPTION # Implements bottom panel of the project tab @@ -45,14 +50,13 @@ class BottomNoteBook { public variable cvarsview_frame ;# Identifier of tab of NoteBook widget for c variables public variable graph_frame ;# Identifier of tab of NoteBook widget for graph public variable messages_frame ;# Identifier of tab of NoteBook widget for messages box - public variable todo_frame ;# Identifier of tab of NoteBook widget for todo box + public variable todo_frame ;# Identifier of tab of NoteBook widget for to do box public variable calculator_frame ;# Identifier of tab of NoteBook widget for calculator public variable terminal_frame ;# Identifier of tab of NoteBook widget for terminal public variable findinfiles_frame ;# Identifier of tab of NoteBook widget for terminal ## Private private variable pri_notebook ;# Identifier of NoteBook widget when panel is visible - private variable sec_notebook ;# Identifier of NoteBook widget when panel is hidden private variable main_frame ;# Identifier of frame containing both NoteBooks private variable panel_hidding_ena 1 ;# Is panel hidding enabled @@ -69,10 +73,10 @@ class BottomNoteBook { if {$active_page == {Terminal}} { set active_page {Simulator} } elseif { - [lsearch {Simulator CVarsView Graph Messages Todo Calculator FindInFiles} $active_page] == -1 - } { - puts stderr "Invalid value of active page '$active_page', setting to {Simulator}" - set active_page {Simulator} + [lsearch {Simulator CVarsView Graph Messages Todo Calculator FindInFiles} $active_page] == -1 + } then { + puts stderr "Invalid value of active page '$active_page', setting to {Simulator}" + set active_page {Simulator} } } @@ -86,11 +90,11 @@ class BottomNoteBook { ## Create Bottom NoteBook (This function must be called after contructor) # @parm widget mainframe - Frame for bottom notebook # @parm widget PaneWindow - parent pane window contaier - # @parm String todoText - content of todo text + # @parm String todoText - content of to do text # @parm List calculatorList - List of values for calculator (display content, radix, etc.) # @parm List graph_config - Graph configuration list # @return Widget - ID of frame containg both notebooks - public method initiate_BottomNoteBook {mainframe PaneWindow todoText calculatorList graph_config} { + public method initalize_BottomNoteBook {mainframe PaneWindow todoText calculatorList graph_config} { # set parent pane window set parentPane $PaneWindow @@ -99,18 +103,7 @@ class BottomNoteBook { # Frame for primary and secondary notebook set main_frame $mainframe # Primary notebook - set pri_notebook [NoteBook $main_frame.ntb_bottomNB_pri \ - -side top -bd 1 \ - -arcradius 4 -bg {#EEEEEE} \ - -font [font create -family {helvetica} -size -12 -weight bold] \ - ] - # Secondary notebook - set sec_notebook [NoteBook $main_frame.ntb_bottomNB_sec \ - -side top \ - -arcradius 4 \ - -borderwidth 1 -bg {#EEEEEE} \ - -font [font create -family {helvetica} -size -12 -weight bold] \ - ] + set pri_notebook [ModernNoteBook $main_frame.ntb_bottomNB_pri] # Register notebook status bar tips notebook_Sbar_set {bottomnb} [list \ @@ -127,150 +120,92 @@ class BottomNoteBook { ] $pri_notebook bindtabs "notebook_Sbar bottomnb" $pri_notebook bindtabs "Sbar {} ;#" - $sec_notebook bindtabs "notebook_Sbar bottomnb" - $sec_notebook bindtabs "Sbar {} ;#" ## create Primary NoteBook tabs # Tab "Simulator" - set simulator_frame [$pri_notebook insert end {Simulator} \ - -text [mc "Simulator"] \ - -image ::ICONS::16::kcmmemory \ - -raisecmd "$this bottomNB_set_active_page {Simulator}" \ - -helptext [mc "Simulator panel %s" "(Ctrl+1)"] \ - -createcmd [list $this CreateSimulatorGUI] \ + set simulator_frame [$pri_notebook insert end {Simulator} \ + -text [mc "Simulator"] \ + -image ::ICONS::16::kcmmemory \ + -raisecmd [list $this bottomNB_set_active_page {Simulator}] \ + -helptext [mc "Simulator panel %s" "(Ctrl+1)"] \ + -createcmd [list $this CreateSimulatorGUI] \ ] # Tab "C variables" - set cvarsview_frame [$pri_notebook insert end {CVarsView} \ - -text [mc "C variables"] \ - -image ::ICONS::16::player_playlist \ - -raisecmd "$this bottomNB_set_active_page {CVarsView}" \ - -helptext [mc "Variables from C source code %s" ""] \ - -createcmd [list $this CreateCVarsViewGUI] \ + set cvarsview_frame [$pri_notebook insert end {CVarsView} \ + -text [mc "C variables"] \ + -image ::ICONS::16::player_playlist \ + -raisecmd [list $this bottomNB_set_active_page {CVarsView}] \ + -helptext [mc "Variables from C source code %s" ""] \ + -createcmd [list $this CreateCVarsViewGUI] \ ] # Tab "Graph" set graph_frame [$pri_notebook insert end {Graph} \ -text [mc "IO Ports"] \ -image ::ICONS::16::graph \ - -raisecmd "$this bottomNB_set_active_page {Graph}" \ + -raisecmd [list $this bottomNB_set_active_page {Graph}] \ -helptext [mc "Graph showing state of MCU ports %s" "(Ctrl+2)"] \ -createcmd [list $this CreateGraphGUI] \ ] # Tab "Messages" - set messages_frame [$pri_notebook insert end {Messages} \ - -text [mc "Messages"] \ - -image ::ICONS::16::kcmsystem \ - -raisecmd "$this bottomNB_set_active_page {Messages}" \ - -helptext [mc "Compiler messages %s" "(Ctrl+3)"] \ - -createcmd [list $this CreateMessagesGUI] \ + set messages_frame [$pri_notebook insert end {Messages} \ + -text [mc "Messages"] \ + -image ::ICONS::16::kcmsystem \ + -raisecmd [list $this bottomNB_set_active_page {Messages}] \ + -helptext [mc "Compiler messages %s" "(Ctrl+3)"] \ + -createcmd [list $this CreateMessagesGUI] \ + -leavecmd " + $pri_notebook itemconfigure {Messages} -image ::ICONS::16::kcmsystem + " \ ] # Tab "Notes" set todo_frame [$pri_notebook insert end {Todo} \ -text [mc "Notes"] \ -image ::ICONS::16::camera_test \ - -raisecmd "$this bottomNB_set_active_page {Todo}" \ - -helptext [mc "Personal todo list & notepad %s" "(Ctrl+4)"]\ + -raisecmd [list $this bottomNB_set_active_page {Todo}] \ + -helptext [mc "Personal to do list & notepad %s" "(Ctrl+4)"]\ -createcmd [list $this CreateTodoGUI] \ ] # Tab "Calculator" - set calculator_frame [$pri_notebook insert end {Calculator} \ - -text [mc "Calculator"] \ - -image ::ICONS::16::xcalc \ - -raisecmd "$this bottomNB_set_active_page {Calculator}" \ - -helptext [mc "Scientific calculator %s" "(Ctrl+5)"] \ - -createcmd [list $this CreateCalculatorGUI] \ + set calculator_frame [$pri_notebook insert end {Calculator} \ + -text [mc "Calculator"] \ + -image ::ICONS::16::xcalc \ + -raisecmd [list $this bottomNB_set_active_page {Calculator}] \ + -helptext [mc "Scientific calculator %s" "(Ctrl+5)"] \ + -createcmd [list $this CreateCalculatorGUI] \ ] if {!$::MICROSOFT_WINDOWS} { ;# Microsoft Windows has no terminal emulator # Tab "Terminal" - set terminal_frame [$pri_notebook insert end {Terminal} \ - -text [mc "Terminal"] \ - -image ::ICONS::16::terminal \ - -raisecmd "$this bottomNB_set_active_page {Terminal}" \ - -helptext [mc "Terminal emulator %s" ""] \ - -createcmd [list $this CreateTerminalEmulGUI] \ - -state [expr {${::PROGRAM_AVALIABLE(urxvt)} ? "normal" : "disabled"}] \ + set terminal_frame [$pri_notebook insert end {Terminal} \ + -text [mc "Terminal"] \ + -image ::ICONS::16::terminal \ + -raisecmd [list $this bottomNB_set_active_page {Terminal}] \ + -helptext [mc "Terminal emulator %s" ""] \ + -createcmd [list $this CreateTerminalEmulGUI] \ + -state [expr {${::PROGRAM_AVAILABLE(urxvt)} ? "normal" : "disabled"}] \ ] } # Tab "Find in files" - set findinfiles_frame [$pri_notebook insert end {FindInFiles} \ - -text [mc "Find in files"] \ - -image ::ICONS::16::filefind \ - -raisecmd "$this bottomNB_set_active_page {FindInFiles}"\ - -helptext [mc "Find in files %s" ""] \ - -createcmd [list $this CreateFindInFilesGUI] \ + set findinfiles_frame [$pri_notebook insert end {FindInFiles} \ + -text [mc "Find in files"] \ + -image ::ICONS::16::filefind \ + -raisecmd [list $this bottomNB_set_active_page {FindInFiles}] \ + -helptext [mc "Find in files %s" ""] \ + -createcmd [list $this CreateFindInFilesGUI] \ ] # Tab "Hide" - $pri_notebook insert end {Hide} \ - -text [mc "Hide"] \ - -image ::ICONS::16::2downarrow \ - -raisecmd "$this bottomNB_show_hide" \ - -helptext [mc "Hide this panel"] \ - - ## Create Secondary NoteBook tabs - # tab "Simulator" - $sec_notebook insert end {Simulator} \ - -text [mc "Simulator"] \ - -image ::ICONS::16::kcmmemory \ - -raisecmd "$this bottomNB_show_hide Simulator" \ - -helptext [mc "Simulator panel %s" "(Ctrl+1)"] - # tab "C variables" - $sec_notebook insert end {CVarsView} \ - -text [mc "C variables"] \ - -image ::ICONS::16::player_playlist \ - -raisecmd "$this bottomNB_show_hide CVarsView" \ - -helptext [mc "Variables from C source code %s" ""] - # tab "Graph" - $sec_notebook insert end {Graph} \ - -text [mc "IO Ports"] \ - -image ::ICONS::16::graph \ - -raisecmd "$this bottomNB_show_hide Graph" \ - -helptext [mc "Graph showing state of MCU ports %s" "(Ctrl+2)"] - # tab "Messages" - $sec_notebook insert end {Messages} \ - -text [mc "Messages"] \ - -image ::ICONS::16::kcmsystem \ - -raisecmd "$this bottomNB_show_hide Messages" \ - -helptext [mc "Compiler messages %s" "(Ctrl+3)"] - # tab "Notes" - $sec_notebook insert end {Todo} \ - -text [mc "Notes"] \ - -image ::ICONS::16::camera_test \ - -raisecmd "$this bottomNB_show_hide Todo" \ - -helptext [mc "Personal todo list & notepad %s" "(Ctrl+4)"] - # tab "Calculator" - $sec_notebook insert end {Calculator} \ - -text [mc "Calculator"] \ - -image ::ICONS::16::xcalc \ - -raisecmd "$this bottomNB_show_hide Calculator" \ - -helptext [mc "Scientific calculator %s" "(Ctrl+5)"] - if {!$::MICROSOFT_WINDOWS} { ;# Microsoft Windows has no terminal emulator - # tab "Terminal" - $sec_notebook insert end {Terminal} \ - -text [mc "Terminal"] \ - -image ::ICONS::16::terminal \ - -raisecmd "$this bottomNB_show_hide Terminal" \ - -helptext [mc "Terminal emulator %s" ""] \ - -state [expr {${::PROGRAM_AVALIABLE(urxvt)} ? "normal" : "disabled"}] - } - # tab "Find in files" - $sec_notebook insert end {FindInFiles} \ - -text [mc "Find in files"] \ - -image ::ICONS::16::filefind \ - -raisecmd "$this bottomNB_show_hide FindInFiles" \ - -helptext [mc "Find in files %s" ""] \ - -createcmd [list $this CreateFindInFilesGUI] - # tab "Show" - $sec_notebook insert end {Show} \ - -text [mc "Show"] \ - -image ::ICONS::16::2uparrow \ - -raisecmd "$this bottomNB_show_hide" \ - -helptext [mc "Show this panel"] + $pri_notebook insert end {Hide} \ + -text [mc "Hide"] \ + -image ::ICONS::16::2downarrow \ + -raisecmd [list $this bottomNB_show_hide] \ + -helptext [mc "Hide this panel"] \ # Prepare panel componenets but do not create GUI elements PrepareCalculator $calculator_frame $calculatorList PrepareGraph $graph_frame $graph_config PrepareMessages $messages_frame PrepareTodo $todo_frame $todoText + PrepareSimulator $simulator_frame PrepareCVarsView $cvarsview_frame if {!$::MICROSOFT_WINDOWS} { ;# Microsoft Windows has no terminal emulator @@ -278,25 +213,30 @@ class BottomNoteBook { } PrepareFindInFiles $findinfiles_frame - # take case of proper pane resizing bind $parentPane "$this bottomNB_panel_set_size" # Show primary notebook if panel is visible or secondary notebook ohterwise + pack [$pri_notebook get_nb] -expand 1 -fill both -padx 5 -pady 5 if {$PanelVisible != 0} { - pack $pri_notebook -expand 1 -fill both - $parentPane paneconfigure $main_frame -minsize 190 - $parentPane configure -sashwidth 2 + $parentPane paneconfigure $main_frame -minsize 215 + $parentPane configure -sashwidth 4 # Raise tab catch {$pri_notebook raise $active_page} - } { - pack $sec_notebook -anchor nw -fill x -expand 1 + } else { + $pri_notebook hide_pages_area + $pri_notebook deselect_tab_button + $pri_notebook itemconfigure {Hide} \ + -text [mc "Show"] \ + -image ::ICONS::16::2uparrow \ + -helptext [mc "Show this panel"] + $parentPane paneconfigure $main_frame -minsize 0 $parentPane configure -sashwidth 0 bind $parentPane