def __init__(self, parent):
super(MyFrame, self).__init__(parent, title=TITLE, size=(1280, 768))
icon_path = 'Assets/Microsoft-logo_rgb_c-gray.png'
self.SetIcon(wx.Icon(icon_path))
sizer = wx.BoxSizer(wx.VERTICAL)
self.title = MyTitle(self)
sizer.Add(self.title, flag=wx.EXPAND)
self.book = MyLabelBook(self)
sizer.Add(self.book, 1, flag=wx.EXPAND)
status_text = (
'Microsoft will receive the images you upload and may use them to '
'improve Face API and related services. By submitting an image, '
'you confirm you have consent from everyone in it.'
)
self.status = wx.StatusBar(self)
self.status.SetStatusText(status_text)
sizer.Add(self.status, flag=wx.EXPAND)
self.SetSizer(sizer)
self.Layout()
python类Icon()的实例源码
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.''')
def LoadIconList(self):
isz = (16, 16)
self.tree_fs.icon_list = wx.ImageList(*isz)
folder = wx.Icon(
'icons/ic_folder_black_18dp.png',
wx.BITMAP_TYPE_PNG,
isz[0],
isz[1],
)
folder_open = wx.Icon(
'icons/ic_folder_open_black_18dp.png',
wx.BITMAP_TYPE_PNG,
isz[0],
isz[1],
)
self.tree_fs.icon_fldridx = self.tree_fs.icon_list.AddIcon(folder)
self.tree_fs.icon_fldropenidx = self.tree_fs.icon_list.AddIcon(folder_open)
self.tree_fs.icon_fileidx = self.tree_fs.icon_list.AddIcon(wx.ArtProvider.GetIcon(wx.ART_NORMAL_FILE, wx.ART_OTHER, isz))
self.tree_fs.SetImageList(self.tree_fs.icon_list)
def __init__(self, controller_uid):
TopLevel.__init__(self, controller_uid)
UIM = UIManager()
controller = UIM.get(self._controller_uid)
wx.Dialog.__init__(self, None, wx.ID_ANY, controller.model.title,
pos=controller.model.pos, size=controller.model.size,
style=controller.model.style
)
self._objects = {}
if controller.model.icon:
self.icon = wx.Icon(controller.model.icon, wx.BITMAP_TYPE_ICO)
self.SetIcon(self.icon)
if controller.model.maximized:
self.Maximize()
self.Bind(wx.EVT_MAXIMIZE, self.on_maximize)
self.Bind(wx.EVT_SIZE, self.on_size)
self.Bind(wx.EVT_MOVE, self.on_move)
dialog_box = wx.BoxSizer(wx.VERTICAL)
self.SetSizer(dialog_box)
self.mainpanel = self.AddCreateContainer('BoxSizer', self, proportion=1,
flag=wx.TOP|wx.LEFT|wx.RIGHT|wx.EXPAND, border=10
)
button_sizer = self.CreateButtonSizer(controller.model.flags)
dialog_box.Add(button_sizer, flag=wx.ALIGN_CENTER|wx.TOP|wx.BOTTOM, border=10)
dialog_box.Layout()
def __init__(self, *args, **kwargs):
if 'size' not in kwargs:
kwargs['size'] = (360, 240)
super(NewRockTableDialog, self).__init__(*args, **kwargs)
# ico = wx.Icon(r'./icons/plus32x32.ico', wx.BITMAP_TYPE_ICO)
# self.SetIcon(ico)
fgs = wx.BoxSizer(wx.HORIZONTAL)
main_label = wx.StaticText(self, label="Fill up the cell below to create a new rock table.")
name_label = wx.StaticText(self, label="Name Rock Table: ")
# unit_label = wx.StaticText(self, label="Unidade: ")
self.name_ctrl = wx.TextCtrl(self)
# self.unit_ctrl = wx.TextCtrl(self)
fgs.Add(name_label, 0, wx.EXPAND)
fgs.Add(self.name_ctrl, 1, wx.EXPAND)
# fgs.AddGrowableRow(0)
sizer = wx.BoxSizer(wx.VERTICAL)
button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL)
sizer.Add(main_label, 1, wx.GROW | wx.EXPAND)
sizer.Add(fgs, 0, wx.EXPAND)
sizer.Add(button_sizer, 0, wx.EXPAND)
self.SetSizer(sizer)
self.name_ctrl.SetFocus()
def OnAboutBox(self):
description = """StopGo helps you create stop motion animation."""
licence = """StopGo is free software; you can redistribute
it and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
StopGo is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details. You should have
received a copy of the GNU General Public License along with File Hunter;
if not, write to the Free Software Foundation, Inc., 59 Temple Place,
Suite 330, Boston, MA VERSION_STRIVERSION_STRIVERSION_STRINVERSION_STRING307 USA"""
info = wx.AboutDialogInfo()
info.SetIcon(wx.Icon(os.path.join(os.path.dirname(__file__),'..','..','stopgo','images','makerbox.png'), wx.BITMAP_TYPE_PNG))
info.SetName('StopGo')
info.SetVersion('0.8.18')
info.SetDescription(description)
info.SetCopyright('(C) 2016 - ' + str(date.today().year) + ' Seth Kenlon')
info.SetWebSite('http://makerbox.org.nz')
info.SetLicence(licence)
info.AddDeveloper('Klaatu, Seth Kenlon, Jess Weichler')
wx.AboutBox(info)
def __init__(self, parent, ID=-1, title="Frame", pos=wx.DefaultPosition, size=wx.DefaultSize):
wx.Frame.__init__(self, parent, ID, title, pos, size)
self.SetBackgroundColour(backgroundColour)
icon = wx.Icon('pySIM.ico', wx.BITMAP_TYPE_ICO)
self.SetIcon(icon)
def __init__(self, parent, title):
style = wx.DEFAULT_FRAME_STYLE & ~(
wx.RESIZE_BORDER | wx.MAXIMIZE_BOX |
wx.MINIMIZE_BOX|wx.CLOSE_BOX)
wx.Frame.__init__(self, parent, title=title,
style=style, size=(400,60))
self.textbox = wx.TextCtrl(self)
img = wx.Image("matags.png", wx.BITMAP_TYPE_ANY)
bmp = wx.Bitmap(img)
self.icon = wx.Icon()
self.icon.CopyFromBitmap(bmp)
self.SetIcon(self.icon)
self.tbIcon = wx.adv.TaskBarIcon()
self.tbIcon.SetIcon(self.icon)
self.Show(True)
self.Centre()
self.reg_hot_keys()
self.Bind(wx.EVT_HOTKEY, self.on_extract_tag,
id=self.hotkeys['extract_tag'][0])
self.Bind(wx.EVT_HOTKEY, self.on_close,
id=self.hotkeys['quit'][0])
self.Bind(wx.EVT_HOTKEY, self.on_activate,
id=self.hotkeys['activate'][0])
self.Bind(wx.EVT_HOTKEY, self.on_refresh,
id=self.hotkeys['refresh'][0])
self.textbox.Bind(wx.EVT_CHAR, self.check_key)
# do not use EVT_KEY_DOWN,
# it becomes difficult to get lower case
# self.textbox.Bind(wx.EVT_KEY_DOWN, self.check_key)
# self.Bind(wx.EVT_CLOSE, self.on_close)
self.Bind(wx.EVT_ICONIZE, self.on_iconify)
self.matags = MaTags()
# try:
# except Exception as e:
# self.textbox.ChangeValue(e.args[0].decode('utf8', 'ignore'))
# self.textbox.Disable()
def __init__(self, parent, title):
self.dirname=os.getcwd()
wx.Frame.__init__(self, parent, title=title, size=(1000,700))
self.SetSizeHints(1000,700,-1,-1)
self.CreateStatusBar()
filemenu= wx.Menu()
menuOpen = filemenu.Append(wx.ID_OPEN, "&Open"," Open saved state")
menuSave = filemenu.Append(wx.ID_SAVE, "&Save"," Save current state")
filemenu.InsertSeparator(2)
menuNew = filemenu.Append(wx.ID_NEW, "&New"," Create new session")
filemenu.InsertSeparator(4)
menuExit = filemenu.Append(wx.ID_EXIT,"E&xit"," Terminate the program")
viewmenu = wx.Menu()
vismenu = wx.Menu()
self.viewmenuundock = vismenu.Append(wx.ID_ANY,"&Undock","Undock the visualisation")
self.viewmenuundock.Enable(0)
self.viewmenudock = vismenu.Append(wx.ID_ANY,"&Dock","Dock the visualisation")
self.viewmenudock.Enable(0)
self.Bind(wx.EVT_MENU, self.OnUndock, self.viewmenuundock)
self.Bind(wx.EVT_MENU, self.OnDock, self.viewmenudock)
if IsNotWX4():
viewmenu.AppendMenu(wx.ID_ANY,"&Visualisation", vismenu)
else:
viewmenu.Append(wx.ID_ANY,"&Visualisation", vismenu)
self.visualdialog_docked = True
editmenu = wx.Menu()
self.menuCWD = editmenu.Append(wx.ID_ANY, "Current Working &Directory","Current Working Directory")
self.Bind(wx.EVT_MENU, self.OnCWD, self.menuCWD)
helpmenu= wx.Menu()
menuAbout= helpmenu.Append(wx.ID_ABOUT, "&About"," Information about Bonsu")
menuDoc= helpmenu.Append(wx.ID_HELP, "&Contents","Documentation")
menuBar = wx.MenuBar()
menuBar.Append(filemenu,"&File")
menuBar.Append(viewmenu,"&View")
menuBar.Append(editmenu,"&Edit")
menuBar.Append(helpmenu,"&Help")
self.SetMenuBar(menuBar)
self.Bind(wx.EVT_MENU, self.OnOpen, menuOpen)
self.Bind(wx.EVT_MENU, self.OnSave, menuSave)
self.Bind(wx.EVT_MENU, self.OnNew, menuNew)
self.Bind(wx.EVT_MENU, self.OnExit, menuExit)
self.Bind(wx.EVT_MENU, self.OnAbout, menuAbout)
self.Bind(wx.EVT_MENU, self.OnHelp, menuDoc)
self.Bind(wx.EVT_CLOSE, self.OnExit)
self.fontpointsize=wx.SystemSettings.GetFont(wx.SYS_SYSTEM_FONT).GetPointSize()
self.font = wx.Font(self.fontpointsize, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
self.SetFont(self.font)
icon = wx.Icon(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'image', 'bonsu.ico'), wx.BITMAP_TYPE_ICO)
wx.Frame.SetIcon(self, icon)
self.nb = None
self.sizer = wx.BoxSizer(wx.VERTICAL)
self.Fit()
self.Layout()
self.Show()
def setIcon(self):
#????
icon = wx.Icon("icon.ico",wx.BITMAP_TYPE_ICO)
self.SetIcon(icon)
def __init__(self, parent, fileOpen=None):
""" Constructor of the PLCOpenEditor class.
:param parent: The parent window.
:param fileOpen: The filepath to open if no controler defined (default: None).
"""
self.icon = wx.Icon(os.path.join(beremiz_dir, "images", "poe.ico"), wx.BITMAP_TYPE_ICO)
IDEFrame.__init__(self, parent)
result = None
# Open the filepath if defined
if fileOpen is not None:
fileOpen = DecodeFileSystemPath(fileOpen, False)
if os.path.isfile(fileOpen):
# Create a new controller
controler = PLCControler()
result = controler.OpenXMLFile(fileOpen)
self.Controler = controler
self.LibraryPanel.SetController(controler)
self.ProjectTree.Enable(True)
self.PouInstanceVariablesPanel.SetController(controler)
self._Refresh(PROJECTTREE, POUINSTANCEVARIABLESPANEL, LIBRARYTREE)
# Define PLCOpenEditor icon
self.SetIcon(self.icon)
self.Bind(wx.EVT_CLOSE, self.OnCloseFrame)
self._Refresh(TITLE, EDITORTOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU)
if result is not None:
(num, line) = result
self.ShowErrorMessage(_("PLC syntax error at line {a1}:\n{a2}").format(a1=num, a2=line))
def OnAboutMenu(self, event):
info = version.GetAboutDialogInfo()
info.Name = "PLCOpenEditor"
info.Description = _("PLCOpenEditor is part of Beremiz project.\n\n"
"Beremiz is an ") + info.Description
info.Icon = wx.Icon(os.path.join(beremiz_dir, "images", "aboutlogo.png"), wx.BITMAP_TYPE_PNG)
ShowAboutDialog(self, info)
def __init__(self, parent, title='Frame3D', manager=None):
wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = title, pos = wx.DefaultPosition, size = wx.Size( 800,600 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )
self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )
sizer = wx.BoxSizer( wx.VERTICAL )
root = os.path.abspath(os.path.dirname(__file__))
self.SetIcon(wx.Icon(os.path.join(root, 'imgs/logo.ico'), wx.BITMAP_TYPE_ICO))
self.viewer = canvas3d.Viewer3D( self , manager)
sizer.Add( self.viewer, 1, wx.EXPAND |wx.ALL, 0 )
self.Bind(wx.EVT_CLOSE, self.on_closing)
self.SetSizer( sizer )
self.Layout()
self.Centre( wx.BOTH )
def __init__(self, parent, title, data, cols=None, rows=None):
wx.Frame.__init__(self, parent, -1, title)
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))
TableLogManager.add(title, self)
self.data, self.cols, self.rows = data, cols, rows
tableBase = GenericTable(data, cols, rows)
self.grid = wx.grid.Grid(self)
## create tablegrid and set tablegrid value
#self.grid.SetTable(tableBase)
self.Bind(wx.EVT_CLOSE, self.OnClose)
self.grid.CreateGrid(len(data), len(data[0]))
if cols!=None:
for i in range(len(cols)):
self.grid.SetColLabelValue(i, cols[i])
if rows!=None:
for i in range(len(rows)):
self.grid.SetColLabelValue(i, rows[i])
for i in range(len(data)):
for j in range(len(data[0])):
self.grid.SetCellValue(i, j,str(data[i][j]))
self.grid.AutoSize()
## create menus
menus = [('File(&F)',
[('Save as tab', self.OnSaveTab),
('Save as csv', self.OnSaveCsv),
('-'),
('Exit', self.OnClose)
]
),
('Help(&H)',
[('About', self.OnAbout)]
)
]
## bind the menus with the correspond events
menuBar=wx.MenuBar()
for menu in menus:
m = wx.Menu()
for item in menu[1]:
if item[0]=='-':
m.AppendSeparator()
else:
i = m.Append(-1, item[0])
if item[1]!=None:
self.Bind(wx.EVT_MENU,item[1], i)
menuBar.Append(m,menu[0])
self.SetMenuBar(menuBar)
self.Fit()
def __init__(self, parent, title, cont, url):
wx.Frame.__init__ (self, parent, id = wx.ID_ANY, title = title, size = wx.Size(500,500))
logopath = os.path.join(root_dir, 'data/logo.ico')
self.SetIcon(wx.Icon(logopath, wx.BITMAP_TYPE_ICO))
HtmlPanel(self, md2html(cont), url)
def __init__(self, title='ImagePy TexLog'):
wx.Frame.__init__(self, IPy.curapp,title=title,size=(500,300))
logopath = os.path.join(root_dir, 'data/logo.ico')
self.SetIcon(wx.Icon(logopath, wx.BITMAP_TYPE_ICO))
self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_3DLIGHT ) )
self.title = title
TextLogManager.add(title, self)
self.file=''
### Create menus (name:event) k-v pairs
menus = [
## File
('File(&F)',[('Open', self.OnOpen),
('Save', self.OnSave),
('Save as', self.OnSaveAs),
('-'),
('Exit', self.OnClose)
]),
## Edit
('Edit(&E)', [ ('Undo', self.OnUndo),
('Redo', self.OnRedo),
('-'),
('Cut', self.OnCut),
('Copy', self.OnCopy),
('Paste', self.OnPaste),
('-'),
('All', self.OnSelectAll)
]),
## Help
('Help(&H)', [('About', self.OnAbout)])
]
### Bind menus with the corresponding events
self.menuBar=wx.MenuBar()
for menu in menus:
m = wx.Menu()
for item in menu[1]:
if item[0]=='-':
m.AppendSeparator()
else:
i = m.Append(-1, item[0])
self.Bind(wx.EVT_MENU,item[1], i)
self.menuBar.Append(m,menu[0])
self.SetMenuBar(self.menuBar)
self.Bind(wx.EVT_CLOSE, self.OnClosing)
sizer = wx.BoxSizer( wx.VERTICAL )
self.text= wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString,
wx.DefaultPosition, wx.DefaultSize, wx.TE_MULTILINE )
sizer.Add( self.text, 1, wx.ALL|wx.EXPAND, 1 )
self.SetSizer( sizer )
self.Bind(wx.EVT_RIGHT_DOWN,self.OnRClick)
def __init__( self, parent, title):
wx.Frame.__init__ ( self, parent, id = wx.ID_ANY,
title = title, pos = wx.DefaultPosition,
size = wx.Size( 500,300 ) )
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.DefaultSize, wx.DefaultSize )
sizer = wx.BoxSizer( wx.VERTICAL )
self.canvas = LineCanvas( self)
#self.canvas.set_data(np.random.rand(256)*100)
#self.canvas.set_lim(0, 0)
sizer.Add( self.canvas, 1, wx.EXPAND |wx.ALL, 5 )
sizer2 = wx.BoxSizer( wx.HORIZONTAL )
self.lab_info = wx.StaticText( self, wx.ID_ANY, "Information",
wx.DefaultPosition, wx.DefaultSize, 0 )
self.lab_info.Wrap( -1 )
sizer2.Add( self.lab_info, 0, wx.ALL, 5 )
sizer2.AddStretchSpacer(1)
self.btn_save = wx.Button( self, wx.ID_ANY, "Save",
wx.DefaultPosition, wx.DefaultSize, 0 )
sizer2.Add( self.btn_save, 0, wx.ALL, 5 )
self.btn_cancel = wx.Button( self, wx.ID_ANY, "Cancel",
wx.DefaultPosition, wx.DefaultSize, 0 )
sizer2.Add( self.btn_cancel, 0, wx.ALL, 5 )
sizer.Add( sizer2, 0, wx.ALL|wx.EXPAND, 5 )
self.SetSizer( sizer )
self.Layout()
self.Centre( wx.BOTH )
self.canvas.handle_move = self.handle_move
self.Bind(wx.EVT_CLOSE, self.on_closing)
self.btn_cancel.Bind(wx.EVT_BUTTON, self.on_cancel)
self.btn_save.Bind(wx.EVT_BUTTON, self.on_save)
self.set_title_label = self.canvas.set_title_label
self.add_data = self.canvas.add_data
self.clear = self.canvas.clear
def __init__(self, parent, title, hist):
wx.Frame.__init__(self, parent, title=title, style = wx.DEFAULT_DIALOG_STYLE)
logopath = os.path.join(root_dir, 'data/logo.ico')
self.SetIcon(wx.Icon(logopath, wx.BITMAP_TYPE_ICO))
if len(hist)==3:self.rgb(hist)
else: self.gray(hist)
def __init__( self, parent,):
wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = 'Plugin List',
pos = wx.DefaultPosition, size = wx.Size( 612,500 ),
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.DefaultSize, wx.DefaultSize )
bSizer1 = wx.BoxSizer( wx.VERTICAL )
bSizer2 = wx.BoxSizer( wx.HORIZONTAL )
self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, "Search:",
wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText1.Wrap( -1 )
bSizer2.Add( self.m_staticText1, 0, wx.ALIGN_CENTER|wx.ALL, 5 )
self.txt_search = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString,
wx.DefaultPosition, wx.DefaultSize, 0 )
bSizer2.Add( self.txt_search, 1, wx.ALL, 5 )
bSizer1.Add( bSizer2, 0, wx.EXPAND, 5 )
self.lst_plgs = VirtualListCtrl( self, ['Name', 'Location'])
self.lst_plgs.SetColumnWidth(0,200)
self.lst_plgs.SetColumnWidth(1,400)
bSizer1.Add( self.lst_plgs, 1, wx.ALL|wx.EXPAND, 5 )
self.SetSizer( bSizer1 )
self.Layout()
self.Centre( wx.BOTH )
# Connect Events
self.txt_search.Bind( wx.EVT_TEXT, self.on_search )
self.lst_plgs.Bind( wx.EVT_LIST_ITEM_ACTIVATED, self.on_run )
self.load()
def __init__( self, parent):
wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = 'Plugin List',
pos = wx.DefaultPosition, size = wx.Size( 412,500 ),
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.DefaultSize, wx.DefaultSize )
bSizer1 = wx.BoxSizer( wx.VERTICAL )
bSizer2 = wx.BoxSizer( wx.HORIZONTAL )
self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, "Search:",
wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText1.Wrap( -1 )
bSizer2.Add( self.m_staticText1, 0, wx.ALIGN_CENTER|wx.ALL, 5 )
self.txt_search = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString,
wx.DefaultPosition, wx.DefaultSize, 0 )
bSizer2.Add( self.txt_search, 1, wx.ALL, 5 )
bSizer1.Add( bSizer2, 0, wx.EXPAND, 5 )
self.lst_plgs = VirtualListCtrl( self, ['Name', 'Shotcut'])
self.lst_plgs.SetColumnWidth(0,200)
self.lst_plgs.SetColumnWidth(1,200)
bSizer1.Add( self.lst_plgs, 1, wx.ALL|wx.EXPAND, 5 )
self.SetSizer( bSizer1 )
self.Layout()
self.Centre( wx.BOTH )
# Connect Events
self.txt_search.Bind( wx.EVT_TEXT, self.on_search )
self.lst_plgs.Bind(wx.EVT_LIST_KEY_DOWN, self.on_run)
self.load()
self.Bind(wx.EVT_CLOSE, self.on_close)
def __init__(self, *args, **kwds):
wx.Frame.__init__(self, *args, **kwds)
self.icon = wx.Icon("/usr/share/icons/hicolor/128x128/apps/switch-icon.png", wx.BITMAP_TYPE_PNG)
self.SetIcon(self.icon)
with open(CurrentHosts, "rb") as fp:
self.current = fp.read()
self.all_hosts = get_all_hosts()
self.combo_box_1 = wx.ComboBox(self, wx.ID_ANY, choices = self.all_hosts, style = wx.CB_DROPDOWN)
index = 0
try:
index = self.all_hosts.index(self.current)
except Exception:
pass
self.combo_box_1.Select(index)
self.button_add = wx.Button(self, wx.ID_ANY, "Add")
self.button_delete = wx.Button(self, wx.ID_ANY, "Delete")
self.button_edit = wx.Button(self, wx.ID_ANY, "Edit")
self.button_set = wx.Button(self, wx.ID_ANY, "Set")
self.Bind(wx.EVT_BUTTON, self.OnAdd, self.button_add)
self.Bind(wx.EVT_BUTTON, self.OnDelete, self.button_delete)
self.Bind(wx.EVT_BUTTON, self.OnEdit, self.button_edit)
self.Bind(wx.EVT_BUTTON, self.OnSet, self.button_set)
self.statusbar = self.CreateStatusBar(1)
self.__set_properties()
self.__do_layout()
def __init__(self):
wx.Frame.__init__(self, None, title='Image Extractor')
self.panel = wx.Panel(self)
loc = wx.IconLocation(r'C:\Python35\python.exe', 0)
self.SetIcon(wx.Icon(loc))
def __init__(self):
wx.Frame.__init__(self, None, title='Custom Image')
self.panel = wx.Panel(self, wx.ID_ANY)
ico = wx.Icon('py.ico', wx.BITMAP_TYPE_ICO)
self.SetIcon(ico)
def __init__(self, frame):
wx.TaskBarIcon.__init__(self)
self.frame = frame
# Set the image
icon = wx.Icon('python.ico', wx.BITMAP_TYPE_ICO)
self.SetIcon(icon, "Python")
# bind some events
self.Bind(wx.EVT_MENU, self.OnTaskBarClose, id=self.TBMENU_CLOSE)
self.Bind(wx.EVT_TASKBAR_LEFT_DOWN, self.OnTaskBarLeftClick)
def __init__(self, frame):
wx.adv.TaskBarIcon.__init__(self)
self.frame = frame
# Set the image
icon = wx.Icon('python.ico', wx.BITMAP_TYPE_ICO)
self.SetIcon(icon, "Python")
# bind some events
self.Bind(wx.EVT_MENU, self.OnTaskBarClose, id=self.TBMENU_CLOSE)
self.Bind(wx.adv.EVT_TASKBAR_LEFT_DOWN, self.OnTaskBarLeftClick)
def __init__(self, frame):
"""Constructor"""
wx.TaskBarIcon.__init__(self)
self.frame = frame
icon = wx.Icon('python.ico', wx.BITMAP_TYPE_ICO)
self.SetIcon(icon, "Restore")
self.Bind(wx.EVT_TASKBAR_LEFT_DOWN, self.OnTaskBarLeftClick)
def __init__(self, *args, **kwargs):
if 'size' not in kwargs:
kwargs['size'] = (360, 240)
super(NewPartitionDialog, self).__init__(*args, **kwargs)
# ico = wx.Icon(r'./icons/plus32x32.ico', wx.BITMAP_TYPE_ICO)
# self.SetIcon(ico)
fgs = wx.BoxSizer(wx.HORIZONTAL)
main_label = wx.StaticText(self, label="Fill up the cell below to create a new partition.")
name_label = wx.StaticText(self, label="Name Partition: ")
# unit_label = wx.StaticText(self, label="Unidade: ")
self.name_ctrl = wx.TextCtrl(self)
# self.unit_ctrl = wx.TextCtrl(self)
fgs.Add(name_label, 0, wx.EXPAND)
fgs.Add(self.name_ctrl, 1, wx.EXPAND)
# fgs.AddGrowableRow(0)
sizer = wx.BoxSizer(wx.VERTICAL)
button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL)
#if _iswxphoenix:
sizer.Add(main_label, 1, wx.GROW | wx.EXPAND)
sizer.Add(fgs, 0, wx.EXPAND)
sizer.Add(button_sizer, 0, wx.EXPAND)
#else:
# sizer.AddSizer(fgs, proportion=1, flag=wx.EXPAND)
# sizer.AddSizer(button_sizer, proportion=0, flag=wx.EXPAND)
# self.
self.SetSizer(sizer)
self.name_ctrl.SetFocus()
def __init__(self, controller_uid):
TopLevel.__init__(self, controller_uid)
UIM = UIManager()
controller = UIM.get(self._controller_uid)
#
parent_uid = UIM._getparentuid(self._controller_uid)
parent_obj = UIM.get(parent_uid)
if not parent_obj:
parent_view = None
else:
parent_view = parent_obj.view
#
wx.Frame.__init__(self, parent_view, wx.ID_ANY, controller.model.title,
pos=controller.model.pos, size=controller.model.size,
style=controller.model.style
)
if controller.model.icon:
self.icon = wx.Icon(controller.model.icon, wx.BITMAP_TYPE_ICO)
self.SetIcon(self.icon)
if controller.model.maximized:
self.Maximize()
self.Bind(wx.EVT_MAXIMIZE, self.on_maximize)
self.Bind(wx.EVT_SIZE, self.on_size)
self.Bind(wx.EVT_MOVE, self.on_move)
###############################################################################
###############################################################################
def OnAbout(self,e):
description =\
"""Bonsu is a collection of tools and algorithms primarily for the reconstruction of phase information from diffraction intensity measurements."""
licence =\
"""This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>."""
if IsNotWX4():
info = wx.AboutDialogInfo()
else:
info = wx.adv.AboutDialogInfo()
info.SetIcon(wx.Icon(os.path.join(os.path.dirname(os.path.dirname(__file__)),'image', 'bonsu.ico'), wx.BITMAP_TYPE_ICO))
info.SetName('Bonsu')
info.SetVersion(__version__)
info.SetDescription(description)
info.SetCopyright('Copyright (C) 2011-2017 Marcus C. Newton')
info.SetWebSite('github.com/bonsudev/bonsu')
info.SetLicence(licence)
info.AddDeveloper('Marcus C. Newton')
self.version_str_list = []
self.version_str_list.append("Python "+str(sys.version_info.major)+"."+str(sys.version_info.minor)+"."+str(sys.version_info.micro))
self.version_str_list.append("wxPython "+wx.version())
self.version_str_list.append("NumPy "+numpy.version.version)
self.version_str_list.append("VTK "+vtk.vtkVersion().GetVTKVersion())
self.version_str_list.append("PIL "+Image.VERSION)
try:
import h5py
self.version_str_list.append("h5Py "+h5py.version.version)
except:
pass
self.version_str_list.append("Build date: "+__builddate__)
info.SetArtists(self.version_str_list)
dialog = CustomAboutDialog(self,info)
dialog.ShowModal()
dialog.Destroy()
def __init__(self):
grc_wxgui.top_block_gui.__init__(self, title="Top Block")
_icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png"
self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY))
##################################################
# Variables
##################################################
self.samp_rate = samp_rate = 2000000
##################################################
# Blocks
##################################################
self.wxgui_waterfallsink2_0 = waterfallsink2.waterfall_sink_c(
self.GetWin(),
baseband_freq=930000000,
dynamic_range=100,
ref_level=0,
ref_scale=2.0,
sample_rate=samp_rate,
fft_size=512,
fft_rate=15,
average=False,
avg_alpha=None,
title='Waterfall Plot',
)
self.Add(self.wxgui_waterfallsink2_0.win)
self.wxgui_fftsink2_0 = fftsink2.fft_sink_c(
self.GetWin(),
baseband_freq=930000000,
y_per_div=10,
y_divs=10,
ref_level=0,
ref_scale=2.0,
sample_rate=samp_rate,
fft_size=1024,
fft_rate=15,
average=False,
avg_alpha=None,
title='FFT Plot',
peak_hold=False,
)
self.Add(self.wxgui_fftsink2_0.win)
self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True)
self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex*1, '/home/bill/signal_hunter/out.iq', True)
##################################################
# Connections
##################################################
self.connect((self.blocks_file_source_0, 0), (self.blocks_throttle_0, 0))
self.connect((self.blocks_throttle_0, 0), (self.wxgui_fftsink2_0, 0))
self.connect((self.blocks_throttle_0, 0), (self.wxgui_waterfallsink2_0, 0))