Beispiel #1
0
    def __init__(self, parent, alignment = wx.ALIGN_LEFT, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.DefaultSize, style = 0, name = u"ZPropertyBook"): #$NON-NLS-1$
        self.tabs = {}
        self.tabAreaBGColor = getDefaultDialogBackgroundColor()
        self.bgColor = getDefaultControlBackgroundColor()
        self.borderColor = getDefaultControlBorderColor()

        wx.Panel.__init__(self, parent, wx.ID_ANY, pos, size, style, name)
        
        self.SetBackgroundColour(self.bgColor)
        
        # Create a tab container, sizer to store the panels, and the overall property book sizer
        self.tabContainer = ZPropertyBookTabContainer(self, alignment, self.tabAreaBGColor, self.borderColor)
        self.tabPanelSizer = wx.BoxSizer(wx.VERTICAL)
        self.bookSizer = wx.BoxSizer(wx.HORIZONTAL)
        
        self.bookSizer.Add(self.tabContainer, 0, wx.EXPAND)
        self.bookSizer.AddSizer(self.tabPanelSizer, 1, wx.EXPAND | wx.ALL, 3)
        
        self.Bind(ZEVT_PB_TAB_SELECTION, self.onTabSelection, self.tabContainer)
        self.Bind(wx.EVT_PAINT, self.onPaint, self)
        self.Bind(wx.EVT_ERASE_BACKGROUND, self.onEraseBackground, self)
        self.Bind(wx.EVT_SIZE, self.onResize, self)
        
        self.SetAutoLayout(True)
        self.SetSizer(self.bookSizer)
        self.Layout()
Beispiel #2
0
    def __init__(self, parent, tabName):
        self.tabName = tabName
        self.first = False
        self.active = False
        self.hovering = False  # is the user hovering the mouse over the control
        self.clicking = False  # is the user clicking the control
        self.font = getDefaultFont()
        # FIXME (EPW) make these colors settable
        self.borderColor = getDefaultControlBorderColor()
        self.tabColor = getDefaultDialogBackgroundColor()
        self.activeColor = getDefaultControlBackgroundColor()
        self.hoverColor = wx.Color(min(self.tabColor.Red() + 20, 255),
                                   min(self.tabColor.Green() + 20, 255),
                                   min(self.tabColor.Blue(), 255))

        wx.Control.__init__(self, parent, wx.ID_ANY, style=wx.NO_BORDER)

        self.Bind(wx.EVT_PAINT, self.onPaint, self)
        self.Bind(wx.EVT_ERASE_BACKGROUND, self.onEraseBackground, self)
        self.Bind(wx.EVT_ENTER_WINDOW, self.onEnter, self)
        self.Bind(wx.EVT_LEAVE_WINDOW, self.onLeave, self)
        self.Bind(wx.EVT_LEFT_DOWN, self.onLeftClickDown, self)
        self.Bind(wx.EVT_LEFT_UP, self.onLeftClickUp, self)

        # FIXME allow the font to be changed - when that is done, size hints must be recalc'd
        winDC = wx.WindowDC(parent)
        winDC.SetFont(self.font)
        (w, h) = winDC.GetTextExtent(tabName)
        self.SetSizeHints(w + 10, h + 10)
        del winDC
Beispiel #3
0
 def __init__(self, parent, tabName):
     self.tabName = tabName
     self.first = False
     self.active = False
     self.hovering = False # is the user hovering the mouse over the control
     self.clicking = False # is the user clicking the control
     self.font = getDefaultFont()
     # FIXME (EPW) make these colors settable
     self.borderColor = getDefaultControlBorderColor()
     self.tabColor = getDefaultDialogBackgroundColor()
     self.activeColor = getDefaultControlBackgroundColor()
     self.hoverColor = wx.Color(min(self.tabColor.Red() + 20, 255), min(self.tabColor.Green() + 20, 255), min(self.tabColor.Blue(), 255))
     
     wx.Control.__init__(self, parent, wx.ID_ANY, style = wx.NO_BORDER)
     
     self.Bind(wx.EVT_PAINT, self.onPaint, self)
     self.Bind(wx.EVT_ERASE_BACKGROUND, self.onEraseBackground, self)
     self.Bind(wx.EVT_ENTER_WINDOW, self.onEnter, self)
     self.Bind(wx.EVT_LEAVE_WINDOW, self.onLeave, self)
     self.Bind(wx.EVT_LEFT_DOWN, self.onLeftClickDown, self)
     self.Bind(wx.EVT_LEFT_UP, self.onLeftClickUp, self)
     
     # FIXME allow the font to be changed - when that is done, size hints must be recalc'd
     winDC = wx.WindowDC(parent)
     winDC.SetFont(self.font)
     (w, h) = winDC.GetTextExtent(tabName)
     self.SetSizeHints(w + 10, h + 10)
     del winDC
Beispiel #4
0
    def __init__(self, parent):
        self.parent = parent
        self.tools = []
        self.selectedTool = None

        wx.Panel.__init__(self, parent, wx.ID_ANY)
        self.SetBackgroundColour(getDefaultControlBackgroundColor())
        
        self.toolSizer = wx.BoxSizer(wx.HORIZONTAL)
        self.toolSizer.AddSpacer(10)
        
        self.SetAutoLayout(True)
        self.SetSizer(self.toolSizer)
        self.Layout()
Beispiel #5
0
    def __init__(self, parent, bitmap, choices, multiSelect=False):
        self.bitmap = bitmap
        self.choices = choices
        self.selectedChoices = []
        self.multiSelect = multiSelect
        self.backgroundColor = getDefaultControlBackgroundColor()
        self.borderColor = getDefaultControlBorderColor()

        wx.Panel.__init__(self, parent, wx.ID_ANY, style=wx.NO_BORDER)

        self.SetBackgroundColour(self.backgroundColor)

        self._createWidgets()
        self._layoutWidgets()
        self._bindWidgetEvents()
Beispiel #6
0
    def __init__(self, parent, bitmap, choices, multiSelect = False):
        self.bitmap = bitmap
        self.choices = choices
        self.selectedChoices = []
        self.multiSelect = multiSelect
        self.backgroundColor = getDefaultControlBackgroundColor()
        self.borderColor = getDefaultControlBorderColor()

        wx.Panel.__init__(self, parent, wx.ID_ANY, style = wx.NO_BORDER)
        
        self.SetBackgroundColour(self.backgroundColor)

        self._createWidgets()
        self._layoutWidgets()
        self._bindWidgetEvents()
Beispiel #7
0
    def __init__(self, provider, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.HSCROLL | wx.VSCROLL, name = u"ZPanelListBox"): #$NON-NLS-1$
        self.provider = provider
        self.backgroundColor = getDefaultControlBackgroundColor()
        self.borderColor = getDefaultControlBorderColor()
        self.style = style

        style = wx.NO_BORDER
        wx.Panel.__init__(self, parent, id, pos, size, style, name)

        self._createInternalRepresentation()
        self._layoutInternalRepresentation()

        self.SetBackgroundColor(self.backgroundColor)

        self.Bind(wx.EVT_PAINT, self.onPaint, self)
        self.Bind(wx.EVT_ERASE_BACKGROUND, self.onEraseBackground, self)
Beispiel #8
0
    def onPaint(self, event):
        (w, h) = self.GetSizeTuple()
        paintDC = wx.BufferedPaintDC(self)
        paintDC.SetBackground(wx.Brush(getDefaultControlBackgroundColor(), wx.SOLID))
        paintDC.Clear()

        brush = wx.TRANSPARENT_BRUSH
        pen = wx.Pen(getDefaultControlBorderColor())
        paintDC.SetBrush(brush)
        paintDC.SetPen(pen)

        paintDC.DrawRectangle(0, 0, w, h)

        del paintDC

        event.Skip()
Beispiel #9
0
    def __init__(self,
                 parent,
                 alignment=wx.ALIGN_LEFT,
                 id=wx.ID_ANY,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 style=0,
                 name=u"ZPropertyBook"):  #$NON-NLS-1$
        self.tabs = {}
        self.tabAreaBGColor = getDefaultDialogBackgroundColor()
        self.bgColor = getDefaultControlBackgroundColor()
        self.borderColor = getDefaultControlBorderColor()

        wx.Panel.__init__(self, parent, wx.ID_ANY, pos, size, style, name)

        self.SetBackgroundColour(self.bgColor)

        # Create a tab container, sizer to store the panels, and the overall property book sizer
        self.tabContainer = ZPropertyBookTabContainer(self, alignment,
                                                      self.tabAreaBGColor,
                                                      self.borderColor)
        self.tabPanelSizer = wx.BoxSizer(wx.VERTICAL)
        self.bookSizer = wx.BoxSizer(wx.HORIZONTAL)

        self.bookSizer.Add(self.tabContainer, 0, wx.EXPAND)
        self.bookSizer.AddSizer(self.tabPanelSizer, 1, wx.EXPAND | wx.ALL, 3)

        self.Bind(ZEVT_PB_TAB_SELECTION, self.onTabSelection,
                  self.tabContainer)
        self.Bind(wx.EVT_PAINT, self.onPaint, self)
        self.Bind(wx.EVT_ERASE_BACKGROUND, self.onEraseBackground, self)
        self.Bind(wx.EVT_SIZE, self.onResize, self)

        self.SetAutoLayout(True)
        self.SetSizer(self.bookSizer)
        self.Layout()