#NEWLINE# def __init__( self , parent ) : #NEWLINE# #INDENT# wx . Frame . __init__ ( self , parent , id = wx . ID_ANY , title = 'WebLab-Deusto Experiment Server Tester' , pos = wx . DefaultPosition , size = wx . Size ( 611 , 507 ) , style = ( wx . DEFAULT_FRAME_STYLE | wx . TAB_TRAVERSAL ) ) #NEWLINE# self . SetSizeHintsSz ( wx . DefaultSize , wx . DefaultSize ) #NEWLINE# self . SetBackgroundColour ( wx . Colour ( 221 , 232 , 249 ) ) #NEWLINE# mainBoxSizer = wx . BoxSizer ( wx . VERTICAL ) #NEWLINE# serverSizer = wx . StaticBoxSizer ( wx . StaticBox ( self , wx . ID_ANY , 'Server' ) , wx . HORIZONTAL ) #NEWLINE# self . mHostLabel = wx . StaticText ( self , wx . ID_ANY , 'Host:' , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# self . mHostLabel . Wrap ( ( - 1 ) ) #NEWLINE# serverSizer . Add ( self . mHostLabel , 0 , ( wx . ALL | wx . ALIGN_CENTER_VERTICAL ) , 5 ) #NEWLINE# self . mHostText = wx . TextCtrl ( self , wx . ID_ANY , wx . EmptyString , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# serverSizer . Add ( self . mHostText , 3 , wx . ALL , 5 ) #NEWLINE# self . mPortLabel = wx . StaticText ( self , wx . ID_ANY , 'Port:' , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# self . mPortLabel . Wrap ( ( - 1 ) ) #NEWLINE# serverSizer . Add ( self . mPortLabel , 0 , ( wx . ALL | wx . ALIGN_CENTER_VERTICAL ) , 5 ) #NEWLINE# self . mPortText = wx . TextCtrl ( self , wx . ID_ANY , wx . EmptyString , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# serverSizer . Add ( self . mPortText , 1 , wx . ALL , 5 ) #NEWLINE# self . m_staticText10 = wx . StaticText ( self , wx . ID_ANY , 'URI:' , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# self . m_staticText10 . Wrap ( ( - 1 ) ) #NEWLINE# serverSizer . Add ( self . m_staticText10 , 0 , ( wx . ALL | wx . ALIGN_CENTER_VERTICAL ) , 5 ) #NEWLINE# self . mUriText = wx . TextCtrl ( self , wx . ID_ANY , wx . EmptyString , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# serverSizer . Add ( self . mUriText , 0 , wx . ALL , 5 ) #NEWLINE# self . mConnectButton = wx . Button ( self , wx . ID_ANY , 'Connect' , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# serverSizer . Add ( self . mConnectButton , 0 , wx . ALL , 5 ) #NEWLINE# mainBoxSizer . Add ( serverSizer , 0 , wx . EXPAND , 5 ) #NEWLINE# tabsSizer = wx . BoxSizer ( wx . VERTICAL ) #NEWLINE# self . mNotebook = wx . Notebook ( self , wx . ID_ANY , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# self . mCommandsTab = wx . Panel ( self . mNotebook , wx . ID_ANY , wx . DefaultPosition , wx . DefaultSize , wx . TAB_TRAVERSAL ) #NEWLINE# self . mCommandsTab . SetBackgroundColour ( wx . Colour ( 221 , 254 , 216 ) ) #NEWLINE# commandsSizer = wx . BoxSizer ( wx . HORIZONTAL ) #NEWLINE# mCmdOtherCtrlsSizer = wx . BoxSizer ( wx . VERTICAL ) #NEWLINE# bSizer15 = wx . BoxSizer ( wx . VERTICAL ) #NEWLINE# mCmdOtherCtrlsSizer . Add ( bSizer15 , 1 , wx . EXPAND , 5 ) #NEWLINE# mCmdsTabFileSizer = wx . BoxSizer ( wx . HORIZONTAL ) #NEWLINE# self . m_staticText6 = wx . StaticText ( self . mCommandsTab , wx . ID_ANY , 'Content:' , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# self . m_staticText6 . Wrap ( ( - 1 ) ) #NEWLINE# mCmdsTabFileSizer . Add ( self . m_staticText6 , 0 , ( wx . ALL | wx . ALIGN_CENTER_VERTICAL ) , 5 ) #NEWLINE# bSizer18 = wx . BoxSizer ( wx . HORIZONTAL ) #NEWLINE# self . mFilePickerPath = wx . TextCtrl ( self . mCommandsTab , wx . ID_ANY , wx . EmptyString , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# bSizer18 . Add ( self . mFilePickerPath , 1 , ( ( wx . ALL | wx . ALIGN_CENTER_VERTICAL ) | wx . EXPAND ) , 5 ) #NEWLINE# self . mFilePickerButton = wx . Button ( self . mCommandsTab , wx . ID_ANY , '...' , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# bSizer18 . Add ( self . mFilePickerButton , 1 , wx . ALIGN_CENTER_VERTICAL , 5 ) #NEWLINE# mCmdsTabFileSizer . Add ( bSizer18 , 0 , wx . ALIGN_CENTER_VERTICAL , 5 ) #NEWLINE# self . m_staticText7 = wx . StaticText ( self . mCommandsTab , wx . ID_ANY , 'FileInfo:' , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# self . m_staticText7 . Wrap ( ( - 1 ) ) #NEWLINE# mCmdsTabFileSizer . Add ( self . m_staticText7 , 0 , ( wx . ALL | wx . ALIGN_CENTER_VERTICAL ) , 5 ) #NEWLINE# self . mFileInfoText = wx . TextCtrl ( self . mCommandsTab , wx . ID_ANY , wx . EmptyString , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# mCmdsTabFileSizer . Add ( self . mFileInfoText , 1 , ( wx . ALL | wx . ALIGN_CENTER_VERTICAL ) , 5 ) #NEWLINE# mCmdOtherCtrlsSizer . Add ( mCmdsTabFileSizer , 1 , ( wx . EXPAND | wx . ALL ) , 5 ) #NEWLINE# mCmdsTabCommandSizer = wx . BoxSizer ( wx . HORIZONTAL ) #NEWLINE# self . mCommandLabel = wx . StaticText ( self . mCommandsTab , wx . ID_ANY , 'Command:' , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# self . mCommandLabel . Wrap ( ( - 1 ) ) #NEWLINE# mCmdsTabCommandSizer . Add ( self . mCommandLabel , 0 , ( wx . ALL | wx . ALIGN_CENTER_VERTICAL ) , 5 ) #NEWLINE# self . mCommandText = wx . TextCtrl ( self . mCommandsTab , wx . ID_ANY , wx . EmptyString , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# mCmdsTabCommandSizer . Add ( self . mCommandText , 1 , ( wx . ALL | wx . ALIGN_CENTER_VERTICAL ) , 5 ) #NEWLINE# mCmdOtherCtrlsSizer . Add ( mCmdsTabCommandSizer , 1 , ( wx . EXPAND | wx . ALL ) , 5 ) #NEWLINE# bSizer16 = wx . BoxSizer ( wx . VERTICAL ) #NEWLINE# mCmdOtherCtrlsSizer . Add ( bSizer16 , 1 , wx . EXPAND , 5 ) #NEWLINE# commandsSizer . Add ( mCmdOtherCtrlsSizer , 1 , wx . EXPAND , 5 ) #NEWLINE# mCmdButtonsSizer = wx . BoxSizer ( wx . VERTICAL ) #NEWLINE# self . mStartExperimentButton = wx . Button ( self . mCommandsTab , wx . ID_ANY , '> start_experiment()' , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# mCmdButtonsSizer . Add ( self . mStartExperimentButton , 1 , ( ( wx . ALL | wx . ALIGN_RIGHT ) | wx . EXPAND ) , 5 ) #NEWLINE# self . mSendFileButton = wx . Button ( self . mCommandsTab , wx . ID_ANY , '> send_file()' , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# mCmdButtonsSizer . Add ( self . mSendFileButton , 1 , ( ( wx . ALL | wx . ALIGN_RIGHT ) | wx . EXPAND ) , 5 ) #NEWLINE# self . mSendCommand = wx . Button ( self . mCommandsTab , wx . ID_ANY , '> send_command()' , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# mCmdButtonsSizer . Add ( self . mSendCommand , 1 , ( ( wx . ALL | wx . ALIGN_RIGHT ) | wx . EXPAND ) , 5 ) #NEWLINE# self . mDisposeButton = wx . Button ( self . mCommandsTab , wx . ID_ANY , '> dispose()' , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# mCmdButtonsSizer . Add ( self . mDisposeButton , 1 , ( ( wx . ALL | wx . ALIGN_RIGHT ) | wx . EXPAND ) , 5 ) #NEWLINE# commandsSizer . Add ( mCmdButtonsSizer , 0 , wx . EXPAND , 5 ) #NEWLINE# self . mCommandsTab . SetSizer ( commandsSizer ) #NEWLINE# self . mCommandsTab . Layout ( ) #NEWLINE# commandsSizer . Fit ( self . mCommandsTab ) #NEWLINE# self . mNotebook . AddPage ( self . mCommandsTab , 'Commands' , False ) #NEWLINE# self . mScriptsTab = wx . Panel ( self . mNotebook , wx . ID_ANY , wx . DefaultPosition , wx . DefaultSize , wx . TAB_TRAVERSAL ) #NEWLINE# self . mScriptsTab . SetBackgroundColour ( wx . Colour ( 221 , 254 , 216 ) ) #NEWLINE# scriptsSizer = wx . BoxSizer ( wx . HORIZONTAL ) #NEWLINE# self . mScriptLabel = wx . StaticText ( self . mScriptsTab , wx . ID_ANY , 'Script:' , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# self . mScriptLabel . Wrap ( ( - 1 ) ) #NEWLINE# scriptsSizer . Add ( self . mScriptLabel , 0 , ( wx . ALL | wx . ALIGN_CENTER_VERTICAL ) , 5 ) #NEWLINE# bSizer181 = wx . BoxSizer ( wx . HORIZONTAL ) #NEWLINE# self . mScriptPickerPath = wx . TextCtrl ( self . mScriptsTab , wx . ID_ANY , wx . EmptyString , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# bSizer181 . Add ( self . mScriptPickerPath , 1 , ( ( wx . ALL | wx . ALIGN_CENTER_VERTICAL ) | wx . EXPAND ) , 5 ) #NEWLINE# self . mScriptPickerButton = wx . Button ( self . mScriptsTab , wx . ID_ANY , '...' , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# bSizer181 . Add ( self . mScriptPickerButton , 1 , wx . ALIGN_CENTER_VERTICAL , 5 ) #NEWLINE# scriptsSizer . Add ( bSizer181 , 1 , wx . ALIGN_CENTER_VERTICAL , 5 ) #NEWLINE# self . mRunScriptButton = wx . Button ( self . mScriptsTab , wx . ID_ANY , 'Run Script' , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# scriptsSizer . Add ( self . mRunScriptButton , 0 , ( wx . ALL | wx . ALIGN_CENTER_VERTICAL ) , 5 ) #NEWLINE# self . mScriptsTab . SetSizer ( scriptsSizer ) #NEWLINE# self . mScriptsTab . Layout ( ) #NEWLINE# scriptsSizer . Fit ( self . mScriptsTab ) #NEWLINE# self . mNotebook . AddPage ( self . mScriptsTab , 'Scripts' , True ) #NEWLINE# tabsSizer . Add ( self . mNotebook , 1 , ( wx . EXPAND | wx . ALL ) , 5 ) #NEWLINE# mainBoxSizer . Add ( tabsSizer , 1 , wx . EXPAND , 5 ) #NEWLINE# logSizer = wx . BoxSizer ( wx . VERTICAL ) #NEWLINE# self . mLogGrid = wx . grid . Grid ( self , wx . ID_ANY , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# self . mLogGrid . CreateGrid ( 0 , 2 ) #NEWLINE# self . mLogGrid . EnableEditing ( False ) #NEWLINE# self . mLogGrid . EnableGridLines ( True ) #NEWLINE# self . mLogGrid . EnableDragGridSize ( False ) #NEWLINE# self . mLogGrid . SetMargins ( 0 , 0 ) #NEWLINE# self . mLogGrid . SetColSize ( 0 , 80 ) #NEWLINE# self . mLogGrid . SetColSize ( 1 , 80 ) #NEWLINE# self . mLogGrid . EnableDragColMove ( False ) #NEWLINE# self . mLogGrid . EnableDragColSize ( False ) #NEWLINE# self . mLogGrid . SetColLabelSize ( 30 ) #NEWLINE# self . mLogGrid . SetColLabelValue ( 0 , 'Sent' ) #NEWLINE# self . mLogGrid . SetColLabelValue ( 1 , 'Received' ) #NEWLINE# self . mLogGrid . SetColLabelAlignment ( wx . ALIGN_CENTRE , wx . ALIGN_CENTRE ) #NEWLINE# self . mLogGrid . EnableDragRowSize ( False ) #NEWLINE# self . mLogGrid . SetRowLabelSize ( 80 ) #NEWLINE# self . mLogGrid . SetRowLabelAlignment ( wx . ALIGN_CENTRE , wx . ALIGN_CENTRE ) #NEWLINE# self . mLogGrid . SetDefaultCellBackgroundColour ( wx . Colour ( 255 , 255 , 221 ) ) #NEWLINE# self . mLogGrid . SetDefaultCellAlignment ( wx . ALIGN_LEFT , wx . ALIGN_TOP ) #NEWLINE# logSizer . Add ( self . mLogGrid , 1 , ( ( wx . ALL | wx . ALIGN_CENTER_HORIZONTAL ) | wx . EXPAND ) , 5 ) #NEWLINE# mainBoxSizer . Add ( logSizer , 1 , wx . EXPAND , 5 ) #NEWLINE# buttonsSizer = wx . BoxSizer ( wx . HORIZONTAL ) #NEWLINE# self . mCleanLogButton = wx . Button ( self , wx . ID_ANY , 'Clean Log' , wx . DefaultPosition , wx . DefaultSize , 0 ) #NEWLINE# buttonsSizer . Add ( self . mCleanLogButton , 0 , ( wx . ALIGN_RIGHT | wx . ALL ) , 5 ) #NEWLINE# mainBoxSizer . Add ( buttonsSizer , 0 , ( ( ( wx . TOP | wx . BOTTOM ) | wx . RIGHT ) | wx . ALIGN_RIGHT ) , 5 ) #NEWLINE# self . SetSizer ( mainBoxSizer ) #NEWLINE# self . Layout ( ) #NEWLINE# self . mStatusBar = self . CreateStatusBar ( 1 , wx . ST_SIZEGRIP , wx . ID_ANY ) #NEWLINE# self . Bind ( wx . EVT_ACTIVATE , self . OnActivate ) #NEWLINE# self . Bind ( wx . EVT_ACTIVATE_APP , self . OnActivateApp ) #NEWLINE# self . Bind ( wx . EVT_CLOSE , self . OnClose ) #NEWLINE# self . Bind ( wx . EVT_ENTER_WINDOW , self . OnEnterWindow ) #NEWLINE# self . Bind ( wx . EVT_ICONIZE , self . OnIconize ) #NEWLINE# self . Bind ( wx . EVT_IDLE , self . OnIdle ) #NEWLINE# self . Bind ( wx . EVT_PAINT , self . OnPaint ) #NEWLINE# self . mHostText . Bind ( wx . EVT_TEXT , self . OnHostText ) #NEWLINE# self . mHostText . Bind ( wx . EVT_TEXT_ENTER , self . OnHostTextEnter ) #NEWLINE# self . mPortText . Bind ( wx . EVT_CHAR , self . OnPortChar ) #NEWLINE# self . mPortText . Bind ( wx . EVT_TEXT , self . OnPortText ) #NEWLINE# self . mPortText . Bind ( wx . EVT_TEXT_ENTER , self . OnPortTextEnter ) #NEWLINE# self . mConnectButton . Bind ( wx . EVT_BUTTON , self . OnConnect ) #NEWLINE# self . mFilePickerButton . Bind ( wx . EVT_BUTTON , self . OnFilePickerButtonClicked ) #NEWLINE# self . mFileInfoText . Bind ( wx . EVT_TEXT , self . OnFileInfoText ) #NEWLINE# self . mFileInfoText . Bind ( wx . EVT_TEXT_ENTER , self . OnFileInfoTextEnter ) #NEWLINE# self . mCommandText . Bind ( wx . EVT_TEXT , self . OnCommandText ) #NEWLINE# self . mCommandText . Bind ( wx . EVT_TEXT_ENTER , self . OnCommandTextEnter ) #NEWLINE# self . mStartExperimentButton . Bind ( wx . EVT_BUTTON , self . OnStartExperiment ) #NEWLINE# self . mSendFileButton . Bind ( wx . EVT_BUTTON , self . OnSendFile ) #NEWLINE# self . mSendCommand . Bind ( wx . EVT_BUTTON , self . OnSendCommand ) #NEWLINE# self . mDisposeButton . Bind ( wx . EVT_BUTTON , self . OnDispose ) #NEWLINE# self . mScriptPickerButton . Bind ( wx . EVT_BUTTON , self . OnScriptPickerButtonClicked ) #NEWLINE# self . mRunScriptButton . Bind ( wx . EVT_BUTTON , self . OnRunScript ) #NEWLINE# self . mLogGrid . Bind ( wx . grid . EVT_GRID_CELL_CHANGE , self . OnLogCellChange ) #NEWLINE# self . mLogGrid . Bind ( wx . grid . EVT_GRID_CELL_LEFT_CLICK , self . OnLogCellLeftClick ) #NEWLINE# self . mLogGrid . Bind ( wx . grid . EVT_GRID_CELL_RIGHT_CLICK , self . OnLogCellRightClick ) #NEWLINE# self . mLogGrid . Bind ( wx . grid . EVT_GRID_SELECT_CELL , self . OnLogSelectCell ) #NEWLINE# self . mLogGrid . Bind ( wx . EVT_KILL_FOCUS , self . OnLogKillFocus ) #NEWLINE# self . mLogGrid . Bind ( wx . EVT_PAINT , self . OnLogPaint ) #NEWLINE# self . mLogGrid . Bind ( wx . EVT_SET_FOCUS , self . OnLogSetFocus ) #NEWLINE# self . mLogGrid . Bind ( wx . EVT_SIZE , self . OnLogSize ) #NEWLINE# self . mLogGrid . Bind ( wx . EVT_UPDATE_UI , self . OnLogUpdateUI ) #NEWLINE# self . mCleanLogButton . Bind ( wx . EVT_BUTTON , self . OnCleanLog )