$search
00001 /********************************************************************* 00002 * 00003 * Software License Agreement (BSD License) 00004 * 00005 * Copyright (c) 2012, Robert Bosch LLC. 00006 * All rights reserved. 00007 * 00008 * Redistribution and use in source and binary forms, with or without 00009 * modification, are permitted provided that the following conditions 00010 * are met: 00011 * 00012 * * Redistributions of source code must retain the above copyright 00013 * notice, this list of conditions and the following disclaimer. 00014 * * Redistributions in binary form must reproduce the above 00015 * copyright notice, this list of conditions and the following 00016 * disclaimer in the documentation and/or other materials provided 00017 * with the distribution. 00018 * * Neither the name of the Robert Bosch nor the names of its 00019 * contributors may be used to endorse or promote products derived 00020 * from this software without specific prior written permission. 00021 * 00022 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00023 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00024 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00025 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00026 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00027 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00028 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00029 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00030 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00031 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00032 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00033 * POSSIBILITY OF SUCH DAMAGE. 00034 * 00035 *********************************************************************/ 00036 00038 // C++ code generated with wxFormBuilder (version Dec 21 2009) 00039 // http://www.wxformbuilder.org/ 00040 // 00041 // PLEASE DO "NOT" EDIT THIS FILE! 00043 00044 #include "object_segmentation_frame.h" 00045 00047 00048 ObjectSegmentationFrame::ObjectSegmentationFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxFrame( parent, id, title, pos, size, style, name ) 00049 { 00050 this->SetSizeHints( wxDefaultSize, wxSize( -1,-1 ) ); 00051 this->SetBackgroundColour( wxColour( 135, 136, 138 ) ); 00052 00053 wxInitAllImageHandlers(); 00054 00055 wxBoxSizer* bSizer1; 00056 bSizer1 = new wxBoxSizer( wxVERTICAL ); 00057 00058 MainPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); 00059 MainPanel->SetBackgroundColour( wxColour( 255, 255, 255 ) ); 00060 00061 wxBoxSizer* MainSizer; 00062 MainSizer = new wxBoxSizer( wxVERTICAL ); 00063 00064 wxBoxSizer* HeaderSizer; 00065 HeaderSizer = new wxBoxSizer( wxVERTICAL ); 00066 00067 wxBoxSizer* LogoSizer; 00068 LogoSizer = new wxBoxSizer( wxHORIZONTAL ); 00069 00070 00071 LogoSizer->Add( 10, 0, 0, 0, 5 ); 00072 00073 TitleText = new wxStaticText( MainPanel, wxID_ANY, wxT("Bosch Shared Autonomy Demonstration"), wxDefaultPosition, wxDefaultSize, 0 ); 00074 TitleText->Wrap( -1 ); 00075 TitleText->SetFont( wxFont( 22, 70, 90, 90, false, wxT("Bosch Sans") ) ); 00076 TitleText->SetForegroundColour( wxColour( 64, 66, 69 ) ); 00077 TitleText->SetBackgroundColour( wxColour( 255, 255, 255 ) ); 00078 00079 LogoSizer->Add( TitleText, 0, wxTOP, 15 ); 00080 00081 00082 LogoSizer->Add( 0, 0, 5, wxEXPAND, 5 ); 00083 00084 BoschLogo = new wxStaticBitmap( MainPanel, wxID_ANY, wxBitmap( wxT("ui/Bosch_Logo_small.png"), wxBITMAP_TYPE_PNG ), wxDefaultPosition, wxSize( -1,-1 ), 0 ); 00085 BoschLogo->SetBackgroundColour( wxColour( 255, 255, 255 ) ); 00086 00087 LogoSizer->Add( BoschLogo, 0, wxTOP|wxBOTTOM|wxRIGHT, 10 ); 00088 00089 HeaderSizer->Add( LogoSizer, 0, wxEXPAND, 1 ); 00090 00091 NavigationPanel = new wxPanel( MainPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); 00092 NavigationPanel->SetBackgroundColour( wxColour( 0, 59, 106 ) ); 00093 NavigationPanel->SetMinSize( wxSize( -1,30 ) ); 00094 NavigationPanel->SetMaxSize( wxSize( -1,30 ) ); 00095 00096 HeaderSizer->Add( NavigationPanel, 0, wxRIGHT|wxLEFT|wxEXPAND, 10 ); 00097 00098 MainSizer->Add( HeaderSizer, 0, wxEXPAND, 10 ); 00099 00100 ImagePanel = new wxPanel( MainPanel, wxID_ANY, wxDefaultPosition, wxSize( 640,480 ), 0 ); 00101 ImagePanel->SetBackgroundColour( wxColour( 0, 20, 42 ) ); 00102 ImagePanel->SetMinSize( wxSize( 640,480 ) ); 00103 00104 MainSizer->Add( ImagePanel, 10, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND|wxSHAPED, 10 ); 00105 00106 InstructionsLabel = new wxStaticText( MainPanel, wxID_ANY, wxT("Draw a box around an object and push Select. Press Go to pick up the object."), wxDefaultPosition, wxDefaultSize, 0 ); 00107 InstructionsLabel->Wrap( -1 ); 00108 InstructionsLabel->SetFont( wxFont( 14, 70, 90, 90, false, wxT("Bosch Sans") ) ); 00109 00110 MainSizer->Add( InstructionsLabel, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 10 ); 00111 00112 wxBoxSizer* ButtonSizer; 00113 ButtonSizer = new wxBoxSizer( wxHORIZONTAL ); 00114 00115 00116 ButtonSizer->Add( 0, 0, 3, wxEXPAND, 5 ); 00117 00118 wxBoxSizer* SegmentSizer; 00119 SegmentSizer = new wxBoxSizer( wxVERTICAL ); 00120 00121 segment_button_ = new wxBitmapButton( MainPanel, wxID_ANY, wxBitmap( wxT("ui/Arcade_Blue_Up.png"), wxBITMAP_TYPE_PNG ), wxDefaultPosition, wxDefaultSize, 0|wxNO_BORDER ); 00122 00123 segment_button_->SetBitmapSelected( wxBitmap( wxT("ui/Arcade_Blue_Down.png"), wxBITMAP_TYPE_PNG ) ); 00124 segment_button_->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ) ); 00125 segment_button_->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ) ); 00126 00127 segment_button_->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ) ); 00128 segment_button_->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ) ); 00129 00130 SegmentSizer->Add( segment_button_, 0, wxALIGN_CENTER, 0 ); 00131 00132 SegmentText = new wxStaticText( MainPanel, wxID_ANY, wxT("Select"), wxDefaultPosition, wxDefaultSize, 0 ); 00133 SegmentText->Wrap( -1 ); 00134 SegmentText->SetFont( wxFont( 14, 70, 90, 90, false, wxT("Bosch Sans") ) ); 00135 00136 SegmentSizer->Add( SegmentText, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); 00137 00138 ButtonSizer->Add( SegmentSizer, 0, wxEXPAND, 5 ); 00139 00140 00141 ButtonSizer->Add( 0, 0, 1, wxEXPAND, 5 ); 00142 00143 wxBoxSizer* AcceptSizer; 00144 AcceptSizer = new wxBoxSizer( wxVERTICAL ); 00145 00146 accept_button_ = new wxBitmapButton( MainPanel, wxID_ANY, wxBitmap( wxT("ui/Arcade_Green_Up.png"), wxBITMAP_TYPE_PNG ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxNO_BORDER ); 00147 00148 accept_button_->SetBitmapSelected( wxBitmap( wxT("ui/Arcade_Green_Down.png"), wxBITMAP_TYPE_PNG ) ); 00149 AcceptSizer->Add( accept_button_, 0, wxALIGN_CENTER, 10 ); 00150 00151 AcceptText = new wxStaticText( MainPanel, wxID_ANY, wxT("Go!"), wxDefaultPosition, wxDefaultSize, 0 ); 00152 AcceptText->Wrap( -1 ); 00153 AcceptText->SetFont( wxFont( 14, 70, 90, 90, false, wxT("Bosch Sans") ) ); 00154 00155 AcceptSizer->Add( AcceptText, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); 00156 00157 ButtonSizer->Add( AcceptSizer, 0, wxEXPAND, 5 ); 00158 00159 00160 ButtonSizer->Add( 0, 0, 1, wxEXPAND, 5 ); 00161 00162 wxBoxSizer* ResetSizer; 00163 ResetSizer = new wxBoxSizer( wxVERTICAL ); 00164 00165 reset_button_ = new wxBitmapButton( MainPanel, wxID_ANY, wxBitmap( wxT("ui/Arcade_Red_Up.png"), wxBITMAP_TYPE_PNG ), wxDefaultPosition, wxDefaultSize, 0|wxNO_BORDER ); 00166 00167 reset_button_->SetBitmapSelected( wxBitmap( wxT("ui/Arcade_Red_Down.png"), wxBITMAP_TYPE_PNG ) ); 00168 ResetSizer->Add( reset_button_, 0, wxALIGN_CENTER, 5 ); 00169 00170 ResetText = new wxStaticText( MainPanel, wxID_ANY, wxT("Reset"), wxDefaultPosition, wxDefaultSize, 0 ); 00171 ResetText->Wrap( -1 ); 00172 ResetText->SetFont( wxFont( 14, 70, 90, 90, false, wxT("Bosch Sans") ) ); 00173 00174 ResetSizer->Add( ResetText, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); 00175 00176 ButtonSizer->Add( ResetSizer, 0, wxEXPAND, 5 ); 00177 00178 00179 ButtonSizer->Add( 0, 0, 3, wxEXPAND, 5 ); 00180 00181 MainSizer->Add( ButtonSizer, 0, wxEXPAND, 0 ); 00182 00183 FauxFooter = new wxPanel( MainPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); 00184 FauxFooter->SetBackgroundColour( wxColour( 255, 255, 255 ) ); 00185 FauxFooter->SetMinSize( wxSize( -1,30 ) ); 00186 FauxFooter->SetMaxSize( wxSize( -1,30 ) ); 00187 00188 MainSizer->Add( FauxFooter, 0, wxEXPAND, 0 ); 00189 00190 MainPanel->SetSizer( MainSizer ); 00191 MainPanel->Layout(); 00192 MainSizer->Fit( MainPanel ); 00193 bSizer1->Add( MainPanel, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 10 ); 00194 00195 Footer = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); 00196 Footer->SetBackgroundColour( wxColour( 135, 136, 138 ) ); 00197 00198 wxBoxSizer* bSizer11; 00199 bSizer11 = new wxBoxSizer( wxHORIZONTAL ); 00200 00201 refresh_button_ = new wxButton( Footer, wxID_ANY, wxT("Refresh"), wxDefaultPosition, wxDefaultSize, 0 ); 00202 refresh_button_->SetForegroundColour( wxColour( 255, 255, 255 ) ); 00203 refresh_button_->SetBackgroundColour( wxColour( 135, 136, 138 ) ); 00204 00205 bSizer11->Add( refresh_button_, 0, wxALIGN_CENTER_VERTICAL, 5 ); 00206 00207 m_staticText4 = new wxStaticText( Footer, wxID_ANY, wxT("Copyright 2012 Robert Bosch LLC. All rights reserved."), wxDefaultPosition, wxDefaultSize, 0 ); 00208 m_staticText4->Wrap( -1 ); 00209 m_staticText4->SetForegroundColour( wxColour( 255, 255, 255 ) ); 00210 00211 bSizer11->Add( m_staticText4, 0, wxALL, 5 ); 00212 00213 Footer->SetSizer( bSizer11 ); 00214 Footer->Layout(); 00215 bSizer11->Fit( Footer ); 00216 bSizer1->Add( Footer, 0, wxEXPAND|wxALL, 10 ); 00217 00218 this->SetSizer( bSizer1 ); 00219 this->Layout(); 00220 00221 // Connect Events 00222 segment_button_->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ObjectSegmentationFrame::segmentButtonClicked ), NULL, this ); 00223 accept_button_->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ObjectSegmentationFrame::acceptButtonClicked ), NULL, this ); 00224 reset_button_->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ObjectSegmentationFrame::resetButtonClicked ), NULL, this ); 00225 refresh_button_->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ObjectSegmentationFrame::refreshButtonClicked ), NULL, this ); 00226 } 00227 00228 ObjectSegmentationFrame::~ObjectSegmentationFrame() 00229 { 00230 // Disconnect Events 00231 segment_button_->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ObjectSegmentationFrame::segmentButtonClicked ), NULL, this ); 00232 accept_button_->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ObjectSegmentationFrame::acceptButtonClicked ), NULL, this ); 00233 reset_button_->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ObjectSegmentationFrame::resetButtonClicked ), NULL, this ); 00234 refresh_button_->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ObjectSegmentationFrame::refreshButtonClicked ), NULL, this ); 00235 }