Python wx.SystemSettings_GetColour() Examples

The following are 8 code examples of wx.SystemSettings_GetColour(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module wx , or try the search function .
Example #1
Source File: ListCtrl.py    From BitTorrent with GNU General Public License v3.0 6 votes vote down vote up
def draw_sort_arrow(self, direction):
        b = wx.EmptyBitmap(self.icon_size, self.icon_size)
        w, h = b.GetSize()
        ho = (h - 5) / 2
        dc = wx.MemoryDC()
        dc.SelectObject(b)
        colour = wx.SystemSettings_GetColour(wx.SYS_COLOUR_GRAYTEXT)
        dc.SetBackgroundMode(wx.TRANSPARENT)
        dc.Clear()
        dc.SetPen(wx.Pen(colour))
        for i in xrange(5):
            if direction == 'down':
                j = 4 - i
            else:
                j = i
            dc.DrawLine(i,j+ho,9-i,j+ho)
        dc.SelectObject(wx.NullBitmap)
        b.SetMask(wx.Mask(b, (255, 255, 255)))
        return b 
Example #2
Source File: bug184.py    From wxGlade with MIT License 6 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: Bug184_Frame.__init__
        kwds["style"] = kwds.get("style", 0)
        wx.Frame.__init__(self, *args, **kwds)
        self.SetTitle(_("frame_1"))
        self.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND))

        sizer_1 = wx.BoxSizer(wx.VERTICAL)

        self.label_1 = wx.StaticText(self, wx.ID_ANY, _("Just a label"))
        sizer_1.Add(self.label_1, 1, wx.ALL | wx.EXPAND, 5)

        self.SetSizer(sizer_1)
        sizer_1.Fit(self)

        self.Layout()
        # end wxGlade

# end of class Bug184_Frame 
Example #3
Source File: squaremap.py    From pyFileFixity with MIT License 5 votes vote down vote up
def BrushForNode( self, node, depth=0 ):
        """Create brush to use to display the given node"""
        if node == self.selectedNode:
            color = wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHT)
        elif node == self.highlightedNode:
            color = wx.Colour( red=0, green=255, blue=0 )
        else:
            color = self.adapter.background_color(node, depth)
            if not color:
                red = (depth * 10)%255
                green = 255-((depth * 5)%255)
                blue = (depth * 25)%255
                color = wx.Colour( red, green, blue )
        return wx.Brush( color  ) 
Example #4
Source File: squaremap.py    From pyFileFixity with MIT License 5 votes vote down vote up
def TextForegroundForNode(self, node, depth=0):
        """Determine the text foreground color to use to display the label of
           the given node"""
        if node == self.selectedNode:
            fg_color = wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHTTEXT)
        else:
            fg_color = self.adapter.foreground_color(node, depth)
            if not fg_color:
                fg_color = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOWTEXT)
        return fg_color 
Example #5
Source File: ListCtrl.py    From BitTorrent with GNU General Public License v3.0 5 votes vote down vote up
def OnEraseBackground(self, event=None):
        nsp = self.GetScrollPos(wx.VERTICAL)
        if self._last_scrollpos != nsp:
            self._last_scrollpos = nsp
            # should only refresh visible items, hmm
            wx.CallAfter(self.Refresh)
        dc = wx.ClientDC(self)
        # erase the section of the background which is not covered by the
        # items or the selected column highlighting
        dc.SetBackground(wx.Brush(self.GetBackgroundColour()))
        f = self.GetRect()
        r = wx.Region(0, 0, f.width, f.height)
        x = self.GetVisibleViewRect()
        offset = self._get_origin_offset(include_header=True)
        x.Offset(offset)
        r.SubtractRect(x)
        if '__WXMSW__' in wx.PlatformInfo:
            c = self.GetColumnRect(self.enabled_columns.index(self.selected_column))
            r.SubtractRect(c)
        dc.SetClippingRegionAsRegion(r)
        dc.Clear()

        if '__WXMSW__' in wx.PlatformInfo:
            # draw the selected column highlighting under the items
            dc.DestroyClippingRegion()
            r = wx.Region(0, 0, f.width, f.height)
            r.SubtractRect(x)
            dc.SetClippingRegionAsRegion(r)
            dc.SetPen(wx.TRANSPARENT_PEN)
            hc = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
            r = highlight_color(hc.Red())
            g = highlight_color(hc.Green())
            b = highlight_color(hc.Blue())
            hc.Set(r, g, b)
            dc.SetBrush(wx.Brush(hc))
            dc.DrawRectangle(c.x, c.y, c.width, c.height) 
Example #6
Source File: StatusBar.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, parent):
        wx.StatusBar.__init__(self, parent, -1)
        self.sizeChanged = False
        self.Bind(wx.EVT_SIZE, self.OnSize)
        self.Bind(wx.EVT_IDLE, self.OnIdle)
        self.SetFieldsCount(2)
        self.SetStatusWidths([-1, 40])
        self.icons = [
            GetInternalBitmap("Tray1"),
            GetInternalBitmap("Tray3"),
            GetInternalBitmap("Tray2"),
        ]
        self.icon = wx.StaticBitmap(self, -1, self.icons[0], (0, 0), (16, 16))
        rect = self.GetFieldRect(0)

        checkBox = wx.CheckBox(self, -1, eg.text.MainFrame.onlyLogAssigned)
        self.checkBox = checkBox
        colour = wx.SystemSettings_GetColour(wx.SYS_COLOUR_MENUBAR)
        checkBox.SetBackgroundColour(colour)
        self.checkBoxColour = checkBox.GetForegroundColour()
        checkBox.SetValue(eg.config.onlyLogAssigned)
        self.SetCheckBoxColour(eg.config.onlyLogAssigned)
        checkBox.Bind(wx.EVT_CHECKBOX, self.OnCheckBox)
        checkBox.SetPosition((rect.x + 2, rect.y + 2))
        checkBox.SetToolTipString(eg.text.MainFrame.onlyLogAssignedToolTip)

        eg.Bind("ProcessingChange", self.OnProcessingChange)
        self.Reposition() 
Example #7
Source File: toplevels_no_size_Classic.py    From wxGlade with MIT License 4 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: wxgMeasurementsByDayPnl.__init__
        kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
        wx.Panel.__init__(self, *args, **kwds)

        __szr_main = wx.BoxSizer(wx.HORIZONTAL)

        self._LCTRL_days = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT)
        self._LCTRL_days.SetMinSize((100, 100))
        __szr_main.Add(self._LCTRL_days, 1, wx.EXPAND | wx.RIGHT, 5)

        self._LCTRL_results = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT)
        self._LCTRL_results.SetMinSize((100, 100))
        __szr_main.Add(self._LCTRL_results, 1, wx.EXPAND | wx.RIGHT, 5)

        __szr_details = wx.BoxSizer(wx.VERTICAL)
        __szr_main.Add(__szr_details, 1, wx.EXPAND, 0)

        self._TCTRL_measurements = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_AUTO_URL | wx.TE_MULTILINE | wx.TE_READONLY)
        self._TCTRL_measurements.SetMinSize((255, 102))
        self._TCTRL_measurements.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND))
        __szr_details.Add(self._TCTRL_measurements, 1, wx.EXPAND, 0)

        __szr_show_docs = wx.BoxSizer(wx.HORIZONTAL)
        __szr_details.Add(__szr_show_docs, 0, wx.EXPAND, 0)

        self._LBL_no_of_docs = wx.StaticText(self, wx.ID_ANY, "")
        self._LBL_no_of_docs.SetMinSize((100, 100))
        __szr_show_docs.Add(self._LBL_no_of_docs, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)

        self._BTN_show_docs = wx.Button(self, wx.ID_ANY, "Show X documents")
        self._BTN_show_docs.SetMinSize((100, 100))
        self._BTN_show_docs.SetToolTip(wx.ToolTip("Show lab related documents for the episode of the selected measurement."))
        self._BTN_show_docs.Enable(False)
        __szr_show_docs.Add(self._BTN_show_docs, 0, wx.ALIGN_CENTER_VERTICAL, 0)

        __szr_show_docs.Add((20, 20), 1, wx.EXPAND, 0)

        self.SetSizer(__szr_main)
        __szr_main.Fit(self)

        self.Layout()

        self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_day_selected, self._LCTRL_days)
        self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_result_selected, self._LCTRL_results)
        self.Bind(wx.EVT_BUTTON, self._on_show_docs_button_pressed, self._BTN_show_docs)
        # end wxGlade 
Example #8
Source File: toplevels_no_size_Classic.py    From wxGlade with MIT License 4 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: MyFrame1.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.SetTitle("frame_1")

        __szr_main = wx.BoxSizer(wx.HORIZONTAL)

        self._LCTRL_days = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT)
        self._LCTRL_days.SetMinSize((100, 100))
        __szr_main.Add(self._LCTRL_days, 1, wx.EXPAND | wx.RIGHT, 5)

        self._LCTRL_results = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT)
        self._LCTRL_results.SetMinSize((100, 100))
        __szr_main.Add(self._LCTRL_results, 1, wx.EXPAND | wx.RIGHT, 5)

        __szr_details = wx.BoxSizer(wx.VERTICAL)
        __szr_main.Add(__szr_details, 1, wx.EXPAND, 0)

        self._TCTRL_measurements = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_AUTO_URL | wx.TE_MULTILINE | wx.TE_READONLY)
        self._TCTRL_measurements.SetMinSize((255, 102))
        self._TCTRL_measurements.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND))
        __szr_details.Add(self._TCTRL_measurements, 1, wx.EXPAND, 0)

        __szr_show_docs = wx.BoxSizer(wx.HORIZONTAL)
        __szr_details.Add(__szr_show_docs, 0, wx.EXPAND, 0)

        self._LBL_no_of_docs = wx.StaticText(self, wx.ID_ANY, "")
        self._LBL_no_of_docs.SetMinSize((100, 100))
        __szr_show_docs.Add(self._LBL_no_of_docs, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)

        self._BTN_show_docs = wx.Button(self, wx.ID_ANY, "Show X documents")
        self._BTN_show_docs.SetMinSize((100, 100))
        self._BTN_show_docs.SetToolTip(wx.ToolTip("Show lab related documents for the episode of the selected measurement."))
        self._BTN_show_docs.Enable(False)
        __szr_show_docs.Add(self._BTN_show_docs, 0, wx.ALIGN_CENTER_VERTICAL, 0)

        __szr_show_docs.Add((20, 20), 1, wx.EXPAND, 0)

        self.SetSizer(__szr_main)
        __szr_main.Fit(self)

        self.Layout()

        self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_day_selected, self._LCTRL_days)
        self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_result_selected, self._LCTRL_results)
        self.Bind(wx.EVT_BUTTON, self._on_show_docs_button_pressed, self._BTN_show_docs)
        # end wxGlade