| 1 |
26 |
unneback |
//####COPYRIGHTBEGIN####
|
| 2 |
|
|
//
|
| 3 |
|
|
// ----------------------------------------------------------------------------
|
| 4 |
|
|
// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
|
| 5 |
|
|
//
|
| 6 |
|
|
// This program is part of the eCos host tools.
|
| 7 |
|
|
//
|
| 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)
|
| 11 |
|
|
// any later version.
|
| 12 |
|
|
//
|
| 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
|
| 16 |
|
|
// more details.
|
| 17 |
|
|
//
|
| 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.
|
| 21 |
|
|
//
|
| 22 |
|
|
// ----------------------------------------------------------------------------
|
| 23 |
|
|
//
|
| 24 |
|
|
//####COPYRIGHTEND####
|
| 25 |
|
|
// platformsdlg.cpp :
|
| 26 |
|
|
//
|
| 27 |
|
|
//===========================================================================
|
| 28 |
|
|
//#####DESCRIPTIONBEGIN####
|
| 29 |
|
|
//
|
| 30 |
|
|
// Author(s): julians
|
| 31 |
|
|
// Contact(s): julians
|
| 32 |
|
|
// Date: 2000/09/06
|
| 33 |
|
|
// Version: $Id: configpropdlg.cpp,v 1.1.1.1 2004-02-14 13:28:52 phoenix Exp $
|
| 34 |
|
|
// Purpose:
|
| 35 |
|
|
// Description: Implementation file for the ecConfigPropertiesDialog
|
| 36 |
|
|
// Requires:
|
| 37 |
|
|
// Provides:
|
| 38 |
|
|
// See also:
|
| 39 |
|
|
// Known bugs:
|
| 40 |
|
|
// Usage:
|
| 41 |
|
|
//
|
| 42 |
|
|
//####DESCRIPTIONEND####
|
| 43 |
|
|
//
|
| 44 |
|
|
//===========================================================================
|
| 45 |
|
|
|
| 46 |
|
|
// ============================================================================
|
| 47 |
|
|
// declarations
|
| 48 |
|
|
// ============================================================================
|
| 49 |
|
|
|
| 50 |
|
|
// ----------------------------------------------------------------------------
|
| 51 |
|
|
// headers
|
| 52 |
|
|
// ----------------------------------------------------------------------------
|
| 53 |
|
|
#ifdef __GNUG__
|
| 54 |
|
|
#pragma implementation "configpropdlg.h"
|
| 55 |
|
|
#endif
|
| 56 |
|
|
|
| 57 |
|
|
// Includes other headers for precompiled compilation
|
| 58 |
|
|
#include "ecpch.h"
|
| 59 |
|
|
|
| 60 |
|
|
#ifdef __BORLANDC__
|
| 61 |
|
|
#pragma hdrstop
|
| 62 |
|
|
#endif
|
| 63 |
|
|
|
| 64 |
|
|
#include "wx/cshelp.h"
|
| 65 |
|
|
|
| 66 |
|
|
#include "configtool.h"
|
| 67 |
|
|
#include "configpropdlg.h"
|
| 68 |
|
|
#include "propertywin.h"
|
| 69 |
|
|
|
| 70 |
|
|
BEGIN_EVENT_TABLE(ecConfigPropertiesDialog, wxDialog)
|
| 71 |
|
|
EVT_BUTTON(wxID_OK, ecConfigPropertiesDialog::OnClose)
|
| 72 |
|
|
END_EVENT_TABLE()
|
| 73 |
|
|
|
| 74 |
|
|
// ----------------------------------------------------------------------------
|
| 75 |
|
|
// main frame
|
| 76 |
|
|
// ----------------------------------------------------------------------------
|
| 77 |
|
|
|
| 78 |
|
|
// Frame constructor
|
| 79 |
|
|
ecConfigPropertiesDialog::ecConfigPropertiesDialog(wxWindow* parent, ecConfigItem* item)
|
| 80 |
|
|
{
|
| 81 |
|
|
m_listCtrl = NULL;
|
| 82 |
|
|
m_item = item;
|
| 83 |
|
|
|
| 84 |
|
|
SetExtraStyle(wxDIALOG_EX_CONTEXTHELP);
|
| 85 |
|
|
|
| 86 |
|
|
wxDialog::Create(parent, ecID_CONFIG_PROPERTIES_DIALOG, _("Configuration Item Properties"));
|
| 87 |
|
|
|
| 88 |
|
|
CreateControls(this);
|
| 89 |
|
|
|
| 90 |
|
|
m_listCtrl->Fill(m_item);
|
| 91 |
|
|
|
| 92 |
|
|
Centre(wxBOTH);
|
| 93 |
|
|
}
|
| 94 |
|
|
|
| 95 |
|
|
void ecConfigPropertiesDialog::CreateControls(wxWindow* parent)
|
| 96 |
|
|
{
|
| 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);
|
| 101 |
|
|
|
| 102 |
|
|
wxSizer *item0 = new wxBoxSizer( wxVERTICAL );
|
| 103 |
|
|
|
| 104 |
|
|
wxWindow *item1 = parent->FindWindow( ecID_CONFIG_PROPERTIES_LIST );
|
| 105 |
|
|
wxASSERT( item1 );
|
| 106 |
|
|
item0->Add( item1, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
| 107 |
|
|
|
| 108 |
|
|
wxSizer *item2 = new wxBoxSizer( wxHORIZONTAL );
|
| 109 |
|
|
|
| 110 |
|
|
item2->Add( 20, 20, 1, wxALIGN_CENTRE|wxALL, 5 );
|
| 111 |
|
|
|
| 112 |
|
|
wxButton *item3 = new wxButton( parent, wxID_OK, "&Close", wxDefaultPosition, wxDefaultSize, 0 );
|
| 113 |
|
|
item2->Add( item3, 0, wxALIGN_CENTRE|wxALL, 5 );
|
| 114 |
|
|
|
| 115 |
|
|
item0->Add( item2, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
| 116 |
|
|
|
| 117 |
|
|
#ifdef __WXGTK__
|
| 118 |
|
|
wxButton *contextButton = new wxContextHelpButton( parent );
|
| 119 |
|
|
item2->Add( contextButton, 0, wxALIGN_CENTRE|wxALL, 5 );
|
| 120 |
|
|
#endif
|
| 121 |
|
|
|
| 122 |
|
|
((wxButton*) parent->FindWindow(wxID_OK))->SetDefault();
|
| 123 |
|
|
|
| 124 |
|
|
parent->SetAutoLayout( TRUE );
|
| 125 |
|
|
parent->SetSizer( item0 );
|
| 126 |
|
|
parent->Layout();
|
| 127 |
|
|
item0->Fit( parent );
|
| 128 |
|
|
item0->SetSizeHints( parent );
|
| 129 |
|
|
|
| 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."));
|
| 133 |
|
|
|
| 134 |
|
|
#if __WXGTK__
|
| 135 |
|
|
parent->FindWindow( wxID_CONTEXT_HELP )->SetHelpText(_("Invokes context-sensitive help for the clicked-on window."));
|
| 136 |
|
|
#endif
|
| 137 |
|
|
|
| 138 |
|
|
}
|
| 139 |
|
|
|
| 140 |
|
|
void ecConfigPropertiesDialog::OnClose(wxCommandEvent& event)
|
| 141 |
|
|
{
|
| 142 |
|
|
event.Skip();
|
| 143 |
|
|
}
|