+ // set a dialog background
+ SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
+
+ // add the controls to the frame
+ wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
+
+ wxBoxSizer *item1 = new wxBoxSizer( wxHORIZONTAL );
+
+ wxFlexGridSizer *item2 = new wxFlexGridSizer( 2, 0, 0 );
+ item2->AddGrowableCol( 1 );
+
+ wxButton *item3 = new wxButton( this, ID_START, wxT("Start Server"), wxDefaultPosition, wxDefaultSize, 0 );
+ item2->Add( item3, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+ wxString strs4[] =
+ {
+ IPC_SERVICE, _T("...")
+ };
+ wxChoice *item4 = new wxChoice( this, ID_SERVERNAME, wxDefaultPosition, wxSize(100,-1), 2, strs4, 0 );
+ item2->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+ wxButton *item5 = new wxButton( this, ID_DISCONNECT, wxT("Disconnect Client"), wxDefaultPosition, wxDefaultSize, 0 );
+ item2->Add( item5, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+ item2->Add( 20, 20, 0, wxALIGN_CENTER|wxALL, 5 );
+
+ wxButton *item6 = new wxButton( this, ID_ADVISE, wxT("Advise"), wxDefaultPosition, wxDefaultSize, 0 );
+ item2->Add( item6, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+ item2->Add( 20, 20, 0, wxALIGN_CENTER|wxALL, 5 );
+
+ item1->Add( item2, 1, wxALIGN_CENTER|wxALL, 5 );
+
+ item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+ wxStaticBox *item8 = new wxStaticBox( this, -1, wxT("Server log") );
+ wxStaticBoxSizer *item7 = new wxStaticBoxSizer( item8, wxVERTICAL );
+
+ wxTextCtrl *item9 = new wxTextCtrl( this, ID_LOG, wxT(""), wxDefaultPosition, wxSize(500,140), wxTE_MULTILINE );
+ item7->Add( item9, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+ item0->Add( item7, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+ SetSizer( item0 );
+ item0->SetSizeHints( this );
+
+ // status
+ m_server = NULL;
+ GetServername()->SetSelection(0);
+ wxLogTextCtrl *logWindow = new wxLogTextCtrl(GetLog());
+ delete wxLog::SetActiveTarget(logWindow);
+ wxLogMessage(_T("Click on Start to start the server"));
+ Enable();
+}
+
+void MyFrame::Enable()
+{
+ GetStart()->Enable(m_server == NULL);
+ GetServername()->Enable(m_server == NULL);
+ GetAdvise()->Enable(m_server && m_server->CanAdvise());
+ GetDisconnect()->Enable(m_server && m_server->IsConnected() != NULL);