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