本文整理汇总了Python中wx.ART_TOOLBAR属性的典型用法代码示例。如果您正苦于以下问题:Python wx.ART_TOOLBAR属性的具体用法?Python wx.ART_TOOLBAR怎么用?Python wx.ART_TOOLBAR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.ART_TOOLBAR属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ART_TOOLBAR [as 别名]
def __init__(self, parent):
# TODO: try to use MessageBox instead, as they already include buttons, icons, etc.
wx.Dialog.__init__(self, parent, title="SCT Processing")
self.SetSize((300, 120))
vbox = wx.BoxSizer(wx.VERTICAL)
lbldesc = wx.StaticText(self, id=wx.ID_ANY, label="Processing, please wait...")
vbox.Add(lbldesc, 0, wx.ALIGN_LEFT | wx.ALL, 10)
btns = self.CreateSeparatedButtonSizer(wx.CANCEL)
vbox.Add(btns, 0, wx.ALIGN_LEFT | wx.ALL, 5)
hbox = wx.BoxSizer(wx.HORIZONTAL)
# TODO: use a nicer image, showing two gears (similar to ID_EXECUTE)
save_ico = wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_TOOLBAR, (50, 50))
img_info = wx.StaticBitmap(self, -1, save_ico, wx.DefaultPosition, (save_ico.GetWidth(), save_ico.GetHeight()))
hbox.Add(img_info, 0, wx.ALL, 10)
hbox.Add(vbox, 0, wx.ALL, 0)
self.SetSizer(hbox)
self.Centre()
self.CenterOnParent()
# TODO: retrieve action from the cancel button
示例2: add_to_imagelist
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ART_TOOLBAR [as 别名]
def add_to_imagelist(self, path):
folder_bmp = wx.ArtProvider.GetBitmap(wx.ART_FOLDER, wx.ART_TOOLBAR, self.tsize)
# file_bmp = wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, wx.ART_TOOLBAR, self.tsize)
if os.path.isdir(path):
img_id = self.il.Add(folder_bmp)
else:
thumb_bmp = self.create_thumb_bmp(path)
img_id = self.il.Add(thumb_bmp)
return img_id
示例3: add_to_imagelist
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ART_TOOLBAR [as 别名]
def add_to_imagelist(self, path):
folder_bmp = wx.ArtProvider.GetBitmap(wx.ART_FOLDER, wx.ART_TOOLBAR, self.tsize)
if os.path.isdir(path):
img_id = self.image_list.Add(folder_bmp)
else:
thumb_bmp = self.create_thumb_bmp(path)
img_id = self.image_list.Add(thumb_bmp)
return img_id
示例4: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ART_TOOLBAR [as 别名]
def __init__(self, parent, ops=[], *a, **k):
size = wx.the_app.config['toolbar_size']
self.size = size
style = self.default_style
config = wx.the_app.config
if config['toolbar_text']:
style |= wx.TB_TEXT
wx.ToolBar.__init__(self, parent, style=style, **k)
self.SetToolBitmapSize((size,size))
while ops:
opset = ops.pop(0)
for e in opset:
if issubclass(type(e.image), (str,unicode)):
bmp = wx.ArtProvider.GetBitmap(e.image, wx.ART_TOOLBAR, (size,size))
elif type(e.image) is tuple:
i = wx.the_app.theme_library.get(e.image, self.size)
bmp = wx.BitmapFromImage(i)
assert bmp.Ok(), "The image (%s) is not valid." % i
self.AddLabelTool(e.id, e.label, bmp, shortHelp=e.shorthelp)
if len(ops):
self.AddSeparator()
self.Realize()
示例5: SetupToolBar
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ART_TOOLBAR [as 别名]
def SetupToolBar(self):
"""Create the toolbar for common actions"""
tb = self.CreateToolBar(self.TBFLAGS)
tsize = (24, 24)
tb.ToolBitmapSize = tsize
open_bmp = wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_TOOLBAR,
tsize)
tb.AddLabelTool(ID_OPEN, "Open", open_bmp, shortHelp="Open",
longHelp="Open a (c)Profile trace file")
if not osx:
tb.AddSeparator()
# self.Bind(wx.EVT_TOOL, self.OnOpenFile, id=ID_OPEN)
self.rootViewTool = tb.AddLabelTool(
ID_ROOT_VIEW, _("Root View"),
wx.ArtProvider.GetBitmap(wx.ART_GO_HOME, wx.ART_TOOLBAR, tsize),
shortHelp=_("Display the root of the current view tree (home view)")
)
self.rootViewTool = tb.AddLabelTool(
ID_BACK_VIEW, _("Back"),
wx.ArtProvider.GetBitmap(wx.ART_GO_BACK, wx.ART_TOOLBAR, tsize),
shortHelp=_("Back to the previously activated node in the call tree")
)
self.upViewTool = tb.AddLabelTool(
ID_UP_VIEW, _("Up"),
wx.ArtProvider.GetBitmap(wx.ART_GO_UP, wx.ART_TOOLBAR, tsize),
shortHelp=_("Go one level up the call tree (highest-percentage parent)")
)
if not osx:
tb.AddSeparator()
# TODO: figure out why the control is sizing the label incorrectly on Linux
self.percentageViewTool = wx.CheckBox(tb, -1, _("Percent "))
self.percentageViewTool.SetToolTip(wx.ToolTip(
_("Toggle display of percentages in list views")))
tb.AddControl(self.percentageViewTool)
wx.EVT_CHECKBOX(self.percentageViewTool,
self.percentageViewTool.GetId(), self.OnPercentageView)
self.viewTypeTool= wx.Choice( tb, -1, choices= getattr(self.loader,'ROOTS',[]) )
self.viewTypeTool.SetToolTip(wx.ToolTip(
_("Switch between different hierarchic views of the data")))
wx.EVT_CHOICE( self.viewTypeTool, self.viewTypeTool.GetId(), self.OnViewTypeTool )
tb.AddControl( self.viewTypeTool )
tb.Realize()