def __do_layout(self):
# begin wxGlade: MyFrame.__do_layout
sizer_4 = wx.BoxSizer(wx.VERTICAL)
sizer_5 = wx.BoxSizer(wx.HORIZONTAL)
sizer_5.Add(self.label_5, 0, wx.ALIGN_CENTER_VERTICAL, 0)
sizer_5.Add(self.text_ctrl_bucar, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 7)
sizer_5.Add(self.button_buscar, 0, wx.ALIGN_CENTER_VERTICAL, 0)
sizer_5.Add(self.label_6, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)
sizer_5.Add(self.bitmap_button_1, 0, wx.ALIGN_CENTER_VERTICAL, 0)
sizer_4.Add(sizer_5, 1, wx.ALIGN_BOTTOM | wx.ALIGN_RIGHT | wx.ALL, 6)
sizer_4.Add(self.list_ctrl_1, 1, 0, 0)
self.SetSizer(sizer_4)
sizer_4.Fit(self)
self.Layout()
# end wxGlade
# end of class MyFrame
python类ALIGN_BOTTOM的实例源码
def GetBitmapRect(self):
client_size = self.GetClientSize()
bitmap_size = self.BackgroundBitmap.GetSize()
if self.BackgroundAlign & wx.ALIGN_RIGHT:
x = client_size[0] - bitmap_size[0]
elif self.BackgroundAlign & wx.ALIGN_CENTER_HORIZONTAL:
x = (client_size[0] - bitmap_size[0]) / 2
else:
x = 0
if self.BackgroundAlign & wx.ALIGN_BOTTOM:
y = client_size[1] - bitmap_size[1]
elif self.BackgroundAlign & wx.ALIGN_CENTER_VERTICAL:
y = (client_size[1] - bitmap_size[1]) / 2
else:
y = 0
return wx.Rect(x, y, bitmap_size[0], bitmap_size[1])
def __init__(self, parent):
wx.Panel.__init__(self, parent, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize)
self.ztv_frame = self.GetTopLevelParent()
self.ztv_frame.primary_image_panel.popup_menu_cursor_modes.append('Slice plot')
self.ztv_frame.primary_image_panel.available_cursor_modes['Slice plot'] = {
'set-to-mode':self.set_cursor_to_plot_mode,
'on_button_press':self.on_button_press,
'on_motion':self.on_motion,
'on_button_release':self.on_button_release}
for cur_key in ['c', 'C', 'v', 'V', 'y', 'Y']:
self.ztv_frame.primary_image_panel.available_key_presses[cur_key] = self.do_column_plot
for cur_key in ['r', 'R', 'h', 'H', 'x', 'X']:
self.ztv_frame.primary_image_panel.available_key_presses[cur_key] = self.do_row_plot
for cur_key in ['z', 'Z']:
self.ztv_frame.primary_image_panel.available_key_presses[cur_key] = self.do_stack_plot
self.primary_image_patch = None
self.sizer = wx.BoxSizer(wx.VERTICAL)
self.plot_panel = PlotPlotPanel(self)
self.sizer.Add(self.plot_panel, 1, wx.LEFT | wx.TOP | wx.EXPAND)
self.hideshow_button = wx.Button(self, wx.ID_ANY, u"Hide", wx.DefaultPosition, wx.DefaultSize, 0)
self.sizer.Add(self.hideshow_button, 0, wx.ALL|wx.ALIGN_RIGHT|wx.ALIGN_BOTTOM, 2)
self.hideshow_button.Bind(wx.EVT_BUTTON, self.on_hideshow_button)
self.SetSizer(self.sizer)
self.Fit()
self.start_pt = wx.RealPoint(0., 0.)
self.end_pt = wx.RealPoint(0., 0.)
self.redraw()
pub.subscribe(self.on_new_xy0, 'set-new-slice-plot-xy0')
pub.subscribe(self.on_new_xy1, 'set-new-slice-plot-xy1')
pub.subscribe(self.queue_redraw, 'primary-xy-limits-changed')
pub.subscribe(self.queue_redraw, 'recalc-display-image-called')
pub.subscribe(self.remove_overplot_on_image, 'hide-plot-panel-overplot')
pub.subscribe(self.redraw_overplot_on_image, 'show-plot-panel-overplot')
pub.subscribe(self.publish_xy0xy1_to_stream, 'get-slice-plot-coords')
def __init__(self, parent):
wx.Panel.__init__(self, parent, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize)
self.ztv_frame = self.GetTopLevelParent()
self.ztv_frame.primary_image_panel.popup_menu_cursor_modes.append('Slice plot')
self.ztv_frame.primary_image_panel.available_cursor_modes['Slice plot'] = {
'set-to-mode':self.set_cursor_to_plot_mode,
'on_button_press':self.on_button_press,
'on_motion':self.on_motion,
'on_button_release':self.on_button_release}
for cur_key in ['c', 'C', 'v', 'V', 'y', 'Y']:
self.ztv_frame.primary_image_panel.available_key_presses[cur_key] = self.do_column_plot
for cur_key in ['r', 'R', 'h', 'H', 'x', 'X']:
self.ztv_frame.primary_image_panel.available_key_presses[cur_key] = self.do_row_plot
for cur_key in ['z', 'Z']:
self.ztv_frame.primary_image_panel.available_key_presses[cur_key] = self.do_stack_plot
self.primary_image_patch = None
self.sizer = wx.BoxSizer(wx.VERTICAL)
self.plot_panel = PlotPlotPanel(self)
self.sizer.Add(self.plot_panel, 1, wx.LEFT | wx.TOP | wx.EXPAND)
self.hideshow_button = wx.Button(self, wx.ID_ANY, u"Hide", wx.DefaultPosition, wx.DefaultSize, 0)
self.sizer.Add(self.hideshow_button, 0, wx.ALL|wx.ALIGN_RIGHT|wx.ALIGN_BOTTOM, 2)
self.hideshow_button.Bind(wx.EVT_BUTTON, self.on_hideshow_button)
self.SetSizer(self.sizer)
self.Fit()
self.start_pt = wx.RealPoint(0., 0.)
self.end_pt = wx.RealPoint(0., 0.)
self.redraw()
pub.subscribe(self.on_new_xy0, 'set-new-slice-plot-xy0')
pub.subscribe(self.on_new_xy1, 'set-new-slice-plot-xy1')
pub.subscribe(self.queue_redraw, 'primary-xy-limits-changed')
pub.subscribe(self.queue_redraw, 'recalc-display-image-called')
pub.subscribe(self.remove_overplot_on_image, 'hide-plot-panel-overplot')
pub.subscribe(self.redraw_overplot_on_image, 'show-plot-panel-overplot')
pub.subscribe(self.publish_xy0xy1_to_stream, 'get-slice-plot-coords')
def __init__( self, parent ):
wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = 'ImagePy',
size = wx.Size(-1,-1), pos = wx.DefaultPosition,
style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )
logopath = os.path.join(root_dir, 'data/logo.ico')
#self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_3DLIGHT ) )
self.SetIcon(wx.Icon(logopath, wx.BITMAP_TYPE_ICO))
self.SetSizeHints( wx.Size( 600,-1 ), wx.DefaultSize )
IPy.curapp = self
# Todo:Fixed absolute/relative path!
# print("menuspath:{}".format( os.path.join(root_dir,"menus")))
# print("toolspath:{}".format(os.path.join(root_dir,"tools"))
# menuspath = os.path.join(root_dir, "menus")
# toolspath = os.path.join(root_dir,"tools")
self.menubar = pluginloader.buildMenuBarByPath(self, 'menus')
self.SetMenuBar( self.menubar )
self.shortcut = pluginloader.buildShortcut(self)
self.SetAcceleratorTable(self.shortcut)
sizer = wx.BoxSizer(wx.VERTICAL)
self.toolbar = toolsloader.build_tools(self, 'tools')
#self.toolbar.Realize()
#sizertool.Add(self.toolbar, 1, 0, 5 )
#sizertool.Add(self.morebar, 0, 0, 5)
sizer.Add(self.toolbar, 0, wx.EXPAND, 5 )
#sizer.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 )
self.line_color = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
#self.line_color.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_HIGHLIGHT ) )
sizer.AddStretchSpacer(prop=1)
sizer.Add(self.line_color, 0, wx.EXPAND |wx.ALL, 0 )
stapanel = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
sizersta = wx.BoxSizer( wx.HORIZONTAL )
self.txt_info = wx.StaticText( stapanel, wx.ID_ANY, "ImagePy v0.2", wx.DefaultPosition, wx.DefaultSize, 0 )
self.txt_info.Wrap( -1 )
#self.txt_info.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_INFOBK ) )
sizersta.Add( self.txt_info, 1, wx.ALIGN_BOTTOM|wx.BOTTOM|wx.LEFT|wx.RIGHT, 2 )
self.pro_bar = wx.Gauge( stapanel, wx.ID_ANY, 100, wx.DefaultPosition, wx.Size( 100,15 ), wx.GA_HORIZONTAL )
sizersta.Add( self.pro_bar, 0, wx.ALIGN_BOTTOM|wx.BOTTOM|wx.LEFT|wx.RIGHT, 2 )
stapanel.SetSizer(sizersta)
stapanel.SetDropTarget(FileDrop())
sizer.Add(stapanel, 0, wx.EXPAND, 5 )
self.SetSizer( sizer )
self.Centre( wx.BOTH )
self.Layout()
self.Fit()
self.update = False
self.Bind(wx.EVT_CLOSE, self.on_close)
thread = threading.Thread(None, self.hold, ())
thread.setDaemon(True)
thread.start()
def __init__(self, parent, match):
self.match = match
self.parent = parent
wx.Dialog.__init__(self, parent)
self.vsplit = wx.BoxSizer(wx.VERTICAL)
self.ptop = wx.Panel(self)
self.pbot = wx.Panel(self)
pan = ScoresPanel(self.ptop, match, self)
nw = wx.Button(self.pbot, label="no result", pos=(50, 15))
rw = wx.Button(self.pbot, label="confirm", pos=(150, 15))
self.vsplit.Add(self.ptop, 1, wx.ALIGN_TOP | wx.EXPAND)
self.vsplit.Add(self.pbot, 1, wx.ALIGN_BOTTOM | wx.EXPAND)
self.SetSizer(self.vsplit)
def nowinner(e):
self.match.settbd()
self.parent.updatebracketimg()
self.Close()
def setwinner(e):
self.match.setscore(pan.w1.GetValue(), pan.w2.GetValue())
self.parent.updatebracketimg()
self.Close()
self.Bind(wx.EVT_BUTTON, nowinner, nw)
self.Bind(wx.EVT_BUTTON, setwinner, rw)
self.SetSize((300, 170))
self.SetTitle("Report Scores")
self.Show()
def __init__(self, parent, match):
self.match = match
self.parent = parent
wx.Dialog.__init__(self, parent)
self.vsplit = wx.BoxSizer(wx.VERTICAL)
self.ptop = wx.Panel(self)
self.pbot = wx.Panel(self)
pan = ScoresPanel(self.ptop, match, self)
nw = wx.Button(self.pbot, label="no result", pos=(50, 15))
rw = wx.Button(self.pbot, label="confirm", pos=(150, 15))
self.vsplit.Add(self.ptop, 1, wx.ALIGN_TOP | wx.EXPAND)
self.vsplit.Add(self.pbot, 1, wx.ALIGN_BOTTOM | wx.EXPAND)
self.SetSizer(self.vsplit)
def nowinner(e):
self.match.settbd()
self.parent.updatebracketimg()
self.Close()
def setwinner(e):
if(self.match.doscore(pan.w1.GetValue(), pan.w2.GetValue())):
self.parent.updatebracketimg()
self.Close()
else:
pan.w1.SetValue(0)
pan.w2.SetValue(0)
self.Bind(wx.EVT_BUTTON, nowinner, nw)
self.Bind(wx.EVT_BUTTON, setwinner, rw)
self.SetSize((300, 170))
self.SetTitle("Report Scores")
self.Show()
def _init_coll_flexGridSizer1_Items(self, parent):
# generated method, don't edit
parent.AddWindow(self.TDisplay, 0, border=0, flag=wx.GROW | wx.EXPAND)
parent.AddWindow(self.TInput, 1, border=1,
flag=wx.GROW | wx.RIGHT | wx.LEFT | wx.EXPAND | wx.ALIGN_BOTTOM)
def __init__(self, parent, datatypes, infos):
wx.Dialog.__init__(self, parent, title=_('Edit array type properties'))
main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=3, vgap=10)
main_sizer.AddGrowableCol(0)
main_sizer.AddGrowableRow(1)
top_sizer = wx.BoxSizer(wx.HORIZONTAL)
main_sizer.AddSizer(top_sizer, border=20,
flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)
basetype_label = wx.StaticText(self, label=_('Base Type:'))
top_sizer.AddWindow(basetype_label, 1, flag=wx.ALIGN_BOTTOM)
self.BaseType = wx.ComboBox(self, style=wx.CB_READONLY)
top_sizer.AddWindow(self.BaseType, 1, flag=wx.GROW)
self.Dimensions = CustomEditableListBox(self, label=_("Dimensions:"),
style=(wx.gizmos.EL_ALLOW_NEW |
wx.gizmos.EL_ALLOW_EDIT |
wx.gizmos.EL_ALLOW_DELETE))
for func in ["_OnLabelEndEdit",
"_OnAddButton",
"_OnDelButton",
"_OnUpButton",
"_OnDownButton"]:
setattr(self.Dimensions, func, self.OnDimensionsChanged)
main_sizer.AddSizer(self.Dimensions, border=20,
flag=wx.GROW | wx.LEFT | wx.RIGHT)
button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE)
self.Bind(wx.EVT_BUTTON, self.OnOK, button_sizer.GetAffirmativeButton())
main_sizer.AddSizer(button_sizer, border=20,
flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
self.SetSizer(main_sizer)
for datatype in datatypes:
self.BaseType.Append(datatype)
if isinstance(infos, TupleType) and infos[0] == "array":
self.BaseType.SetStringSelection(infos[1])
self.Dimensions.SetStrings(map(lambda x: "..".join(x), infos[2]))
elif infos in datatypes:
self.BaseType.SetStringSelection(infos)
self.BaseType.SetFocus()
self.Fit()