source: sasview/src/sas/sasgui/guiframe/gui_style.py @ 18d50612

Last change on this file since 18d50612 was a1b8fee, checked in by andyfaff, 8 years ago

MAINT: from future import print_function

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