From 8d07cc398939eadeb16d7de5f2047d677a943df6 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Sat, 19 May 2018 16:53:48 +0300 Subject: [PATCH] Added ttk::style options. Add function skeletons --- 1c_srv.cfg | 2 +- lib/function.tcl | 46 +++++++++++++++++++++++++++++++++------------- lib/gui.tcl | 5 ++--- 3 files changed, 36 insertions(+), 17 deletions(-) diff --git a/1c_srv.cfg b/1c_srv.cfg index c8d0298..5a4d829 100644 --- a/1c_srv.cfg +++ b/1c_srv.cfg @@ -6,7 +6,7 @@ # https://bitbucket.org/svk28/rac-gui ###################################################### -set host 1c-vm-srv +set host localhost set port 1541 diff --git a/lib/function.tcl b/lib/function.tcl index 814716c..f1dccac 100644 --- a/lib/function.tcl +++ b/lib/function.tcl @@ -18,7 +18,6 @@ proc TreePress {tree} { set key [lindex [split $id "::"] 0] Run::$key $tree $host $values #RunCommand $root "infobase summary list --cluster=$cluster $host" - } namespace eval Run {} {} @@ -257,19 +256,40 @@ proc Del {} { Del::$key .frm_tree.tree $host $values } -namespace eval Del {} {} - -proc Del::work_server {tree host values} { - global active_cluster - .frm_work.tree_work delete [ .frm_work.tree_work children {}] - set answer [tk_messageBox -message "Удалить рабочий сервер $values?" \ - -icon question -type yesno ] - switch -- $answer { - yes { - set lst [RunCommand infobase::$values "server remove --cluster=$active_cluster --server=$values $host"] - $tree delete "work_server::$values" +namespace eval Del {} { + proc work_server {tree host values} { + global active_cluster + .frm_work.tree_work delete [ .frm_work.tree_work children {}] + set answer [tk_messageBox -message "Удалить рабочий сервер $values?" \ + -icon question -type yesno ] + switch -- $answer { + yes { + set lst [RunCommand infobase::$values "server remove --cluster=$active_cluster --server=$values $host"] + $tree delete "work_server::$values" + } + no {return} } - no {return} + } +} +proc Add {} { + global active_cluster host + set id [.frm_tree.tree selection] + set values [.frm_tree.tree item [.frm_tree.tree selection] -values] + set key [lindex [split $id "::"] 0] + puts "$key, $id , $values" + Add::$key .frm_tree.tree $host $values +} + +namespace eval Add {} { + proc server {} { + } + proc work_server {tree host values} { + } + proc infobase {tree host values} { + Add::infobases $tree $host $values + } + proc infobases {tree host values} { + puts "$tree $host $values" } } diff --git a/lib/gui.tcl b/lib/gui.tcl index 3ece49a..d2d7683 100644 --- a/lib/gui.tcl +++ b/lib/gui.tcl @@ -23,16 +23,15 @@ wm overrideredirect . 0 wm positionfrom . user set frm_tool [frame .frm_tool] +ttk::style theme use clam + 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 -ttk::style theme use clam - # 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