Пример #1
0
 def DoCreateResource(self):
     TRACE('DoCreateResource: %s', self.GetClass())
     if self.GetClass() == 'foldpanel':
         n = self.GetParamNode('object')
         if n:
             old_ins = self._isInside
             self._isInside = False
             bar = self._w
             item = self.CreateResFromNode(n, bar, None)
             self._isInside = old_ins
             wnd = item
             if wnd:
                 item = bar.AddFoldPanel(
                     self.GetText('label'),
                     collapsed=self.GetBool('collapsed'))
                 bar.AddFoldPanelWindow(item, wnd)
         return wnd
     else:
         w = fpb.FoldPanelBar(self.GetParentAsWindow(), self.GetID(),
                              self.GetPosition(), self.GetSize(),
                              self.GetStyle(), self.GetStyle('exstyle'))
         self.SetupWindow(w)
         self._w = w
         old_ins = self._isInside
         self._isInside = True
         self.CreateChildren(w, True)
         self._isInside = old_ins
         return w
Пример #2
0
# Name:         controls.py
# Purpose:      Control components
# Author:       Roman Rolinsky <*****@*****.**>
# Created:      31.05.2007
# RCS-ID:       $Id: core.py 47823 2007-07-29 19:24:35Z ROL $

from wx.tools.XRCed import component, images, attribute, params
from wx.tools.XRCed.globals import TRACE
import _bitmaps as bitmaps

TRACE('*** creating control components')

# Set panel images
component.Manager.panelImages['Controls'] = images.ToolPanel_Controls.GetImage(
)

### wxStaticText

c = component.Component('wxStaticText', ['control', 'tool'],
                        ['pos', 'size', 'label', 'wrap'],
                        defaults={'label': 'LABEL'},
                        image=images.TreeStaticText.GetImage())
c.addStyles('wxALIGN_LEFT', 'wxALIGN_RIGHT', 'wxALIGN_CENTRE',
            'wxST_NO_AUTORESIZE')
component.Manager.register(c)
component.Manager.setMenu(c, 'control', 'label', 'wxStaticText', 10)
component.Manager.setTool(c, 'Controls', pos=(0, 0))

### wxStaticLine

c = component.Component('wxStaticLine', ['control', 'tool'], ['pos', 'size'],
Пример #3
0
PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
Odemis. If not, see http://www.gnu.org/licenses/.

"""
# Purpose:      XRCED Component plugin for custom Delmic wxPython classes
# Important: Create a symbolic link to this and the xh_delmic module within
# XRCED's plugins folder.

from wx.tools.XRCed import component, params, images, attribute
from wx.tools.XRCed.globals import TRACE

import odemis.gui.xmlh.xh_delmic as xh_delmic

TRACE('*** creating xh_delmic components')

##### FoldPanelBar #####

c = component.Container(
    'FoldPanelBar', ['window', 'top_level', 'control'],
    ['pos', 'size', 'spacing', 'leftspacing', 'rightspacing'])
c.addStyles('FPB_SINGLE_FOLD', 'FPB_COLLAPSE_TO_BOTTOM', 'FPB_EXCLUSIVE_FOLD',
            'FPB_HORIZONTAL', 'FPB_VERTICAL')
c.setParamClass('spacing', params.ParamIntNN)
c.setParamClass('leftspacing', params.ParamIntNN)
c.setParamClass('rightspacing', params.ParamIntNN)
component.Manager.register(c)
component.Manager.addXmlHandler(xh_delmic.FoldPanelBarXmlHandler)
component.Manager.setMenu(c, 'Delmic', 'Fold Panel Bar', 'FoldPanelBar', 1)
Пример #4
0
# Name:         core.py
# Purpose:      Core components
# Author:       Roman Rolinsky <*****@*****.**>
# Created:      31.05.2007
# RCS-ID:       $Id: core.py 64627 2010-06-18 18:17:45Z ROL $

import wx
from wx.tools.XRCed import component, images, attribute, params, view
from wx.tools.XRCed.globals import TRACE, is_object, is_element, STD_NAME
import _bitmaps as bitmaps

TRACE('*** creating core components')

# Set panel images
component.Manager.panelImages['Windows'] = images.ToolPanel_Windows.GetImage()
component.Manager.panelImages['Menus'] = images.ToolPanel_Menus.GetImage()
component.Manager.panelImages['Sizers'] = images.ToolPanel_Sizers.GetImage()
component.Manager.panelImages['Panels'] = images.ToolPanel_Panels.GetImage()
component.Manager.panelImages['Gizmos'] = images.ToolPanel_Gizmos.GetImage()

### wxFrame


class Frame(component.Container):
    def getChildObject(self, node, obj, index):
        # Do not count toolbar and menubar
        objects = filter(is_element, node.childNodes)
        indexOffset = 0  # count non-window children
        for i, o in enumerate(objects):
            if o.getAttribute('class') == 'wxMenuBar':
                if i == index: return obj.GetMenuBar()
Пример #5
0
# Name:         wxlib.py
# Purpose:      Component plugins for wx.lib classes
# Author:       Roman Rolinsky <*****@*****.**>
# Created:      05.09.2007
# RCS-ID:       $Id$

import xh_wxlib
from wx.tools.XRCed import component, params
from wx.tools.XRCed.globals import TRACE
from wx.lib.ticker_xrc import wxTickerXmlHandler

TRACE('*** creating wx.lib components')

# wx.lib.foldpanelbar.FoldPanelBar

c = component.SmartContainer('wx.lib.foldpanelbar.FoldPanelBar',
                             ['book', 'window', 'control'], ['pos', 'size'],
                             implicit_klass='foldpanel',
                             implicit_page='FoldPanel',
                             implicit_attributes=['label', 'collapsed'],
                             implicit_params={'collapsed': params.ParamBool})
c.addStyles('FPB_DEFAULT_STYLE', 'FPB_SINGLE_FOLD', 'FPB_COLLAPSE_TO_BOTTOM',
            'FPB_EXCLUSIVE_FOLD', 'FPB_HORIZONTAL', 'FPB_VERTICAL')
component.Manager.register(c)
component.Manager.addXmlHandler(xh_wxlib.FoldPanelBarXmlHandler)
component.Manager.setMenu(c, 'bar', 'fold panel bar', 'FoldPanelBar', 1000)

# wx.lib.ticker.Ticker


class ParamDirection(params.RadioBox):