infodialog.cpp

Go to the documentation of this file.
00001 
00002 // Name:        infodialog.cpp
00003 // Purpose:     
00004 // Author:      NDA
00005 // Modified by: 
00006 // Created:     11/10/2006 12:54:22
00007 // RCS-ID:      
00008 // Copyright:   CAEN S.p.A All rights reserved.
00009 // Licence:     
00011 
00012 // Generated by DialogBlocks (unregistered), 11/10/2006 12:54:22
00013 
00014 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
00015 #pragma implementation "infodialog.h"
00016 #endif
00017 
00018 // For compilers that support precompilation, includes "wx/wx.h".
00019 #include "wx/wxprec.h"
00020 
00021 #ifdef __BORLANDC__
00022 #pragma hdrstop
00023 #endif
00024 
00025 #ifndef WX_PRECOMP
00026 #include "wx/wx.h"
00027 #endif
00030 
00031 #include "infodialog.h"
00032 #include "hyperlinkctrl.h"
00033 extern "C" 
00034 {
00035         #include "../include/CAENVMETool/cvt_board_commons.h"
00036 }
00037 
00040 
00045 IMPLEMENT_DYNAMIC_CLASS( InfoDialog, wxDialog )
00046 
00047 
00051 BEGIN_EVENT_TABLE( InfoDialog, wxDialog )
00052 
00054     EVT_BUTTON( ID_OK_BUTTON, InfoDialog::OnOkButtonClick )
00055 
00057 
00058     //EVT_LINK( ID_HYPERLINK, InfoDialog::OnHyperlink )
00059 END_EVENT_TABLE()
00060 
00065 InfoDialog::InfoDialog( )
00066 {
00067 }
00068 
00069 InfoDialog::InfoDialog( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
00070 {
00071     Create(parent, id, caption, pos, size, style);
00072 }
00073 
00078 bool InfoDialog::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
00079 {
00081     m_left_panel = NULL;
00082     m_left_sizer = NULL;
00083     m_caenvmetool_rev = NULL;
00085 
00087     SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
00088     wxDialog::Create( parent, id, caption, pos, size, style );
00089 
00090     CreateControls();
00091     SetIcon(GetIconResource(wxT("scope2.png")));
00092     if (GetSizer())
00093     {
00094         GetSizer()->SetSizeHints(this);
00095     }
00096     Centre();
00098     return true;
00099 }
00100 
00105 void InfoDialog::CreateControls()
00106 {    
00108     // Generated by DialogBlocks, 10/01/2007 12:39:28 (unregistered)
00109 
00110     InfoDialog* itemDialog1 = this;
00111 
00112     wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
00113     itemDialog1->SetSizer(itemBoxSizer2);
00114 
00115     m_left_panel = new wxPanel( itemDialog1, ID_PANEL2, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
00116     m_left_panel->SetBackgroundColour(wxColour(255, 255, 255));
00117     itemBoxSizer2->Add(m_left_panel, 1, wxGROW|wxALL, 5);
00118 
00119     wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
00120     m_left_panel->SetSizer(itemBoxSizer4);
00121 
00122     m_left_sizer = new wxBoxSizer(wxVERTICAL);
00123     itemBoxSizer4->Add(m_left_sizer, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00124 
00125     wxBitmap itemStaticBitmap6Bitmap(itemDialog1->GetBitmapResource(wxT("caen.png")));
00126     wxStaticBitmap* itemStaticBitmap6 = new wxStaticBitmap( m_left_panel, wxID_STATIC, itemStaticBitmap6Bitmap, wxDefaultPosition, wxSize(195, 62), 0 );
00127     m_left_sizer->Add(itemStaticBitmap6, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
00128 
00129     wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxVERTICAL);
00130     itemBoxSizer4->Add(itemBoxSizer7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00131 
00132     wxStaticText* itemStaticText8 = new wxStaticText( m_left_panel, wxID_STATIC, _("CAEN Scope"), wxDefaultPosition, wxSize(150, -1), 0 );
00133     itemStaticText8->SetForegroundColour(wxColour(0, 0, 160));
00134     itemStaticText8->SetFont(wxFont(12, wxSWISS, wxITALIC, wxBOLD, false, _T("Tahoma")));
00135     itemBoxSizer7->Add(itemStaticText8, 1, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5);
00136 
00137     wxStaticText* itemStaticText9 = new wxStaticText( m_left_panel, wxID_STATIC, _("CAENVMETool usage demo software"), wxDefaultPosition, wxDefaultSize, 0 );
00138     itemStaticText9->SetForegroundColour(wxColour(0, 0, 160));
00139     itemStaticText9->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, false, _T("Tahoma")));
00140     itemBoxSizer7->Add(itemStaticText9, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE, 5);
00141 
00142     wxStaticText* itemStaticText10 = new wxStaticText( m_left_panel, wxID_STATIC, _("CAENSCOPE Rev. 1.2"), wxDefaultPosition, wxDefaultSize, 0 );
00143     itemBoxSizer7->Add(itemStaticText10, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 2);
00144 
00145     m_caenvmetool_rev = new wxStaticText( m_left_panel, wxID_STATIC, _("CAENVMETool Rev ????"), wxDefaultPosition, wxDefaultSize, 0 );
00146     itemBoxSizer7->Add(m_caenvmetool_rev, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 2);
00147 
00148     wxPanel* itemPanel12 = new wxPanel( itemDialog1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL );
00149     itemPanel12->SetBackgroundColour(wxColour(192, 192, 192));
00150     itemBoxSizer2->Add(itemPanel12, 0, wxGROW|wxALL, 5);
00151 
00152     wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL);
00153     itemPanel12->SetSizer(itemBoxSizer13);
00154 
00155     wxButton* itemButton14 = new wxButton( itemPanel12, ID_OK_BUTTON, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 );
00156     itemButton14->SetDefault();
00157     itemButton14->SetHelpText(_("Close this windows"));
00158     if (ShowToolTips())
00159         itemButton14->SetToolTip(_("Close this windows"));
00160     itemButton14->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, false, _T("Tahoma")));
00161     itemBoxSizer13->Add(itemButton14, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
00162 
00164         wxHyperlinkCtrl *hyper_link= new wxHyperlinkCtrl( m_left_panel, ID_HYPERLINK, _("www.caen.it"));
00165         hyper_link->SetBackgroundColour(wxColour(255, 255, 255));
00166         hyper_link->SetLinkCursor();
00167         hyper_link->SetURL( _("http://www.caen.it"));
00168         hyper_link->SetToolTip( wxT("Goto caen web site") );
00169         hyper_link->AutoBrowse( true);
00170         hyper_link->UpdateLink();
00171         this->m_left_sizer->Add( hyper_link, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
00172 
00173         // CAENVMETool revision
00174         this->m_caenvmetool_rev->SetLabel( cvt_SW_rev());
00175 
00176 }
00177 
00182 bool InfoDialog::ShowToolTips()
00183 {
00184     return true;
00185 }
00186 
00191 wxBitmap InfoDialog::GetBitmapResource( const wxString& name )
00192 {
00193     // Bitmap retrieval
00195     wxUnusedVar(name);
00196     if (name == _T("caen.png"))
00197     {
00198         wxBitmap bitmap(_T("caen.png"), wxBITMAP_TYPE_PNG);
00199         return bitmap;
00200     }
00201     return wxNullBitmap;
00203 }
00204 
00209 wxIcon InfoDialog::GetIconResource( const wxString& name )
00210 {
00211     // Icon retrieval
00213     wxUnusedVar(name);
00214     if (name == _T("scope2.png"))
00215     {
00216         wxIcon icon(_T("scope2.png"), wxBITMAP_TYPE_PNG);
00217         return icon;
00218     }
00219     return wxNullIcon;
00221 }
00226 void InfoDialog::OnOkButtonClick( wxCommandEvent& /* event*/ )
00227 {
00228         this->EndModal( wxID_OK);
00229 }
00230 //void InfoDialog::OnHyperlink(wxCommandEvent & /* event*/)
00231 //{
00232 //      wxHyperlinkCtrl::GotoURL(wxT("http://www.caen.it"), "", false, false);
00233 //}

Generated on Mon Mar 19 17:14:08 2007 for CAENScope by  doxygen 1.4.6-NO