Small changes

This commit is contained in:
Sergey Kalinin 2018-05-24 11:37:34 +03:00
parent 4565785093
commit 7d1f8919a4
3 changed files with 31 additions and 43 deletions

View File

@ -1,10 +1,10 @@
###################################################### ###########################################
# Rac GUI # Rac GUI
# Distributed under GNU Public License # Distributed under GNU Public License
# Author: Sergey Kalinin svk@nuk-svk.ru # Author: Sergey Kalinin svk@nuk-svk.ru
# Copyright (c) "http://nuk-svk.ru", 2018 # Copyright (c) "http://nuk-svk.ru", 2018
# https://bitbucket.org/svk28/rac-gui # https://bitbucket.org/svk28/rac-gui
###################################################### ###########################################
proc Quit {} { proc Quit {} {
exit exit
@ -21,7 +21,7 @@ proc TreePress {tree} {
} elseif {$key eq ""} { } elseif {$key eq ""} {
return return
} }
#puts "$id $host $values" puts "$id $host $values"
Run::$key $tree $host $values Run::$key $tree $host $values
#RunCommand $root "infobase summary list --cluster=$cluster $host" #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 global default dedicate_manager using_central_server
set dedicate_manager "none" set dedicate_manager "none"
set using_central_server "normal" set using_central_server "normal"
set active_cluster $values #set active_cluster $values
toplevel .add toplevel .add
wm title .add "Добавление рабочего сервера" wm title .add "Добавление рабочего сервера"
ttk::label .add.lbl -image server_grey_64 ttk::label .add.lbl -image server_grey_64
@ -471,7 +471,7 @@ proc Add::infobase {tree host values} {
proc Add::infobases {tree host values} { proc Add::infobases {tree host values} {
global default active_cluster global default active_cluster
global secure_level dbms block_shedule create_db license_distribution date_offset db_create 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 license_distribution deny
set secure_level [lindex $default(secure_level) 0] 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 columnconfigure $frm 0 -weight 1
grid rowconfigure $frm 0 -weight 1 grid rowconfigure $frm 0 -weight 1
set active_cluster $values #set active_cluster $values
# Проверяем значение чекбокса и выставляем соответсвющую опцию # Проверяем значение чекбокса и выставляем соответсвющую опцию
if {$create_db eq "true"} { if {$create_db eq "true"} {
set db_create "--create-database" set db_create "--create-database"
@ -609,7 +609,7 @@ proc Add::cluster {tree host values} {
RunCommand "" "cluster insert \ RunCommand "" "cluster insert \
--host=[.add.frm.ent_host get] \ --host=[.add.frm.ent_host get] \
--port=[.add.frm.ent_port 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 destroy .add
} }
ttk::button $frm_btn.btn_cancel -command {destroy .add} -image quit_grey_24 ttk::button $frm_btn.btn_cancel -command {destroy .add} -image quit_grey_24
@ -627,3 +627,5 @@ proc SaveMainServer {host port} {
return "$host:$port" return "$host:$port"
} }

View File

@ -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_del -command Del -image del_grey_32
ttk::button $frm_tool.btn_quit -command Quit -image quit_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 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] set frm_tree [frame .frm_tree]
@ -50,15 +46,10 @@ grid rowconfigure $frm_tree 0 -weight 1
#bind $frm_tree.tree <ButtonRelease> "TreePress %x %y %X %Y $frm_tree.tree" #bind $frm_tree.tree <ButtonRelease> "TreePress %x %y %X %Y $frm_tree.tree"
bind $frm_tree.tree <ButtonRelease> "TreePress $frm_tree.tree" bind $frm_tree.tree <ButtonRelease> "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] set frm_work [frame .frm_work]
ttk::scrollbar $frm_work.hsb -orient horizontal -command [list $frm_work.tree_work xview] 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] 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 \ #set tree_work [ttk::treeview $frm_work.tree_work \
#$tree_work heading Creator -text "Creator" -anchor center #$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 $tree_work -expand true -fill both
pack $frm_tool -side left -fill y pack $frm_tool -side left -fill y
pack $frm_tree $frm_work -side left -expand true -fill both 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

View File

@ -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" .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