7
7
from ttk_text .scrolled_text import ScrolledText
8
8
9
9
from vcf_generator_lite .constants import APP_NAME , URL_LICENSE , URL_RELEASES , URL_REPORT , URL_REPOSITORY
10
+ from vcf_generator_lite .layout .vertical_dialog_layout import VerticalDialogLayout
10
11
from vcf_generator_lite .util .tkinter .menu import MenuBarWindowExtension , MenuCascade , MenuCommand , MenuSeparator
11
12
from vcf_generator_lite .util .tkinter .widget import auto_wrap_configure_event
12
13
from vcf_generator_lite .widget .menu import TextContextMenu
16
17
EVENT_GENERATE , USAGE
17
18
18
19
19
- class MainWindow (ExtendedTk , MenuBarWindowExtension ):
20
+ class MainWindow (ExtendedTk , VerticalDialogLayout , MenuBarWindowExtension ):
20
21
generate_button : Button
21
22
content_text : ScrolledText
22
23
progress_bar : Progressbar
@@ -30,30 +31,34 @@ def _configure_ui_withdraw(self):
30
31
self .title (APP_NAME )
31
32
self .wm_minsize_pt (300 , 300 )
32
33
self .wm_size_pt (450 , 450 )
33
- self ._create_widgets ()
34
+ self ._create_widgets (self )
34
35
self ._create_menus ()
35
36
36
37
@override
37
38
def _configure_ui (self ):
38
39
super ()._configure_ui ()
39
40
self .content_text .focus_set ()
40
41
41
- def _create_widgets (self ):
42
- description_label = Label (self , text = USAGE , justify = LEFT )
42
+ @override
43
+ def _create_header (self , parent : Misc ):
44
+ description_label = Label (parent , text = USAGE , justify = LEFT )
43
45
description_label .bind ("<Configure>" , auto_wrap_configure_event , "+" )
44
46
description_label .pack (fill = X , padx = "7p" , pady = "7p" )
47
+ return description_label
45
48
46
- self .content_text = ScrolledText (self , undo = True , tabs = "2c" , tabstyle = "wordprocessor" , maxundo = 5 )
49
+ @override
50
+ def _create_content (self , master : Misc ):
51
+ content_frame = Frame (master )
52
+ self .content_text = ScrolledText (content_frame , undo = True , tabs = "2c" , tabstyle = "wordprocessor" , maxundo = 5 )
47
53
self .content_text .insert (0.0 , DEFAULT_INPUT_CONTENT )
48
54
self .content_text .edit_reset ()
49
55
self .content_text .pack (fill = BOTH , expand = True , padx = "7p" , pady = 0 )
50
56
text_context_menu = TextContextMenu (self .content_text )
51
57
text_context_menu .bind_to_widget ()
58
+ return content_frame
52
59
53
- action_frame = self ._create_action_bar (self )
54
- action_frame .pack (fill = X )
55
-
56
- def _create_action_bar (self , master : Misc ):
60
+ @override
61
+ def _create_actions (self , master : Misc ):
57
62
action_frame = Frame (master )
58
63
sizegrip = Sizegrip (action_frame )
59
64
sizegrip .place (relx = 1 , rely = 1 , anchor = SE )
0 commit comments