本文整理汇总了Python中wx.ICON_WARNING属性的典型用法代码示例。如果您正苦于以下问题:Python wx.ICON_WARNING属性的具体用法?Python wx.ICON_WARNING怎么用?Python wx.ICON_WARNING使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.ICON_WARNING属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __on_rec
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_WARNING [as 别名]
def __on_rec(self, recording):
timestamp = time.time()
for monitor in self._monitors:
if not recording:
monitor.set_level(None, timestamp, None)
monitor.set_recording(recording, timestamp)
if recording:
self.__on_start()
else:
while self._push.hasFailed():
resp = wx.MessageBox('Web push has failed, retry?', 'Warning',
wx.OK | wx.CANCEL | wx.ICON_WARNING)
if resp == wx.OK:
busy = wx.BusyInfo('Pushing...', self)
self._push.send_failed(self._settings.get_push_uri())
del busy
else:
self._push.clear_failed()
self._warnedPush = False
self.__set_timeline()
示例2: verify_connect
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_WARNING [as 别名]
def verify_connect(self, con_info):
if self.is_connected() or self.connecting:
gui.messageBox(_("NVDA Remote is already connected. Disconnect before opening a new connection."), _("NVDA Remote Already Connected"), wx.OK|wx.ICON_WARNING)
return
self.connecting = True
server_addr = con_info.get_address()
key = con_info.key
if con_info.mode == 'master':
message = _("Do you wish to control the machine on server {server} with key {key}?").format(server=server_addr, key=key)
elif con_info.mode == 'slave':
message = _("Do you wish to allow this machine to be controlled on server {server} with key {key}?").format(server=server_addr, key=key)
if gui.messageBox(message, _("NVDA Remote Connection Request"), wx.YES|wx.NO|wx.NO_DEFAULT|wx.ICON_WARNING) != wx.YES:
self.connecting = False
return
if con_info.mode == 'master':
self.connect_as_master((con_info.hostname, con_info.port), key=key)
elif con_info.mode == 'slave':
self.connect_as_slave((con_info.hostname, con_info.port), key=key)
self.connecting = False
示例3: OnInternetDown
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_WARNING [as 别名]
def OnInternetDown(self, event):
if event.data == 1:
self.sb.SetStatusText("Network is down")
if self.sync_model.GetUseSystemNotifSetting():
if wxgtk4:
nmsg = wx.adv.NotificationMessage(title="GoSync", message="Network has gone down!")
nmsg.SetFlags(wx.ICON_WARNING)
nmsg.Show(timeout=wx.adv.NotificationMessage.Timeout_Auto)
else:
nmsg = wx.NotificationMessage("GoSync", "Network has gone down!")
nmsg.SetFlags(wx.ICON_WARNING)
nmsg.Show(timeout=wx.NotificationMessage.Timeout_Auto)
else:
self.sb.SetStatusText("Network is up!")
if self.sync_model.GetUseSystemNotifSetting():
if wxgtk4:
nmsg = wx.adv.NotificationMessage(title="GoSync", message="Network is up!")
nmsg.SetFlags(wx.ICON_INFORMATION)
nmsg.Show(timeout=wx.adv.NotificationMessage.Timeout_Auto)
else:
nmsg = wx.NotificationMessage("GoSync", "Network is up!")
nmsg.SetFlags(wx.ICON_INFORMATION)
nmsg.Show(timeout=wx.NotificationMessage.Timeout_Auto)
示例4: OnColorCalibration
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_WARNING [as 别名]
def OnColorCalibration(self, event):
if self.scaniface.IsScanning():
dlg = wx.MessageDialog(self, 'In order to calibrate, please stop scanning process first.',
'Stop scanning',
wx.OK | wx.ICON_WARNING)
dlg.ShowModal()
dlg.Destroy()
return
training = self.trainingAreas.GetValue()
if not training:
return
if self.settings['output']['color'] and self.settings['output']['color_name']:
self.group = self.settings['output']['color_name']
else:
self.group = None
dlg = wx.MessageDialog(self, "In order to calibrate colors, please specify name of output color raster in 'Output' tab.",
'Need color output',
wx.OK | wx.ICON_WARNING)
dlg.ShowModal()
dlg.Destroy()
return
self.CalibrateColor()
示例5: CalibrateModelBBox
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_WARNING [as 别名]
def CalibrateModelBBox(self, event):
if self.IsScanning():
dlg = wx.MessageDialog(self, 'In order to calibrate, please stop scanning process first.',
'Stop scanning',
wx.OK | wx.ICON_WARNING)
dlg.ShowModal()
dlg.Destroy()
return
params = {}
if self.calib_matrix:
params['calib_matrix'] = self.calib_matrix
params['rotate'] = self.scan['rotation_angle']
zrange = ','.join(self.scan['trim_nsewtb'].split(',')[4:])
params['zrange'] = zrange
res = gscript.parse_command('r.in.kinect', flags='m', overwrite=True, **params)
if not res['bbox']:
gscript.message(_("Failed to find model extent"))
offsetcm = 2
n, s, e, w = [int(round(float(each))) for each in res['bbox'].split(',')]
self.scanning_panel.trim['n'].SetValue(str(n + offsetcm))
self.scanning_panel.trim['s'].SetValue(str(abs(s) + offsetcm))
self.scanning_panel.trim['e'].SetValue(str(e + offsetcm))
self.scanning_panel.trim['w'].SetValue(str(abs(w) + offsetcm))
示例6: OnKeyPressed
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_WARNING [as 别名]
def OnKeyPressed(self, event=None):
if event.GetKeyCode() == wx.WXK_RIGHT:
self.nextImage(event=None)
elif event.GetKeyCode() == wx.WXK_LEFT:
self.prevImage(event=None)
elif event.GetKeyCode() == wx.WXK_BACK:
pos_abs = event.GetPosition()
inv = self.axes.transData.inverted()
pos_rel = list(inv.transform(pos_abs))
pos_rel[1] = (
self.axes.get_ylim()[0] - pos_rel[1]
) # Recall y-axis is inverted
i = np.nanargmin(
[self.calc_distance(*dp.point.center, *pos_rel) for dp in self.drs]
)
closest_dp = self.drs[i]
msg = wx.MessageBox(
"Do you want to remove the label %s ?" % closest_dp.bodyParts,
"Remove!",
wx.YES_NO | wx.ICON_WARNING,
)
if msg == 2:
closest_dp.delete_data()
示例7: quitButton
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_WARNING [as 别名]
def quitButton(self, event):
"""
Quits the GUI
"""
self.statusbar.SetStatusText("")
dlg = wx.MessageDialog(
None, "Are you sure?", "Quit!", wx.YES_NO | wx.ICON_WARNING
)
result = dlg.ShowModal()
if result == wx.ID_YES:
print(
"Closing... The refined labels are stored in a subdirectory under labeled-data. Use the function 'merge_datasets' to augment the training dataset, and then re-train a network using create_training_dataset followed by train_network!"
)
self.Destroy()
else:
self.save.Enable(True)
示例8: Run
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_WARNING [as 别名]
def Run(self):
dlg = SVG2ZoneDialog()
res = dlg.ShowModal()
if res == wx.ID_OK:
print("ok")
if (dlg.net.value == None):
warndlg = wx.MessageDialog(self, "no net was selected", "Error", wx.OK | wx.ICON_WARNING)
warndlg.ShowModal()
warndlg.Destroy()
return
# do it.
SVG2Zone(dlg.file_picker.value,
pcbnew.GetBoard(),
dlg.basic_layer.valueint,
dlg.net.GetValuePtr())
else:
print("cancel")
示例9: Run
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_WARNING [as 别名]
def Run(self):
dlg = DXFZoneDialog()
res = dlg.ShowModal()
if res == wx.ID_OK:
print("ok")
if (dlg.net.value == None):
warndlg = wx.MessageDialog(self, "no net was selected", "Error", wx.OK | wx.ICON_WARNING)
warndlg.ShowModal()
warndlg.Destroy()
return
net = dlg.net.GetValuePtr()
traverse_dxf(dlg.file_picker.value,
zone_actions(pcbnew.GetBoard(),
net,
dlg.basic_layer.valueint),
merge_polys=True,
break_curves=True
)
#pcbnew.Refresh()
else:
print("cancel")
示例10: on_list_item_activated
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_WARNING [as 别名]
def on_list_item_activated(self, event): # wxGlade: DeviceManager.<event_handler>
uid = event.GetLabel()
try:
device = self.device.instances['device'][uid]
except KeyError:
device_name = self.device.read_persistent(str, 'device_name', 'Lhystudios', uid)
device = self.device.open('device', device_name, root=self.device, uid=int(uid), instance_name=str(uid))
if device.state == STATE_UNKNOWN:
device.open('window', "MeerK40t", None, -1, "")
device.boot()
self.Close()
else:
dlg = wx.MessageDialog(None, _("That device already booted."),
_("Cannot Boot Selected Device"), wx.OK | wx.ICON_WARNING)
result = dlg.ShowModal()
dlg.Destroy()
示例11: initialize
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_WARNING [as 别名]
def initialize(self):
self.device.close('window', self.name)
self.Show()
if self.device.is_root():
for attr in dir(self):
value = getattr(self, attr)
if isinstance(value, wx.Control):
value.Enable(False)
dlg = wx.MessageDialog(None, _("You do not have a selected device."),
_("No Device Selected."), wx.OK | wx.ICON_WARNING)
result = dlg.ShowModal()
dlg.Destroy()
return
self.device.setting(bool, 'rotary', False)
self.device.setting(float, 'scale_x', 1.0)
self.device.setting(float, 'scale_y', 1.0)
self.spin_rotary_scalex.SetValue(self.device.scale_x)
self.spin_rotary_scaley.SetValue(self.device.scale_y)
self.checkbox_rotary.SetValue(self.device.rotary)
self.on_check_rotary(None)
示例12: __on_del
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_WARNING [as 别名]
def __on_del(self, _event):
if len(self._signals):
resp = wx.MessageBox('''Remove monitor?\n'''
'''The recording on this monitor will be lost''',
'Warning',
wx.OK | wx.CANCEL | wx.ICON_WARNING)
if resp != wx.OK:
return
self._on_del(self)
示例13: __on_clear
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_WARNING [as 别名]
def __on_clear(self, _event):
resp = wx.MessageBox('Clear recorded data?', 'Warning',
wx.OK | wx.CANCEL | wx.ICON_WARNING)
if resp != wx.OK:
return
for monitor in self._monitors:
monitor.clear()
self.__set_timeline()
self._isSaved = False
self.__set_title()
示例14: __save_warning
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_WARNING [as 别名]
def __save_warning(self):
if not self._isSaved:
resp = wx.MessageBox('Not saved, continue?', 'Warning',
wx.OK | wx.CANCEL | wx.ICON_WARNING)
if resp != wx.OK:
return False
return True
示例15: warn
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_WARNING [as 别名]
def warn(self, message, caption='Warning!'):
dlg = wx.MessageDialog(self.parent, message, caption,
wx.OK | wx.ICON_WARNING)
dlg.ShowModal()
dlg.Destroy()