本文整理汇总了Python中wx.BORDER_SIMPLE属性的典型用法代码示例。如果您正苦于以下问题:Python wx.BORDER_SIMPLE属性的具体用法?Python wx.BORDER_SIMPLE怎么用?Python wx.BORDER_SIMPLE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.BORDER_SIMPLE属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BORDER_SIMPLE [as 别名]
def __init__(
self,
parent = None,
id = -1,
label = "",
pos = (-1, -1),
size = (-1, -1),
style = wx.BORDER_SIMPLE,
name = "Monitors",
background = wx.SystemSettings.GetColour(wx.SYS_COLOUR_MENU)
):
wx.Panel.__init__(self, parent, id, pos, size, style, name)
b1 = 2
b2 = 3
b3 = self.GetWindowBorderSize()[1]
lbl = wx.StaticText(self, -1, eg.text.General.monitorsLabel, pos = ((b2, b1)))
lbl.Enable(False)
monsCtrl = MonsListCtrl(self, ((b2, 2 * b1 + lbl.GetSize()[1])))
self.SetBackgroundColour(wx.Colour(*background))
monsCtrl.SetBackgroundColour(wx.Colour(*background))
w, h = monsCtrl.GetRealSize()
self.size = (w + 2 * b2 + 2, h + lbl.GetSize()[1] + 2 * b1 + b2 + b3)
self.SetMinSize(self.size)
self.Bind(wx.EVT_SIZE, self.OnSize)
示例2: create_sizer_paths
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BORDER_SIMPLE [as 别名]
def create_sizer_paths(self):
self.sizer_setting_paths = wx.StaticBoxSizer(wx.VERTICAL, self, "Wallpaper paths")
self.statbox_parent_paths = self.sizer_setting_paths.GetStaticBox()
st_paths_info = wx.StaticText(self.statbox_parent_paths, -1, "Browse to add your wallpaper files or source folders here:")
if self.use_multi_image:
self.path_listctrl = wx.ListCtrl(self.statbox_parent_paths, -1,
style=wx.LC_REPORT
| wx.BORDER_SIMPLE
| wx.LC_SORT_ASCENDING
)
self.path_listctrl.InsertColumn(0, 'Display', wx.LIST_FORMAT_RIGHT, width = 100)
self.path_listctrl.InsertColumn(1, 'Source', width = 400)
else:
# show simpler listing without header if only one wallpaper target
self.path_listctrl = wx.ListCtrl(self.statbox_parent_paths, -1,
style=wx.LC_REPORT
| wx.BORDER_SIMPLE
| wx.LC_NO_HEADER
)
self.path_listctrl.InsertColumn(0, 'Source', width = 500)
self.path_listctrl.SetImageList(self.image_list, wx.IMAGE_LIST_SMALL)
self.sizer_setting_paths.Add(st_paths_info, 0, wx.ALIGN_LEFT|wx.ALL, 5)
self.sizer_setting_paths.Add(
self.path_listctrl, 1, wx.CENTER|wx.EXPAND|wx.TOP|wx.LEFT|wx.RIGHT, 5
)
# Buttons
self.sizer_setting_paths_buttons = wx.BoxSizer(wx.HORIZONTAL)
self.button_browse = wx.Button(self.statbox_parent_paths, label="Browse")
self.button_remove_source = wx.Button(self.statbox_parent_paths, label="Remove selected source")
self.button_browse.Bind(wx.EVT_BUTTON, self.onBrowsePaths)
self.button_remove_source.Bind(wx.EVT_BUTTON, self.onRemoveSource)
self.sizer_setting_paths_buttons.Add(self.button_browse, 0, wx.CENTER|wx.ALL, 5)
self.sizer_setting_paths_buttons.Add(self.button_remove_source, 0, wx.CENTER|wx.ALL, 5)
# add button sizer to parent paths sizer
self.sizer_setting_paths.Add(self.sizer_setting_paths_buttons, 0, wx.CENTER|wx.EXPAND|wx.ALL, 0)
self.sizer_settings_right.Add(
self.sizer_setting_paths, 1, wx.CENTER|wx.EXPAND|wx.TOP|wx.LEFT|wx.RIGHT, 5
)
示例3: refresh_path_listctrl
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BORDER_SIMPLE [as 别名]
def refresh_path_listctrl(self, use_multi_image, migrate_paths=False):
if use_multi_image == self.multi_column_listc and migrate_paths:
self.sizer_main.Layout()
else:
if migrate_paths and self.path_listctrl.GetItemCount():
# warn that paths can't be migrated
msg = ("Wallpaper sources cannot be migrated between span"
" and multi image, continue?"
"\n"
"Saved sources are not affected until you overwrite.")
res = show_message_dialog(msg, style="YES_NO")
if not res:
# user canceled
return False
self.path_listctrl.Destroy()
self.image_list.RemoveAll()
if use_multi_image:
self.multi_column_listc = True
self.path_listctrl = wx.ListCtrl(self.statbox_parent_paths, -1,
style=wx.LC_REPORT
| wx.BORDER_SIMPLE
| wx.LC_SORT_ASCENDING
)
self.path_listctrl.InsertColumn(0, 'Display', wx.LIST_FORMAT_RIGHT, width=100)
self.path_listctrl.InsertColumn(1, 'Source', width=400)
else:
self.multi_column_listc = False
# show simpler listing without header if only one wallpaper target
self.path_listctrl = wx.ListCtrl(self.statbox_parent_paths, -1,
style=wx.LC_REPORT
| wx.BORDER_SIMPLE
| wx.LC_NO_HEADER
)
self.path_listctrl.InsertColumn(0, 'Source', width=500)
self.path_listctrl.SetImageList(self.image_list, wx.IMAGE_LIST_SMALL)
self.sizer_setting_paths.Insert(1, self.path_listctrl, 1,
wx.CENTER | wx.EXPAND | wx.ALL, 5)
self.path_listctrl.InvalidateBestSize()
self.sizer_main.Layout()
return True
示例4: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BORDER_SIMPLE [as 别名]
def __init__(self, parent, id_):
super(SCTPanel, self).__init__(parent=parent, id=id_)
# Logo
self.img_logo = self.get_logo()
self.sizer_logo_sct = wx.BoxSizer(wx.VERTICAL)
self.sizer_logo_sct.Add(self.img_logo, 0, wx.ALL, 5)
# Citation
txt_sct_citation = wx.VSCROLL | \
wx.HSCROLL | wx.TE_READONLY | \
wx.BORDER_SIMPLE
html_sct_citation = html.HtmlWindow(self, wx.ID_ANY,
size=(280, 115),
style=txt_sct_citation)
html_sct_citation.SetPage(self.DESCRIPTION_SCT)
self.sizer_logo_sct.Add(html_sct_citation, 0, wx.ALL, 5)
# Help button
button_help = wx.Button(self, id=id_, label="Help")
button_help.Bind(wx.EVT_BUTTON, self.tutorial)
self.sizer_logo_sct.Add(button_help, 0, wx.ALL, 5)
# Get function-specific description
self.html_desc = self.get_description()
# Organize boxes
self.sizer_logo_text = wx.BoxSizer(wx.HORIZONTAL) # create main box
self.sizer_logo_text.Add(self.sizer_logo_sct, 0, wx.ALL, 5)
# TODO: increase the width of the description box
self.sizer_logo_text.Add(self.html_desc, 0, wx.ALL, 5)
self.sizer_h = wx.BoxSizer(wx.HORIZONTAL)
self.sizer_h.Add(self.sizer_logo_text)
示例5: get_description
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BORDER_SIMPLE [as 别名]
def get_description(self):
txt_style = wx.VSCROLL | \
wx.HSCROLL | wx.TE_READONLY | \
wx.BORDER_SIMPLE
htmlw = html.HtmlWindow(self, wx.ID_ANY,
size=(280, 208),
style=txt_style)
htmlw.SetPage(self.DESCRIPTION)
return htmlw
示例6: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BORDER_SIMPLE [as 别名]
def __init__(self, parent, choices=None):
wx.PopupWindow.__init__(self, parent, wx.BORDER_SIMPLE)
self.ListBox = wx.ListBox(self, -1, style=wx.LB_HSCROLL | wx.LB_SINGLE | wx.LB_SORT)
choices = [] if choices is None else choices
self.SetChoices(choices)
self.ListBox.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
self.ListBox.Bind(wx.EVT_MOTION, self.OnMotion)
示例7: create_paths_listctrl
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BORDER_SIMPLE [as 别名]
def create_paths_listctrl(self, use_multi_image):
if use_multi_image:
self.paths_listctrl = wx.ListCtrl(self, -1,
size=(-1, -1),
style=wx.LC_REPORT
# | wx.BORDER_SUNKEN
| wx.BORDER_SIMPLE
# | wx.BORDER_STATIC
# | wx.BORDER_THEME
# | wx.BORDER_NONE
# | wx.LC_EDIT_LABELS
| wx.LC_SORT_ASCENDING
# | wx.LC_NO_HEADER
# | wx.LC_VRULES
# | wx.LC_HRULES
# | wx.LC_SINGLE_SEL
)
self.paths_listctrl.InsertColumn(0, 'Display', wx.LIST_FORMAT_RIGHT, width=100)
self.paths_listctrl.InsertColumn(1, 'Source', width=620)
else:
# show simpler listing without header if only one wallpaper target
self.paths_listctrl = wx.ListCtrl(self, -1,
size=(-1, -1),
style=wx.LC_REPORT
# | wx.BORDER_SUNKEN
| wx.BORDER_SIMPLE
# | wx.BORDER_STATIC
# | wx.BORDER_THEME
# | wx.BORDER_NONE
# | wx.LC_EDIT_LABELS
# | wx.LC_SORT_ASCENDING
| wx.LC_NO_HEADER
# | wx.LC_VRULES
# | wx.LC_HRULES
# | wx.LC_SINGLE_SEL
)
self.paths_listctrl.InsertColumn(0, 'Source', width=720)
# Add the item list to the control
self.paths_listctrl.SetImageList(self.il, wx.IMAGE_LIST_SMALL)
self.sizer_paths_list.Add(self.paths_listctrl, 1, wx.CENTER|wx.ALL|wx.EXPAND, 5)