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 | TOOL_ON = 32 |
---|
17 | SINGLE_APPLICATION = 64 |
---|
18 | WELCOME_PANEL_ON = 128 |
---|
19 | DEFAULT_STYLE = SINGLE_APPLICATION|DATALOADER_ON|PLOTTING_ON|FIXED_PANEL |
---|
20 | MULTIPLE_APPLICATIONS = DEFAULT_STYLE|WELCOME_PANEL_ON |
---|
21 | |
---|
22 | class GUIFRAME_ID: |
---|
23 | UNDO_ID = wx.NewId() |
---|
24 | REDO_ID = wx.NewId() |
---|
25 | BOOKMARK_ID = wx.NewId() |
---|
26 | SAVE_ID = wx.NewId() |
---|
27 | ZOOM_IN_ID = wx.NewId() |
---|
28 | ZOOM_OUT_ID = wx.NewId() |
---|
29 | ZOOM_ID = wx.NewId() |
---|
30 | DRAG_ID = wx.NewId() |
---|
31 | RESET_ID = wx.NewId() |
---|
32 | PREVIEW_ID = wx.NewId() |
---|
33 | PRINT_ID = wx.NewId() |
---|
34 | CURRENT_APPLICATION = wx.NewId() |
---|
35 | CURVE_SYMBOL_NUM = 13 |
---|
36 | |
---|
37 | class GUIFRAME_ICON: |
---|
38 | PATH = get_data_path(media='images') |
---|
39 | SAVE_ICON_PATH = os.path.join(PATH, 'save.png') |
---|
40 | UNDO_ICON_PATH = os.path.join(PATH, 'undo.png') |
---|
41 | REDO_ICON_PATH = os.path.join(PATH, 'redo.png') |
---|
42 | BOOKMARK_ICON_PATH = os.path.join(PATH, 'bookmark.png') |
---|
43 | ZOOM_IN_ID_PATH = os.path.join(PATH, 'zoom_in.png') |
---|
44 | ZOOM_OUT_ID_PATH = os.path.join(PATH, 'zoom_out.png') |
---|
45 | ZOOM_ID_PATH = os.path.join(PATH, 'search_pan.png') |
---|
46 | DRAG_ID_PATH = os.path.join(PATH, 'drag_hand.png') |
---|
47 | RESET_ID_PATH = os.path.join(PATH, 'reset.png') |
---|
48 | PREVIEW_ID_PATH = os.path.join(PATH, 'report.png') |
---|
49 | PRINT_ID_PATH = os.path.join(PATH, 'printer.png') |
---|
50 | |
---|
51 | SAVE_ICON = wx.Image(os.path.join(PATH, 'save.png')) |
---|
52 | UNDO_ICON = wx.Image(os.path.join(PATH, 'undo.png')) |
---|
53 | REDO_ICON = wx.Image(os.path.join(PATH, 'redo.png')) |
---|
54 | BOOKMARK_ICON = wx.Image(os.path.join(PATH, 'bookmark.png')) |
---|
55 | ZOOM_IN_ICON = wx.Image(os.path.join(PATH, 'zoom_in.png')) |
---|
56 | ZOOM_OUT_ICON = wx.Image(os.path.join(PATH, 'zoom_out.png')) |
---|
57 | ZOOM_ICON = wx.Image(os.path.join(PATH, 'search_pan.png')) |
---|
58 | DRAG_ICON = wx.Image(os.path.join(PATH, 'drag_hand.png')) |
---|
59 | RESET_ICON = wx.Image(os.path.join(PATH, 'reset.png')) |
---|
60 | REPORT_ICON = wx.Image(os.path.join(PATH, 'report.png')) |
---|
61 | PREVIEW_ICON = wx.Image(os.path.join(PATH, 'preview.png')) |
---|
62 | PRINT_ICON = wx.Image(os.path.join(PATH, 'printer.png')) |
---|
63 | |
---|
64 | if __name__ == "__main__": |
---|
65 | |
---|
66 | print GUIFRAME.DEFAULT_STYLE |
---|
67 | print GUIFRAME.FLOATING_PANEL |
---|
68 | print GUIFRAME.SINGLE_APPLICATION |
---|
69 | style = GUIFRAME.MULTIPLE_APPLICATIONS |
---|
70 | style &= GUIFRAME.PLOTTING_ON |
---|
71 | print style == GUIFRAME.PLOTTING_ON |
---|
72 | style1 = GUIFRAME.MULTIPLE_APPLICATIONS |
---|
73 | style1 &= (~GUIFRAME.MANAGER_ON) |
---|
74 | print style1 == GUIFRAME.DEFAULT_STYLE |
---|
75 | print style1 |
---|
76 | |
---|
77 | |
---|
78 | |
---|