Esempio n. 1
0
 def OnInit(self):
     self.mainFrame = MainFrame(parent=None,
                                id=wx.NewId(),
                                title=u"Reclass")
     self.SetTopWindow(self.mainFrame)
     self.mainFrame.Show()
     return True
Esempio n. 2
0
    def OnInit(self):
        print('Running wxPython ' + wx.version())
        # Set Current directory to the one containing this file
        os.chdir(os.path.dirname(os.path.abspath(__file__)))

        self.SetAppName('SettingsManager')

        s = SettingsManager()
        s.ReadSettings()
        self._snglInstChecker = wx.SingleInstanceChecker()
        self._snglInstChecker.CreateDefault()
        if self._snglInstChecker.IsAnotherRunning(
        ) and not s.MultipleInstancesAllowed:
            wx.MessageBox(
                'Another instance of this application is already running!',
                'Multiple instances not allowed',
                wx.OK | wx.ICON_EXCLAMATION | wx.CENTER)
            return False

        # Create the main window
        frm = MainFrame()
        self.SetTopWindow(frm)

        frm.Show()
        return True
Esempio n. 3
0
    def OnInit(self):
        self.m_frame = MainFrame(None)
        self.m_frame.Center(wx.BOTH)
        self.m_frame.Show()
        self.SetTopWindow(self.m_frame)

        return True
Esempio n. 4
0
def main():
    logger.info('run')
    logger.debug('debug')
    application = wx.App()
    frame = MainFrame()
    frame.Show()
    application.MainLoop()
Esempio n. 5
0
    def __init__(self, settings=None):
        """
        Class constructor
        
        @param settings: path to the main configuration file
        """
        # Callbacks not being used
        self.registerValueChanged = None

        # wxPython app
        self.app = wx.App(False)

        # Start SWAP server
        try:
            # Superclass call
            SwapInterface.__init__(self, settings, False)
            # Clear error file
            SwapException.clear()
        except SwapException as ex:
            ex.display()
            ex.log()

        # Open SWAP Device Management Tool
        self.dmtframe = MainFrame("SWAP Device Management Tool",
                                  self,
                                  server=self.server)
        #self.dmtframe.SetSize(wx.Size(370,500))
        self.app.SetTopWindow(self.dmtframe)
        self.dmtframe.CenterOnScreen()
        self.dmtframe.Show(True)

        self.app.MainLoop()
Esempio n. 6
0
class Application(wx.App):
    """The application class for Cain."""
    def __init__(self):
        """Construct the base class and redirect the output."""
        if not sys.platform in ('win32', 'win64'):
            wx.App.__init__(self, redirect=True, filename="ErrorLog.txt")
        else:
            # On windows we might not have write permission for the log file.
            wx.App.__init__(self)

    def OnInit(self):
        # Splash screen.
        image = wx.Image(os.path.join(resourcePath, "gui/splash.png"),
                         wx.BITMAP_TYPE_PNG)
        bmp = image.ConvertToBitmap()
        wx.SplashScreen(bmp, wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
                        2000, None, -1)
        wx.Yield()
        # Main window.
        self.frame = MainFrame()
        self.frame.Show()
        self.SetTopWindow(self.frame)
        return True

    def readInitialFile(self, inputFileName):
        self.frame.readFile(inputFileName, False)
Esempio n. 7
0
class VideoConverter(wx.App):
    def OnInit(self):
        self.m_frame = MainFrame(None)
        self.m_frame.Center(wx.BOTH)
        self.m_frame.Show()
        self.SetTopWindow(self.m_frame)
        return True
Esempio n. 8
0
    def __init__(self, application):
        self.app = application

        self.mainFrame = MainFrame(None)
        self.mainFrame.SetTitle(res.APPLICATION_NAME)

        self.mainFrame.Show()
Esempio n. 9
0
class PicasaDownload(wx.App):
    def OnInit(self):
        self.m_frame = MainFrame(None)
        self.m_frame.Center(wx.BOTH)
        self.m_frame.Show()
        self.SetTopWindow(self.m_frame)

        return True
Esempio n. 10
0
class MainController(object):
    def __init__(self, application):
        self.app = application

        self.mainFrame = MainFrame(None)
        self.mainFrame.SetTitle(res.APPLICATION_NAME)

        self.mainFrame.Show()
Esempio n. 11
0
 def test_reset(self):
     mainframe = MainFrame(100, 100)
     for i in range(100):
         for j in range(100):
             mainframe.GameMap[0][0] = 1
     mainframe.reset()
     for i in range(100):
         for j in range(100):
             self.assertEqual(mainframe.GameMap[i][j], 0, "error")
Esempio n. 12
0
 def initialize(self):
     if self.is_initialized:
         return
     self.is_initialized = True
     self.create_timer()
     frame = MainFrame()
     frame.Center()
     PublicData.MainFrom = frame
     self.SetTopWindow(frame)
     frame.Show()
Esempio n. 13
0
 def main():
     studentCard1 = StudentCard("a1", 'tut')  #add card 1 to list
     studentCard2 = StudentCard("b2", 'tenpaku')  #add card 2 to list
     
     gui = GUI()
     gui.mainloop()
     studentCard = gui.getInputCard()
     
     if not studentCard is None:
         from MainFrame import MainFrame as MF
         mainFrame = MF(studentCard)
         mainFrame.mainloop()
Esempio n. 14
0
    def OnInit(self):
        print('Running wxPython ' + wx.version())
        # Set Current directory to the one containing this file
        os.chdir(os.path.dirname(os.path.abspath(__file__)))

        self.SetAppName('wxStandardPaths')

        # Create the main window
        frm = MainFrame()
        self.SetTopWindow(frm)

        frm.Show()
        return True
Esempio n. 15
0
 def OnInit(self):
     # Splash screen.
     image = wx.Image(os.path.join(resourcePath, "gui/splash.png"),
                      wx.BITMAP_TYPE_PNG)
     bmp = image.ConvertToBitmap()
     wx.SplashScreen(bmp, wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
                     2000, None, -1)
     wx.Yield()
     # Main window.
     self.frame = MainFrame()
     self.frame.Show()
     self.SetTopWindow(self.frame)
     return True
Esempio n. 16
0
def start_app(cl_args):
    """Execute GUI application

    :param cl_args: Dict with command-line arguments
    """
    import wx
    from MainFrame import MainFrame

    app = wx.App()
    frame = MainFrame(parent=None,
                      app_creds=(APP_NAME, APP_VERSION),
                      cl_args=cl_args)
    frame.Show()
    app.MainLoop()
Esempio n. 17
0
    def __init__(self, *args, **kwargs):
        tk.Tk.__init__(self, *args, **kwargs)
        self.title("ScriptLauncher by FARBEX97")

        self.shared_data = {
            "script_name": tk.StringVar(),
            "src_dir": json.load(open("config.json"))["src_dir"]
        }

        # MenuBar
        menubar = MenuBar(self)
        self.config(menu=menubar)

        # MainFrame config
        container = MainFrame(self)
        self.geometry("500x200")

        # Window style config
        s = ttk.Style()
        s.configure(".", background="#c0c5ce")
        s.configure("TButton", background="#343d46")

        # Load all frames
        self.frames = {}
        for F in (StartPage, RunScriptPage):
            frame = F(container, self)
            self.frames[F] = frame
            frame.grid(row=0, column=0, sticky="nsew")
        self.show_frame(StartPage)
Esempio n. 18
0
 def OnInit(self):
     str=urllib2.unquote((sys.argv[1].split('/',2))[2])
     temp=str
     fid=(temp.split('&'))[0].split('=')[1]
     name=(str.split('&'))[1].split('=')[1]
     tid=(str.split('&'))[2].split('=')[1]
     title=(str.split('&'))[3].split('=')[1]
     uid=(str.split('&'))[4].split('=')[1]
     ulink=(str.split('&'))[5].split('=')[1]
     
     self.m_frame = MainFrame(None)
     self.m_frame.SetIcon(wx.IconFromLocation(wx.IconLocation(r'scanner.ico',0)))
     self.m_frame.setParams(fid,name,tid,title,uid,ulink)
     self.m_frame.Show()
     self.SetTopWindow(self.m_frame)
     return True
Esempio n. 19
0
 def MainLoop(self):
     mainFrame = MainFrame(self,
                           -1,
                           self.pyre_app_instance.name,
                           self.toolkit,
                           pyreapp=self.pyre_app_instance,
                           pyreapp_executable=self.pyre_app_executable)
     return
Esempio n. 20
0
def start(*args):
    '''if a wx App is already running, use this to get a MainFrame without
    firing up another App.

    Args:
        *args: each arg is a filename to open
    Returns:
        a dataviewer.MainFrame.MainFrame instance
    '''

    mf = MainFrame(parent=None, id=-1, title='Data Viewer Clone')
    mf.Show()

    for fname in args:
        mf.openDataSheet(fname)

    return mf
class scannerApp(wx.App):
    def OnInit(self):
        str=urllib2.unquote((sys.argv[1].split('/',2))[2])
        temp=str
        fid=(temp.split('&'))[0].split('=')[1]
        name=(str.split('&'))[1].split('=')[1]
        tid=(str.split('&'))[2].split('=')[1]
        title=(str.split('&'))[3].split('=')[1]
        uid=(str.split('&'))[4].split('=')[1]
        ulink=(str.split('&'))[5].split('=')[1]
        
        self.m_frame = MainFrame(None)
        self.m_frame.SetIcon(wx.IconFromLocation(wx.IconLocation(r'scanner.ico',0)))
        self.m_frame.setParams(fid,name,tid,title,uid,ulink)
        self.m_frame.Show()
        self.SetTopWindow(self.m_frame)
        return True
Esempio n. 22
0
    def sign_in(self, event):
        db = sqlite3.connect('Library.db')
        with db:
            cursor = db.cursor()
            hash_pass = hashlib.md5(self.password.Value).hexdigest()
            cursor.execute('SELECT * FROM Пользователи')
            users = cursor.fetchall()
            for each_user in users:
                login, password = each_user
                if self.login.Value == login and hash_pass == password:
                    main_frame = MainFrame()
                    main_frame.Show()
                    self.Close()
                    break

            else:
                wx.MessageBox('Пользователя с такими данными не существует.',
                              'Ошибка!', wx.OK | wx.ICON_ERROR)
Esempio n. 23
0
    def OnInit(self):
        print('Running wxPython ' + wx.version())
        # Set Current directory to the one containing this file
        os.chdir(os.path.dirname(os.path.abspath(__file__)))

        self.SetAppName('PwdProtect')

        dlg = DlgLogin(None, 'wxWidgets', 3)
        if dlg.ShowModal() != wx.ID_OK:
            wx.MessageBox('You can not access to this application!', 'Password required', wx.ICON_EXCLAMATION|wx.OK|wx.CENTER)
            return False
        dlg.Destroy()

        # Create the main window
        frm = MainFrame()
        self.SetTopWindow(frm)

        frm.Show()
        return True
Esempio n. 24
0
class Vikuraa(wx.App):
    def __init__(self, session, peripherals, parent=None):
        self.session = session
        self.peripherals = peripherals
        wx.App.__init__(self, parent)


    def OnInit(self):
        self.mainFrame = MainFrame(None, self.session, self.peripherals)
        self.mainFrame.Show()
        return True
Esempio n. 25
0
    def __init__(self, parent):
        MainFrame.__init__(self, parent)
        self.connection = None
        self.start_db_connection()
        self.query = None
        self.load_saved_query()
        self.rootNode = None
        self.create_tree_view()
        self.dataCursor = None

        # Binding Event to Button
        self.saveBtn.Bind(wx.EVT_BUTTON, self.onSave)
        self.loadBtn.Bind(wx.EVT_BUTTON, self.onLoad)
        self.removeBtn.Bind(wx.EVT_BUTTON, self.onRemove)
        self.submitBtn.Bind(wx.EVT_BUTTON, self.onSubmit)
        self.sqlBox.Bind(wx.EVT_TEXT, self.onSqlChange)
        self.natLangBox.Bind(wx.EVT_TEXT, self.onNatLangChange)
        self.vocalBtn.Bind(wx.EVT_BUTTON, self.onVocalize)
        self.loadMoreDataBtn.Bind(wx.EVT_BUTTON, self.onLoadMoreData)
        self.saveBox.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.onLoad)
Esempio n. 26
0
def runGUI():
    window = Tk()
    window.title('MP3 Player Max')
    window.geometry('700x120')
    logo = PhotoImage(file='./logo-mp3.png')

    window.iconphoto(True, logo)
    window.resizable(False, False)
    f = MainFrame(window)

    window.mainloop()
Esempio n. 27
0
class MainApp(wx.App):
    def __init__(self, parent, mst):
        self.mst = mst
        wx.App.__init__(self, parent)

    def OnInit(self):
        self.mFrame = MainFrame(None, self.mst)
        self.mst.set_window(self.mFrame)
        self.mFrame.Show()
        self.SetTopWindow(self.mFrame)
        return True
Esempio n. 28
0
def getmainframe(app, filenames):
    from MainFrame import MainFrame
    Globals.starting = True

    app.mainframe = frame = MainFrame(app, filenames)

    frame.workpath = app.workpath
    frame.userpath = app.userpath
    frame.afterinit()
    frame.editctrl.openPage()
    Globals.starting = False
    return frame
Esempio n. 29
0
class OurApp(wx.App):
    """
    Subclass of wx.App
    Has only one frame which is also a top level frame.
    """
    def OnInit(self):
        self.mainFrame = MainFrame(parent=None,
                                   id=wx.NewId(),
                                   title=u"Reclass")
        self.SetTopWindow(self.mainFrame)
        self.mainFrame.Show()
        return True
Esempio n. 30
0
    def __init__(self, row, column):
        pygame.init()
        self.screen = pygame.display.set_mode((600, 800), 0, 32)
        self.frame = MainFrame(row, column)
        self.positions = [[0 for i in range(column)] for j in range(row)]
        self.COUNT = pygame.USEREVENT + 1

        pygame.time.set_timer(self.COUNT, 500)  # Time
        pygame.display.set_caption("LifeGame")  # 标题
        self.screen.fill((200, 200, 200))

        for i in range(self.frame.Row):
            for j in range(self.frame.Column):
                x = i * 600 / self.frame.Row
                y = j * 600 / self.frame.Column
                self.positions[i][j] = (x, y + 200)
        pygame.draw.rect(self.screen, (255, 255, 255), ((5, 5), (140, 50)))
        pygame.draw.rect(self.screen, (255, 255, 255), ((155, 5), (140, 50)))
        pygame.draw.rect(self.screen, (255, 255, 255), ((305, 5), (140, 50)))
        pygame.draw.rect(self.screen, (255, 255, 255), ((455, 5), (140, 50)))
        self.screen.blit(self.drawText("start"), (50, 20))
        self.screen.blit(self.drawText("pause"), (200, 20))
        self.screen.blit(self.drawText("reset"), (350, 20))
        self.screen.blit(self.drawText("random"), (490, 20))
Esempio n. 31
0
    def __init__(self, application):
        QtGui.QMainWindow.__init__(self)

        self.channel = Channel()
        self.channel.open()

        self.application = application
        self.setWindowTitle(u'Отладчик')

        main_frame = MainFrame(self)
        self.setCentralWidget(main_frame)

        self.connect(application, QtCore.SIGNAL('aboutToQuit()'), self.on_quit)

        self.statusBar().showMessage(u'Готов')

        DebugDataProvider(self)
        DebugDataProvider.receive_data()
        DebugDataProvider.update_code_text()

        self.resize(1000, 300)
Esempio n. 32
0
 def OnInit(self):
     self.mainFrame = MainFrame(None, self.session, self.peripherals)
     self.mainFrame.Show()
     return True
Esempio n. 33
0
# -*- coding: utf-8 -*-
from PyQt4 import QtGui
import sys
from MainFrame import MainFrame

if __name__ == '__main__':
    qApp=QtGui.QApplication(sys.argv)
    main=MainFrame()
    main.showMaximized()
    sys.exit(qApp.exec_())

Esempio n. 34
0
from Tkinter import Tk
from MainFrame import MainFrame

root = Tk()
app = MainFrame(master=root)
app.mainloop()
root.destroy()