def init(win): icon = wx.EmptyIcon() iconfile = common.uni_work_file('ulipad.ico') # icon.LoadFile(iconfile, wx.BITMAP_TYPE_ICO) bmp = common.getpngimage(iconfile) # win.SetIcon(icon.CopyFromBitmap(bmp)) win.SetIcon(wx.Icon(iconfile, wx.BITMAP_TYPE_ICO))
def OnToolRegister(win, event): try: key = _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, '*', _winreg.KEY_ALL_ACCESS) filename = os.path.basename(sys.argv[0]) f, ext = os.path.splitext(filename) if ext == '.exe': command = '"%s" "%%L"' % os.path.normpath(common.uni_work_file(filename)) else: path = os.path.normpath(common.uni_work_file('%s.pyw' % f)) execute = sys.executable.replace('python.exe', 'pythonw.exe') command = '"%s" "%s" "%%L"' % (execute, path) _winreg.SetValue(key, 'shell\\UliPad\\command', _winreg.REG_SZ, common.encode_string(command, common.defaultfilesystemencoding)) common.note(tr('Done')) except: error.traceback() wx.MessageDialog(win, tr('Registering UliPad to the context menu of Windows Explorer failed.'), tr("Error"), wx.OK | wx.ICON_EXCLAMATION).ShowModal()
def afterinit(win): win.ftp_imagelist = { 'close': 'images/folderclose.gif', 'document': 'images/file.gif', 'parentfold': 'images/parentfold.gif', } win.ftp_resfile = common.uni_work_file('resources/ftpmanagedialog.xrc') win.ftp = None
def mainframe_init(win): win.quote_user = False win.quote_index = 0 win.quote_start = '' win.quote_end = '' win.quoteresfile = common.uni_work_file('resources/quotedialog.xrc') wx.EVT_UPDATE_UI(win, win.IDM_EDIT_FORMAT_QUOTE, win.OnUpdateUI) wx.EVT_UPDATE_UI(win, win.IDM_EDIT_FORMAT_UNQUOTE, win.OnUpdateUI)
def OnDocumentSyntaxPreference(win, event): from modules import i18n from modules import Resource import SyntaxDialog syntax_resfile = common.uni_work_file('resources/syntaxdialog.xrc') filename = i18n.makefilename(syntax_resfile, win.app.i18n.lang) if hasattr(win.document, 'languagename'): name = win.document.languagename else: name = '' Resource.loadfromresfile(filename, win, SyntaxDialog.SyntaxDialog, 'SyntaxDialog', win, win.lexers, name).ShowModal()
def OnToolRegister(win, event): try: key = _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, '*', _winreg.KEY_ALL_ACCESS) filename = os.path.basename(sys.argv[0]) f, ext = os.path.splitext(filename) if ext == '.exe': command = '"%s" "%%L"' % os.path.normpath( common.uni_work_file(filename)) else: path = os.path.normpath(common.uni_work_file('%s.pyw' % f)) execute = sys.executable.replace('python.exe', 'pythonw.exe') command = '"%s" "%s" "%%L"' % (execute, path) _winreg.SetValue( key, 'shell\\UliPad\\command', _winreg.REG_SZ, common.encode_string(command, common.defaultfilesystemencoding)) common.note(tr('Done')) except: error.traceback() wx.MessageDialog( win, tr('Registering UliPad to the context menu of Windows Explorer failed.' ), tr("Error"), wx.OK | wx.ICON_EXCLAMATION).ShowModal()
def beforegui(app): splashimg = common.uni_work_file('images/splash.jpg') app.splashwin = None if app.pref.splash_on_startup: app.splashwin = wx.SplashScreen(wx.Image(splashimg).ConvertToBitmap(), wx.SPLASH_CENTRE_ON_SCREEN|wx.SPLASH_NO_TIMEOUT, 0, None, -1)
def beforeinit(win): langinifile = common.uni_work_file('lang/language.ini') win.language_ids = [win.IDM_OPTION_LANGUAGE_ENGLISH] win.language_country = [''] create_language_menu(win, langinifile)