source: sasview/sansguiframe/src/sans/guiframe/gui_style.py @ 95b513c

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 95b513c was 6e75ed0, checked in by Robert Whitley <robert.whitley@…>, 13 years ago

Refs #36. Delete should be cross button and hide should be a toolbar button.

Clean up some warnings.

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