コード例 #1
0
ファイル: propertybook.py プロジェクト: Tidosho/zoundryraven
    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()
コード例 #2
0
ファイル: propertybook.py プロジェクト: mpm2050/Raven
    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
コード例 #3
0
ファイル: propertybook.py プロジェクト: Tidosho/zoundryraven
 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
コード例 #4
0
ファイル: imgbutton.py プロジェクト: mpm2050/Raven
    def __init__(self,
                 parent,
                 bitmap,
                 drawDropArrow=False,
                 hoverBitmap=None,
                 drawHoverBox=True,
                 style=wx.NO_BORDER):
        self.bitmap = bitmap
        self.disabledBitmap = None
        self.hoverBitmap = hoverBitmap
        self.drawHoverBox = drawHoverBox
        self.drawDropArrow = drawDropArrow

        self.borderColor = getDefaultControlBorderColor()
        self.hoverBackgroundColor = wx.Color(254, 225, 119)
        self.clickBackgroundColor = wx.Color(251, 209, 61)

        wx.PyControl.__init__(self, parent, wx.ID_ANY, style=style)
        ZClickableControlMixin.__init__(self)
        ZHoverableControlMixin.__init__(self)

        self.Bind(wx.EVT_PAINT, self.onPaint, self)
        self.Bind(wx.EVT_ERASE_BACKGROUND, self.onEraseBackground, self)

        sizeW = self.bitmap.GetWidth()
        sizeH = self.bitmap.GetHeight()
        if self.drawHoverBox or self.drawDropArrow:
            sizeW += 4
            sizeH += 4
        self.SetSizeHints(sizeW, sizeH)
コード例 #5
0
ファイル: win32.py プロジェクト: mpm2050/Raven
 def onPaint(self, event):
     if self.style & wx.SIMPLE_BORDER:
         paintDC = wx.BufferedPaintDC(self)
         paintDC.SetPen(wx.Pen(getDefaultControlBorderColor()))
         paintDC.SetBrush(wx.TRANSPARENT_BRUSH)
         (w, h) = self.GetSizeTuple()
         paintDC.DrawRectangle(0, 0, w, h)
         del paintDC
     event.Skip()
コード例 #6
0
ファイル: togglebutton.py プロジェクト: Tidosho/zoundryraven
    def __init__(self, parent, bitmap, toggledBitmap=None, style=wx.NO_BORDER):
        self.bitmap = bitmap
        self.disabledBitmap = None
        self.toggledBitmap = toggledBitmap
        self.disabledToggledBitmap = None
        self.toggled = False

        self.borderColor = getDefaultControlBorderColor()
        self.toggledBorderColor = getDefaultControlBorderColor()
        self.hoverBackgroundColor = wx.Color(254, 225, 119)
        self.clickBackgroundColor = wx.Color(251, 209, 61)
        self.toggledBackgroundColor = wx.Color(249, 249, 249)

        wx.PyControl.__init__(self, parent, wx.ID_ANY, style=style)
        ZClickableControlMixin.__init__(self)
        ZHoverableControlMixin.__init__(self)

        self.Bind(wx.EVT_PAINT, self.onPaint, self)
        self.Bind(wx.EVT_ERASE_BACKGROUND, self.onEraseBackground, self)

        sizeW = self.bitmap.GetWidth() + 4
        sizeH = self.bitmap.GetHeight() + 4
        self.SetSizeHints(sizeW, sizeH)
コード例 #7
0
ファイル: togglebutton.py プロジェクト: mpm2050/Raven
    def __init__(self, parent, bitmap, toggledBitmap = None, style = wx.NO_BORDER):
        self.bitmap = bitmap
        self.disabledBitmap = None
        self.toggledBitmap = toggledBitmap
        self.disabledToggledBitmap = None
        self.toggled = False

        self.borderColor = getDefaultControlBorderColor()
        self.toggledBorderColor = getDefaultControlBorderColor()
        self.hoverBackgroundColor = wx.Color(254, 225, 119)
        self.clickBackgroundColor = wx.Color(251, 209, 61)
        self.toggledBackgroundColor = wx.Color(249, 249, 249)

        wx.PyControl.__init__(self, parent, wx.ID_ANY, style = style)
        ZClickableControlMixin.__init__(self)
        ZHoverableControlMixin.__init__(self)

        self.Bind(wx.EVT_PAINT, self.onPaint, self)
        self.Bind(wx.EVT_ERASE_BACKGROUND, self.onEraseBackground, self)

        sizeW = self.bitmap.GetWidth() + 4
        sizeH = self.bitmap.GetHeight() + 4
        self.SetSizeHints(sizeW, sizeH)
コード例 #8
0
ファイル: textbox.py プロジェクト: mpm2050/Raven
    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()
コード例 #9
0
ファイル: textbox.py プロジェクト: Tidosho/zoundryraven
    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()
コード例 #10
0
ファイル: panellist.py プロジェクト: mpm2050/Raven
    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)
コード例 #11
0
ファイル: blogchooser.py プロジェクト: mpm2050/Raven
    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()
コード例 #12
0
ファイル: propertybook.py プロジェクト: mpm2050/Raven
    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()
コード例 #13
0
ファイル: imgbutton.py プロジェクト: Tidosho/zoundryraven
    def __init__(self, parent, bitmap, drawDropArrow = False, hoverBitmap = None, drawHoverBox = True, style = wx.NO_BORDER):
        self.bitmap = bitmap
        self.disabledBitmap = None
        self.hoverBitmap = hoverBitmap
        self.drawHoverBox = drawHoverBox
        self.drawDropArrow = drawDropArrow

        self.borderColor = getDefaultControlBorderColor()
        self.hoverBackgroundColor = wx.Color(254, 225, 119)
        self.clickBackgroundColor = wx.Color(251, 209, 61)

        wx.PyControl.__init__(self, parent, wx.ID_ANY, style = style)
        ZClickableControlMixin.__init__(self)
        ZHoverableControlMixin.__init__(self)

        self.Bind(wx.EVT_PAINT, self.onPaint, self)
        self.Bind(wx.EVT_ERASE_BACKGROUND, self.onEraseBackground, self)

        sizeW = self.bitmap.GetWidth()
        sizeH = self.bitmap.GetHeight()
        if self.drawHoverBox or self.drawDropArrow:
            sizeW += 4
            sizeH += 4
        self.SetSizeHints(sizeW, sizeH)