-
Notifications
You must be signed in to change notification settings - Fork 1
/
mainwin_ui.tcl
184 lines (174 loc) · 7.43 KB
/
mainwin_ui.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#############################################################################
# Generated by PAGE version 4.26
# in conjunction with Tcl version 8.6
# Sep 27, 2023 09:52:06 PM CEST platform: Linux
set vTcl(timestamp) ""
if {!$vTcl(borrow) && !$vTcl(template)} {
set vTcl(actual_gui_font_tooltip_name) TkDefaultFont
set vTcl(actual_gui_font_treeview_name) TkDefaultFont
set vTcl(actual_gui_bg) #d9d9d9
set vTcl(actual_gui_fg) #000000
set vTcl(actual_gui_analog) #ececec
set vTcl(actual_gui_menu_analog) #ececec
set vTcl(actual_gui_menu_bg) #d9d9d9
set vTcl(actual_gui_menu_fg) #000000
set vTcl(complement_color) #d9d9d9
set vTcl(analog_color_p) #d9d9d9
set vTcl(analog_color_m) #d9d9d9
set vTcl(active_fg) #000000
set vTcl(actual_gui_menu_active_bg) #d8d8d8
set vTcl(active_menu_fg) #000000
}
proc vTclWindow.top37 {base} {
global vTcl
if {$base == ""} {
set base .top37
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
set top $base
###################
# CREATING WIDGETS
###################
vTcl::widgets::core::toplevel::createCmd $top -class Toplevel \
-background $vTcl(actual_gui_bg) -highlightcolor black
wm focusmodel $top passive
wm geometry $top 597x444+418+380
update
# set in toplevel.wgt.
global vTcl
global img_list
set vTcl(save,dflt,origin) 0
wm maxsize $top 3196 1173
wm minsize $top 120 1
wm overrideredirect $top 0
wm resizable $top 1 1
wm deiconify $top
wm title $top "Git Review"
vTcl:DefineAlias "$top" "DiffToDoc" vTcl:Toplevel:WidgetProc "" 1
text $top.tex39 \
-background white -font TkTextFont -foreground black -height 104 \
-highlightcolor black -insertbackground black \
-selectbackground #c4c4c4 -selectforeground black -undo 1 -width 574 \
-wrap word
.top37.tex39 configure -font "TkTextFont"
.top37.tex39 insert end text
vTcl:DefineAlias "$top.tex39" "txtCommitIds" vTcl:WidgetProc "DiffToDoc" 1
text $top.tex40 \
-background white -font TkTextFont -foreground black -height 144 \
-highlightcolor black -insertbackground black \
-selectbackground #c4c4c4 -selectforeground black -undo 1 -width 574 \
-wrap word
.top37.tex40 configure -font "TkTextFont"
.top37.tex40 insert end text
vTcl:DefineAlias "$top.tex40" "txtFilters" vTcl:WidgetProc "DiffToDoc" 1
ttk::combobox $top.tCo40 \
-values 'master','develop' -font TkTextFont \
-textvariable self.varBaseBranch -foreground {} -background {} \
-takefocus {}
vTcl:DefineAlias "$top.tCo40" "comboBaseBranch" vTcl:WidgetProc "DiffToDoc" 1
ttk::combobox $top.tCo41 \
-values 'master','develop','feat_xxx' -font TkTextFont \
-textvariable self.varToBranch -foreground {} -background {} \
-takefocus {}
vTcl:DefineAlias "$top.tCo41" "comboToBranch" vTcl:WidgetProc "DiffToDoc" 1
ttk::style configure TButton -background $vTcl(actual_gui_bg)
ttk::style configure TButton -foreground $vTcl(actual_gui_fg)
ttk::style configure TButton -font "$vTcl(actual_gui_font_dft_desc)"
ttk::button $top.tBu42 \
-command {lambda: addBranchDiffFromCommonAncestor(self)} \
-takefocus {} -text Add
vTcl:DefineAlias "$top.tBu42" "TButton1" vTcl:WidgetProc "DiffToDoc" 1
ttk::label $top.tLa43 \
-background $vTcl(actual_gui_bg) -foreground $vTcl(actual_gui_fg) \
-font TkDefaultFont -relief flat -text {Base branch:}
vTcl:DefineAlias "$top.tLa43" "TLabel1" vTcl:WidgetProc "DiffToDoc" 1
ttk::label $top.tLa44 \
-background $vTcl(actual_gui_bg) -foreground $vTcl(actual_gui_fg) \
-font TkDefaultFont -relief flat -text Branch:
vTcl:DefineAlias "$top.tLa44" "TLabel2" vTcl:WidgetProc "DiffToDoc" 1
ttk::label $top.tLa39 \
-background $vTcl(actual_gui_bg) -foreground $vTcl(actual_gui_fg) \
-font TkDefaultFont -relief flat -text Name:
vTcl:DefineAlias "$top.tLa39" "TLabel3" vTcl:WidgetProc "DiffToDoc" 1
ttk::entry $top.tEn40 \
-font TkTextFont -textvariable self.varName -foreground {} \
-background {} -takefocus {} -cursor xterm
vTcl:DefineAlias "$top.tEn40" "edName" vTcl:WidgetProc "DiffToDoc" 1
ttk::style configure TButton -background $vTcl(actual_gui_bg)
ttk::style configure TButton -foreground $vTcl(actual_gui_fg)
ttk::style configure TButton -font "$vTcl(actual_gui_font_dft_desc)"
ttk::button $top.tBu39 \
-command {lambda: generateDiffDocument(self)} -takefocus {} \
-text Generate
vTcl:DefineAlias "$top.tBu39" "TButton2" vTcl:WidgetProc "DiffToDoc" 1
ttk::label $top.tLa40 \
-background $vTcl(actual_gui_bg) -foreground $vTcl(actual_gui_fg) \
-font TkDefaultFont -relief flat -text Commits
vTcl:DefineAlias "$top.tLa40" "TLabel4" vTcl:WidgetProc "DiffToDoc" 1
ttk::label $top.tLa41 \
-background $vTcl(actual_gui_bg) -foreground $vTcl(actual_gui_fg) \
-font TkDefaultFont -relief flat -text Exclude
vTcl:DefineAlias "$top.tLa41" "TLabel5" vTcl:WidgetProc "DiffToDoc" 1
ttk::style configure TButton -background $vTcl(actual_gui_bg)
ttk::style configure TButton -foreground $vTcl(actual_gui_fg)
ttk::style configure TButton -font "$vTcl(actual_gui_font_dft_desc)"
ttk::button $top.tBu40 \
-command {lambda: displayDiffPreview(self)} -takefocus {} \
-text Preview...
vTcl:DefineAlias "$top.tBu40" "TButton3" vTcl:WidgetProc "DiffToDoc" 1
###################
# SETTING GEOMETRY
###################
place $top.tex39 \
-in $top -x 10 -y 129 -width 574 -relwidth 0 -height 104 -relheight 0 \
-anchor nw -bordermode ignore
place $top.tex40 \
-in $top -x 10 -y 260 -width 574 -relwidth 0 -height 144 -relheight 0 \
-anchor nw -bordermode ignore
place $top.tCo40 \
-in $top -x 110 -y 10 -width 397 -relwidth 0 -height 21 -relheight 0 \
-anchor nw -bordermode ignore
place $top.tCo41 \
-in $top -x 110 -y 40 -width 397 -relwidth 0 -height 21 -relheight 0 \
-anchor nw -bordermode ignore
place $top.tBu42 \
-in $top -x 520 -y 30 -width 62 -relwidth 0 -height 28 -relheight 0 \
-anchor nw -bordermode ignore
place $top.tLa43 \
-in $top -x 10 -y 10 -width 92 -relwidth 0 -height 19 -relheight 0 \
-anchor nw -bordermode ignore
place $top.tLa44 \
-in $top -x 10 -y 40 -width 92 -relwidth 0 -anchor nw \
-bordermode ignore
place $top.tLa39 \
-in $top -x 10 -y 70 -width 92 -relwidth 0 -height 19 -relheight 0 \
-anchor nw -bordermode ignore
place $top.tEn40 \
-in $top -x 110 -y 70 -width 474 -relwidth 0 -height 21 -relheight 0 \
-anchor nw -bordermode ignore
place $top.tBu39 \
-in $top -x 490 -y 410 -anchor nw -bordermode ignore
place $top.tLa40 \
-in $top -x 10 -y 105 -width 61 -height 19 -anchor nw \
-bordermode ignore
place $top.tLa41 \
-in $top -x 10 -y 240 -anchor nw -bordermode ignore
place $top.tBu40 \
-in $top -x 380 -y 410 -anchor nw -bordermode ignore
vTcl:FireEvent $base <<Ready>>
}
set btop ""
if {$vTcl(borrow)} {
set btop .bor[expr int([expr rand() * 100])]
while {[lsearch $btop $vTcl(tops)] != -1} {
set btop .bor[expr int([expr rand() * 100])]
}
}
set vTcl(btop) $btop
Window show .
Window show .top37 $btop
if {$vTcl(borrow)} {
$btop configure -background plum
}