本文整理汇总了Python中wx.ToolTip方法的典型用法代码示例。如果您正苦于以下问题:Python wx.ToolTip方法的具体用法?Python wx.ToolTip怎么用?Python wx.ToolTip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wx
的用法示例。
在下文中一共展示了wx.ToolTip方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _update_pause_button
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ToolTip [as 别名]
def _update_pause_button(self, event):
selected_rows = self._status_list.get_all_selected()
label = _("Pause")
bitmap = self._bitmaps["pause"]
for row in selected_rows:
object_id = self._status_list.GetItemData(row)
download_item = self._download_list.get_item(object_id)
if download_item.stage == "Paused":
# If we find one or more items in Paused
# state set the button functionality to resume
label = _("Resume")
bitmap = self._bitmaps["resume"]
break
self._buttons["pause"].SetLabel(label)
self._buttons["pause"].SetToolTip(wx.ToolTip(label))
self._buttons["pause"].SetBitmap(bitmap, wx.TOP)
示例2: add_tooltip
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ToolTip [as 别名]
def add_tooltip(widget, text):
"""Add a tooltip to widget with the specified text."""
tooltip = wx.ToolTip(text)
widget.SetToolTip(tooltip)
示例3: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ToolTip [as 别名]
def __init__(self, *args, **kwargs):
super(GeneralTab, self).__init__(*args, **kwargs)
self.language_label = self.crt_statictext(_("Language"))
self.language_combobox = self.crt_bitmap_combobox(list(self.LOCALE_NAMES.items()), event_handler=self._on_language)
self.filename_format_label = self.crt_statictext(_("Filename format"))
self.filename_format_combobox = self.crt_combobox(list(OUTPUT_FORMATS.values()), event_handler=self._on_filename)
self.filename_custom_format = self.crt_textctrl()
self.filename_custom_format_button = self.crt_button("...", self._on_format)
self.filename_opts_label = self.crt_statictext(_("Filename options"))
self.filename_ascii_checkbox = self.crt_checkbox(_("Restrict filenames to ASCII"))
self.more_opts_label = self.crt_statictext(_("More options"))
self.confirm_exit_checkbox = self.crt_checkbox(_("Confirm on exit"))
self.confirm_deletion_checkbox = self.crt_checkbox(_("Confirm item deletion"))
self.show_completion_popup_checkbox = self.crt_checkbox(_("Inform me on download completion"))
self.shutdown_checkbox = self.crt_checkbox(_("Shutdown on download completion"), event_handler=self._on_shutdown)
self.sudo_textctrl = self.crt_textctrl(wx.TE_PASSWORD)
# Build the menu for the custom format button
self.custom_format_menu = self._build_custom_format_menu()
self._set_layout()
if os.name == "nt":
self.sudo_textctrl.Hide()
self.sudo_textctrl.SetToolTip(wx.ToolTip(_("SUDO password")))
示例4: _reset_widgets
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ToolTip [as 别名]
def _reset_widgets(self):
"""Resets GUI widgets after update or download process. """
self._buttons["start"].SetLabel(_("Start"))
self._buttons["start"].SetToolTip(wx.ToolTip(_("Start")))
self._buttons["start"].SetBitmap(self._bitmaps["start"], wx.TOP)
示例5: _start_download
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ToolTip [as 别名]
def _start_download(self):
if self._status_list.is_empty():
self._create_popup(_("No items to download"),
self.WARNING_LABEL,
wx.OK | wx.ICON_EXCLAMATION)
else:
self._app_timer.Start(100)
self.download_manager = DownloadManager(self, self._download_list, self.opt_manager, self.log_manager)
self._status_bar_write(self.DOWNLOAD_STARTED)
self._buttons["start"].SetLabel(self.STOP_LABEL)
self._buttons["start"].SetToolTip(wx.ToolTip(self.STOP_LABEL))
self._buttons["start"].SetBitmap(self._bitmaps["stop"], wx.TOP)
示例6: Configure
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ToolTip [as 别名]
def Configure(self, only_sel = False):
panel = eg.ConfigPanel(self)
onlySelCtrl = wx.CheckBox(panel, -1, self.text.onlySel)
onlySelCtrl.SetValue(only_sel)
onlySelCtrl.SetToolTip(wx.ToolTip(self.text.onlySelToolTip))
panel.AddCtrl(onlySelCtrl)
while panel.Affirmed():
panel.SetResult(onlySelCtrl.GetValue(),)
示例7: Configure
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ToolTip [as 别名]
def Configure(self, call_id='', string=""):
panel = eg.ConfigPanel()
labelText = wx.StaticText(panel, -1, self.plugin.text.call_id_label)
w,h=labelText.GetSize()
labelDtmf = wx.StaticText(panel, -1, self.text.dtmfLabel)
textControl = wx.TextCtrl(panel, -1, call_id)
textControl.SetMinSize((w,-1))
textControl2 = wx.TextCtrl(panel, -1, string)
textControl2.SetMinSize((w,-1))
textControl2.SetToolTip(wx.ToolTip(self.text.toolTip))
panel.sizer.Add(labelText,0,wx.TOP,10)
panel.sizer.Add(textControl,0,wx.TOP,3)
panel.sizer.Add(labelDtmf,0,wx.TOP,10)
panel.sizer.Add(textControl2,0,wx.TOP,3)
def onStringChange(evt):
val = textControl2.GetValue()
cur = textControl2.GetInsertionPoint()
lng = len(val)
tmp = []
for char in val:
if char in ["0","1","2","3","4","5","6","7","8","9","A","B","C","D","*","#"]:
tmp.append(char)
val = "".join(tmp)
textControl2.ChangeValue(val)
if len(val) < lng:
PlaySound('SystemExclamation',SND_ASYNC)
cur += -1
textControl2.SetInsertionPoint(cur)
evt.Skip()
textControl2.Bind(wx.EVT_TEXT,onStringChange)
while panel.Affirmed():
panel.SetResult(textControl.GetValue(),textControl2.GetValue())
示例8: Configure
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ToolTip [as 别名]
def Configure(self, sep='', res = True):
panel = eg.ConfigPanel(self)
sepLbl = wx.StaticText(panel,-1,self.plugin.text.sepLabel)
sepCtrl = wx.TextCtrl(panel,-1,sep)
sepLbl.SetToolTip(wx.ToolTip(self.plugin.text.sepToolTip))
sepCtrl.SetToolTip(wx.ToolTip(self.plugin.text.sepToolTip))
resCtrl = wx.CheckBox(panel, -1, self.plugin.text.resType)
resCtrl.SetValue(res)
def onResCtrl(evt = None):
enable = resCtrl.GetValue()
sepCtrl.Enable(enable)
sepLbl.Enable(enable)
if evt:
evt.Skip()
resCtrl.Bind(wx.EVT_CHECKBOX, onResCtrl)
onResCtrl()
mySizer = wx.BoxSizer(wx.HORIZONTAL)
panel.sizer.Add(resCtrl, 0, wx.TOP, 30)
panel.sizer.Add(mySizer,0,wx.TOP,15)
mySizer.Add(sepLbl,0,wx.TOP,3)
mySizer.Add((10,1))
mySizer.Add(sepCtrl)
while panel.Affirmed():
panel.SetResult(
sepCtrl.GetValue(),
resCtrl.GetValue()
)
示例9: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ToolTip [as 别名]
def __init__(self, *args, **kwargs):
super(Frame, self).__init__(*args, **kwargs)
self.MyFrame = self
self.is_running = False
self.panel = wx.Panel(
self,
pos=(0, 0),
size=(500,100),
style=wx.CLOSE_BOX | wx.CAPTION | wx.MINIMIZE_BOX | wx.SYSTEM_MENU
)
self.panel.SetBackgroundColour('#ffffff')
self.SetTitle('Filmow to Letterboxd')
self.SetMinSize((500, 300))
self.SetMaxSize((500, 300))
self.letterboxd_link = hl.HyperLinkCtrl(
self.panel,
-1,
'letterboxd',
URL='https://letterboxd.com/import/',
pos=(420,240)
)
self.letterboxd_link.SetToolTip(wx.ToolTip('Clica só quando o programa tiver rodado e sua conta no Letterboxd tiver criada, beleza?'))
self.coffee_link = hl.HyperLinkCtrl(
self.panel,
-1,
'quer me agradecer?',
URL='https://www.buymeacoffee.com/yanari',
pos=(310,240)
)
self.coffee_link.SetToolTip(wx.ToolTip('Se tiver dado tudo certo cê pode me pagar um cafézinho, que tal?. Não é obrigatório, claro.'))
wx.StaticText(self.panel, -1, 'Username no Filmow:', pos=(25, 54))
self.username = wx.TextCtrl(self.panel, size=(200, 25), pos=(150, 50))
submit_button = wx.Button(self.panel, wx.ID_SAVE, 'Submit', pos=(360, 50))
self.Bind(wx.EVT_BUTTON, self.Submit, submit_button)
self.Bind(wx.EVT_CLOSE, self.OnClose)
self.Show(True)
示例10: CreateMenuBar
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ToolTip [as 别名]
def CreateMenuBar(self):
"""Create our menu-bar for triggering operations"""
menubar = wx.MenuBar()
menu = wx.Menu()
menu.Append(ID_OPEN, _('&Open Profile'), _('Open a cProfile file'))
menu.Append(ID_OPEN_MEMORY, _('Open &Memory'), _('Open a Meliae memory-dump file'))
menu.AppendSeparator()
menu.Append(ID_EXIT, _('&Close'), _('Close this RunSnakeRun window'))
menubar.Append(menu, _('&File'))
menu = wx.Menu()
# self.packageMenuItem = menu.AppendCheckItem(
# ID_PACKAGE_VIEW, _('&File View'),
# _('View time spent by package/module')
# )
self.percentageMenuItem = menu.AppendCheckItem(
ID_PERCENTAGE_VIEW, _('&Percentage View'),
_('View time spent as percent of overall time')
)
self.rootViewItem = menu.Append(
ID_ROOT_VIEW, _('&Root View (Home)'),
_('View the root of the tree')
)
self.backViewItem = menu.Append(
ID_BACK_VIEW, _('&Back'), _('Go back in your viewing history')
)
self.upViewItem = menu.Append(
ID_UP_VIEW, _('&Up'),
_('Go "up" to the parent of this node with the largest cumulative total')
)
self.moreSquareViewItem = menu.AppendCheckItem(
ID_MORE_SQUARE, _('&Hierarchic Squares'),
_('Toggle hierarchic squares in the square-map view')
)
# This stuff isn't really all that useful for profiling,
# it's more about how to generate graphics to describe profiling...
self.deeperViewItem = menu.Append(
ID_DEEPER_VIEW, _('&Deeper'), _('View deeper squaremap views')
)
self.shallowerViewItem = menu.Append(
ID_SHALLOWER_VIEW, _('&Shallower'), _('View shallower squaremap views')
)
# wx.ToolTip.Enable(True)
menubar.Append(menu, _('&View'))
self.viewTypeMenu =wx.Menu( )
menubar.Append(self.viewTypeMenu, _('View &Type'))
self.SetMenuBar(menubar)
wx.EVT_MENU(self, ID_EXIT, lambda evt: self.Close(True))
wx.EVT_MENU(self, ID_OPEN, self.OnOpenFile)
wx.EVT_MENU(self, ID_OPEN_MEMORY, self.OnOpenMemory)
wx.EVT_MENU(self, ID_PERCENTAGE_VIEW, self.OnPercentageView)
wx.EVT_MENU(self, ID_UP_VIEW, self.OnUpView)
wx.EVT_MENU(self, ID_DEEPER_VIEW, self.OnDeeperView)
wx.EVT_MENU(self, ID_SHALLOWER_VIEW, self.OnShallowerView)
wx.EVT_MENU(self, ID_ROOT_VIEW, self.OnRootView)
wx.EVT_MENU(self, ID_BACK_VIEW, self.OnBackView)
wx.EVT_MENU(self, ID_MORE_SQUARE, self.OnMoreSquareToggle)
示例11: SetupToolBar
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ToolTip [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()
示例12: __set_properties
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ToolTip [as 别名]
def __set_properties(self):
# begin wxGlade: All_Widgets_Frame.__set_properties
self.SetTitle(_("All Widgets"))
_icon = wx.NullIcon
_icon.CopyFromBitmap(wx.ArtProvider.GetBitmap(wx.ART_TIP, wx.ART_OTHER, (32, 32)))
self.SetIcon(_icon)
self.All_Widgets_statusbar.SetStatusWidths([-1])
# statusbar fields
All_Widgets_statusbar_fields = [_("All Widgets statusbar")]
for i in range(len(All_Widgets_statusbar_fields)):
self.All_Widgets_statusbar.SetStatusText(All_Widgets_statusbar_fields[i], i)
self.All_Widgets_toolbar.Realize()
self.bitmap_button_icon1.SetSize(self.bitmap_button_icon1.GetBestSize())
self.bitmap_button_icon1.SetDefault()
self.bitmap_button_empty1.SetSize(self.bitmap_button_empty1.GetBestSize())
self.bitmap_button_empty1.SetDefault()
self.bitmap_button_icon2.SetBitmapDisabled(wx.EmptyBitmap(32, 32))
self.bitmap_button_icon2.SetSize(self.bitmap_button_icon2.GetBestSize())
self.bitmap_button_icon2.SetDefault()
self.bitmap_button_art.SetSize(self.bitmap_button_art.GetBestSize())
self.bitmap_button_art.SetDefault()
self.checkbox_2.SetValue(1)
self.checkbox_4.Set3StateValue(wx.CHK_UNCHECKED)
self.checkbox_5.Set3StateValue(wx.CHK_CHECKED)
self.checkbox_6.Set3StateValue(wx.CHK_UNDETERMINED)
self.check_list_box_1.SetSelection(2)
self.choice_filled.SetSelection(1)
self.combo_box_filled.SetSelection(0)
self.grid_1.CreateGrid(10, 3)
self.list_box_filled.SetSelection(1)
self.radio_box_filled1.SetSelection(1)
self.radio_box_filled2.SetSelection(1)
self.splitter_1.SetMinimumPaneSize(20)
self.notebook_1_wxSplitterWindow_horizontal.SetScrollRate(10, 10)
self.splitter_2.SetMinimumPaneSize(20)
self.notebook_1_wxSplitterWindow_vertical.SetScrollRate(10, 10)
self.label_1.SetForegroundColour(wx.Colour(255, 0, 0))
self.label_4.SetBackgroundColour(wx.Colour(255, 0, 0))
self.label_4.SetToolTip(wx.ToolTip(_("Background colour won't show, check documentation for more details")))
self.label_5.SetBackgroundColour(wx.Colour(255, 0, 255))
self.label_5.SetForegroundColour(wx.Colour(0, 255, 0))
self.label_5.SetToolTip(wx.ToolTip(_("Background colour won't show, check documentation for more details")))
# end wxGlade
示例13: make_object_button
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ToolTip [as 别名]
def make_object_button(widget, icon_path, toplevel=False, tip=None):
"""Creates a button for the widgets toolbar.
Function used by the various widget modules to add a button to the widgets toolbar.
Icons with a relative path will be loaded from config.icon_path.
widget: (name of) the widget the button will add to the app
icon_path: Path to the icon_path used for the button
toplevel: True if the widget is a toplevel object (frame, dialog)
tip: Tool tip to display
return: The newly created wxBitmapButton instance"""
if not config.use_gui: return None
import wx
import misc
from tree import WidgetTree
if not os.path.isabs(icon_path):
icon_path = os.path.join(config.icons_path, icon_path)
bmp = misc.get_xpm_bitmap(icon_path)
label = widget.replace('Edit', '')
if compat.version < (3,0):
# old wx version: use BitmapButton
tmp = wx.BitmapButton(palette, -1, bmp, size=(31,31))
if not toplevel:
tmp.Bind(wx.EVT_BUTTON, add_object)
else:
tmp.Bind(wx.EVT_BUTTON, add_toplevel_object)
else:
# for more recent versions, we support config options to display icons and/or labels
if not toplevel:
if not config.preferences.show_palette_labels:
# icons only -> set size
tmp = wx.ToggleButton(palette, -1, size=(31,31), name=label)
else:
tmp = wx.ToggleButton(palette, -1, label, name=label )
tmp.Bind(wx.EVT_TOGGLEBUTTON, add_object)
else:
if not config.preferences.show_palette_labels:
tmp = wx.Button(palette, -1, size=(31,31), name=label)
else:
tmp = wx.Button(palette, -1, label, name=label )
tmp.Bind(wx.EVT_BUTTON, add_toplevel_object)
if config.preferences.show_palette_icons:
tmp.SetBitmap( bmp )
refs[tmp.GetId()] = widget
if not tip:
tip = _('Add a %s') % label
tmp.SetToolTip(wx.ToolTip(tip))
WidgetTree.images[widget] = icon_path
return tmp
示例14: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ToolTip [as 别名]
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