当前位置: 首页>>代码示例>>Python>>正文


Python wx.BLUE属性代码示例

本文整理汇总了Python中wx.BLUE属性的典型用法代码示例。如果您正苦于以下问题:Python wx.BLUE属性的具体用法?Python wx.BLUE怎么用?Python wx.BLUE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在wx的用法示例。


在下文中一共展示了wx.BLUE属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _set_cur_widget

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BLUE [as 别名]
def _set_cur_widget(self, editor):
        # set self.cur_widget; adjust label colors and bold if required (on Windows)
        if self.cur_widget and wx.Platform == "__WXMSW__" and self.cur_widget.item:
            item = self.cur_widget.item
            self.SetItemTextColour(item, wx.NullColour)
            self.SetItemBold( item, False )
        self.cur_widget = editor
        item = editor.item
        self.EnsureVisible(item)
        # ensure that the icon is visible
        text_rect = self.GetBoundingRect(item, True)
        if text_rect.x<22:
            self.SetScrollPos(wx.HORIZONTAL, self.GetScrollPos(wx.HORIZONTAL) - 22 + text_rect.x)
        if wx.Platform == "__WXMSW__":
            self.SetItemBold(item, True)
            self.SetItemTextColour(item, wx.BLUE)
        s = editor._get_tooltip_string()
        common.main.user_message( s and s.replace("\n", " ") or "" ) 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:20,代码来源:tree.py

示例2: _draw_background

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BLUE [as 别名]
def _draw_background(self, dc, clear=True):
        "draw the hatches on device context dc (red if selected)"
        size = self.widget.GetSize()
        small = size[0]<10 or size[1]<10
        focused = misc.focused_widget is self
        if clear:
            if small and focused:
                dc.SetBackground(wx.Brush(wx.BLUE))
            else:
                dc.SetBackground(wx.Brush(wx.LIGHT_GREY))
            dc.Clear()
        if small and focused:
            color = wx.WHITE
        elif small or not focused:
            color = wx.BLACK
        else:
            color = wx.BLUE

        if focused:
            hatch = compat.BRUSHSTYLE_CROSSDIAG_HATCH
        elif not self.parent.IS_SIZER:
            hatch = compat.BRUSHSTYLE_FDIAGONAL_HATCH
        else:
            if not "cols" in self.parent.PROPERTIES:  # horizontal/vertical sizer or grid sizer?
                pos = self.index
            else:
                pos = sum( self.sizer._get_row_col(self.index) )
            hatch = compat.BRUSHSTYLE_FDIAGONAL_HATCH  if pos%2 else  compat.BRUSHSTYLE_BDIAGONAL_HATCH
        brush = wx.Brush(color, hatch)
        # draw hatched lines in foreground
        dc.SetBrush(brush)
        size = self.widget.GetClientSize()
        dc.DrawRectangle(0, 0, size.width, size.height)

    # context menu ##################################################################################################### 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:37,代码来源:edit_base.py

示例3: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BLUE [as 别名]
def __init__(self, parent):
        kwds = {'size': (7, 7)}
        wx.Window.__init__(self, parent, wx.ID_ANY, **kwds)
        self.SetBackgroundColour(wx.BLUE)
        self.Hide() 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:7,代码来源:misc.py

示例4: _set_tooltip

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BLUE [as 别名]
def _set_tooltip(self, *controls):
        tooltip = self._find_tooltip()
        if not tooltip: return
        for c in controls:
            if not c: continue
            if not c.GetToolTip():
                compat.SetToolTip(c, tooltip)
            if self.min_version and isinstance(c, wx.TextCtrl):
                c.SetForegroundColour(wx.BLUE)


# these classes are not really used, as they don't have an editor: 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:14,代码来源:new_properties.py

示例5: update_display

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BLUE [as 别名]
def update_display(self, start_editing=False):
        # when the value has changed
        if start_editing: self.editing = True
        if not self.editing: return
        checked = self.get_list_value()
        for i,checkbox in enumerate(self._choices):
            if checkbox is None: continue
            name = self._names[i]
            if checked[i] and not checkbox.GetValue():
                checkbox.SetValue(True)
            elif not checked[i] and checkbox.GetValue():
                checkbox.SetValue(False)
            # display included flags in grey and excluded flags red
            if self.EXCLUDES:
                excludes = self.EXCLUDES.get(name, [])
            else:
                excludes = self.style_defs[name].get("exclude",[])
            default_color = wx.BLACK if not "rename_to" in self.style_defs[name] else wx.Colour(130,130,130)
            if checked[i] and not name in self.value_set:
                checkbox.SetForegroundColour(wx.Colour(120,120,100))  # grey
            elif self.value_set.intersection( excludes ):
                checkbox.SetForegroundColour(wx.RED)
            else:
                supported_by = self.style_defs.get(name, {}).get("supported_by", None)
                if supported_by:
                    checkbox.SetForegroundColour(wx.BLUE)
                else:
                    checkbox.SetForegroundColour(default_color)
            if self.EXCLUDES2 and name in self.EXCLUDES2:
                checkbox.SetForegroundColour(wx.RED)
                checkbox.Disable()
            elif self.EXCLUDES2 is not None:
                checkbox.Enable()
            checkbox.Refresh()

    ####################################################################################################################
    # helpers for CheckBox tooltips 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:39,代码来源:new_properties.py

示例6: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BLUE [as 别名]
def __init__(self, scene, root):
        Widget.__init__(self, scene, all=False)
        self.root = root
        self.elements = scene.device.device_root.elements
        self.selection_pen = wx.Pen()
        self.selection_pen.SetColour(wx.BLUE)
        self.selection_pen.SetWidth(25)
        self.selection_pen.SetStyle(wx.PENSTYLE_SHORT_DASH)
        self.save_width = None
        self.save_height = None
        self.tool = self.tool_translate
        self.cursor = None
        self.uniform = True 
开发者ID:meerk40t,项目名称:meerk40t,代码行数:15,代码来源:Widget.py

示例7: Draw

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BLUE [as 别名]
def Draw(self, dc):
        Graphic_Element.Draw(self, dc)
        if self.Value:
            if self.Forced:
                dc.SetPen(MiterPen(wx.CYAN))
            else:
                dc.SetPen(MiterPen(wx.GREEN))
        elif self.Forced:
            dc.SetPen(MiterPen(wx.BLUE))
        else:
            dc.SetPen(MiterPen(wx.BLACK))
        dc.SetBrush(wx.WHITE_BRUSH)

        if getattr(dc, "printing", False):
            name_size = dc.GetTextExtent(self.Name)
        else:
            name_size = self.NameSize

        # Draw two rectangles for representing the step
        dc.DrawRectangle(self.Pos.x, self.Pos.y, self.Size[0] + 1, self.Size[1] + 1)
        if self.Initial:
            dc.DrawRectangle(self.Pos.x + 2, self.Pos.y + 2, self.Size[0] - 3, self.Size[1] - 3)
        # Draw step name
        name_pos = (self.Pos.x + (self.Size[0] - name_size[0]) // 2,
                    self.Pos.y + (self.Size[1] - name_size[1]) // 2)
        dc.DrawText(self.Name, name_pos[0], name_pos[1])
        # Draw input and output connectors
        if self.Input:
            self.Input.Draw(dc)
        if self.Output:
            self.Output.Draw(dc)
        if self.Action:
            self.Action.Draw(dc)

        if not getattr(dc, "printing", False):
            DrawHighlightedText(dc, self.Name, self.Highlights, name_pos[0], name_pos[1])


# -------------------------------------------------------------------------------
#                       Sequencial Function Chart Transition
# ------------------------------------------------------------------------------- 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:43,代码来源:SFC_Objects.py

示例8: Normal

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BLUE [as 别名]
def Normal(fontName="Arial"):
        """
        Return a reasonable default format for a report
        """
        fmt = ReportFormat()
        fmt.PageHeader.Font = wx.FFont(24, wx.FONTFAMILY_DEFAULT, face=fontName)
        fmt.PageHeader.TextAlignment = wx.ALIGN_CENTRE
        fmt.PageHeader.Add(FrameDecoration(pen=wx.Pen(wx.BLUE, 1), space=5))
        #fmt.PageHeader.Add(LineDecoration(pen=wx.Pen(wx.BLUE, 2), space=5))

        fmt.ReportHeader.Font = wx.FFont(36, wx.FONTFAMILY_DEFAULT, face=fontName)
        fmt.ReportHeader.TextColor = wx.RED
        fmt.ReportHeader.Padding = (0, 12, 0, 12)

        fmt.ListHeader.Add(LineDecoration(side=Decoration.BOTTOM, pen=wx.Pen(wx.GREEN, 1)))

        fmt.PageFooter.Font = wx.FFont(12, wx.FONTFAMILY_DEFAULT, face=fontName)
        fmt.PageFooter.TextAlignment = wx.ALIGN_RIGHT
        fmt.PageFooter.Add(LineDecoration(side=Decoration.TOP, pen=wx.Pen(wx.BLUE, 1), space=3))

        fmt.Row.Font = wx.FFont(12, wx.FONTFAMILY_DEFAULT, face=fontName)
        #fmt.ColumnHeader.CellPadding=25
        fmt.ColumnHeader.GridPen=wx.Pen(wx.RED, 1)
        fmt.Row.CellPadding=(10, 10, 0, 10)
        fmt.Row.GridPen=wx.Pen(wx.BLUE, 1)
        #fmt.ColumnHeader.Add(FrameDecoration(pen=wx.Pen(wx.RED, 1)))
        #fmt.Row.Add(FrameDecoration(pen=wx.Pen(wx.RED, 10)))
        #fmt.Row.Add(LineDecoration(side=Decoration.BOTTOM, pen=wx.Pen(wx.GREEN, 1)))

        return fmt

#====================================================================== 
开发者ID:JackonYang,项目名称:bookhub,代码行数:34,代码来源:OLVPrinter.py

示例9: run

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BLUE [as 别名]
def run(self):
            printer = OLVPrinter(self.olv, "First ObjectListView Report")
            printer.ReportFormat = ReportFormat.Normal()

            #fmt.PageHeader.Font = wx.FFont(36, wx.FONTFAMILY_SWISS, face="Gill Sans")
            #fmt.PageHeader.Add(BackgroundDecoration(wx.BLUE))
            #fmt.PageHeader.Add(LineDecoration(side=Decoration.TOP, pen=wx.Pen(wx.RED, 5), space=0))
            #fmt.PageHeader.Add(LineDecoration(pen=wx.BLACK_PEN, space=0))
            #
            #fmt.PageFooter.Font = wx.FFont(12, wx.FONTFAMILY_SWISS, face="Gill Sans")
            #fmt.PageFooter.Add(BackgroundDecoration(wx.GREEN))
            #fmt.PageFooter.Add(LineDecoration(pen=wx.Pen(wx.BLUE, 5), space=0))
            #fmt.PageFooter.Add(LineDecoration(side=Decoration.TOP, pen=wx.RED_PEN, space=0))

            printer.PrintPreview(self) 
开发者ID:JackonYang,项目名称:bookhub,代码行数:17,代码来源:OLVPrinter.py

示例10: Normal

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BLUE [as 别名]
def Normal(headerFontName="Gill Sans", rowFontName="Times New Roman"):
        """
        Return a reasonable default format for a report
        """
        fmt = ReportFormat()
        fmt.IsShrinkToFit = True

        fmt.PageHeader.Font = wx.FFont(12, wx.FONTFAMILY_DEFAULT, face=headerFontName)
        fmt.PageHeader.Line(wx.BOTTOM, wx.BLUE, 2, space=5)
        fmt.PageHeader.Padding = (0, 0, 0, 12)

        fmt.ListHeader.Font = wx.FFont(26, wx.FONTFAMILY_SWISS, wx.FONTFLAG_BOLD, face=headerFontName)
        fmt.ListHeader.TextColor = wx.WHITE
        fmt.ListHeader.Padding = (0, 12, 0, 12)
        fmt.ListHeader.TextAlignment = wx.ALIGN_LEFT
        fmt.ListHeader.Background(wx.BLUE, wx.WHITE, space=(16, 4, 0, 4))

        fmt.GroupTitle.Font = wx.FFont(14, wx.FONTFAMILY_DEFAULT, face=headerFontName)
        fmt.GroupTitle.Line(wx.BOTTOM, wx.BLUE, 4, toColor=wx.WHITE, space=5)
        fmt.GroupTitle.Padding = (0, 12, 0, 12)

        fmt.PageFooter.Font = wx.FFont(10, wx.FONTFAMILY_DEFAULT, face=headerFontName)
        fmt.PageFooter.Background(wx.WHITE, wx.BLUE, space=(0, 4, 0, 4))

        fmt.ColumnHeader.Font = wx.FFont(14, wx.FONTFAMILY_DEFAULT, wx.FONTFLAG_BOLD, face=headerFontName)
        fmt.ColumnHeader.CellPadding = 2
        fmt.ColumnHeader.Background(wx.Colour(192, 192, 192))
        fmt.ColumnHeader.GridPen = wx.Pen(wx.WHITE, 1)
        fmt.ColumnHeader.Padding = (0, 0, 0, 12)
        fmt.ColumnHeader.AlwaysCenter = True

        fmt.Row.Font = wx.FFont(12, wx.FONTFAMILY_DEFAULT, face=rowFontName)
        fmt.Row.Line(wx.BOTTOM, pen=wx.Pen(wx.BLUE, 1, wx.DOT), space=3)
        fmt.Row.CellPadding = 2
        fmt.Row.CanWrap = True

        return fmt 
开发者ID:JackonYang,项目名称:bookhub,代码行数:39,代码来源:ListCtrlPrinter.py

示例11: Background

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BLUE [as 别名]
def Background(self, color=wx.BLUE, toColor=None, space=0):
        """
        Add a coloured background to the block
        """
        self.Add(RectangleDecoration(color=color, toColor=toColor, space=space)) 
开发者ID:JackonYang,项目名称:bookhub,代码行数:7,代码来源:ListCtrlPrinter.py

示例12: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BLUE [as 别名]
def __init__(self, parent, id, log):
        wx.Notebook.__init__(self, parent, id, size=(21,21), style=
                             wx.BK_DEFAULT
                             #wx.BK_TOP 
                             #wx.BK_BOTTOM
                             #wx.BK_LEFT
                             #wx.BK_RIGHT
                             # | wx.NB_MULTILINE
                             )
        self.log = log

        win = self.makeColorPanel(wx.BLUE)
        self.AddPage(win, "Blue")
        st = wx.StaticText(win.win, -1,
                          "You can put nearly any type of window here,\n"
                          "and if the platform supports it then the\n"
                          "tabs can be on any side of the notebook.",
                          (10, 10))

        st.SetForegroundColour(wx.WHITE)
        st.SetBackgroundColour(wx.BLUE)

        # Show how to put an image on one of the notebook tabs,
        # first make the image list:
        il = wx.ImageList(16, 16)
        idx1 = il.Add(images.getSmilesBitmap())
        self.AssignImageList(il)

        # now put an image on the first tab we just created:
        self.SetPageImage(0, idx1)


        win = self.makeColorPanel(wx.RED)
        self.AddPage(win, "Red")

        win = ScrolledWindow.MyCanvas(self)
        self.AddPage(win, 'ScrolledWindow')

        win = self.makeColorPanel(wx.GREEN)
        self.AddPage(win, "Green")

        win = GridSimple.SimpleGrid(self, log)
        self.AddPage(win, "Grid")

        win = ListCtrl.TestListCtrlPanel(self, log)
        self.AddPage(win, 'List')

        win = self.makeColorPanel(wx.CYAN)
        self.AddPage(win, "Cyan")

        win = self.makeColorPanel(wx.NamedColour('Midnight Blue'))
        self.AddPage(win, "Midnight Blue")

        win = self.makeColorPanel(wx.NamedColour('Indian Red'))
        self.AddPage(win, "Indian Red")

        self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.OnPageChanged)
        self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGING, self.OnPageChanging) 
开发者ID:peckhams,项目名称:topoflow,代码行数:60,代码来源:Notebook_Test.py

示例13: DrawViewer

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BLUE [as 别名]
def DrawViewer(self):
        """
        Redraw content displayed by Viewer
        """
        # Create buffered DC for drawing in panel
        width, height = self.GetSize()
        bitmap = wx.EmptyBitmap(width, height)
        dc = wx.BufferedDC(wx.ClientDC(self), bitmap)
        dc.Clear()

        # Get Graphics Context for DC, for anti-aliased and transparent
        # rendering
        gc = wx.GCDC(dc)

        gc.BeginDrawing()

        # Get first item
        item = self.ItemsDict.values()[0]

        # Get item variable path masked according Debug Variable Panel mask
        item_path = item.GetVariable(
            self.ParentWindow.GetVariableNameMask())

        # Draw item variable path at Viewer left side
        w, h = gc.GetTextExtent(item_path)
        gc.DrawText(item_path, 20, (height - h) // 2)

        # Update 'Release' button state and text color according to item forced
        # flag value
        item_forced = item.IsForced()
        self.Buttons[1].Enable(item_forced)
        self.RefreshButtonsPosition()
        if item_forced:
            gc.SetTextForeground(wx.BLUE)

        # Draw item current value at right side of Viewer
        item_value = item.GetValue()
        w, h = gc.GetTextExtent(item_value)
        gc.DrawText(item_value, width - 40 - w, (height - h) // 2)

        # Draw other Viewer common elements
        self.DrawCommonElements(gc)

        gc.EndDrawing() 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:46,代码来源:DebugVariableTextViewer.py

示例14: TooMuch

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BLUE [as 别名]
def TooMuch(headerFontName="Chiller", rowFontName="Gill Sans"):
        """
        Return a reasonable default format for a report
        """
        fmt = ReportFormat()
        fmt.IsShrinkToFit = False

        fmt.PageHeader.Font = wx.FFont(12, wx.FONTFAMILY_DECORATIVE, wx.FONTFLAG_BOLD, face=headerFontName)
        fmt.PageHeader.TextColor = wx.WHITE
        fmt.PageHeader.Background(wx.GREEN, wx.RED, space=(16, 4, 0, 4))
        fmt.PageHeader.Padding = (0, 0, 0, 12)

        fmt.ListHeader.Font = wx.FFont(24, wx.FONTFAMILY_DECORATIVE, face=headerFontName)
        fmt.ListHeader.TextColor = wx.WHITE
        fmt.ListHeader.Padding = (0, 12, 0, 12)
        fmt.ListHeader.TextAlignment = wx.ALIGN_CENTER
        fmt.ListHeader.Background(wx.RED, wx.GREEN, space=(16, 4, 0, 4))

        fmt.GroupTitle.Font = wx.FFont(14, wx.FONTFAMILY_DECORATIVE, wx.FONTFLAG_BOLD, face=headerFontName)
        fmt.GroupTitle.TextColor = wx.BLUE
        fmt.GroupTitle.Padding = (0, 12, 0, 12)
        fmt.GroupTitle.Line(wx.BOTTOM, wx.GREEN, 4, toColor=wx.WHITE, space=5)

        fmt.PageFooter.Font = wx.FFont(10, wx.FONTFAMILY_DECORATIVE, face=headerFontName)
        fmt.PageFooter.Line(wx.TOP, wx.GREEN, 2, toColor=wx.RED, space=3)
        fmt.PageFooter.Padding = (0, 16, 0, 0)

        fmt.ColumnHeader.Font = wx.FFont(14, wx.FONTFAMILY_SWISS, wx.FONTFLAG_BOLD, face=headerFontName)
        fmt.ColumnHeader.Background(wx.Colour(255, 215, 0))
        fmt.ColumnHeader.CellPadding = 5
        fmt.ColumnHeader.GridPen = wx.Pen(wx.Colour(192, 192, 192), 1)

        fmt.Row.Font = wx.FFont(12, wx.FONTFAMILY_SWISS, face=rowFontName)
        fmt.Row.CellPadding = 5
        fmt.Row.GridPen = wx.Pen(wx.BLUE, 1, wx.DOT)
        fmt.Row.CanWrap = True

        fmt.Watermark.TextColor = wx.Colour(233, 150, 122)

        return fmt

#---------------------------------------------------------------------------- 
开发者ID:JackonYang,项目名称:bookhub,代码行数:44,代码来源:ListCtrlPrinter.py


注:本文中的wx.BLUE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。