1 //####COPYRIGHTBEGIN####
3 // ----------------------------------------------------------------------------
4 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
6 // This program is part of the eCos host tools.
8 // This program is free software; you can redistribute it and/or modify it
9 // under the terms of the GNU General Public License as published by the Free
10 // Software Foundation; either version 2 of the License, or (at your option)
13 // This program is distributed in the hope that it will be useful, but WITHOUT
14 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 // You should have received a copy of the GNU General Public License along with
19 // this program; if not, write to the Free Software Foundation, Inc.,
20 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 // ----------------------------------------------------------------------------
24 //####COPYRIGHTEND####
27 //===========================================================================
28 //#####DESCRIPTIONBEGIN####
31 // Contact(s): julians
35 // Description: Implementation file for ecLicenseDialog
42 //####DESCRIPTIONEND####
44 //===========================================================================
47 #pragma implementation "licensedlg.cpp"
56 #include "wx/valgen.h"
58 #include "licensedlg.h"
59 #include "configtool.h"
61 //----------------------------------------------------------------------------
63 //----------------------------------------------------------------------------
65 // WDR: event table for ecLicenseDialog
67 BEGIN_EVENT_TABLE(ecLicenseDialog, ecDialog)
68 EVT_BUTTON( wxID_OK, ecLicenseDialog::OnOK )
69 EVT_BUTTON( wxID_CANCEL, ecLicenseDialog::OnCancel )
72 ecLicenseDialog::ecLicenseDialog( const wxString& licenseText, wxWindow *parent, wxWindowID id, const wxString &title,
73 const wxPoint &position, const wxSize& size, long style )
75 SetExtraStyle(wxDIALOG_EX_CONTEXTHELP);
76 m_licenseText = licenseText;
78 wxDialog::Create( parent, id, title, position, size, style );
85 // WDR: handler implementations for ecLicenseDialog
87 void ecLicenseDialog::OnOK(wxCommandEvent &event)
92 void ecLicenseDialog::OnCancel(wxCommandEvent &event)
97 void ecLicenseDialog::CreateControls()
99 wxWindow* parent = this;
101 wxSizer *item0 = new wxBoxSizer( wxVERTICAL );
103 wxTextCtrl *item1 = new wxTextCtrl( parent, ecID_LICENSE_TEXT, _(""), wxDefaultPosition, wxSize(590,260), wxTE_MULTILINE|wxTE_READONLY );
104 item0->Add( item1, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
106 wxStaticText *item2 = new wxStaticText( parent, wxID_STATIC,
107 _("Do you accept all the terms of the preceding license agreement?"),
108 wxDefaultPosition, wxDefaultSize, 0 );
109 item0->Add( item2, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
111 wxSizer *item3 = new wxBoxSizer( wxHORIZONTAL );
113 wxButton *item4 = new wxButton( parent, wxID_OK, _("&Yes"), wxDefaultPosition, wxDefaultSize, 0 );
115 item3->Add( item4, 0, wxALIGN_CENTRE|wxALL, 5 );
117 wxButton *item5 = new wxButton( parent, wxID_CANCEL, _("&No"), wxDefaultPosition, wxDefaultSize, 0 );
118 item3->Add( item5, 0, wxALIGN_CENTRE|wxALL, 5 );
120 item0->Add( item3, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
122 parent->SetAutoLayout( TRUE );
123 parent->SetSizer( item0 );
125 item0->Fit( parent );
126 item0->SetSizeHints( parent );
129 parent->FindWindow( ecID_LICENSE_TEXT )->SetValidator(wxGenericValidator(& m_licenseText));
131 // Add context-sensitive help text
132 parent->FindWindow( ecID_LICENSE_TEXT )->SetHelpText(_("Displays the license for this package."));
133 parent->FindWindow( wxID_OK )->SetHelpText(_("Confirms that you accept the license."));
134 parent->FindWindow( wxID_CANCEL )->SetHelpText(_("Confirms that you do NOT accept the license."));
137 // parent->FindWindow( wxID_CONTEXT_HELP )->SetHelpText(_("Invokes context-sensitive help for the clicked-on window."));