def __init__(
        self, parent, id=-1, title="", mainFrame=None, pos=wx.DefaultPosition, size=wx.DefaultSize, style=style
    ):
        wx.Frame.__init__(self, parent, id, title, pos, size, style)

        self.SetBackgroundColour(BACKGROUND_COLOUR)
        self.ceciliaMainFrame = mainFrame
        self.menubar = InterfaceMenuBar(self, self.ceciliaMainFrame)
        self.SetMenuBar(self.menubar)

        self.box = wx.GridBagSizer(0, 0)

        self.controlBox = wx.BoxSizer(wx.VERTICAL)

        self.controlPanel = Control.CECControl(self, -1)
        togglePopupPanel, objs, tpsize = self.createTogglePopupPanel()
        slidersPanel, slPanelSize = self.createSlidersPanel()
        self.grapher = getGrapher(self)
        CeciliaLib.setVar("grapher", self.grapher)
        presetPanel = Preset.CECPreset(self)
        CeciliaLib.setVar("presetPanel", presetPanel)

        self.controlBox.Add(self.controlPanel, 1, wx.EXPAND | wx.RIGHT, -1)
        self.controlBox.Add(presetPanel, 0, wx.EXPAND | wx.TOP | wx.RIGHT, -1)
        self.controlBox.Add(togglePopupPanel, 0, wx.EXPAND | wx.TOP | wx.RIGHT, -1)

        self.box.Add(self.controlBox, (0, 0), span=(2, 1), flag=wx.EXPAND)
        self.box.Add(self.grapher, (0, 1), flag=wx.EXPAND)
        self.box.Add(slidersPanel, (1, 1), flag=wx.EXPAND | wx.TOP, border=-1)

        self.box.AddGrowableCol(1, 1)
        self.box.AddGrowableRow(0, 1)

        pos = CeciliaLib.getVar("interfacePosition")
        size = CeciliaLib.getVar("interfaceSize")
        pos, size = self.positionToClientArea(pos, size)

        self.SetSizer(self.box)
        self.SetSize(size)

        self.Bind(wx.EVT_CLOSE, self.onClose)

        if pos == None:
            self.Center()
        else:
            self.SetPosition(pos)

        self.Show(True)

        wx.CallAfter(self.createGrapher)
    def __init__(self, parent, id=-1, title='', editor=None,
                 pos=wx.DefaultPosition, size=wx.DefaultSize,
                 style= wx.DEFAULT_FRAME_STYLE | wx.SUNKEN_BORDER | \
                        wx.CLIP_CHILDREN | wx.WANTS_CHARS):
        wx.Frame.__init__(self, parent, id, title, pos, size, style)

        self.ceciliaEditor = editor
        self.menubar = InterfaceMenuBar(self, self.ceciliaEditor)
        self.SetMenuBar(self.menubar)
        
        self.box = wx.GridBagSizer(0, 0)

        self.controlBox = wx.BoxSizer(wx.VERTICAL)

        self.controlPanel = Control.CECControl(self, -1)
        togglePopupPanel, objs, tpsize = self.createTogglePopupPanel()        
        slidersPanel, slPanelSize = self.createHorizontalSlidersPanel()
        self.grapher = getGrapher(self)
        presetPanel = Preset.CECPreset(self)
        CeciliaLib.setPresetPanel(presetPanel)

        self.controlBox.Add(self.controlPanel, 1, wx.EXPAND | wx.RIGHT, -1)
        self.controlBox.Add(presetPanel, 0, wx.EXPAND | wx.TOP | wx.RIGHT, -1)
        self.controlBox.Add(togglePopupPanel, 0, wx.EXPAND | wx.TOP | wx.RIGHT, -1)

        self.box.Add(self.controlBox, (0,0), span=(2,1), flag=wx.EXPAND)
        self.box.Add(self.grapher, (0,1), flag=wx.EXPAND)
        self.box.Add(slidersPanel, (1,1), flag=wx.EXPAND | wx.TOP, border=-1)
        
        self.box.AddGrowableCol(1, 1)
        self.box.AddGrowableRow(0, 1)

        pos, size = self.positionToClientArea(CeciliaLib.getInterfacePosition(), CeciliaLib.getInterfaceSize())

        self.SetSizer(self.box)        
        self.SetSize(size)

        self.Bind(wx.EVT_CLOSE, self.onClose)

        if pos == None:
            self.Center()
        else:
            self.SetPosition(pos)    

        wx.CallAfter(self.createGrapher)
Beispiel #3
0
    def __init__(self,
                 parent,
                 id=-1,
                 title='',
                 mainFrame=None,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 style=style):
        wx.Frame.__init__(self, parent, id, title, pos, size, style)

        self.SetBackgroundColour(BACKGROUND_COLOUR)
        self.ceciliaMainFrame = mainFrame
        self.menubar = InterfaceMenuBar(self, self.ceciliaMainFrame)
        self.SetMenuBar(self.menubar)

        self._mgr = wx.aui.AuiManager()
        self._mgr.SetManagedWindow(self)

        self.hasScrollbar = False
        self.controlPanel = Control.CECControl(self, -1)

        togglePopupPanel, objs, tpsize = self.createTogglePopupPanel(self)
        self.horizontalSlidersPanel, slPanelSize = self.createHorizontalSlidersPanel(
            self)
        self.grapher = getGrapher(self)
        CeciliaLib.setVar("grapher", self.grapher)
        presetPanel = Preset.CECPreset(self)
        CeciliaLib.setVar("presetPanel", presetPanel)

        self._mgr.AddPane(
            self.horizontalSlidersPanel,
            wx.aui.AuiPaneInfo().Name("hslidersPanel").Caption(
                "").Bottom().Position(2).CloseButton(False).MaximizeButton(
                    False).Layer(1).MinSize(slPanelSize).CaptionVisible(False))

        self._mgr.AddPane(
            self.grapher,
            wx.aui.AuiPaneInfo().Name("graphPanel").Caption("").CloseButton(
                False).MaximizeButton(True).Center().Layer(0))

        self._mgr.AddPane(
            presetPanel,
            wx.aui.AuiPaneInfo().Name("presetPanel").Fixed().Left().Position(
                1).CloseButton(False).MaximizeButton(False).Layer(
                    2).CaptionVisible(False).BestSize((-1, 60)))

        self._mgr.AddPane(
            togglePopupPanel,
            wx.aui.AuiPaneInfo().Name("togglePopup").Fixed().Left().Position(
                2).CloseButton(False).MaximizeButton(False).Layer(
                    2).CaptionVisible(False).MaxSize(tpsize))

        self._mgr.AddPane(
            self.controlPanel,
            wx.aui.AuiPaneInfo().Name("controlPanel").Left().Position(
                0).Fixed().CloseButton(False).MaximizeButton(False).MinSize(
                    (230, -1)).Layer(2).CaptionVisible(False))

        pos, size = self.positionToClientArea(
            CeciliaLib.getVar("interfacePosition"),
            CeciliaLib.getVar("interfaceSize"))

        self.SetSize(size)

        self._artProvider = wx.aui.AuiDefaultDockArt()
        self._artProvider.SetMetric(wx.aui.AUI_DOCKART_SASH_SIZE, 0)
        self._artProvider.SetColour(wx.aui.AUI_DOCKART_BACKGROUND_COLOUR,
                                    BORDER_COLOUR)
        self._artProvider.SetColour(wx.aui.AUI_DOCKART_SASH_COLOUR,
                                    BORDER_COLOUR)
        self._artProvider.SetColour(wx.aui.AUI_DOCKART_BORDER_COLOUR,
                                    BORDER_COLOUR)
        self._artProvider.SetColour(wx.aui.AUI_DOCKART_INACTIVE_CAPTION_COLOUR,
                                    TITLE_BACK_COLOUR)
        self._artProvider.SetColour(
            wx.aui.AUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR,
            TITLE_BACK_COLOUR)
        self._mgr.SetArtProvider(self._artProvider)

        self._mgr.Update()

        self.Bind(wx.EVT_CLOSE, self.onClose)
        self.Bind(wx.EVT_SIZE, self.OnSize)

        if pos == None:
            self.Center()
        else:
            self.SetPosition(pos)

        self.Show(True)

        wx.CallAfter(self.createGrapher)