1 | |
---|
2 | """ |
---|
3 | Provide the style for guiframe |
---|
4 | """ |
---|
5 | import wx |
---|
6 | import os |
---|
7 | from sans.guiframe import get_data_path |
---|
8 | |
---|
9 | |
---|
10 | class GUIFRAME: |
---|
11 | MANAGER_ON = 1 |
---|
12 | FLOATING_PANEL = 2 |
---|
13 | FIXED_PANEL = 4 |
---|
14 | PLOTTING_ON = 8 |
---|
15 | DATALOADER_ON = 16 |
---|
16 | TOOLBAR_ON = 32 |
---|
17 | CALCULATOR_ON = 256 |
---|
18 | SINGLE_APPLICATION = 64 |
---|
19 | WELCOME_PANEL_ON = 128 |
---|
20 | DEFAULT_STYLE = SINGLE_APPLICATION|DATALOADER_ON|PLOTTING_ON|FIXED_PANEL |
---|
21 | MULTIPLE_APPLICATIONS = DEFAULT_STYLE |
---|
22 | |
---|
23 | class GUIFRAME_ID: |
---|
24 | UNDO_ID = wx.NewId() |
---|
25 | REDO_ID = wx.NewId() |
---|
26 | COPY_ID = wx.NewId() |
---|
27 | PASTE_ID = wx.NewId() |
---|
28 | BOOKMARK_ID = wx.NewId() |
---|
29 | SAVE_ID = wx.NewId() |
---|
30 | ZOOM_IN_ID = wx.NewId() |
---|
31 | ZOOM_OUT_ID = wx.NewId() |
---|
32 | ZOOM_ID = wx.NewId() |
---|
33 | DRAG_ID = wx.NewId() |
---|
34 | RESET_ID = wx.NewId() |
---|
35 | PREVIEW_ID = wx.NewId() |
---|
36 | PRINT_ID = wx.NewId() |
---|
37 | CURRENT_APPLICATION = wx.NewId() |
---|
38 | CURVE_SYMBOL_NUM = 13 |
---|
39 | |
---|
40 | class GUIFRAME_ICON: |
---|
41 | PATH = get_data_path(media='images') |
---|
42 | SAVE_ICON_PATH = os.path.join(PATH, 'save.png') |
---|
43 | UNDO_ICON_PATH = os.path.join(PATH, 'undo.png') |
---|
44 | REDO_ICON_PATH = os.path.join(PATH, 'redo.png') |
---|
45 | COPY_ICON_PATH = os.path.join(PATH, 'copy.png') |
---|
46 | PASTE_ICON_PATH = os.path.join(PATH, 'paste.png') |
---|
47 | BOOKMARK_ICON_PATH = os.path.join(PATH, 'bookmark.png') |
---|
48 | ZOOM_IN_ID_PATH = os.path.join(PATH, 'zoom_in.png') |
---|
49 | ZOOM_OUT_ID_PATH = os.path.join(PATH, 'zoom_out.png') |
---|
50 | ZOOM_ID_PATH = os.path.join(PATH, 'search_pan.png') |
---|
51 | DRAG_ID_PATH = os.path.join(PATH, 'drag_hand.png') |
---|
52 | RESET_ID_PATH = os.path.join(PATH, 'reset.png') |
---|
53 | PREVIEW_ID_PATH = os.path.join(PATH, 'report.png') |
---|
54 | PRINT_ID_PATH = os.path.join(PATH, 'printer.png') |
---|
55 | |
---|
56 | SAVE_ICON = wx.Image(os.path.join(PATH, 'save.png')) |
---|
57 | UNDO_ICON = wx.Image(os.path.join(PATH, 'undo.png')) |
---|
58 | REDO_ICON = wx.Image(os.path.join(PATH, 'redo.png')) |
---|
59 | COPY_ICON = wx.Image(os.path.join(PATH, 'copy.png')) |
---|
60 | PASTE_ICON = wx.Image(os.path.join(PATH, 'paste.png')) |
---|
61 | BOOKMARK_ICON = wx.Image(os.path.join(PATH, 'bookmark.png')) |
---|
62 | ZOOM_IN_ICON = wx.Image(os.path.join(PATH, 'zoom_in.png')) |
---|
63 | ZOOM_OUT_ICON = wx.Image(os.path.join(PATH, 'zoom_out.png')) |
---|
64 | ZOOM_ICON = wx.Image(os.path.join(PATH, 'search_pan.png')) |
---|
65 | DRAG_ICON = wx.Image(os.path.join(PATH, 'drag_hand.png')) |
---|
66 | RESET_ICON = wx.Image(os.path.join(PATH, 'reset.png')) |
---|
67 | REPORT_ICON = wx.Image(os.path.join(PATH, 'report.png')) |
---|
68 | PREVIEW_ICON = wx.Image(os.path.join(PATH, 'preview.png')) |
---|
69 | PRINT_ICON = wx.Image(os.path.join(PATH, 'printer.png')) |
---|
70 | |
---|
71 | if __name__ == "__main__": |
---|
72 | |
---|
73 | print GUIFRAME.DEFAULT_STYLE |
---|
74 | print GUIFRAME.FLOATING_PANEL |
---|
75 | print GUIFRAME.SINGLE_APPLICATION |
---|
76 | style = GUIFRAME.MULTIPLE_APPLICATIONS |
---|
77 | style &= GUIFRAME.PLOTTING_ON |
---|
78 | print style == GUIFRAME.PLOTTING_ON |
---|
79 | style1 = GUIFRAME.MULTIPLE_APPLICATIONS |
---|
80 | style1 &= (~GUIFRAME.MANAGER_ON) |
---|
81 | print style1 == GUIFRAME.DEFAULT_STYLE |
---|
82 | print style1 |
---|
83 | |
---|
84 | |
---|
85 | |
---|