File: persist_constants.py

package info (click to toggle)
wxpython3.0 3.0.2.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 482,760 kB
  • ctags: 518,293
  • sloc: cpp: 2,127,226; python: 294,045; makefile: 51,942; ansic: 19,033; sh: 3,013; xml: 1,629; perl: 17
file content (263 lines) | stat: -rw-r--r-- 9,268 bytes parent folder | download | duplicates (3)
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
"""
This module contains all the constants used by the persistent objects.
"""

import wx

# ----------------------------------------------------------------------------------- #
# PersistenceManager styles

PM_SAVE_RESTORE_AUI_PERSPECTIVES     = 1 << 0
PM_SAVE_RESTORE_TREE_LIST_SELECTIONS = 1 << 1
PM_PERSIST_CONTROL_VALUE             = 1 << 2
PM_RESTORE_CAPTION_FROM_CODE         = 1 << 3
PM_DEFAULT_STYLE                     = PM_SAVE_RESTORE_AUI_PERSPECTIVES | PM_PERSIST_CONTROL_VALUE

# ----------------------------------------------------------------------------------- #
CONFIG_PATH_SEPARATOR = "/"

BAD_DEFAULT_NAMES = ["widget", "wxSpinButton", "auiFloating", "AuiTabCtrl", "maskedTextCtrl",
                     "numctrl", "IpAddrCtrl", "masked.num", "time", "scrolledpanel", "cPanel"]

for name in dir(wx):
    if "NameStr" in name:
        BAD_DEFAULT_NAMES.append(eval("wx.%s"%name))

# ----------------------------------------------------------------------------------- #
# String constants used by BookHandler

PERSIST_BOOK_KIND = "Book"
PERSIST_BOOK_SELECTION = "Selection"

# To save and restore wx.lib.agw.aui.AuiNotebook perspectives
PERSIST_BOOK_AGW_AUI_PERSPECTIVE = "AGWAui_Notebook_Perspective"

# ----------------------------------------------------------------------------------- #
# String constants used by TreebookHandler

PERSIST_TREEBOOK_KIND = "TreeBook"

# this key contains the indices of all expanded nodes in the tree book
# separated by PERSIST_SEP
PERSIST_TREEBOOK_EXPANDED_BRANCHES = "Expanded"
PERSIST_SEP = ','

# ----------------------------------------------------------------------------------- #
# String constants used by TLWHandler

# we use just "Window" to keep configuration files and such short, there
# should be no confusion with wx.Window itself as we don't have persistent
# windows, just persistent controls which have their own specific kind strings

PERSIST_TLW_KIND = "Window"

# Names for various persistent options
PERSIST_TLW_X = "x"
PERSIST_TLW_Y = "y"
PERSIST_TLW_W = "w"
PERSIST_TLW_H = "h"

PERSIST_TLW_MAXIMIZED = "Maximized"
PERSIST_TLW_ICONIZED = "Iconized"

# To save and restore wx.aui and wx.lib.agw.aui perspectives
PERSIST_AGW_AUI_PERSPECTIVE = "AGWAui_Perspective"
PERSIST_AUI_PERSPECTIVE = "Aui_Perspective"

PERSIST_AUIPERSPECTIVE_KIND = "AUI manager"

# ----------------------------------------------------------------------------------- #
# String constants used by CheckBoxHandler

PERSIST_CHECKBOX_KIND = "CheckBox"
PERSIST_CHECKBOX_3STATE = "3StateValue"
PERSIST_CHECKBOX = "Value"

# ----------------------------------------------------------------------------------- #
# String constants used by ListBoxHandler

PERSIST_LISTBOX_KIND = "ListBox"
PERSIST_LISTBOX_SELECTIONS = "Selections"

# ----------------------------------------------------------------------------------- #
# String constants used by ListCtrlHandler

PERSIST_LISTCTRL_KIND = "ListCtrl"
PERSIST_LISTCTRL_COLWIDTHS = "ColWidths"

# ----------------------------------------------------------------------------------- #
# String constants used by CheckListBoxHandler

PERSIST_CHECKLISTBOX_KIND = "CheckListBox"
PERSIST_CHECKLIST_CHECKED = "Checked"
PERSIST_CHECKLIST_SELECTIONS = "Selections"

# ----------------------------------------------------------------------------------- #
# String constants used by ChoiceComboHandler

PERSIST_CHOICECOMBO_KIND = "ComboBox"
PERSIST_CHOICECOMBO_SELECTION = "Selection"

# ----------------------------------------------------------------------------------- #
# String constants used by RadioBoxHandler

PERSIST_RADIOBOX_KIND = "RadioBox"
PERSIST_RADIOBOX_SELECTION = "Selection"

# ----------------------------------------------------------------------------------- #
# String constants used by RadioButtonHandler

PERSIST_RADIOBUTTON_KIND = "RadioButton"
PERSIST_RADIOBUTTON_VALUE = "Value"

# ----------------------------------------------------------------------------------- #
# String constants used by ScrolledWindowHandler

PERSIST_SCROLLEDWINDOW_KIND = "ScrolledWindow"
PERSIST_SCROLLEDWINDOW_POS_H = "Scroll_H"
PERSIST_SCROLLEDWINDOW_POS_V = "Scroll_V"

# ----------------------------------------------------------------------------------- #
# String constants used by SliderHandler

PERSIST_SLIDER_KIND = "Slider"
PERSIST_SLIDER_VALUE = "Value"

# ----------------------------------------------------------------------------------- #
# String constants used by SpinHandler

PERSIST_SPIN_KIND = "Spin"
PERSIST_SPIN_VALUE = "Value"

# ----------------------------------------------------------------------------------- #
# String constants used by SplitterHandler

PERSIST_SPLITTER_KIND = "Splitter"
PERSIST_SPLITTER_POSITION = "Position"

# ----------------------------------------------------------------------------------- #
# String constants used by TextCtrlHandler

PERSIST_TEXTCTRL_KIND = "TextCtrl"
PERSIST_TEXTCTRL_VALUE = "Value"

# ----------------------------------------------------------------------------------- #
# String constants used by ToggleButtonHandler

PERSIST_TOGGLEBUTTON_KIND = "ToggleButton"
PERSIST_TOGGLEBUTTON_TOGGLED = "Toggled"

# ----------------------------------------------------------------------------------- #
# String constants used by TreeCtrlHandler

PERSIST_TREECTRL_KIND = "TreeCtrl"
PERSIST_TREECTRL_CHECKED_ITEMS = "Checked"
PERSIST_TREECTRL_EXPANSION = "Expansion"
PERSIST_TREECTRL_SELECTIONS = "Selections"

# ----------------------------------------------------------------------------------- #
# String constants used by TreeListCtrlHandler

PERSIST_TREELISTCTRL_KIND = "TreeListCtrl"
PERSIST_TREELISTCTRL_COLWIDTHS = "ColWidths"

# ----------------------------------------------------------------------------------- #
# String constants used by CalendarCtrlHandler

PERSIST_CALENDAR_KIND = "Calendar"
PERSIST_CALENDAR_DATE = "Date"

# ----------------------------------------------------------------------------------- #
# String constants used by CollapsiblePaneHandler

PERSIST_COLLAPSIBLE_KIND = "Collapsible"
PERSIST_COLLAPSIBLE_STATE = "Collapse"

# ----------------------------------------------------------------------------------- #
# String constants used by DatePickerHandler

PERSIST_DATEPICKER_KIND = "DatePicker"
PERSIST_DATEPICKER_DATE = "Date"

# ----------------------------------------------------------------------------------- #
# String constants used by MediaCtrlHandler

PERSIST_MEDIA_KIND = "MediaCtrl"

PERSIST_MEDIA_POS = "Seek"
PERSIST_MEDIA_VOLUME = "Volume"
PERSIST_MEDIA_RATE = "Rate"

# ----------------------------------------------------------------------------------- #
# String constants used by ColourPickerHandler

PERSIST_COLOURPICKER_KIND = "ColourPicker"
PERSIST_COLOURPICKER_COLOUR = "Colour"

# ----------------------------------------------------------------------------------- #
# String constants used by FileDirPickerHandler

PERSIST_FILEDIRPICKER_KIND = "FileDirPicker"
PERSIST_FILEDIRPICKER_PATH = "Path"

# ----------------------------------------------------------------------------------- #
# String constants used by FontPickerHandler

PERSIST_FONTPICKER_KIND = "FontPicker"
PERSIST_FONTPICKER_FONT = "Font"

# ----------------------------------------------------------------------------------- #
# String constants used by FileHistoryHandler

PERSIST_FILEHISTORY_KIND = "FileHistory"
PERSIST_FILEHISTORY_PATHS = "Paths"

# ----------------------------------------------------------------------------------- #
# String constants used by FindReplaceHandler

PERSIST_FINDREPLACE_KIND = "FindReplace"
PERSIST_FINDREPLACE_FLAGS = "Flags"
PERSIST_FINDREPLACE_SEARCH = "Search"
PERSIST_FINDREPLACE_REPLACE = "Replace"

# ----------------------------------------------------------------------------------- #
# String constants used by FontDialogHandler

PERSIST_FONTDIALOG_KIND = "FontDialog"
PERSIST_FONTDIALOG_EFFECTS = "Effects"
PERSIST_FONTDIALOG_SYMBOLS = "Symbols"
PERSIST_FONTDIALOG_COLOUR = "Colour"
PERSIST_FONTDIALOG_FONT = "Font"
PERSIST_FONTDIALOG_HELP = "Help"

# ----------------------------------------------------------------------------------- #
# String constants used by ColourDialogHandler

PERSIST_COLOURDIALOG_KIND = "ColourDialog"
PERSIST_COLOURDIALOG_COLOUR = "Colour"
PERSIST_COLOURDIALOG_CHOOSEFULL = "ChooseFull"
PERSIST_COLOURDIALOG_CUSTOMCOLOURS = "CustomColours"

# ----------------------------------------------------------------------------------- #
# String constants used by ChoiceDialogHandler

PERSIST_CHOICEDIALOG_KIND = "ChoiceDialog"
PERSIST_CHOICEDIALOG_SELECTIONS = "Selections"

# ----------------------------------------------------------------------------------- #
# String constants used by MenuBarHandler

PERSIST_MENUBAR_KIND = "MenuBar"
PERSIST_MENUBAR_CHECKRADIO_ITEMS = "Checked"

# ----------------------------------------------------------------------------------- #
# String constants used by ToolBarHandler

PERSIST_TOOLBAR_KIND = "ToolBar"
PERSIST_TOOLBAR_CHECKRADIO_ITEMS = "Checked"

# ----------------------------------------------------------------------------------- #
# String constants used by FoldPanelBarHandler

PERSIST_FOLDPANELBAR_KIND = "FoldPanelBar"
PERSIST_FOLDPANELBAR_EXPANDED = "FoldpPanelExpanded"