1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import os
20
21 import wx
22
23 from timelinelib.config.paths import ICONS_DIR
24 from timelinelib.wxgui.dialogs.eventeditortabselection.controller import EventEditorTabSelectionDialogController
25 from timelinelib.wxgui.framework import Dialog
26
27
29
30 """
31 <BoxSizerVertical>
32 <StaticText label="$(header_text)" border="ALL"/>
33 <BoxSizerHorizontal border="LEFT|RIGHT" proportion="1">
34 <ListBox
35 name="lst_tab_order"
36 width="120"
37 height="150"
38 proportion="1"
39 event_EVT_LISTBOX="on_selection_changed"
40 />
41 <Spacer />
42 <BoxSizerVertical align="ALIGN_CENTER_VERTICAL">
43 <BitmapButton
44 name="btn_up"
45 bitmap="$(up_bitmap)"
46 event_EVT_BUTTON="on_up"
47 />
48 <Spacer />
49 <BitmapButton
50 name="btn_down"
51 bitmap="$(down_bitmap)"
52 event_EVT_BUTTON="on_down"
53 />
54 </BoxSizerVertical>
55 </BoxSizerHorizontal>
56 <DialogButtonsOkCancelSizer
57 border="ALL"
58 event_EVT_BUTTON__ID_OK="on_ok"
59 />
60 </BoxSizerVertical>
61 """
62
71
73 for text, key in tab_items:
74 self.lst_tab_order.Append(text, key)
75 self.lst_tab_order.Select(0)
76
79
82
85
88
91
94
97
99 self._MoveSelection(inx, -1)
100
102 self._MoveSelection(inx, 1)
103
105 text = self.lst_tab_order.GetString(inx)
106 key = self.lst_tab_order.GetClientData(inx)
107 self.lst_tab_order.Delete(inx)
108 self.lst_tab_order.Insert(text, inx + offset, key)
109 self.lst_tab_order.Select(inx + offset)
110
112 if 'wxMSW' in wx.PlatformInfo:
113 name = {wx.ART_GO_UP: "up.png", wx.ART_GO_DOWN: "down.png"}
114 return wx.Bitmap(os.path.join(ICONS_DIR, name[bitmap_id]))
115 else:
116 size = (24, 24)
117 return wx.ArtProvider.GetBitmap(bitmap_id, wx.ART_TOOLBAR, size)
118