OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [tools/] [configtool/] [standalone/] [wxwin/] [licensedlg.cpp] - Blame information for rev 790

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
// ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
2
// -------------------------------------------                              
3
// This file is part of the eCos host tools.                                
4
// Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.            
5
//
6
// This program is free software; you can redistribute it and/or modify     
7
// it under the terms of the GNU General Public License as published by     
8
// the Free Software Foundation; either version 2 or (at your option) any   
9
// later version.                                                           
10
//
11
// This program is distributed in the hope that it will be useful, but      
12
// WITHOUT ANY WARRANTY; without even the implied warranty of               
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        
14
// General Public License for more details.                                 
15
//
16
// You should have received a copy of the GNU General Public License        
17
// along with this program; if not, write to the                            
18
// Free Software Foundation, Inc., 51 Franklin Street,                      
19
// Fifth Floor, Boston, MA  02110-1301, USA.                                
20
// -------------------------------------------                              
21
// ####ECOSHOSTGPLCOPYRIGHTEND####                                          
22
// appsettings.cpp :
23
//
24
//===========================================================================
25
//#####DESCRIPTIONBEGIN####
26
//
27
// Author(s):   julians
28
// Contact(s):  julians
29
// Date:        2000/12/18
30
// Version:     $Id: licensedlg.cpp,v 1.2 2001/03/23 13:38:04 julians Exp $
31
// Purpose:
32
// Description: Implementation file for ecLicenseDialog
33
// Requires:
34
// Provides:
35
// See also:
36
// Known bugs:
37
// Usage:
38
//
39
//####DESCRIPTIONEND####
40
//
41
//===========================================================================
42
 
43
#ifdef __GNUG__
44
    #pragma implementation "licensedlg.cpp"
45
#endif
46
 
47
#include "ecpch.h"
48
 
49
#ifdef __BORLANDC__
50
    #pragma hdrstop
51
#endif
52
 
53
#include "wx/valgen.h"
54
 
55
#include "licensedlg.h"
56
#include "configtool.h"
57
 
58
//----------------------------------------------------------------------------
59
// ecLicenseDialog
60
//----------------------------------------------------------------------------
61
 
62
// WDR: event table for ecLicenseDialog
63
 
64
BEGIN_EVENT_TABLE(ecLicenseDialog, ecDialog)
65
    EVT_BUTTON( wxID_OK, ecLicenseDialog::OnOK )
66
    EVT_BUTTON( wxID_CANCEL, ecLicenseDialog::OnCancel )
67
END_EVENT_TABLE()
68
 
69
ecLicenseDialog::ecLicenseDialog( const wxString& licenseText, wxWindow *parent, wxWindowID id, const wxString &title,
70
    const wxPoint &position, const wxSize& size, long style )
71
{
72
    SetExtraStyle(wxDIALOG_EX_CONTEXTHELP);
73
    m_licenseText = licenseText;
74
 
75
    wxDialog::Create( parent, id, title, position, size, style );
76
 
77
    CreateControls();
78
 
79
    Centre(wxBOTH);
80
}
81
 
82
// WDR: handler implementations for ecLicenseDialog
83
 
84
void ecLicenseDialog::OnOK(wxCommandEvent &event)
85
{
86
    event.Skip();
87
}
88
 
89
void ecLicenseDialog::OnCancel(wxCommandEvent &event)
90
{
91
    event.Skip();
92
}
93
 
94
void ecLicenseDialog::CreateControls()
95
{
96
    wxWindow* parent = this;
97
 
98
    wxSizer *item0 = new wxBoxSizer( wxVERTICAL );
99
 
100
    wxTextCtrl *item1 = new wxTextCtrl( parent, ecID_LICENSE_TEXT, _(""), wxDefaultPosition, wxSize(590,260), wxTE_MULTILINE|wxTE_READONLY );
101
    item0->Add( item1, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
102
 
103
    wxStaticText *item2 = new wxStaticText( parent, wxID_STATIC,
104
        _("Do you accept all the terms of the preceding license agreement?"),
105
        wxDefaultPosition, wxDefaultSize, 0 );
106
    item0->Add( item2, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
107
 
108
    wxSizer *item3 = new wxBoxSizer( wxHORIZONTAL );
109
 
110
    wxButton *item4 = new wxButton( parent, wxID_OK, _("&Yes"), wxDefaultPosition, wxDefaultSize, 0 );
111
    item4->SetDefault();
112
    item3->Add( item4, 0, wxALIGN_CENTRE|wxALL, 5 );
113
 
114
    wxButton *item5 = new wxButton( parent, wxID_CANCEL, _("&No"), wxDefaultPosition, wxDefaultSize, 0 );
115
    item3->Add( item5, 0, wxALIGN_CENTRE|wxALL, 5 );
116
 
117
    item0->Add( item3, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
118
 
119
    parent->SetAutoLayout( TRUE );
120
    parent->SetSizer( item0 );
121
    parent->Layout();
122
    item0->Fit( parent );
123
    item0->SetSizeHints( parent );
124
 
125
    // Add validators
126
    parent->FindWindow( ecID_LICENSE_TEXT )->SetValidator(wxGenericValidator(& m_licenseText));
127
 
128
    // Add context-sensitive help text
129
    parent->FindWindow( ecID_LICENSE_TEXT )->SetHelpText(_("Displays the license for this package."));
130
    parent->FindWindow( wxID_OK )->SetHelpText(_("Confirms that you accept the license."));
131
    parent->FindWindow( wxID_CANCEL )->SetHelpText(_("Confirms that you do NOT accept the license."));
132
 
133
#if __WXGTK__
134
    // parent->FindWindow( wxID_CONTEXT_HELP )->SetHelpText(_("Invokes context-sensitive help for the clicked-on window."));
135
#endif
136
 
137
}
138
 
139
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.