本文整理匯總了Python中wx.CLOSE_BOX屬性的典型用法代碼示例。如果您正苦於以下問題:Python wx.CLOSE_BOX屬性的具體用法?Python wx.CLOSE_BOX怎麽用?Python wx.CLOSE_BOX使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類wx
的用法示例。
在下文中一共展示了wx.CLOSE_BOX屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import CLOSE_BOX [as 別名]
def __init__(self):
wx.Frame.__init__(self, None,
pos=wx.DefaultPosition, size=wx.Size(450, 100),
style=wx.MINIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION |
wx.CLOSE_BOX | wx.CLIP_CHILDREN,
title="BRUNO")
panel = wx.Panel(self)
ico = wx.Icon('boy.ico', wx.BITMAP_TYPE_ICO)
self.SetIcon(ico)
my_sizer = wx.BoxSizer(wx.VERTICAL)
lbl = wx.StaticText(panel,
label="Bienvenido Sir. How can I help you?")
my_sizer.Add(lbl, 0, wx.ALL, 5)
self.txt = wx.TextCtrl(panel, style=wx.TE_PROCESS_ENTER,
size=(400, 30))
self.txt.SetFocus()
self.txt.Bind(wx.EVT_TEXT_ENTER, self.OnEnter)
my_sizer.Add(self.txt, 0, wx.ALL, 5)
panel.SetSizer(my_sizer)
self.Show()
speak.Speak('''Welcome back Sir, Broono at your service.''')
示例2: SetWindowStyleFlag
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import CLOSE_BOX [as 別名]
def SetWindowStyleFlag(self, *args, **kwargs):
"""
Changes the main frame style depending on the display of the tray icon.
Sets the style flags for the minimize button. It will be grayed out if
the tray icon is shown and there child dialogs open.
If the tray icon is not shown the minimize button will function as
usual.
:param args: unused, kept for compatibility with
wxFrame.SetWindowStyleFlag()
:param kwargs: unused, kept for compatibility with
wxFrame.SetWindowStyleFlag()
:return: None
"""
if eg.config.showTrayIcon:
if len(self.openDialogs):
style = ~(wx.MINIMIZE_BOX | wx.CLOSE_BOX) & self.style
else:
style = self.style
else:
style = self.style
wx.Frame.SetWindowStyleFlag(self, style)
示例3: OnShowSettings
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import CLOSE_BOX [as 別名]
def OnShowSettings(self, event):
if self.settings_frame is None:
frame_rect = self.GetRect()
display_rect = wx.GetClientDisplayRect()
x_start = frame_rect[0] + frame_rect[2]
if x_start > (display_rect[2] - 400):
x_start = display_rect[2] - 400
y_start = frame_rect[1]
self.settings_frame = SettingsFrame(
self,
-1,
"Settings",
style=wx.CAPTION | wx.MINIMIZE_BOX | wx.CLOSE_BOX | wx.SYSTEM_MENU,
pos=(x_start, y_start),
)
self.settings_frame.Show()
示例4: OnPluginWrapper
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import CLOSE_BOX [as 別名]
def OnPluginWrapper(self, p):
def OnPlugin(event):
if not self._plugins_frame[p]:
helper = self.plugins[p].PluginHelper
self._plugins_frame[p] = helper._plugin_settings_frame(
self,
wx.ID_ANY,
helper._plugin_title,
style=wx.CAPTION | wx.CLOSE_BOX,
)
self._plugins_frame[p].Show()
self._plugins_frame[p].Raise()
else:
self._plugins_frame[p].Destroy()
return OnPlugin
示例5: __init__
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import CLOSE_BOX [as 別名]
def __init__(self, parent, val, maxval):
wx.Dialog.__init__(self, parent, id = wx.ID_ANY,
title = u"Slide", pos = defPos, size = (70, 340),
style = wx.CLOSE_BOX|wx.DEFAULT_DIALOG_STYLE)
boxszr = wx.BoxSizer(wx.HORIZONTAL)
self.slider = wx.Slider( self, wx.ID_ANY, val, 1, maxval,
defPos, wx.Size(-1, 300),
wx.SL_RIGHT|wx.SL_LABELS|wx.SL_INVERSE)
boxszr.Add( self.slider, 0, 0, 5 )
self.slider.Bind(wx.EVT_SCROLL, self.scrolling)
self.SetSizer(boxszr)
self.Layout()
self.Centre(wx.BOTH)
示例6: OnInit
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import CLOSE_BOX [as 別名]
def OnInit(self):
ret = BTApp.OnInit(self)
f = Frame(None, wx.ID_ANY, "%s Language" % app_name,
style=wx.MINIMIZE_BOX|wx.MAXIMIZE_BOX|wx.SYSTEM_MENU|wx.CAPTION|wx.CLOSE_BOX|wx.CLIP_CHILDREN|wx.RESIZE_BORDER)
f.Show()
return ret
示例7: __init__
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import CLOSE_BOX [as 別名]
def __init__(self, repo):
FrameStyle = wx.CAPTION | wx.RESIZE_BORDER | wx.SYSTEM_MENU |\
wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.CLOSE_BOX
wx.Frame.__init__(self, parent=None, id=-1, title="BookHub",
pos=(100, 100), size=(500, 600), style=FrameStyle)
self.BuildUI()
self.InitObjectListView(repo)
self.InitSearchCtrls()
示例8: OnShowZoom
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import CLOSE_BOX [as 別名]
def OnShowZoom(self, event):
if self.zoom_frame is None:
self.zoom_frame = ZoomFrame(
self,
-1,
"Zoom",
style=wx.CAPTION | wx.CLOSE_BOX | wx.RESIZE_BORDER | wx.SYSTEM_MENU,
)
self.zoom_frame.set_image(self._img)
self.zoom_frame.Show()
self.zoom_frame.Raise()
示例9: OnShow3D
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import CLOSE_BOX [as 別名]
def OnShow3D(self, event):
if self.zoom_3d is None:
from rstbx.viewer import pixels3d
self.zoom_3d = pixels3d.pixel_viewer_3d_frame(
self,
-1,
"3D view",
style=wx.CAPTION | wx.CLOSE_BOX | wx.RESIZE_BORDER | wx.SYSTEM_MENU,
)
self.zoom_3d.set_image(self._img)
self.zoom_3d.Show()
self.zoom_3d.Raise()
示例10: OnShowPlot
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import CLOSE_BOX [as 別名]
def OnShowPlot(self, event):
if self.plot_frame is None:
self.plot_frame = PlotFrame(
self,
-1,
"Intensity profile",
style=wx.CAPTION | wx.CLOSE_BOX | wx.SYSTEM_MENU,
)
self.plot_frame.Show()
示例11: OnMask
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import CLOSE_BOX [as 別名]
def OnMask(self, event):
if not self._mask_frame:
self._mask_frame = MaskSettingsFrame(
self,
wx.ID_ANY,
"Mask tool",
style=wx.CAPTION | wx.CLOSE_BOX | wx.RESIZE_BORDER,
)
self._mask_frame.Show()
self._mask_frame.Raise()
else:
self._mask_frame.Destroy()
示例12: OnRing
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import CLOSE_BOX [as 別名]
def OnRing(self, event):
from .ring_frame import RingSettingsFrame
if not self._ring_frame:
self._ring_frame = RingSettingsFrame(
self, wx.ID_ANY, "Ring tool", style=wx.CAPTION | wx.CLOSE_BOX
)
self._ring_frame.Show()
self._ring_frame.Raise()
else:
self._ring_frame.Destroy()
示例13: OnUC
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import CLOSE_BOX [as 別名]
def OnUC(self, event):
from .uc_frame import UCSettingsFrame
if not self._uc_frame:
self._uc_frame = UCSettingsFrame(
self, wx.ID_ANY, "Unit cell tool", style=wx.CAPTION | wx.CLOSE_BOX
)
self._uc_frame.Show()
self._uc_frame.Raise()
else:
self._uc_frame.Destroy()
示例14: OnScore
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import CLOSE_BOX [as 別名]
def OnScore(self, event):
from .score_frame import ScoreSettingsFrame
if not self._score_frame:
self._score_frame = ScoreSettingsFrame(
self, wx.ID_ANY, "Score tool", style=wx.CAPTION | wx.CLOSE_BOX
)
self._score_frame.Show()
self._score_frame.Raise()
else:
self._score_frame.Destroy()
示例15: __init__
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import CLOSE_BOX [as 別名]
def __init__(self, parent):
wx.MiniFrame.__init__(
self,
parent,
-1,
title="OpenGL settings",
pos=(100, 100),
style=wx.CAPTION | wx.CLOSE_BOX | wx.RAISED_BORDER,
)
self.parent = parent
self.widgets = {}
panel = wx.Panel(self, -1)
main_sizer = wx.BoxSizer(wx.VERTICAL)
fog_box = wx.CheckBox(panel, -1, "Use fog")
fog_box.SetValue(parent.flag_show_fog)
main_sizer.Add(fog_box, 0, wx.ALL, 5)
self.fog_box = fog_box
szr = wx.FlexGridSizer(rows=0, cols=2, vgap=5, hgap=5)
main_sizer.Add(szr, 0, 0, 0)
slab_label = wx.StaticText(panel, -1, "Slab:")
slab_slider = wx.Slider(
panel, -1, int(parent.slab_scale * 100), minValue=1, maxValue=100
)
szr.Add(slab_label, 0, wx.ALL, 5)
szr.Add(slab_slider, 0, wx.ALL, 5)
fog_label = wx.StaticText(panel, -1, "Fog scale:")
fog_slider = wx.Slider(
panel, -1, int(parent.fog_scale_factor * 100), minValue=1, maxValue=100
)
szr.Add(fog_label, 0, wx.ALL, 5)
szr.Add(fog_slider, 0, wx.ALL, 5)
self.widgets["slab_scale"] = slab_slider
self.widgets["fog_scale_factor"] = fog_slider
self.SetSizer(main_sizer)
main_sizer.Fit(panel)
self.Fit()
self.Bind(wx.EVT_SLIDER, self.OnUpdate)
self.Bind(wx.EVT_CHECKBOX, self.OnUpdate)
self.Bind(wx.EVT_CLOSE, self.OnClose)