source: sasview/guiframe/gui_style.py @ 18ec684

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 18ec684 was ba924ed, checked in by Gervaise Alina <gervyh@…>, 14 years ago

working on toolbar

  • Property mode set to 100644
File size: 2.6 KB
Line 
1
2"""
3Provide the style for guiframe
4"""
5import wx
6import os
7from sans.guiframe import get_data_path
8
9
10class 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|MANAGER_ON|WELCOME_PANEL_ON
21   
22class 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   
36class GUIFRAME_ICON:
37    PATH = get_data_path(media='images')
38    SAVE_ICON_PATH = os.path.join(PATH, 'save.png')
39    UNDO_ICON_PATH = os.path.join(PATH, 'undo.png')
40    REDO_ICON_PATH = os.path.join(PATH, 'redo.png')
41    BOOKMARK_ICON_PATH = os.path.join(PATH, 'bookmark.png')
42    ZOOM_IN_ID_PATH = os.path.join(PATH, 'zoom_in.png')
43    ZOOM_OUT_ID_PATH = os.path.join(PATH, 'zoom_out.png')
44    ZOOM_ID_PATH = os.path.join(PATH, 'search_pan.png')
45    DRAG_ID_PATH = os.path.join(PATH, 'drag_hand.png')
46    RESET_ID_PATH = os.path.join(PATH, 'reset.png')
47    PREVIEW_ID_PATH = os.path.join(PATH, 'report.png')
48    PRINT_ID_PATH = os.path.join(PATH, 'printer.png')
49   
50    SAVE_ICON = wx.Image(os.path.join(PATH, 'save.png'))
51    UNDO_ICON = wx.Image(os.path.join(PATH, 'undo.png'))
52    REDO_ICON = wx.Image(os.path.join(PATH, 'redo.png'))
53    BOOKMARK_ICON = wx.Image(os.path.join(PATH, 'bookmark.png'))
54    ZOOM_IN_ICON = wx.Image(os.path.join(PATH, 'zoom_in.png'))
55    ZOOM_OUT_ICON = wx.Image(os.path.join(PATH, 'zoom_out.png'))
56    ZOOM_ICON = wx.Image(os.path.join(PATH, 'search_pan.png'))
57    DRAG_ICON = wx.Image(os.path.join(PATH, 'drag_hand.png'))
58    RESET_ICON = wx.Image(os.path.join(PATH, 'reset.png'))
59    REPORT_ICON = wx.Image(os.path.join(PATH, 'report.png'))
60    PREVIEW_ICON = wx.Image(os.path.join(PATH, 'preview.png'))
61    PRINT_ICON = wx.Image(os.path.join(PATH, 'printer.png'))
62
63if __name__ == "__main__":
64 
65    print GUIFRAME.DEFAULT_STYLE
66    print GUIFRAME.FLOATING_PANEL
67    print GUIFRAME.SINGLE_APPLICATION
68    style = GUIFRAME.MULTIPLE_APPLICATIONS
69    style &= GUIFRAME.PLOTTING_ON
70    print style == GUIFRAME.PLOTTING_ON
71    style1 = GUIFRAME.MULTIPLE_APPLICATIONS
72    style1 &= (~GUIFRAME.MANAGER_ON)
73    print style1 == GUIFRAME.DEFAULT_STYLE
74    print style1
75   
76 
77 
Note: See TracBrowser for help on using the repository browser.