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

Last change on this file since a9279cc was d85c194, checked in by Piotr Rozyczko <piotr.rozyczko@…>, 9 years ago

Remaining modules refactored

  • Property mode set to 100644
File size: 3.2 KB
RevLine 
[b7c7a1c]1
2"""
3Provide the style for guiframe
4"""
[f036c692]5import wx
[ba924ed]6import os
[d85c194]7from sas.sasgui.guiframe import get_data_path
[ba924ed]8
[b7c7a1c]9
[52b8b74]10class 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
[adf44c2]21    MULTIPLE_APPLICATIONS = DEFAULT_STYLE
[f036c692]22   
23class GUIFRAME_ID:
24    UNDO_ID = wx.NewId()
25    REDO_ID = wx.NewId()
[07c8630]26    COPY_ID = wx.NewId()
27    PASTE_ID = wx.NewId()
[f036c692]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()
[a07e72f]38    CURVE_SYMBOL_NUM = 13
[34dbaf4]39    COPYEX_ID = wx.NewId()
40    COPYLAT_ID = wx.NewId()
41    COPYAS_ID = wx.NewId()
42
43
[ba924ed]44class GUIFRAME_ICON:
45    PATH = get_data_path(media='images')
[07dd0b4]46    FRAME_ICON_PATH = os.path.join(PATH, 'ball.ico')
[ba924ed]47    SAVE_ICON_PATH = os.path.join(PATH, 'save.png')
48    UNDO_ICON_PATH = os.path.join(PATH, 'undo.png')
49    REDO_ICON_PATH = os.path.join(PATH, 'redo.png')
[07c8630]50    COPY_ICON_PATH = os.path.join(PATH, 'copy.png')
51    PASTE_ICON_PATH = os.path.join(PATH, 'paste.png')
[ba924ed]52    BOOKMARK_ICON_PATH = os.path.join(PATH, 'bookmark.png')
53    ZOOM_IN_ID_PATH = os.path.join(PATH, 'zoom_in.png')
54    ZOOM_OUT_ID_PATH = os.path.join(PATH, 'zoom_out.png')
55    ZOOM_ID_PATH = os.path.join(PATH, 'search_pan.png')
56    DRAG_ID_PATH = os.path.join(PATH, 'drag_hand.png')
57    RESET_ID_PATH = os.path.join(PATH, 'reset.png')
58    PREVIEW_ID_PATH = os.path.join(PATH, 'report.png')
59    PRINT_ID_PATH = os.path.join(PATH, 'printer.png')
[6e75ed0]60    HIDE_ID_PATH = os.path.join(PATH, 'hide.png')
[ba924ed]61   
[07dd0b4]62 
[ba924ed]63    SAVE_ICON = wx.Image(os.path.join(PATH, 'save.png'))
64    UNDO_ICON = wx.Image(os.path.join(PATH, 'undo.png'))
65    REDO_ICON = wx.Image(os.path.join(PATH, 'redo.png'))
[07c8630]66    COPY_ICON = wx.Image(os.path.join(PATH, 'copy.png'))
67    PASTE_ICON = wx.Image(os.path.join(PATH, 'paste.png'))
[ba924ed]68    BOOKMARK_ICON = wx.Image(os.path.join(PATH, 'bookmark.png'))
69    ZOOM_IN_ICON = wx.Image(os.path.join(PATH, 'zoom_in.png'))
70    ZOOM_OUT_ICON = wx.Image(os.path.join(PATH, 'zoom_out.png'))
71    ZOOM_ICON = wx.Image(os.path.join(PATH, 'search_pan.png'))
72    DRAG_ICON = wx.Image(os.path.join(PATH, 'drag_hand.png'))
73    RESET_ICON = wx.Image(os.path.join(PATH, 'reset.png'))
74    REPORT_ICON = wx.Image(os.path.join(PATH, 'report.png'))
75    PREVIEW_ICON = wx.Image(os.path.join(PATH, 'preview.png'))
76    PRINT_ICON = wx.Image(os.path.join(PATH, 'printer.png'))
[6e75ed0]77    HIDE_ICON = wx.Image(os.path.join(PATH, 'hide.png'))
[b7c7a1c]78
[52b8b74]79if __name__ == "__main__":
80 
81    print GUIFRAME.DEFAULT_STYLE
82    print GUIFRAME.FLOATING_PANEL
[7a67e075]83    print GUIFRAME.SINGLE_APPLICATION
84    style = GUIFRAME.MULTIPLE_APPLICATIONS
[3feed3e]85    style &= GUIFRAME.PLOTTING_ON
86    print style == GUIFRAME.PLOTTING_ON
[7a67e075]87    style1 = GUIFRAME.MULTIPLE_APPLICATIONS
88    style1 &= (~GUIFRAME.MANAGER_ON)
89    print style1 == GUIFRAME.DEFAULT_STYLE
[6e75ed0]90    print style1
Note: See TracBrowser for help on using the repository browser.