1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 from timelinelib.wxgui.dialogs.eraeditor.controller import EraEditorDialogController
20 from timelinelib.wxgui.framework import Dialog
21
22
24
25 """
26 <BoxSizerVertical>
27 <StaticBoxSizerVertical label="$(groupbox_text)" border="ALL" >
28 <FlexGridSizer rows="0" columns="2" border="ALL">
29 <StaticText
30 label="$(when_text)"
31 align="ALIGN_CENTER_VERTICAL"
32 />
33 <PeriodPicker
34 time_type="$(time_type)"
35 config="$(config)"
36 name="period_picker"
37 />
38 <Spacer />
39 <BoxSizerHorizontal >
40 <CheckBox
41 align="ALIGN_CENTER_VERTICAL"
42 label="$(ends_today_text)"
43 name="cbx_ends_today"
44 />
45 </BoxSizerHorizontal>
46 <StaticText
47 label="$(name_text)"
48 align="ALIGN_CENTER_VERTICAL"
49 />
50 <TextCtrl name="txt_name" />
51 <StaticText
52 label="$(colour_text)"
53 align="ALIGN_CENTER_VERTICAL"
54 />
55 <ColourSelect
56 name="colorpicker"
57 align="ALIGN_CENTER_VERTICAL"
58 width="60"
59 height="30"
60 />
61 </FlexGridSizer>
62 </StaticBoxSizerVertical>
63 <DialogButtonsOkCancelSizer
64 border="LEFT|RIGHT|BOTTOM"
65 event_EVT_BUTTON__ID_OK="on_ok"
66 />
67 </BoxSizerVertical>
68 """
69
70 - def __init__(self, parent, title, time_type, config, era):
71 Dialog.__init__(self, EraEditorDialogController, parent, {
72 "groupbox_text": _("Era Properties"),
73 "name_text": _("Name:"),
74 "colour_text": _("Colour:"),
75 "when_text": _("When:"),
76 "time_type": time_type,
77 "config": config,
78 "ends_today_text": _("Ends today"),
79 }, title=title)
80 self.controller.on_init(era)
81 self.period_picker.SetFocus()
82
85
88
90 return self.cbx_ends_today.IsChecked()
91
94
97
100
103
105 self.colorpicker.SetValue(new_color)
106
109
112
115