changeset 2802:e14d4c233d66

* standalone/wxwin/mainwin.cpp: Tweak the conflicts status pane width. * standalone/wxwin/configtooldoc.cpp, standalone/wxwin/filename.cpp: Accommodate UNC file paths. * standalone/wxwin/propertywin.cpp, standalone/wxwin/conflictwin.cpp: Automatically size the last column. * standalone/wxwin/configitem.cpp, standalone/wxwin/configitem.h, standalone/wxwin/configtree.cpp: Do not grey tree item text for active non-modifiable items. * standalone/common/ecosconfig.cxx, standalone/wxwin/configtool.cpp: Update copyright notice years.
author jld
date Mon, 16 Feb 2009 09:17:42 +0000
parents 5f91384cf205
children d21b0d3d2e3e
files host/tools/configtool/ChangeLog host/tools/configtool/standalone/common/ecosconfig.cxx host/tools/configtool/standalone/wxwin/configitem.cpp host/tools/configtool/standalone/wxwin/configitem.h host/tools/configtool/standalone/wxwin/configtool.cpp host/tools/configtool/standalone/wxwin/configtooldoc.cpp host/tools/configtool/standalone/wxwin/configtree.cpp host/tools/configtool/standalone/wxwin/conflictwin.cpp host/tools/configtool/standalone/wxwin/filename.cpp host/tools/configtool/standalone/wxwin/mainwin.cpp host/tools/configtool/standalone/wxwin/propertywin.cpp
diffstat 11 files changed, 80 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/host/tools/configtool/ChangeLog
+++ b/host/tools/configtool/ChangeLog
@@ -1,3 +1,17 @@
+2009-02-16  John Dallaway  <john@dallaway.org.uk>
+
+	* standalone/wxwin/mainwin.cpp: Tweak the conflicts status pane width.
+
+	* standalone/wxwin/configtooldoc.cpp, standalone/wxwin/filename.cpp:
+	Accommodate UNC file paths.
+
+	* standalone/wxwin/propertywin.cpp, standalone/wxwin/conflictwin.cpp:
+	Automatically size the last column.
+
+	* standalone/wxwin/configitem.cpp, standalone/wxwin/configitem.h,
+	  standalone/wxwin/configtree.cpp: Do not grey tree item text for
+	active non-modifiable items.
+
 2008-12-31  John Dallaway  <john@dallaway.org.uk>
 
 	* standalone/wxwin/outputwin.cpp, standalone/wxwin/outputwin.h,
--- a/host/tools/configtool/standalone/common/ecosconfig.cxx
+++ b/host/tools/configtool/standalone/common/ecosconfig.cxx
@@ -48,7 +48,7 @@
 #include "ecosconfig.hxx"
 
 #define TOOL_VERSION "3.net"
-#define TOOL_COPYRIGHT "Copyright (c) 2002-2008 Free Software Foundation, Inc."
+#define TOOL_COPYRIGHT "Copyright (c) 2002-2009 Free Software Foundation, Inc."
 #define DEFAULT_SAVE_FILE "ecos.ecc"
 static const char* tool = "ecosconfig";
 
--- a/host/tools/configtool/standalone/wxwin/configitem.cpp
+++ b/host/tools/configtool/standalone/wxwin/configitem.cpp
@@ -1,7 +1,7 @@
 // ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
 // -------------------------------------------                              
 // This file is part of the eCos host tools.                                
-// Copyright (C) 1998, 1999, 2000, 2006, 2008 Free Software Foundation, Inc.
+// Copyright (C) 1998, 1999, 2000, 2006, 2008, 2009 Free Software Foundation, Inc.
 //
 // This program is free software; you can redistribute it and/or modify     
 // it under the terms of the GNU General Public License as published by     
@@ -24,8 +24,8 @@
 //===========================================================================
 //#####DESCRIPTIONBEGIN####
 //
-// Author(s):   julians
-// Contact(s):  julians
+// Author(s):   julians, jld
+// Contact(s):  julians, jld
 // Date:        2000/09/01
 // Version:     $Id: configitem.cpp,v 1.10 2001/04/30 17:12:32 julians Exp $
 // Purpose:
@@ -129,6 +129,7 @@ ecConfigItem::ecConfigItem(ecConfigItem*
     m_optionFlavor = ecFlavorNone;
     m_enabled = FALSE;
     m_active = FALSE;
+    m_modifiable = FALSE;
     m_parent = parent;
     m_CdlItem = vitem;
     m_hint = ecHintNone;
@@ -220,6 +221,7 @@ bool ecConfigItem::ConvertFromCdl()
 
     m_active = IsActive();
     m_enabled = IsEnabled();
+    m_modifiable = IsModifiable();
 
     return TRUE;
 }
@@ -328,7 +330,7 @@ bool ecConfigItem::UpdateTreeItem(ecConf
 
     if (!iconName.IsEmpty())
     {
-        int iconId = treeCtrl.GetIconDB().GetIconId(iconName, iconState, GetActive());
+        int iconId = treeCtrl.GetIconDB().GetIconId(iconName, iconState, GetModifiable());
         treeCtrl.SetItemImage(m_treeItem, iconId, wxTreeItemIcon_Normal);
         treeCtrl.SetItemImage(m_treeItem, iconId, wxTreeItemIcon_Selected);
     }
@@ -348,7 +350,7 @@ void ecConfigItem::OnIconLeftDown(ecConf
     case ecFlavorBool:
     case ecFlavorBoolData:
         {
-            if (GetActive())
+            if (GetModifiable())
             {
                 wxGetApp().GetConfigToolDoc()->SetEnabled(*this, !m_enabled);
             }
@@ -356,7 +358,7 @@ void ecConfigItem::OnIconLeftDown(ecConf
         }
     case ecFlavorData:
         {
-            if (GetActive())
+            if (GetModifiable())
             {
                 switch (GetOptionType())
                 {
@@ -499,7 +501,7 @@ wxString ecConfigItem::GetDisplayValue()
 // Can we start editing this item?
 bool ecConfigItem::CanEdit() const
 {
-    if (!GetActive())
+    if (!GetModifiable())
         return FALSE;
 
     if (GetConfigType() != ecOption)
@@ -938,13 +940,24 @@ bool ecConfigItem::IsEnabled() const
     return NULL==valuable ||valuable->is_enabled();
 }
 
+bool ecConfigItem::IsModifiable() const
+{
+    const CdlValuable valuable = GetCdlValuable();
+    if (valuable && ((GetOptionType() != ecOptionTypeNone) || HasBool()))
+    {
+        return (valuable->is_modifiable () && valuable->is_active ());
+    }
+    else
+        return GetCdlItem()->is_active();
+}
+
 bool ecConfigItem::IsActive() const
 {
 //    return GetCdlItem()->is_active();
     const CdlValuable valuable = GetCdlValuable();
     if (valuable && ((GetOptionType() != ecOptionTypeNone) || HasBool()))
     {
-        return (valuable->is_modifiable () && valuable->is_active ());
+        return (valuable->is_active ());
     }
     else
         return GetCdlItem()->is_active();
--- a/host/tools/configtool/standalone/wxwin/configitem.h
+++ b/host/tools/configtool/standalone/wxwin/configitem.h
@@ -1,7 +1,7 @@
 // ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
 // -------------------------------------------                              
 // This file is part of the eCos host tools.                                
-// Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.            
+// Copyright (C) 1998, 1999, 2000, 2009 Free Software Foundation, Inc.            
 //
 // This program is free software; you can redistribute it and/or modify     
 // it under the terms of the GNU General Public License as published by     
@@ -24,8 +24,8 @@
 //===========================================================================
 //#####DESCRIPTIONBEGIN####
 //
-// Author(s):   julians
-// Contact(s):  julians
+// Author(s):   julians, jld
+// Contact(s):  julians, jld
 // Date:        2000/09/01
 // Version:     $Id: configitem.h,v 1.4 2001/04/09 12:51:34 julians Exp $
 // Purpose:
@@ -174,7 +174,11 @@ public:
     void SetEnabled(bool enabled) { m_enabled = enabled; }
     bool GetEnabled() const { return m_enabled; }
 
-    // Whether greyed out or not
+    // Whether value and icon greyed out or not
+    void SetModifiable(bool modifiable) { m_modifiable = modifiable; }
+    bool GetModifiable() const { return m_modifiable; }
+
+    // Whether tree item text greyed out or not
     void SetActive(bool active) { m_active = active; }
     bool GetActive() const { return m_active; }
 
@@ -236,6 +240,7 @@ public:
     bool HasModifiedChildren() const;
     bool IsEnabled() const;
     bool IsActive() const; // Added JACS
+    bool IsModifiable() const;
 
     bool Modified() const;
 
@@ -278,6 +283,7 @@ protected:
     wxString            m_macro;
     bool                m_enabled;
     bool                m_active;
+    bool                m_modifiable;
     ecConfigType        m_configType;
     ecOptionType        m_optionType;
     ecOptionFlavor      m_optionFlavor;
--- a/host/tools/configtool/standalone/wxwin/configtool.cpp
+++ b/host/tools/configtool/standalone/wxwin/configtool.cpp
@@ -1,7 +1,7 @@
 // ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
 // -------------------------------------------                              
 // This file is part of the eCos host tools.                                
-// Copyright (C) 1998, 1999, 2000, 2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
+// Copyright (C) 1998, 1999, 2000, 2003, 2004, 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
 //
 // This program is free software; you can redistribute it and/or modify     
 // it under the terms of the GNU General Public License as published by     
@@ -284,7 +284,7 @@ bool ecApp::OnInit()
         wxLog::SetActiveTarget(new wxLogStderr);
 #endif
         wxString msg;
-        msg.Printf(wxT("eCos Configuration Tool (c) Free Software Foundation, Inc., 1998-2008 Version %s, %s"), ecCONFIGURATION_TOOL_VERSION, __DATE__);
+        msg.Printf(wxT("eCos Configuration Tool (c) Free Software Foundation, Inc., 1998-2009 Version %s, %s"), ecCONFIGURATION_TOOL_VERSION, __DATE__);
         wxLogMessage(msg);
         return FALSE;
     }
--- a/host/tools/configtool/standalone/wxwin/configtooldoc.cpp
+++ b/host/tools/configtool/standalone/wxwin/configtooldoc.cpp
@@ -1,7 +1,7 @@
 // ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
 // -------------------------------------------                              
 // This file is part of the eCos host tools.                                
-// Copyright (C) 1998, 1999, 2000, 2003, 2005, 2006, 2008 Free Software Foundation, Inc.
+// Copyright (C) 1998, 1999, 2000, 2003, 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
 //
 // This program is free software; you can redistribute it and/or modify     
 // it under the terms of the GNU General Public License as published by     
@@ -1386,6 +1386,7 @@ bool ecConfigToolDoc::ShowURL(const wxSt
         break;
     case ecAssociatedExternal:
         {
+            QualifyDocURL(strURL, FALSE);
             rc = ShowExternalHtmlHelp(strURL);
         }
 
@@ -1406,7 +1407,11 @@ bool ecConfigToolDoc::ShowExternalHtmlHe
 
     wxString url;
 
+#ifdef __WXMSW__
+    wxString sep(wxT("\\"));
+#else
     wxString sep(wxFILE_SEP_PATH);
+#endif
     wxString docDir(wxString(m_strRepository) + sep + wxString(wxT("doc")));
     if (wxDirExists(docDir + sep + wxT("html")))
         docDir += sep + wxT("html") ;
--- a/host/tools/configtool/standalone/wxwin/configtree.cpp
+++ b/host/tools/configtool/standalone/wxwin/configtree.cpp
@@ -1,7 +1,7 @@
 // ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
 // -------------------------------------------                              
 // This file is part of the eCos host tools.                                
-// Copyright (C) 1998, 1999, 2000, 2008 Free Software Foundation, Inc.      
+// Copyright (C) 1998, 1999, 2000, 2008, 2009 Free Software Foundation, Inc.      
 //
 // This program is free software; you can redistribute it and/or modify     
 // it under the terms of the GNU General Public License as published by     
@@ -24,8 +24,8 @@
 //===========================================================================
 //#####DESCRIPTIONBEGIN####
 //
-// Author(s):   julians
-// Contact(s):  julians
+// Author(s):   julians, jld
+// Contact(s):  julians, jld
 // Date:        2000/08/24
 // Version:     $Id: configtree.cpp,v 1.8 2001/04/24 14:39:13 julians Exp $
 // Purpose:
@@ -436,7 +436,7 @@ void ecValueWindow::DrawItem(wxDC& dc, w
         static wxColour normalColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOWTEXT);
         static wxColour disabledColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_GRAYTEXT);
 #endif
-        dc.SetTextForeground( (item->GetActive() && (item->GetConfigType() != ecPackage)) ? normalColour : disabledColour );
+        dc.SetTextForeground( (item->GetModifiable() && (item->GetConfigType() != ecPackage)) ? normalColour : disabledColour );
         
         int textW, textH;
         dc.GetTextExtent(text, & textW, & textH);
--- a/host/tools/configtool/standalone/wxwin/conflictwin.cpp
+++ b/host/tools/configtool/standalone/wxwin/conflictwin.cpp
@@ -1,7 +1,7 @@
 // ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
 // -------------------------------------------                              
 // This file is part of the eCos host tools.                                
-// Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.            
+// Copyright (C) 1998, 1999, 2000, 2009 Free Software Foundation, Inc.            
 //
 // This program is free software; you can redistribute it and/or modify     
 // it under the terms of the GNU General Public License as published by     
@@ -24,7 +24,7 @@
 //===========================================================================
 //#####DESCRIPTIONBEGIN####
 //
-// Author(s):   julians
+// Author(s):   julians, jld
 // Contact(s):  julians
 // Date:        2000/09/04
 // Version:     $Id: conflictwin.cpp,v 1.3 2001/04/24 14:39:13 julians Exp $
@@ -89,7 +89,7 @@ ecConflictListCtrl::ecConflictListCtrl(w
 
     InsertColumn(0, "Item", wxLIST_FORMAT_LEFT, 200);
     InsertColumn(1, "Conflict", wxLIST_FORMAT_LEFT, 80);
-    InsertColumn(2, "Property", wxLIST_FORMAT_LEFT, 200);
+    InsertColumn(2, "Property", wxLIST_FORMAT_LEFT, 100);
 
     m_contextMenu = new wxMenu;
     m_contextMenu->Append(ecID_WHATS_THIS, _("&What's This?"));
@@ -226,6 +226,9 @@ void ecConflictListCtrl::AddConflicts (c
     for (std::list<CdlConflict>::const_iterator conf_i=conflicts.begin (); conf_i != conflicts.end (); conf_i++) {
         AddConflict(*conf_i);
     }
+    SetColumnWidth(2, wxLIST_AUTOSIZE); // resize the property column for the longest item
+    if (GetColumnWidth(2) < 100)        // but at least wide enough for the column heading
+        SetColumnWidth(2, 100);
 }
 
 ecConfigItem *ecConflictListCtrl::AssociatedItem(int nRow,int nCol)
--- a/host/tools/configtool/standalone/wxwin/filename.cpp
+++ b/host/tools/configtool/standalone/wxwin/filename.cpp
@@ -1,7 +1,7 @@
 // ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
 // -------------------------------------------                              
 // This file is part of the eCos host tools.                                
-// Copyright (C) 1998, 1999, 2000, 2003, 2005 Free Software Foundation, Inc.
+// Copyright (C) 1998, 1999, 2000, 2003, 2005, 2009 Free Software Foundation, Inc.
 //
 // This program is free software; you can redistribute it and/or modify     
 // it under the terms of the GNU General Public License as published by     
@@ -73,7 +73,12 @@
 
 #define wxTChar wxT
 
+#ifdef __WXMSW__
+const wxChar ecFileName::cSep=wxT('\\');
+#else
 const wxChar ecFileName::cSep=wxFILE_SEP_PATH;
+#endif
+
 
 ecFileName::ecFileName(const wxChar* psz1,const wxChar* psz2):
 wxString(psz1)
--- a/host/tools/configtool/standalone/wxwin/mainwin.cpp
+++ b/host/tools/configtool/standalone/wxwin/mainwin.cpp
@@ -1,7 +1,7 @@
 // ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
 // -------------------------------------------                              
 // This file is part of the eCos host tools.                                
-// Copyright (C) 1998, 1999, 2000, 2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
+// Copyright (C) 1998, 1999, 2000, 2003, 2004, 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
 //
 // This program is free software; you can redistribute it and/or modify     
 // it under the terms of the GNU General Public License as published by     
@@ -404,7 +404,7 @@ ecMainFrame::ecMainFrame(wxDocManager *m
 #endif
     
     int* widths = new int[4];
-    widths[0] = -1; widths[1] = 100; widths[2] = 40; widths[3] = 80;
+    widths[0] = -1; widths[1] = 100; widths[2] = 40; widths[3] = 100;
     SetStatusWidths(4, widths);
     delete[] widths;
     
@@ -571,7 +571,7 @@ void ecMainFrame::OnAbout(wxCommandEvent
 	int iTclVerMajor, iTclVerMinor, iTclVerPatchLevel;
 	Tcl_GetVersion (&iTclVerMajor, &iTclVerMinor, &iTclVerPatchLevel, NULL);
 	msg.Printf("eCos Configuration Tool %s (%s %s)\n\n"
-		"Copyright (c) Free Software Foundation, Inc. 1998-2008\n\n"
+		"Copyright (c) Free Software Foundation, Inc. 1998-2009\n\n"
 		"Using %s %s and Tcl %d.%d.%d",
 		ecCONFIGURATION_TOOL_VERSION, __DATE__, __TIME__,
 		wxPlatformInfo::Get().GetPortIdName().c_str(), wxVERSION_NUM_DOT_STRING,
--- a/host/tools/configtool/standalone/wxwin/propertywin.cpp
+++ b/host/tools/configtool/standalone/wxwin/propertywin.cpp
@@ -1,7 +1,7 @@
 // ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
 // -------------------------------------------                              
 // This file is part of the eCos host tools.                                
-// Copyright (C) 1998, 1999, 2000, 2008 Free Software Foundation, Inc.      
+// Copyright (C) 1998, 1999, 2000, 2008, 2009 Free Software Foundation, Inc.      
 //
 // This program is free software; you can redistribute it and/or modify     
 // it under the terms of the GNU General Public License as published by     
@@ -24,7 +24,7 @@
 //===========================================================================
 //#####DESCRIPTIONBEGIN####
 //
-// Author(s):   julians
+// Author(s):   julians, jld
 // Contact(s):  julians
 // Date:        2000/09/04
 // Version:     $Id: propertywin.cpp,v 1.7 2001/04/24 14:39:13 julians Exp $
@@ -187,7 +187,7 @@ void ecPropertyListCtrl::OnRightClick(wx
 void ecPropertyListCtrl::AddColumns()
 {
     InsertColumn(0, "Property", wxLIST_FORMAT_LEFT, 100);
-    InsertColumn(1, "Value", wxLIST_FORMAT_LEFT, 300);
+    InsertColumn(1, "Value", wxLIST_FORMAT_LEFT, 100);
 }
 
 void ecPropertyListCtrl::Fill(ecConfigItem *pti)
@@ -319,6 +319,10 @@ void ecPropertyListCtrl::Fill(ecConfigIt
 #endif
     }
 
+    SetColumnWidth(1, wxLIST_AUTOSIZE); // resize the value column for the longest item
+    if (GetColumnWidth(1) < 100)        // but at least wide enough for the column heading
+        SetColumnWidth(1, 100);
+
     Refresh();
 }