From 7d1f8919a44155112731d34cc976534c81cfc5f4 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Thu, 24 May 2018 11:37:34 +0300 Subject: [PATCH] Small changes --- lib/function.tcl | 20 +++++++++++--------- lib/gui.tcl | 35 +---------------------------------- rac_gui.tcl | 19 +++++++++++++++++++ 3 files changed, 31 insertions(+), 43 deletions(-) diff --git a/lib/function.tcl b/lib/function.tcl index bfe4ec9..d819eb1 100644 --- a/lib/function.tcl +++ b/lib/function.tcl @@ -1,10 +1,10 @@ -###################################################### -# Rac GUI -# Distributed under GNU Public License +########################################### +# Rac GUI +# Distributed under GNU Public License # Author: Sergey Kalinin svk@nuk-svk.ru # Copyright (c) "http://nuk-svk.ru", 2018 # https://bitbucket.org/svk28/rac-gui -###################################################### +########################################### proc Quit {} { exit @@ -21,7 +21,7 @@ proc TreePress {tree} { } elseif {$key eq ""} { return } - #puts "$id $host $values" + puts "$id $host $values" Run::$key $tree $host $values #RunCommand $root "infobase summary list --cluster=$cluster $host" } @@ -369,7 +369,7 @@ proc Add::servers {tree host values} { global default dedicate_manager using_central_server set dedicate_manager "none" set using_central_server "normal" - set active_cluster $values + #set active_cluster $values toplevel .add wm title .add "Добавление рабочего сервера" ttk::label .add.lbl -image server_grey_64 @@ -471,7 +471,7 @@ proc Add::infobase {tree host values} { proc Add::infobases {tree host values} { global default active_cluster global secure_level dbms block_shedule create_db license_distribution date_offset db_create - set active_cluster $values + #set active_cluster $values # установка значений по умолчанию set license_distribution deny set secure_level [lindex $default(secure_level) 0] @@ -544,7 +544,7 @@ proc Add::infobases {tree host values} { grid columnconfigure $frm 0 -weight 1 grid rowconfigure $frm 0 -weight 1 - set active_cluster $values + #set active_cluster $values # Проверяем значение чекбокса и выставляем соответсвющую опцию if {$create_db eq "true"} { set db_create "--create-database" @@ -609,7 +609,7 @@ proc Add::cluster {tree host values} { RunCommand "" "cluster insert \ --host=[.add.frm.ent_host get] \ --port=[.add.frm.ent_port get] \ - --name=[.add.frm.ent_cluster_name get] $host"] + --name=[.add.frm.ent_cluster_name get] $host" destroy .add } ttk::button $frm_btn.btn_cancel -command {destroy .add} -image quit_grey_24 @@ -627,3 +627,5 @@ proc SaveMainServer {host port} { return "$host:$port" } + + diff --git a/lib/gui.tcl b/lib/gui.tcl index 0c27e29..9465484 100644 --- a/lib/gui.tcl +++ b/lib/gui.tcl @@ -29,10 +29,6 @@ ttk::button $frm_tool.btn_add -command Add -image add_grey_32 ttk::button $frm_tool.btn_del -command Del -image del_grey_32 ttk::button $frm_tool.btn_quit -command Quit -image quit_grey_32 -# button $frm_tool.btn_add -text + -command Add -image add_color_32 -relief flat -# button $frm_tool.btn_del -text - -command Del -image del_color_32 -relief flat -# button $frm_tool.btn_quit -text Выход -command Quit -image quit_color_32 -relief flat - pack $frm_tool.btn_add $frm_tool.btn_del $frm_tool.btn_quit -side top -padx 5 -pady 5 set frm_tree [frame .frm_tree] @@ -50,15 +46,10 @@ grid rowconfigure $frm_tree 0 -weight 1 #bind $frm_tree.tree "TreePress %x %y %X %Y $frm_tree.tree" bind $frm_tree.tree "TreePress $frm_tree.tree" -#$tree insert {} end -id Languages -text "Languages" -#$tree insert Languages end -text C -values [list "Dennis Ritchie" "1990"] -#$tree insert "" end -id Direct -text "Direct" -#$tree insert Direct end -text C -values [list "Dennis Ritchie" "1990"] - set frm_work [frame .frm_work] ttk::scrollbar $frm_work.hsb -orient horizontal -command [list $frm_work.tree_work xview] ttk::scrollbar $frm_work.vsb -orient vertical -command [list $frm_work.tree_work yview] -set tree_work [ttk::treeview $frm_work.tree_work -show headings -columns "par val" -displaycolumns "par val" -xscrollcommand [list $frm_work.hsb set] -yscrollcommand [list $frm_work.vsb set]] +set tree_work [ttk::treeview $frm_work.tree_work -class TreeView -show headings -columns "par val" -displaycolumns "par val" -xscrollcommand [list $frm_work.hsb set] -yscrollcommand [list $frm_work.vsb set]] #set tree_work [ttk::treeview $frm_work.tree_work \ #$tree_work heading Creator -text "Creator" -anchor center @@ -73,27 +64,3 @@ grid rowconfigure $frm_work 0 -weight 1 #pack $tree_work -expand true -fill both pack $frm_tool -side left -fill y pack $frm_tree $frm_work -side left -expand true -fill both - -# $tree_work insert {} end -id Languages -text "Languages" -# $tree_work insert Languages end -text C -values [list "Dennis Ritchie" "1990"] -# $tree_work insert "" end -id Direct -text "Direct" -# $tree_work insert Direct end -text C -values [list "Dennis Ritchie" "1990"] -# - -# #toplevel . -# text .t.txt -wrap none -xscroll {.t.h set} -yscroll {.t.v set} -# scrollbar .t.v -orient vertical -command {.t.txt yview} -# scrollbar .t.h -orient horizontal -command {.t.txt xview} -# -# # Lay them out -# grid .t.txt .t.v -sticky nsew -# grid .t.h -sticky nsew -# -# # Tell the text widget to take all the extra room -# grid rowconfigure .t .t.txt -weight 1 -# grid columnconfigure .t .t.txt -weight 1 - - - - - diff --git a/rac_gui.tcl b/rac_gui.tcl index 741c19a..c661810 100755 --- a/rac_gui.tcl +++ b/rac_gui.tcl @@ -56,4 +56,23 @@ if [file exists [file join $dir(work) 1c_srv.cfg]] { .frm_tree.tree insert {} end -id "server::$line" -text "$line" -values "$line" } } +# set editor(fg) grey +# set editor(bg) black +# option add *Entry.Foreground $editor(fg) interactive +# option add *Entry.Background $editor(bg) interactive +# option add *Label.Foreground $editor(fg) interactive +# option add *Label.Background $editor(bg) interactive +# option add *Checkbox.Foreground $editor(fg) interactive +# option add *Checkbox.Background $editor(bg) interactive +# option add *Checkbutton.Foreground $editor(fg) interactive +# option add *Checkbutton.Background $editor(bg) interactive +# option add *Combobox.Foreground $editor(fg) interactive +# option add *Combobox.Background $editor(bg) interactive +# option add *Listbox.Foreground $editor(fg) interactive +# option add *Listbox.Background $editor(bg) interactive +# option add *TreeView.Background $editor(bg) interactive +# option add *TreeView.Foreground $editor(fg) interactive +# #option add *Frame.Background $editor(bg) interactive +# option add *ScrollableFrame.Background $editor(bg) interactive +# option add *ScrolledWindow.Background $editor(bg) interactive