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
33 // Version: $Id: configpropdlg.cpp,v 1.2 2001/03/01 15:54:38 julians Exp $
35 // Description: Implementation file for the ecConfigPropertiesDialog
42 //####DESCRIPTIONEND####
44 //===========================================================================
46 // ============================================================================
48 // ============================================================================
50 // ----------------------------------------------------------------------------
52 // ----------------------------------------------------------------------------
54 #pragma implementation "configpropdlg.h"
57 // Includes other headers for precompiled compilation
64 #include "wx/cshelp.h"
66 #include "configtool.h"
67 #include "configpropdlg.h"
68 #include "propertywin.h"
70 BEGIN_EVENT_TABLE(ecConfigPropertiesDialog, wxDialog)
71 EVT_BUTTON(wxID_OK, ecConfigPropertiesDialog::OnClose)
74 // ----------------------------------------------------------------------------
76 // ----------------------------------------------------------------------------
79 ecConfigPropertiesDialog::ecConfigPropertiesDialog(wxWindow* parent, ecConfigItem* item)
84 SetExtraStyle(wxDIALOG_EX_CONTEXTHELP);
86 wxDialog::Create(parent, ecID_CONFIG_PROPERTIES_DIALOG, _("Configuration Item Properties"));
90 m_listCtrl->Fill(m_item);
95 void ecConfigPropertiesDialog::CreateControls(wxWindow* parent)
97 // Create custom windows first
98 m_listCtrl = new ecPropertyListCtrl(parent, ecID_CONFIG_PROPERTIES_LIST, wxDefaultPosition, wxSize(450, 300), wxLC_REPORT|wxCLIP_CHILDREN|wxSUNKEN_BORDER|wxLC_VRULES|wxLC_HRULES);
99 //m_listCtrl->InsertColumn(0, _("Property"), wxLIST_FORMAT_LEFT, 100);
100 //m_listCtrl->InsertColumn(1, _("Value"), wxLIST_FORMAT_LEFT, 100);
102 wxSizer *item0 = new wxBoxSizer( wxVERTICAL );
104 wxWindow *item1 = parent->FindWindow( ecID_CONFIG_PROPERTIES_LIST );
106 item0->Add( item1, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
108 wxSizer *item2 = new wxBoxSizer( wxHORIZONTAL );
110 item2->Add( 20, 20, 1, wxALIGN_CENTRE|wxALL, 5 );
112 wxButton *item3 = new wxButton( parent, wxID_OK, "&Close", wxDefaultPosition, wxDefaultSize, 0 );
113 item2->Add( item3, 0, wxALIGN_CENTRE|wxALL, 5 );
115 item0->Add( item2, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
118 wxButton *contextButton = new wxContextHelpButton( parent );
119 item2->Add( contextButton, 0, wxALIGN_CENTRE|wxALL, 5 );
122 ((wxButton*) parent->FindWindow(wxID_OK))->SetDefault();
124 parent->SetAutoLayout( TRUE );
125 parent->SetSizer( item0 );
127 item0->Fit( parent );
128 item0->SetSizeHints( parent );
130 // Add context-sensitive help text
131 parent->FindWindow( ecID_CONFIG_PROPERTIES_LIST )->SetHelpText(_("Displays the properties of the currently selected configuration item. You can double-click on a URL property to navigate to that documentation page or on a File property to view that header file."));
132 parent->FindWindow( wxID_OK )->SetHelpText(_("Closes the dialog."));
135 parent->FindWindow( wxID_CONTEXT_HELP )->SetHelpText(_("Invokes context-sensitive help for the clicked-on window."));
140 void ecConfigPropertiesDialog::OnClose(wxCommandEvent& event)