# HG changeset patch # User jld # Date 1218620227 0 # Node ID 24c0267fbb705d4f423dd96707699dd0f6730699 # Parent d5dc1a18597440f548e0203fd7fdb30864251924 * Utils/ChangeLog Utils/common/eCosStd.h, configtool/ChangeLog configtool/common/common/build.cxx, configtool/standalone/common/cdl_exec.cxx, configtool/standalone/common/ecosconfig.cxx, configtool/standalone/wxwin/appsettings.cpp, configtool/standalone/wxwin/configitem.cpp, configtool/standalone/wxwin/configtool.cpp, configtool/standalone/wxwin/configtool.h, configtool/standalone/wxwin/configtooldoc.cpp, configtool/standalone/wxwin/configtree.cpp, configtool/standalone/wxwin/configtree.h, configtool/standalone/wxwin/docsystem.cpp, configtool/standalone/wxwin/ecutils.cpp, configtool/standalone/wxwin/filename.cpp, configtool/standalone/wxwin/mainwin.cpp, configtool/standalone/wxwin/mainwin.h, configtool/standalone/wxwin/makefile.gnu, configtool/standalone/wxwin/packagesdlg.cpp, configtool/standalone/wxwin/propertywin.cpp, configtool/standalone/wxwin/reposdlg.cpp, configtool/standalone/wxwin/runtestsdlg.cpp, configtool/standalone/wxwin/sectiondlg.cpp, configtool/standalone/wxwin/settingsdlg.cpp, configtool/standalone/wxwin/symbols.h, ecostest/ChangeLog, ecostest/common/eCosTestUtils.cpp, ecostest/common/eCosTestUtils.h: Update for recent Cygwin and wxWidgets. diff --git a/host/tools/configtool/ChangeLog b/host/tools/configtool/ChangeLog --- a/host/tools/configtool/ChangeLog +++ b/host/tools/configtool/ChangeLog @@ -1,3 +1,36 @@ +2008-08-13 John Dallaway + + * standalone/wxwin/configitem.cpp: Fix assert on ecDoubleEditorCtrl + option type. Initialise wxSpinCtrl with valid integer value. Do not + end editing when clicking within value window. + + * standalone/wxwin/configtool.cpp: Move Tcl and wxMenu initialisation + from class contructor to OnInit() method for compatibility with recent + wxWidgets. Tweak host tool directory path calculation for compatibility + with recent wxWidgets under Cygwin. + + * standalone/wxwin/configtooldoc.cpp: Suppress copying of MLT files. + + * standalone/wxwin/configtree.cpp: Always end editing when clicking + elsewhere in the value window. + + * standalone/wxwin/configtree.cpp, standalone/wxwin/configtree.h: Do + not handle EVT_PAINT, EVT_TREE_ITEM_EXPANDED and EVT_TREE_ITEM_COLLAPSED + events unless strictly necessary. + + * standalone/wxwin/settingsdlg.cpp: Use GetClientSize() to size the + wxNotebook. + + * standalone/wxwin/appsettings.cpp: Use the internal documentation + browser by default. + +2008-03-25 John Dallaway + + * standalone/wxwin/ecutils.cpp: Use PATH_MAX instead of MAXPATHLEN + for compatibility with recent Cygwin headers. + * standalone/wxwin/appsettings.cpp: Omit hardware packages in the + packages dialog and use TCP port 9000 for remote debugging by default. + 2008-03-03 John Dallaway * standalone/wxwin/configitem.cpp: Do not delete the package item @@ -11,6 +44,20 @@ 2008-02-11 John Dallaway + + * standalone/wxwin/configtree.cpp: Disable "Unload Package" context + menu item for hardware packages. [ Bugzilla 1000260 ] + + * standalone/wxwin/propertywin.cpp: Fix presentation of multiple + properties of the same type. + +2008-01-30 John Dallaway + + * standalone/wxwin/mainwin.cpp: Disable the horizontal scroll bar + in the configuration tree on Windows to avoid infinite redraw of + scroll bars. + 2007-10-25 Gary Thomas * standalone/wxwin/propertywin.h: Remove class qualifier - not @@ -21,11 +68,21 @@ 2006-09-06 John Dallaway + + * standalone/wxwin/configtool.h, standalone/wxwin/configtool.cpp: + Eliminate ecApp::CygMount() and ecApp::CygMountText(). + 2006-07-11 John Dallaway * standalone/wxwin/configtool.cpp: Workaround an exception handling issue with Cygwin 1.5.20. +2006-07-10 Bart Veer + + * standalone/common/ecosconfig.cxx: add early C++ exception throw to + work around a cygwin issue. + 2006-05-01 Andy Jackson * standalone/wxwin/admindlg.cpp, @@ -54,11 +111,75 @@ 2006-05-01 Andy Jackson + + * standalone/wxwin/docsystem.cpp (IndexDocs): Revert workaround for + HTML indexing bug in WxGTK 2.4.0. Indexer apparently OK in WxGTK 2.4.2. + +2006-01-16 John Dallaway + + * standalone/wxwin/reposdlg.cpp: "Default package" relabelled + to "Packages template". + * configtool/standalone/wxwin/mainwin.cpp: Update copyright notice. + +2005-11-04 John Dallaway + + * common/common/build.cxx, + standalone/common/cdl_exec.cxx, + standalone/common/ecosconfig.cxx, + standalone/wxwin/configtool.cpp, + standalone/wxwin/configtooldoc.cpp, + standalone/wxwin/filename.cpp: Eliminate /ecos-x text mode + mount points which are no longer necessary with modern GNU + tools and rationalise the conversion of DOS file paths to + POSIX-style paths. + +2005-07-11 John Dallaway + + * standalone/wxwin/configtool.cpp: Remove "tty" from CYGWIN + environment variable if present. It causes ecosadmin.tcl to + report failure when adding new packages. + 2005-07-09 Bart Veer * common/common/build.cxx: add support for C++ files that use a .cpp suffix +2005-06-15 John Dallaway + + * standalone/wxwin/appsettings.cpp: Implement "make -j" on + Linux hosts. + +2005-06-10 John Dallaway + + * standalone/wxwin/makefile.gnu: Build for Cygwin using the + "-D__USE_W32_SOCKETS" compiler switch. + +2005-06-03 John Dallaway + + * standalone/wxwin/settingsdlg.cpp: Use "/dev/ttyS*" notation + for serial port names and a combo box to accommodate non- + standard names. + + * standalone/wxwin/appsettings.cpp: Use "/dev/ttyS0" as default + serial port name. + +2005-05-23 John Dallaway + + * standalone/wxwin/configtooldoc.cpp (AddAllItems): Call + DeleteItems() to clear down the items list before regenerating + the list of items. + +2005-04-27 John Dallaway + + * standalone/wxwin/packagesdlg.cpp: Use an EVT_CHOICE handler for + ecID_PACKAGES_DIALOG_VERSION. + +2004-12-03 John Dallaway + + * standalone/wxwin/docsystem.cpp: Add the RedBoot User's Guide to + the generated index. + 2004-01-16 John Dallaway * configtool/standalone/wxwin/configtool.cpp: Prompt to save eCos diff --git a/host/tools/configtool/common/common/build.cxx b/host/tools/configtool/common/common/build.cxx --- a/host/tools/configtool/common/common/build.cxx +++ b/host/tools/configtool/common/common/build.cxx @@ -3,6 +3,7 @@ // ---------------------------------------------------------------------------- // Copyright (C) 2003 Bart Veer // Copyright (C) 1998, 1999, 2000, 2002 Red Hat, Inc. +// Copyright (C) 2005 eCosCentric Limited // // This program is part of the eCos host tools. // @@ -58,11 +59,11 @@ #include "build.hxx" // Two methods of generating Cygwin filenames -// ECOS_USE_CYGDRIVE = 0: use e.g. //c/, but this is deprecated in new versions of Cygwin +// ECOS_USE_CYGDRIVE = 0: use cygwin_conv_to_posix_path() - Cygwin-hosted builds only // ECOS_USE_CYGDRIVE = 1: use e.g. /cygdrive/c/ // ECOS_USE_CYGDRIVE = 2: use e.g. c:/ notation // ECOS_USE_CYGDRIVE = 3: use e.g. /ecos-x notation where x is a drive name. -#define ECOS_USE_CYGDRIVE 3 +#define ECOS_USE_CYGDRIVE 0 // Use registry functions to find out location of /cygdrive #define ECOS_USE_REGISTRY 1 @@ -162,10 +163,8 @@ std::string cygpath (const std::string i const std::string path = nospace_path (input); std::string output; - // convert the DOS filepath to Cygwin notation - using Cygwin if available - // 2001-10-15: should now do the same thing under Cygwin as under VC++, namely - // use the /ecos-x form. -#if 0 // def __CYGWIN__ + // convert the DOS filepath to Cygwin notation using Cygwin if available +#if defined(__CYGWIN__) && (ECOS_USE_CYGDRIVE == 0) char buffer [MAX_PATH + 1]; cygwin_conv_to_posix_path (path.c_str (), buffer); output = buffer; @@ -271,15 +270,7 @@ std::string cygpath (const std::string i // create a directory bool create_directory (const std::string directory) { -// We take advantage of wxWindows' recursive wxFileName::Mkdir function -// to workaround a bug in Tcl on Windows 9x -#if defined(__WXMSW__) - if (wxDirExists(directory.c_str())) - return TRUE; - return wxFileName::Mkdir(directory.c_str(), 0777, TRUE); -#else return eval_tcl_command ("file mkdir \"" + directory + "\""); -#endif } // copy a file @@ -375,7 +366,7 @@ bool generate_makefile (const CdlConfigu fprintf (stream, makefile_header.c_str ()); // generate the global variables - fprintf (stream, "export PREFIX := %s\n", cygpath (install_tree).c_str ()); + fprintf (stream, "export PREFIX := %s\n", install_tree.c_str ()); fprintf (stream, "export COMMAND_PREFIX := %s\n", command_prefix.c_str ()); fprintf (stream, "export CC := $(COMMAND_PREFIX)gcc\n"); fprintf (stream, "export OBJCOPY := $(COMMAND_PREFIX)objcopy\n"); @@ -390,7 +381,7 @@ bool generate_makefile (const CdlConfigu #if ECOS_USE_CYGDRIVE == 1 fprintf (stream, "export REPOSITORY := %s\n", cygpath (nativepath (info.repository)).c_str()); // double conversion to force /cygdrive/c format #else - fprintf (stream, "export REPOSITORY := %s\n", cygpath (info.repository).c_str()); + fprintf (stream, "export REPOSITORY := %s\n", info.repository.c_str()); #endif fprintf (stream, "PACKAGE := %s\n", info.directory.c_str ()); fprintf (stream, "OBJECT_PREFIX := %s\n", object_prefix.c_str ()); @@ -548,7 +539,7 @@ bool generate_toplevel_makefile (const C #else fprintf (stream, "export HOST := UNIX\n"); #endif - fprintf (stream, "export PREFIX := %s\n", cygpath (install_tree).c_str ()); + fprintf (stream, "export PREFIX := %s\n", install_tree.c_str ()); fprintf (stream, "export COMMAND_PREFIX := %s\n", command_prefix.c_str ()); fprintf (stream, "export CC := $(COMMAND_PREFIX)gcc\n"); fprintf (stream, "export OBJCOPY := $(COMMAND_PREFIX)objcopy\n"); diff --git a/host/tools/configtool/standalone/common/cdl_exec.cxx b/host/tools/configtool/standalone/common/cdl_exec.cxx --- a/host/tools/configtool/standalone/common/cdl_exec.cxx +++ b/host/tools/configtool/standalone/common/cdl_exec.cxx @@ -1,6 +1,7 @@ //####COPYRIGHTBEGIN#### // // ---------------------------------------------------------------------------- +// Copyright (C) 2005 eCosCentric Limited // Copyright (C) 2005 Bart Veer // Copyright (C) 2003 John Dallaway // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. @@ -486,46 +487,9 @@ cdl_exec::cmd_tree () char cwd [PATH_MAX + 1]; #endif getcwd (cwd, sizeof cwd); -#ifdef __CYGWIN__ - char cwd_win32 [MAXPATHLEN + 1]; - cygwin_conv_to_win32_path (cwd, cwd_win32); - generate_build_tree (config, cwd_win32, install_prefix); -#else generate_build_tree (config, cwd, install_prefix); -#endif config->generate_config_headers (install_prefix.empty () ? "install/include/pkgconf" : install_prefix + "/include/pkgconf"); status = true; -#ifdef __CYGWIN__ - char buf[100]; - strcpy(buf, "mount.exe -f -t -u x: /ecos-x"); - //printf("Cwd_win32: %s\n", cwd_win32); - - if ( cwd_win32[1] == ':' ) - { - buf[19] = tolower(cwd_win32[0]); - buf[28] = tolower(cwd_win32[0]); - system(buf); - } - - //printf("Repository: %s\n", repository.c_str()); - - if ( repository[1] == ':' ) - { - buf[19] = tolower(repository[0]); - buf[28] = tolower(repository[0]); - system(buf); - } - if ( !install_prefix.empty() ) - { - //printf("Install prefix: %s\n", install_prefix.c_str()); - if ( install_prefix[1] == ':' ) - { - buf[19] = tolower(install_prefix[0]); - buf[28] = tolower(install_prefix[0]); - system(buf); - } - } -#endif } else { printf("\nUnable to generate build tree, this configuration still contains conflicts.\n"); printf("Either resolve the conflicts or use --ignore-errors\n"); diff --git a/host/tools/configtool/standalone/common/ecosconfig.cxx b/host/tools/configtool/standalone/common/ecosconfig.cxx --- a/host/tools/configtool/standalone/common/ecosconfig.cxx +++ b/host/tools/configtool/standalone/common/ecosconfig.cxx @@ -53,7 +53,7 @@ #include "ecosconfig.hxx" #define TOOL_VERSION "2.net" -#define TOOL_COPYRIGHT "Copyright (c) 2002 Red Hat, Inc.\nCopyright (c) 2004-2006 eCosCentric Limited" +#define TOOL_COPYRIGHT "Copyright (c) 2002 Red Hat, Inc.\nCopyright (c) 2004-2008 eCosCentric Limited" #define DEFAULT_SAVE_FILE "ecos.ecc" static char* tool = "ecosconfig"; diff --git a/host/tools/configtool/standalone/wxwin/appsettings.cpp b/host/tools/configtool/standalone/wxwin/appsettings.cpp --- a/host/tools/configtool/standalone/wxwin/appsettings.cpp +++ b/host/tools/configtool/standalone/wxwin/appsettings.cpp @@ -3,6 +3,7 @@ // ---------------------------------------------------------------------------- // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. // Copyright (C) 2003 John Dallaway +// Copyright (C) 2005, 2006, 2008 eCosCentric Limited // // This program is part of the eCos host tools. // @@ -70,7 +71,6 @@ #include "outputwin.h" #include "shortdescrwin.h" #include "mainwin.h" -#include "filename.h" // For SystemInfo #ifdef __WXMSW__ @@ -115,7 +115,7 @@ ecSettings::ecSettings() m_bUseCustomViewer = FALSE; m_bUseExternalBrowser = FALSE; - m_eUseCustomBrowser = ecAssociatedExternal; + m_eUseCustomBrowser = ecInternal; m_bHex = FALSE; m_nRuleChecking = Immediate|Deferred|SuggestFixes ; @@ -134,7 +134,7 @@ ecSettings::ecSettings() m_editSaveFileOnly = FALSE; // Packages dialog settings - m_omitHardwarePackages = FALSE; + m_omitHardwarePackages = TRUE; m_matchPackageNamesExactly = FALSE; } @@ -357,6 +357,10 @@ bool ecSettings::LoadConfig() SYSTEM_INFO SystemInfo; GetSystemInfo(&SystemInfo); m_strMakeOptions.Printf(_T("-j%d"),SystemInfo.dwNumberOfProcessors); +#else + long lProcessors; + lProcessors = sysconf(_SC_NPROCESSORS_ONLN); + m_strMakeOptions.Printf(_T("-j%ld"),lProcessors < 1 ? 1l : lProcessors); #endif } @@ -910,9 +914,9 @@ ecRunTestsSettings::ecRunTestsSettings() m_nDownloadTimeoutType(TIMEOUT_SPECIFIED), m_bRemote(FALSE), m_bSerial(TRUE), - m_strPort(wxT("COM1")), + m_strPort(wxT("/dev/ttyS0")), m_nBaud(38400), - m_nLocalTCPIPPort(1), + m_nLocalTCPIPPort(9000), m_nReset(RESET_MANUAL), m_nResourcePort(1), m_nRemotePort(1), diff --git a/host/tools/configtool/standalone/wxwin/configitem.cpp b/host/tools/configtool/standalone/wxwin/configitem.cpp --- a/host/tools/configtool/standalone/wxwin/configitem.cpp +++ b/host/tools/configtool/standalone/wxwin/configitem.cpp @@ -617,7 +617,7 @@ bool ecConfigItem::TransferDataFromWindo { ecDoubleEditorCtrl* win = (ecDoubleEditorCtrl*) window; - wxASSERT ( GetOptionType() == ecString ); + wxASSERT ( GetOptionType() == ecDouble ); // TODO: do checking doc->SetValue(*this, atof(win->GetValue())); @@ -1426,7 +1426,7 @@ IMPLEMENT_CLASS(ecIntegerEditorCtrl, wxS ecIntegerEditorCtrl::ecIntegerEditorCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style): - wxSpinCtrl(parent, id, wxEmptyString, pos, size, style, INT_MIN, INT_MAX, 0) + wxSpinCtrl(parent, id, "0", pos, size, style, INT_MIN, INT_MAX, 0) { } @@ -1473,8 +1473,14 @@ void ecEnumEditorCtrl::OnChar(wxKeyEvent void ecEnumEditorCtrl::OnKillFocus(wxFocusEvent& event) { - ecValueWindow* parent = (ecValueWindow*) GetParent(); - parent->EndEditing(); + /* event may result from drop down of menu on wxGTK so + check that the mouse is outside the window */ + wxPoint mouse = ScreenToClient(::wxGetMousePosition()); + wxSize size = GetSize(); + if (mouse.x < 0 || mouse.x > size.x || mouse.y < 0 || mouse.y > size.y) { + ecValueWindow* parent = (ecValueWindow*) GetParent(); + parent->EndEditing(); + } } /* @@ -1510,7 +1516,7 @@ ecEditStringDialog::~ecEditStringDialog( void ecEditStringDialog::OnOK(wxCommandEvent& event) { - wxDialog::OnOK(event); + event.Skip(); } //// Operations diff --git a/host/tools/configtool/standalone/wxwin/configtool.cpp b/host/tools/configtool/standalone/wxwin/configtool.cpp --- a/host/tools/configtool/standalone/wxwin/configtool.cpp +++ b/host/tools/configtool/standalone/wxwin/configtool.cpp @@ -3,7 +3,7 @@ // ---------------------------------------------------------------------------- // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. // Copyright (C) 2003 John Dallaway -// Copyright (C) 2004, 2005, 2006 eCosCentric Limited +// Copyright (C) 2004, 2005, 2006, 2008 eCosCentric Limited // // This program is part of the eCos host tools. // @@ -138,17 +138,11 @@ ecApp::ecApp() m_docManager = NULL; m_mainFrame = NULL; m_currentDoc = NULL; - m_whatsThisMenu = new wxMenu; - m_whatsThisMenu->Append(ecID_WHATS_THIS, _("&What's This?")); m_helpFile = wxEmptyString; m_splashScreen = NULL; m_pipedProcess = NULL; m_valuesLocked = 0; m_helpController = NULL; - m_fileSystem = new wxFileSystem; -#if wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB - m_zipHandler = new wxZipFSHandler; -#endif } ecApp::~ecApp() @@ -167,8 +161,19 @@ bool ecApp::OnInit() } catch(...) { }; #endif + // Mandatory initialisation for Tcl 8.4 + Tcl_FindExecutable(argv[0]); + wxLog::SetTimestamp(NULL); + m_whatsThisMenu = new wxMenu; + m_whatsThisMenu->Append(ecID_WHATS_THIS, _("&What's This?")); + + m_fileSystem = new wxFileSystem; +#if wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB + m_zipHandler = new wxZipFSHandler; +#endif + wxHelpProvider::Set(new wxSimpleHelpProvider); //wxHelpProvider::Set(new wxHelpControllerHelpProvider(& m_helpController)); @@ -180,9 +185,6 @@ bool ecApp::OnInit() wxFileSystem::AddHandler(m_zipHandler); #endif - // Mandatory initialisation for Tcl 8.4 - Tcl_FindExecutable(argv[0]); - wxString currentDir = wxGetCwd(); // Use argv to get current app directory @@ -228,6 +230,16 @@ bool ecApp::OnInit() // Windows resources or plain files LoadResources(); + // remove "tty" from CYGWIN environment variable to allow correct + // execution of cygwin command-line tools from this application +#ifdef __WXMSW__ + wxString strCygwin = wxGetenv(wxT("CYGWIN")); + strCygwin = wxT(" ") + strCygwin; + strCygwin.Replace(wxT(" tty"), wxEmptyString); + strCygwin.Trim(false); + wxSetEnv(wxT("CYGWIN"), strCygwin); +#endif + wxGetEnv(wxT("PATH"), & m_strOriginalPath); // Create a document manager @@ -607,7 +619,7 @@ bool ecApp::LoadBitmapResource(wxBitmap& #endif if (!bitmap.Ok() && wxFileExists(GetFullAppPath(filename))) - bitmap.LoadFile(GetFullAppPath(filename), bitmapType); + bitmap.LoadFile(GetFullAppPath(filename), (wxBitmapType) bitmapType); if (bitmap.Ok() && addToMemoryFS) @@ -1129,8 +1141,8 @@ bool ecApp::PrepareEnvironment(bool bWit if ( !strUserBinDir.IsEmpty() ) { // calculate the directory of the host tools from this application's module name - ecFileName strHostToolsBinDir(this->argv[0]); - strHostToolsBinDir = strHostToolsBinDir.Head (); + const wxFileName strConfigtoolFile(this->argv[0]); + const ecFileName strHostToolsBinDir(strConfigtoolFile.GetPath(wxPATH_GET_VOLUME, wxPATH_DOS)); // tools directories are in the order host-tools, user-tools, comp-tools, install/bin (if present), contrib-tools (if present) on the path const ecFileName strContribBinDir(strUserBinDir, wxT("..\\contrib\\bin")); @@ -1169,14 +1181,6 @@ bool ecApp::PrepareEnvironment(bool bWit // Useful for ecosconfig wxSetEnv(wxT("ECOS_REPOSITORY"), pDoc->GetPackagesDir()); - - // Mount /ecos-x so we can access these in text mode - if (! pDoc->GetBuildTree().IsEmpty() && wxIsalpha(pDoc->GetBuildTree()[0])) - CygMount(pDoc->GetBuildTree()[0]); - if (! pDoc->GetInstallTree().IsEmpty() && wxIsalpha(pDoc->GetInstallTree()[0])) - CygMount(pDoc->GetInstallTree()[0]); - if (! pDoc->GetRepository().IsEmpty() && wxIsalpha(pDoc->GetRepository()[0])) - CygMount(pDoc->GetRepository()[0]); } } } @@ -1274,87 +1278,6 @@ bool ecApp::PrepareEnvironment(bool bWit #endif } -void ecApp::CygMount(wxChar c) -{ - // May not be alpha if it's e.g. a UNC network path - if (!wxIsalpha(c)) - return; - - c = wxTolower(c); - - if(!sm_arMounted[c-_TCHAR('a')]) - { - sm_arMounted[c-wxChar('a')]=true; - wxString strCmd; - String strOutput; - - strCmd.Printf(wxT("mount -t -u %c: /ecos-%c"),c,c); - CSubprocess sub; - sub.Run(strOutput,strCmd); - } - - - // Doing it with wxExecute results in a flashing DOS box unfortunately -#if 0 - wxASSERT(wxIsalpha(c)); - c = wxTolower(c); - if(!sm_arMounted[c-wxChar('a')]) - { - sm_arMounted[c-wxChar('a')] = TRUE; - wxString strCmd; - - strCmd.Printf(wxT("mount.exe %c: /%c"),c,c); - - wxExecute(strCmd, TRUE); - } -#endif -} - -// Fiddling directly with the registry DOESN'T WORK because Cygwin mount tables -// get out of synch with the registry -void ecApp::CygMountText(wxChar c) -{ - wxASSERT(wxIsalpha(c)); - c = wxTolower(c); -// if(!sm_arMounted[c-wxChar('a')]) - { -// sm_arMounted[c-wxChar('a')] = TRUE; - -#if 0 - wxString strCmd; - - strCmd.Printf(wxT("mount.exe %c: /ecos-%c"),c,c); - - wxExecute(strCmd, TRUE); -#else - wxString key, value; - key.Printf(wxT("/ecos-%c"), c); - value.Printf(wxT("%c:"), c); - - // Mount by fiddling with registry instead, so we don't see ugly flashing windows -#ifdef __WXMSW__ - HKEY hKey = 0; - if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Cygnus Solutions\\Cygwin\\mounts v2", - 0, KEY_READ, &hKey)) - { - DWORD disposition; - HKEY hSubKey = 0; - - if (ERROR_SUCCESS == RegCreateKeyEx(hKey, key, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, - NULL, & hSubKey, & disposition)) - { - RegSetValueEx(hSubKey, "native", 0, REG_SZ, (unsigned char*) (const wxChar*) value, value.Length() + 1); - RegCloseKey(hSubKey); - } - - RegCloseKey(hKey); - } -#endif - -#endif - } -} - void ecApp::Build(const wxString &strWhat /*=wxT("")*/ ) { if (m_pipedProcess) diff --git a/host/tools/configtool/standalone/wxwin/configtool.h b/host/tools/configtool/standalone/wxwin/configtool.h --- a/host/tools/configtool/standalone/wxwin/configtool.h +++ b/host/tools/configtool/standalone/wxwin/configtool.h @@ -2,6 +2,7 @@ // // ---------------------------------------------------------------------------- // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// Copyright (C) 2005, 2008 eCosCentric Limited // // This program is part of the eCos host tools. // @@ -55,7 +56,7 @@ #include "wx/docview.h" #include "wx/process.h" #include "wx/timer.h" -#include "splittree.h" +#include "wx/gizmos/splittree.h" #include "appsettings.h" @@ -100,7 +101,8 @@ class ecPipedProcess; #define ecUSE_EXPERIMENTAL_CODE 1 #endif -class WXDLLEXPORT wxZipFSHandler; +//class WXDLLEXPORT wxZipFSHandler; +#include "wx/fs_zip.h" class WXDLLEXPORT wxFileSystem; // Define a new application type, each program should derive a class from wxApp @@ -129,11 +131,6 @@ public: // Fire off a subprocess to build the library or tests void Build(const wxString& strWhat = wxEmptyString) ; - // Mount drive e.g. /c - static void CygMount(wxChar c); - // Mount in text mode e.g. /ecos-c - static void CygMountText(wxChar c); - bool InitializeHelpController(); void SetStatusText(const wxString& text, bool clearFailingRulesPane = TRUE); diff --git a/host/tools/configtool/standalone/wxwin/configtooldoc.cpp b/host/tools/configtool/standalone/wxwin/configtooldoc.cpp --- a/host/tools/configtool/standalone/wxwin/configtooldoc.cpp +++ b/host/tools/configtool/standalone/wxwin/configtooldoc.cpp @@ -3,7 +3,7 @@ // ---------------------------------------------------------------------------- // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. // Copyright (C) 2003 John Dallaway -// Copyright (C) 2008 eCosCentric Limited +// Copyright (C) 2005, 2006, 2008 eCosCentric Limited // // This program is part of the eCos host tools. // @@ -319,7 +319,7 @@ bool ecConfigToolDoc::OnSaveDocument(con { // in each case errors already emitted // copy new MLT files to the build tree as necessary - rc=generate_build_tree (GetCdlConfig(), ecUtils::UnicodeToStdStr(m_strBuildTree), ecUtils::UnicodeToStdStr(m_strInstallTree)); + rc=generate_build_tree (GetCdlConfig(), ecUtils::UnicodeToStdStr(m_strBuildTree.CygPath()), ecUtils::UnicodeToStdStr(m_strInstallTree.CygPath())); rc = TRUE; } } @@ -385,7 +385,7 @@ bool ecConfigToolDoc::GenerateBuildTree( { // in each case errors already emitted // copy new MLT files to the build tree as necessary - bool rc = generate_build_tree (GetCdlConfig(), ecUtils::UnicodeToStdStr(m_strBuildTree), ecUtils::UnicodeToStdStr(m_strInstallTree)); + bool rc = generate_build_tree (GetCdlConfig(), ecUtils::UnicodeToStdStr(m_strBuildTree.CygPath()), ecUtils::UnicodeToStdStr(m_strInstallTree.CygPath())); rc = TRUE; } @@ -485,6 +485,7 @@ void ecConfigToolDoc::AddAllItems() wxGetApp().GetMainFrame()->GetPropertyListWindow()->Fill(NULL); treeCtrl->DeleteAllItems(); + DeleteItems(); m_strMemoryLayoutFolder = wxT(""); m_strLinkerScriptFolder = wxT(""); @@ -2071,6 +2072,7 @@ bool ecConfigToolDoc::SaveMemoryMap() bool ecConfigToolDoc::CopyMLTFiles() { +#if ecUSE_MLT wxString sep(wxFILE_SEP_PATH); // copy default MLT files for the selected target/platform from the repository if they do not already exist @@ -2125,6 +2127,9 @@ bool ecConfigToolDoc::CopyMLTFiles() } } return rc; //FIXME +#else + return TRUE; +#endif } const wxString ecConfigToolDoc::CurrentMemoryLayout () diff --git a/host/tools/configtool/standalone/wxwin/configtree.cpp b/host/tools/configtool/standalone/wxwin/configtree.cpp --- a/host/tools/configtool/standalone/wxwin/configtree.cpp +++ b/host/tools/configtool/standalone/wxwin/configtree.cpp @@ -102,12 +102,9 @@ IMPLEMENT_CLASS(ecConfigTreeCtrl, wxRemotelyScrolledTreeCtrl) BEGIN_EVENT_TABLE(ecConfigTreeCtrl, wxRemotelyScrolledTreeCtrl) - EVT_PAINT(ecConfigTreeCtrl::OnPaint) EVT_MOUSE_EVENTS(ecConfigTreeCtrl::OnMouseEvent) EVT_CHAR(ecConfigTreeCtrl::OnKeyDown) EVT_TREE_SEL_CHANGED(-1, ecConfigTreeCtrl::OnSelChanged) - EVT_TREE_ITEM_EXPANDED(-1, ecConfigTreeCtrl::OnCollapseExpand) - EVT_TREE_ITEM_COLLAPSED(-1, ecConfigTreeCtrl::OnCollapseExpand) EVT_HELP(-1, ecConfigTreeCtrl::OnHelp) END_EVENT_TABLE() @@ -169,83 +166,6 @@ void ecConfigTreeCtrl::LoadIcons() m_iconDB.AddInfo("Integer", wxICON(integer), 0, TRUE); m_iconDB.AddInfo("Integer", wxICON(integer_dis), 0, FALSE); - -#if 0 - // Add some dummy items - ecConfigItem* item = NULL; - wxTreeItemId rootId = AddRoot(_(""), -1, -1, new ecTreeItemData(item = new ecConfigItem(NULL, _("Configuration"), ecContainer))); - - item->SetTreeItem(rootId); - item->UpdateTreeItem(* this); - - wxTreeItemId childId1 = AppendItem(rootId, _(""), -1, -1, new ecTreeItemData(item = new ecConfigItem(item, _("My Package"), ecPackage, ecFlavorData, ecString))); - item->SetTreeItem(childId1); - item->GetValue() = _("v1_4_1"); - item->UpdateTreeItem(* this); - - wxTreeItemId childId2 = AppendItem(childId1, _(""), -1, -1, new ecTreeItemData(item = new ecConfigItem(item, _("Option 1"), ecOption, ecFlavorData, ecString))); - item->SetTreeItem(childId2); - item->GetValue() = _("The value for this option"); - item->UpdateTreeItem(* this); - - childId2 = AppendItem(childId1, _(""), -1, -1, new ecTreeItemData(item = new ecConfigItem(item, _("Option 2"), ecOption, ecFlavorData, ecLong))); - item->SetTreeItem(childId2); - item->GetValue() = (long) 176343; - item->UpdateTreeItem(* this); - - childId2 = AppendItem(childId2, _(""), -1, -1, new ecTreeItemData(item = new ecConfigItem(item, _("Option 3"), ecOption, ecFlavorBool, ecOptionTypeNone, TRUE, TRUE, ecHintCheck))); - item->SetTreeItem(childId2); - item->GetValue() = (bool) TRUE; - item->UpdateTreeItem(* this); - - childId2 = AppendItem(childId1, _(""), -1, -1, new ecTreeItemData(item = new ecConfigItem(item, _("Option 4"), ecOption, ecFlavorBool, ecOptionTypeNone, TRUE, FALSE, ecHintCheck))); - item->SetTreeItem(childId2); - item->UpdateTreeItem(* this); - - childId2 = AppendItem(childId1, _(""), -1, -1, new ecTreeItemData(item = new ecConfigItem(item, _("Option 5"), ecOption, ecFlavorBool, ecOptionTypeNone, TRUE, TRUE, ecHintRadio))); - item->SetTreeItem(childId2); - item->UpdateTreeItem(* this); - - childId2 = AppendItem(childId1, _(""), -1, -1, new ecTreeItemData(item = new ecConfigItem(item, _("Option 6"), ecOption, ecFlavorBool, ecOptionTypeNone, TRUE, FALSE, ecHintRadio))); - item->SetTreeItem(childId2); - item->GetValue() = (bool) TRUE ; - item->UpdateTreeItem(* this); - - // Another branch - childId1 = AppendItem(rootId, _(""), -1, -1, new ecTreeItemData(item = new ecConfigItem(item, _("My Container"), ecContainer))); - item->SetTreeItem(childId1); - item->UpdateTreeItem(* this); - - childId2 = AppendItem(childId1, _(""), -1, -1, new ecTreeItemData(item = new ecConfigItem(item, _("Option 1"), ecOption, ecFlavorData, ecString, FALSE))); - item->SetTreeItem(childId2); - item->GetValue() = _("The value for this option"); - item->UpdateTreeItem(* this); - - childId2 = AppendItem(childId1, _(""), -1, -1, new ecTreeItemData(item = new ecConfigItem(item, _("Option 2"), ecOption, ecFlavorData, ecLong, FALSE))); - item->SetTreeItem(childId2); - item->GetValue() = (long) 176343; - item->UpdateTreeItem(* this); - - childId2 = AppendItem(childId1, _(""), -1, -1, new ecTreeItemData(item = new ecConfigItem(item, _("Option 3"), ecOption, ecFlavorBool, ecOptionTypeNone, FALSE, TRUE, ecHintCheck))); - item->SetTreeItem(childId2); - item->GetValue() = (bool) TRUE; - item->UpdateTreeItem(* this); - - childId2 = AppendItem(childId1, _(""), -1, -1, new ecTreeItemData(item = new ecConfigItem(item, _("Option 4"), ecOption, ecFlavorBool, ecOptionTypeNone, FALSE, FALSE, ecHintCheck))); - item->SetTreeItem(childId2); - item->UpdateTreeItem(* this); - - childId2 = AppendItem(childId1, _(""), -1, -1, new ecTreeItemData(item = new ecConfigItem(item, _("Option 5"), ecOption, ecFlavorBool, ecOptionTypeNone, FALSE, TRUE, ecHintRadio))); - item->SetTreeItem(childId2); - item->UpdateTreeItem(* this); - - childId2 = AppendItem(childId1, _(""), -1, -1, new ecTreeItemData(item = new ecConfigItem(item, _("Option 6"), ecOption, ecFlavorBool, ecOptionTypeNone, FALSE, FALSE, ecHintRadio))); - item->SetTreeItem(childId2); - item->GetValue() = (bool) TRUE ; - item->UpdateTreeItem(* this); - - Expand(rootId); -#endif } ecConfigTreeCtrl::~ecConfigTreeCtrl() @@ -256,47 +176,6 @@ ecConfigTreeCtrl::~ecConfigTreeCtrl() delete m_imageList; } -// Draw the lines on top of the tree -void ecConfigTreeCtrl::OnPaint(wxPaintEvent& event) -{ - wxPaintDC dc(this); - - wxTreeCtrl::OnPaint(event); - - // Reset the device origin since it may have been set - dc.SetDeviceOrigin(0, 0); - - wxSize sz = GetClientSize(); - -#if wxCHECK_VERSION(2, 6, 0) - wxPen pen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID); -#else - wxPen pen(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID); -#endif - dc.SetPen(pen); - dc.SetBrush(* wxTRANSPARENT_BRUSH); - - wxSize clientSize = GetClientSize(); - wxRect itemRect; - int cy=0; - wxTreeItemId h, lastH; - for(h=GetFirstVisibleItem();h;h=GetNextVisible(h)) - { - if (GetBoundingRect(h, itemRect)) - { - cy = itemRect.GetTop(); - dc.DrawLine(0, cy, clientSize.x, cy); - lastH = h; - } - } - - if (lastH && lastH.IsOk() && GetBoundingRect(lastH, itemRect)) - { - cy = itemRect.GetBottom(); - dc.DrawLine(0, cy, clientSize.x, cy); - } -} - void ecConfigTreeCtrl::OnSelChanged(wxTreeEvent& event) { ecConfigToolDoc* doc = wxGetApp().GetConfigToolDoc(); @@ -408,12 +287,6 @@ void ecConfigTreeCtrl::OnKeyDown(wxKeyEv } } -void ecConfigTreeCtrl::OnCollapseExpand(wxTreeEvent& event) -{ - if (GetCompanionWindow()) - GetCompanionWindow()->Refresh(); -} - // show help for this window void ecConfigTreeCtrl::OnHelp(wxHelpEvent& event) { @@ -442,7 +315,6 @@ void ecConfigTreeCtrl::OnHelp(wxHelpEven IMPLEMENT_CLASS(ecValueWindow, wxTreeCompanionWindow) BEGIN_EVENT_TABLE(ecValueWindow, wxTreeCompanionWindow) - EVT_PAINT(ecValueWindow::OnPaint) EVT_MOUSE_EVENTS(ecValueWindow::OnMouseEvent) EVT_SCROLLWIN(ecValueWindow::OnScroll) EVT_TREE_ITEM_EXPANDED(-1, ecValueWindow::OnExpand) @@ -477,50 +349,6 @@ wxTreeCompanionWindow(parent, id, pos, s m_configItem = NULL; } -void ecValueWindow::OnPaint(wxPaintEvent& event) -{ - wxPaintDC dc(this); - - if (!m_treeCtrl) - return; - -#if wxCHECK_VERSION(2, 6, 0) - wxPen pen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID); -#else - wxPen pen(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID); -#endif - dc.SetPen(pen); - dc.SetBrush(* wxTRANSPARENT_BRUSH); - wxFont font(GetFont()); - dc.SetFont(font); - //dc.SetTextForeground(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOWTEXT)); - dc.SetBackgroundMode(wxTRANSPARENT); - - wxSize clientSize = GetClientSize(); - wxRect itemRect; - int cy=0; - wxTreeItemId h, lastH; - for(h=m_treeCtrl->GetFirstVisibleItem();h;h=m_treeCtrl->GetNextVisible(h)) - { - if (m_treeCtrl->GetBoundingRect(h, itemRect)) - { - cy = itemRect.GetTop(); - wxRect drawItemRect(0, cy, clientSize.x, itemRect.GetHeight()); - - lastH = h; - - // Draw the actual item - DrawItem(dc, h, drawItemRect); - dc.DrawLine(0, cy, clientSize.x, cy); - } - } - if (lastH && lastH.IsOk() && m_treeCtrl->GetBoundingRect(lastH, itemRect)) - { - cy = itemRect.GetBottom(); - dc.DrawLine(0, cy, clientSize.x, cy); - } -} - // Returns the rectangle which will enclose the value for this tree item wxRect ecValueWindow::GetItemRect(ecConfigItem* item) { @@ -531,7 +359,7 @@ wxRect ecValueWindow::GetItemRect(ecConf wxRect itemRect; int cy=0; wxTreeItemId h; - for(h=m_treeCtrl->GetFirstVisibleItem();h;h=m_treeCtrl->GetNextVisible(h)) + for(h=m_treeCtrl->GetFirstVisibleItem();h.IsOk() && m_treeCtrl->IsVisible(h);h=m_treeCtrl->GetNextVisible(h)) { ecTreeItemData* data = (ecTreeItemData*) m_treeCtrl->GetItemData(h); if (data->GetConfigItem() == item) @@ -561,7 +389,9 @@ void ecValueWindow::OnMouseEvent(wxMouse m_treeCtrl->SelectItem(item); ecConfigItem* configItem = ((ecTreeItemData*) m_treeCtrl->GetItemData(item))->GetConfigItem(); if (configItem->CanEdit()) - BeginEditing(configItem); + BeginEditing(configItem); + else if (m_configItem) + EndEditing(); } } else if (event.RightDown()) @@ -575,6 +405,9 @@ void ecValueWindow::OnMouseEvent(wxMouse if (item != 0) #endif { + if (m_configItem) + EndEditing(); + ecConfigItem* configItem = ((ecTreeItemData*) m_treeCtrl->GetItemData(item))->GetConfigItem(); m_treeCtrl->SelectItem(item); ((ecConfigTreeCtrl*) m_treeCtrl)->GetPropertiesMenu()->SetClientData((void*) TRUE); @@ -1102,7 +935,9 @@ void ecSplitterScrolledWindow::OnUpdateU { ecConfigItem* item = ((ecTreeItemData*) treeCtrl->GetItemData(id))->GetConfigItem(); - event.Enable( item->IsPackage() ); + event.Enable( item->IsPackage() && + !wxGetApp().GetConfigToolDoc()->GetCdlPkgData()-> + is_hardware_package (ecUtils::UnicodeToStdStr (item->GetMacro()))); } } diff --git a/host/tools/configtool/standalone/wxwin/configtree.h b/host/tools/configtool/standalone/wxwin/configtree.h --- a/host/tools/configtool/standalone/wxwin/configtree.h +++ b/host/tools/configtool/standalone/wxwin/configtree.h @@ -2,6 +2,7 @@ // // ---------------------------------------------------------------------------- // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// Copyright (C) 2008 eCosCentric Limited // // This program is part of the eCos host tools. // @@ -51,7 +52,7 @@ #endif #include "wx/wx.h" -#include "splittree.h" +#include "wx/gizmos/splittree.h" #include "configitem.h" #define wxMAX_ICON_STATES 4 @@ -192,10 +193,8 @@ public: ~ecConfigTreeCtrl(); //// Event handlers - void OnPaint(wxPaintEvent& event); void OnMouseEvent(wxMouseEvent& event); void OnSelChanged(wxTreeEvent& event); - void OnCollapseExpand(wxTreeEvent& event); void OnHelp(wxHelpEvent& event); void OnKeyDown(wxKeyEvent& event); @@ -232,7 +231,6 @@ public: virtual void DrawItem(wxDC& dc, wxTreeItemId id, const wxRect& rect); //// Events - void OnPaint(wxPaintEvent& event); void OnMouseEvent(wxMouseEvent& event); void OnScroll(wxScrollWinEvent& event); void OnExpand(wxTreeEvent& event); diff --git a/host/tools/configtool/standalone/wxwin/docsystem.cpp b/host/tools/configtool/standalone/wxwin/docsystem.cpp --- a/host/tools/configtool/standalone/wxwin/docsystem.cpp +++ b/host/tools/configtool/standalone/wxwin/docsystem.cpp @@ -3,6 +3,7 @@ // ---------------------------------------------------------------------------- // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. // Copyright (C) 2003 John Dallaway +// Copyright (C) 2008 eCosCentric Limited // // This program is part of the eCos host tools. // @@ -487,7 +488,7 @@ Full-text search=Yes\n" << // Index file=" << keywordFile << "\n "Language=0x409 English (United States)\n\ -Title=eCos\n"; +Title=eCos Documentation\n"; stream << "[WINDOWS]\n\ @@ -999,13 +1000,8 @@ bool ecHtmlIndexer::IndexDocs(const wxSt // AddEndSection(); AddIndexByList(wxT("User Guide"), wxT("user-guide/ecos-user-guide.html"), wxT("user-guide/ecos-user-guide.html")); -// AddIndexByList(wxT("RedBoot User's Guide"), wxT("redboot/redboot.html"), wxT("redboot/redboot.html")); -#ifdef __WXGTK__ - // FIXME: wxHtmlParser (version 2.4.0) doesn't like the eCos Reference HTML on Linux so just index the initial page for now - AddIndexItem(wxT("eCos Reference"), wxT("ref/ecos-ref.html")); -#else + AddIndexByList(wxT("RedBoot Guide"), wxT("redboot-guide/redboot-guide.html"), wxT("redboot-guide/redboot-guide.html")); AddIndexByList(wxT("eCos Reference"), wxT("ref/ecos-ref.html"), wxT("ref/ecos-ref.html")); -#endif AddIndexByList(wxT("Component Writer's Guide"), wxT("cdl-guide/cdl-guide.html"), wxT("cdl-guide/cdl-guide.html")); // AddIndexByList(wxT("eCos-EL/IX Compatibility Guide"), wxT("ecos-elix/elix-compatibility.html"), wxT("ecos-elix/elix-compatibility.html")); diff --git a/host/tools/configtool/standalone/wxwin/ecutils.cpp b/host/tools/configtool/standalone/wxwin/ecutils.cpp --- a/host/tools/configtool/standalone/wxwin/ecutils.cpp +++ b/host/tools/configtool/standalone/wxwin/ecutils.cpp @@ -3,6 +3,7 @@ // ---------------------------------------------------------------------------- // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. // Copyright (C) 2003 John Dallaway +// Copyright (C) 2008 eCosCentric Limited // // This program is part of the eCos host tools. // @@ -270,7 +271,7 @@ const wxString ecUtils::NativeToPosixPat else { wxString posix; - cygwin_conv_to_posix_path(native.c_str(), posix.GetWriteBuf(MAXPATHLEN + 1)); + cygwin_conv_to_posix_path(native.c_str(), posix.GetWriteBuf(PATH_MAX + 1)); posix.UngetWriteBuf(); return posix; } @@ -287,7 +288,7 @@ const wxString ecUtils::PosixToNativePat else { wxString native; - cygwin_conv_to_win32_path(posix.c_str(), native.GetWriteBuf(MAXPATHLEN + 1)); + cygwin_conv_to_win32_path(posix.c_str(), native.GetWriteBuf(PATH_MAX + 1)); native.UngetWriteBuf(); return native; } diff --git a/host/tools/configtool/standalone/wxwin/filename.cpp b/host/tools/configtool/standalone/wxwin/filename.cpp --- a/host/tools/configtool/standalone/wxwin/filename.cpp +++ b/host/tools/configtool/standalone/wxwin/filename.cpp @@ -3,6 +3,7 @@ // ---------------------------------------------------------------------------- // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. // Copyright (C) 2003 John Dallaway +// Copyright (C) 2005 eCosCentric Limited // // This program is part of the eCos host tools. // @@ -35,6 +36,10 @@ #pragma hdrstop #endif +#ifdef __CYGWIN__ +#include /* for cygwin_conv_to_posix_path() */ +#endif + #include "wx/filefn.h" #include "wx/confbase.h" // For wxExpandEnvVars @@ -550,7 +555,12 @@ ecFileName ecFileName::EC_GetTempPath() const ecFileName ecFileName::CygPath () const { #ifdef __WXMSW__ - ecFileName rc = ShortName(); + ecFileName rc = NoSpaceName(); +#ifdef __CYGWIN__ + char buffer [MAX_PATH + 1]; + cygwin_conv_to_posix_path (rc.c_str (), buffer); + rc = buffer; +#else if(wxIsalpha(rc[(size_t)0]) && wxTChar(':')==rc[(size_t)1]) { // Convert c:\ to /cygdrive/c/ @@ -563,6 +573,7 @@ const ecFileName ecFileName::CygPath () if (rc[i] == wxTChar('\\')) rc[i] = wxTChar('/'); } +#endif #else const ecFileName& rc = * this; #endif diff --git a/host/tools/configtool/standalone/wxwin/mainwin.cpp b/host/tools/configtool/standalone/wxwin/mainwin.cpp --- a/host/tools/configtool/standalone/wxwin/mainwin.cpp +++ b/host/tools/configtool/standalone/wxwin/mainwin.cpp @@ -94,6 +94,12 @@ #ifdef __WXMSW__ #include "wx/msw/winundef.h" +#if wxCHECK_VERSION(2, 6, 0) +#include "wx/msw/wrapcctl.h" /* for TVS_NOHSCROLL */ +#else +#define _WIN32_IE 0x0600 /* assume maximal feature set */ +#include /* for TVS_NOHSCROLL */ +#endif #endif // ---------------------------------------------------------------------------- @@ -396,7 +402,11 @@ ecMainFrame::ecMainFrame(wxDocManager *m GetToolBar()->Show( FALSE ); // Create the status bar +#ifdef __WXMSW__ CreateStatusBar(4, wxST_SIZEGRIP); +#else + CreateStatusBar(4, 0); +#endif int* widths = new int[4]; widths[0] = -1; widths[1] = 100; widths[2] = 40; widths[3] = 80; @@ -420,7 +430,7 @@ void ecMainFrame::CreateWindows() m_outputSashWindow->SetOrientation(wxLAYOUT_HORIZONTAL); m_outputSashWindow->SetAlignment(wxLAYOUT_BOTTOM); m_outputSashWindow->SetSashVisible(wxSASH_TOP, TRUE); - m_outputWindow = new ecOutputWindow(m_outputSashWindow, ecID_OUTPUT_WINDOW, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxCLIP_CHILDREN|wxTE_READONLY|wxTE_RICH); + m_outputWindow = new ecOutputWindow(m_outputSashWindow, ecID_OUTPUT_WINDOW, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxCLIP_CHILDREN|wxTE_READONLY|wxTE_RICH|wxSUNKEN_BORDER); m_outputWindow->SetHelpText(_("The output window displays various warning and informational messages.")); // Sash window for the memory window @@ -473,10 +483,21 @@ void ecMainFrame::CreateWindows() m_scrolledWindow = new ecSplitterScrolledWindow(m_configSashWindow, ecID_SCROLLED_WINDOW, wxDefaultPosition, wxSize(400, 100), wxNO_BORDER | wxCLIP_CHILDREN | wxVSCROLL); m_splitter = new wxThinSplitterWindow(m_scrolledWindow, ecID_SPLITTER_WINDOW, wxDefaultPosition, - wxSize(400, 100), wxSP_3DBORDER | wxCLIP_CHILDREN /* | wxSP_LIVE_UPDATE */); + wxSize(400, 100), +#ifdef __WXMSW__ + wxSP_3DBORDER | +#else + wxSUNKEN_BORDER | +#endif + wxCLIP_CHILDREN /* | wxSP_LIVE_UPDATE */); m_splitter->SetSashSize(2); m_tree = new ecConfigTreeCtrl(m_splitter, ecID_TREE_CTRL, wxDefaultPosition, - wxSize(200, 100), wxTR_HAS_BUTTONS | wxTR_NO_LINES | wxNO_BORDER ); + wxSize(200, 100), wxTR_HAS_BUTTONS | wxTR_NO_LINES | wxNO_BORDER | wxTR_ROW_LINES /* | wxALWAYS_SHOW_SB */); +#ifdef __WXMSW__ + // disable horizontal scrolling of the config tree control + HWND hTree = (HWND) m_tree->GetHandle(); + SetWindowLong (hTree, GWL_STYLE, GetWindowLong (hTree, GWL_STYLE) | TVS_NOHSCROLL); +#endif m_valueWindow = new ecValueWindow(m_splitter, ecID_VALUE_WINDOW, wxDefaultPosition, wxSize(200, 100), wxNO_BORDER); m_splitter->SplitVertically(m_tree, m_valueWindow); @@ -552,7 +573,16 @@ void ecMainFrame::OnAbout(wxCommandEvent // ecAboutDialog dialog(this, ecID_ABOUT_DIALOG, _("About eCos Configuration Tool")); // dialog.ShowModal(); wxString msg; - msg.Printf("eCos Configuration Tool %s (%s %s)\n\nCopyright (c) Red Hat, Inc. 1998-2002\nCopyright (c) John Dallaway 2003\nCopyright (c) eCosCentric Limited 2004-2008", ecCONFIGURATION_TOOL_VERSION, __DATE__, __TIME__); + int iTclVerMajor, iTclVerMinor, iTclVerPatchLevel; + Tcl_GetVersion (&iTclVerMajor, &iTclVerMinor, &iTclVerPatchLevel, NULL); + msg.Printf("eCos Configuration Tool %s (%s %s)\n\n" + "Copyright (c) Red Hat, Inc. 1998-2002\n" + "Copyright (c) John Dallaway 2003\n" + "Copyright (c) eCosCentric Limited 2004-2008\n\n" + "Using %s %s and Tcl %d.%d.%d", + ecCONFIGURATION_TOOL_VERSION, __DATE__, __TIME__, + wxPlatformInfo::Get().GetPortIdName().c_str(), wxVERSION_NUM_DOT_STRING, + iTclVerMajor, iTclVerMinor, iTclVerPatchLevel); wxMessageBox(msg, _("About eCos Configuration Tool"), wxICON_INFORMATION | wxOK); } @@ -774,7 +804,7 @@ void ecMainFrame::OnToggleToolbar(wxComm wxSizeEvent sizeEvent(GetSize(), GetId()); GetEventHandler()->ProcessEvent(sizeEvent); #ifdef __WXGTK__ - GtkOnSize( GetPosition().x, GetPosition().y, GetSize().x, GetSize().y); + GtkOnSize(); #endif } diff --git a/host/tools/configtool/standalone/wxwin/mainwin.h b/host/tools/configtool/standalone/wxwin/mainwin.h --- a/host/tools/configtool/standalone/wxwin/mainwin.h +++ b/host/tools/configtool/standalone/wxwin/mainwin.h @@ -2,6 +2,7 @@ // // ---------------------------------------------------------------------------- // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// Copyright (C) 2008 eCosCentric Limited // // This program is part of the eCos host tools. // @@ -53,7 +54,7 @@ #include "wx/wx.h" #include "wx/docview.h" -#include "splittree.h" +#include "wx/gizmos/splittree.h" /* * Status bar panes diff --git a/host/tools/configtool/standalone/wxwin/makefile.gnu b/host/tools/configtool/standalone/wxwin/makefile.gnu --- a/host/tools/configtool/standalone/wxwin/makefile.gnu +++ b/host/tools/configtool/standalone/wxwin/makefile.gnu @@ -27,13 +27,13 @@ EXTRALDFLAGS=-L$(TCLDIR)/lib -L$(INSTALL ifneq (,$(findstring CYGWIN, $(shell uname))) PROGRAM=configtool.exe CPPFLAGS=`$(WXDIR)/bin/wx-config --cppflags` -D_WIN32 -D__WIN32__ -DSTRICT -D__USE_W32_SOCKETS - LDFLAGS=`$(WXDIR)/bin/wx-config --libs` -lshlwapi -Wl,--subsystem,windows + LDFLAGS=`$(WXDIR)/bin/wx-config --libs std,gizmos` -lshlwapi -Wl,--subsystem,windows EXTRAOBJECTS=$(CTBUILDDIR)/configtoolres.o RCFLAGS=`$(WXDIR)/bin/wx-config --cppflags` else PROGRAM=configtool CPPFLAGS=`$(WXDIR)/bin/wx-config --cppflags` - LDFLAGS=`$(WXDIR)/bin/wx-config --libs` + LDFLAGS=`$(WXDIR)/bin/wx-config --libs std,gizmos` EXTRAOBJECTS= RCFLAGS=`$(WXDIR)/bin/wx-config --cppflags` endif @@ -61,7 +61,6 @@ OBJECTS = \ $(CTBUILDDIR)/conflictsdlg.o \ $(CTBUILDDIR)/conflictwin.o \ $(CTBUILDDIR)/docsystem.o \ - $(CTBUILDDIR)/ecscrolwin.o \ $(CTBUILDDIR)/eCosSerial.o \ $(CTBUILDDIR)/eCosSocket.o \ $(CTBUILDDIR)/eCosStd.o \ @@ -94,7 +93,6 @@ OBJECTS = \ $(CTBUILDDIR)/settingsdlg.o \ $(CTBUILDDIR)/shortdescrwin.o \ $(CTBUILDDIR)/solutionswin.o \ - $(CTBUILDDIR)/splittree.o \ $(CTBUILDDIR)/Subprocess.o \ $(CTBUILDDIR)/templatesdlg.o \ $(CTBUILDDIR)/TestResource.o @@ -170,9 +168,6 @@ clean: $(CTBUILDDIR)/ecutils.o: $(CTDIR)/ecutils.cpp $(CTDIR)/ecutils.h $(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $< -$(CTBUILDDIR)/ecscrolwin.o: $(CTDIR)/ecscrolwin.cpp $(CTDIR)/ecscrolwin.h - $(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $< - $(CTBUILDDIR)/filename.o: $(CTDIR)/filename.cpp $(CTDIR)/filename.h $(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $< @@ -227,9 +222,6 @@ clean: $(CTBUILDDIR)/solutionswin.o: $(CTDIR)/solutionswin.cpp $(CTDIR)/solutionswin.h $(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $< -$(CTBUILDDIR)/splittree.o: $(CTDIR)/splittree.cpp $(CTDIR)/splittree.h - $(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $< - $(CTBUILDDIR)/templatesdlg.o: $(CTDIR)/templatesdlg.cpp $(CTDIR)/templatesdlg.h $(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $< diff --git a/host/tools/configtool/standalone/wxwin/packagesdlg.cpp b/host/tools/configtool/standalone/wxwin/packagesdlg.cpp --- a/host/tools/configtool/standalone/wxwin/packagesdlg.cpp +++ b/host/tools/configtool/standalone/wxwin/packagesdlg.cpp @@ -3,7 +3,8 @@ // ---------------------------------------------------------------------------- // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. // Copyright (C) 2003 John Dallaway -// +// Copyright (C) 2005 eCosCentric Limited + // This program is part of the eCos host tools. // // This program is free software; you can redistribute it and/or modify it @@ -80,7 +81,7 @@ BEGIN_EVENT_TABLE(ecPackagesDialog, ecDi EVT_LISTBOX_DCLICK(ecID_PACKAGES_DIALOG_USE_LIST, ecPackagesDialog::OnDblClickListBox2) EVT_LISTBOX(ecID_PACKAGES_DIALOG_AVAILABLE_LIST, ecPackagesDialog::OnClickListBox1) EVT_LISTBOX(ecID_PACKAGES_DIALOG_USE_LIST, ecPackagesDialog::OnClickListBox2) - EVT_LISTBOX(ecID_PACKAGES_DIALOG_VERSION, ecPackagesDialog::OnSelectVersion) + EVT_CHOICE(ecID_PACKAGES_DIALOG_VERSION, ecPackagesDialog::OnSelectVersion) EVT_INIT_DIALOG(ecPackagesDialog::OnInitDialog) EVT_BUTTON(ecID_PACKAGES_DIALOG_CLEAR, ecPackagesDialog::OnClearKeywords) EVT_CHECKBOX(ecID_PACKAGES_DIALOG_OMIT_HARDWARE, ecPackagesDialog::OnClickOmitHardwarePackages) diff --git a/host/tools/configtool/standalone/wxwin/propertywin.cpp b/host/tools/configtool/standalone/wxwin/propertywin.cpp --- a/host/tools/configtool/standalone/wxwin/propertywin.cpp +++ b/host/tools/configtool/standalone/wxwin/propertywin.cpp @@ -2,6 +2,7 @@ // // ---------------------------------------------------------------------------- // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// Copyright (C) 2008 eCosCentric Limited // // This program is part of the eCos host tools. // @@ -377,21 +378,10 @@ int ecPropertyListCtrl::SetItem(const wx { wxASSERT( nInsertAs <= GetItemCount() ); -/* - LVFINDINFO info; - info.flags =LVFI_STRING; - info.psz =pszItem; - info.vkDirection=VK_DOWN; - int nIndex=-1; + int nIndex = -2; do { - nIndex=FindItem(&info,nIndex); - } while (--nRepeat>0 && nIndex!=-1); -*/ - // NB: wxListCtrl doesn't support reverse search, so could do it explicitly - // by iterating through the items. - // But for now, just ignore the nRepeat flag and find the first one. - int nIndex = -1; - nIndex = FindItem(0, /* nIndex */ item); + nIndex = FindItem(nIndex+1, item); + } while (--nRepeat > 0 && nIndex != -1); if(-1==nIndex){ nIndex = InsertItem(nInsertAs, item); diff --git a/host/tools/configtool/standalone/wxwin/reposdlg.cpp b/host/tools/configtool/standalone/wxwin/reposdlg.cpp --- a/host/tools/configtool/standalone/wxwin/reposdlg.cpp +++ b/host/tools/configtool/standalone/wxwin/reposdlg.cpp @@ -2,6 +2,7 @@ // // ---------------------------------------------------------------------------- // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// Copyright (C) 2006 eCosCentric Limited // // This program is part of the eCos host tools. // @@ -218,7 +219,7 @@ bool ecRepositoryInfoDialog::CreateHtmlI info += wxT("

"); /////////////////////////////////////////////////// - info += wxT("Default package:

\n"); + info += wxT("Packages template:

\n"); info += wxT("

    "); diff --git a/host/tools/configtool/standalone/wxwin/runtestsdlg.cpp b/host/tools/configtool/standalone/wxwin/runtestsdlg.cpp --- a/host/tools/configtool/standalone/wxwin/runtestsdlg.cpp +++ b/host/tools/configtool/standalone/wxwin/runtestsdlg.cpp @@ -268,7 +268,7 @@ void ecRunTestsDialog::OnOK(wxCommandEve return; } - wxDialog::OnOK(event); + event.Skip(); } void ecRunTestsDialog::OnCloseWindow(wxCloseEvent& event) @@ -453,7 +453,7 @@ void *ecResetThread::Entry() String str1; bool bOk=false; CResetAttributes::ResetResult n=m_info->pSheet->m_pResource->Reset(str1); - str = str1; + str = str1.GetCString(); if(CResetAttributes::RESET_OK!=n){ str += wxT(">>> Could not reset target\n"); } diff --git a/host/tools/configtool/standalone/wxwin/sectiondlg.cpp b/host/tools/configtool/standalone/wxwin/sectiondlg.cpp --- a/host/tools/configtool/standalone/wxwin/sectiondlg.cpp +++ b/host/tools/configtool/standalone/wxwin/sectiondlg.cpp @@ -170,12 +170,12 @@ ecSectionDialog::ecSectionDialog(wxWindo void ecSectionDialog::OnOK(wxCommandEvent& event) { - wxDialog::OnOK(event); + event.Skip(); } void ecSectionDialog::OnCancel(wxCommandEvent& event) { - wxDialog::OnCancel(event); + event.Skip(); } void ecSectionDialog::OnApply(wxCommandEvent& event) diff --git a/host/tools/configtool/standalone/wxwin/settingsdlg.cpp b/host/tools/configtool/standalone/wxwin/settingsdlg.cpp --- a/host/tools/configtool/standalone/wxwin/settingsdlg.cpp +++ b/host/tools/configtool/standalone/wxwin/settingsdlg.cpp @@ -2,6 +2,7 @@ // // ---------------------------------------------------------------------------- // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// Copyright (C) 2005, 2008 eCosCentric Limited // // This program is part of the eCos host tools. // @@ -123,8 +124,9 @@ ecSettingsDialog::ecSettingsDialog(wxWin m_displayOptions = NULL; + wxSize clientSize = GetClientSize(); m_notebook = new wxNotebook(this, ecID_SETTINGS_NOTEBOOK, - wxPoint(2, 2), wxSize(PROPERTY_DIALOG_WIDTH - 4, PROPERTY_DIALOG_HEIGHT - 4)); + wxPoint(2, 2), wxSize(clientSize.GetWidth() - 4 - 10, clientSize.GetHeight() - 4 - 100)); m_displayOptions = new ecDisplayOptionsDialog(m_notebook); m_notebook->AddPage(m_displayOptions, wxT("Display")); @@ -210,8 +212,8 @@ void ecSettingsDialog::OnOK(wxCommandEve { ecSettings oldSettings(wxGetApp().GetSettings()); - wxDialog::OnOK(event); - + TransferDataFromWindow(); + if (wxGetApp().GetSettings().m_bHex != oldSettings.m_bHex) { // Refresh the values window and currently selected properties @@ -226,6 +228,8 @@ void ecSettingsDialog::OnOK(wxCommandEve if (wxGetApp().GetConfigToolDoc()) wxGetApp().GetConfigToolDoc()->UpdateAllViews (NULL, & hint); } + + event.Skip(); } void ecSettingsDialog::OnHelp(wxCommandEvent& event) @@ -1078,16 +1082,16 @@ void ecRunOptionsDialog::CreateControls( wxString strs19[] = { - _("COM1"), - _("COM2"), - _("COM3"), - _("COM4"), - _("COM5"), - _("COM6"), - _("COM7"), - _("COM8") + _("/dev/ttyS0"), + _("/dev/ttyS1"), + _("/dev/ttyS2"), + _("/dev/ttyS3"), + _("/dev/ttyS4"), + _("/dev/ttyS5"), + _("/dev/ttyS6"), + _("/dev/ttyS7") }; - wxChoice *item19 = new wxChoice( parent, ecID_RUN_PROPERTIES_SERIAL_PORT_ADDR, wxDefaultPosition, wxSize(70,-1), 8, strs19, 0 ); + wxComboBox *item19 = new wxComboBox( parent, ecID_RUN_PROPERTIES_SERIAL_PORT_ADDR, wxEmptyString, wxDefaultPosition, wxSize(110,-1), 8, strs19, wxCB_DROPDOWN ); item16->Add( item19, 0, wxALIGN_CENTRE|wxALL, 5 ); wxStaticText *item20 = new wxStaticText( parent, wxID_STATIC, _("&Baud:"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -1111,7 +1115,7 @@ void ecRunOptionsDialog::CreateControls( _("128000"), _("256000") }; - wxChoice *item21 = new wxChoice( parent, ecID_RUN_PROPERTIES_SERIAL_PORT_SPEED, wxDefaultPosition, wxSize(70,-1), 15, strs21, 0 ); + wxChoice *item21 = new wxChoice( parent, ecID_RUN_PROPERTIES_SERIAL_PORT_SPEED, wxDefaultPosition, wxSize(80,-1), 15, strs21, 0 ); item16->Add( item21, 0, wxALIGN_CENTRE|wxALL, 5 ); item14->Add( item16, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); diff --git a/host/tools/ecostest/ChangeLog b/host/tools/ecostest/ChangeLog --- a/host/tools/ecostest/ChangeLog +++ b/host/tools/ecostest/ChangeLog @@ -3,6 +3,12 @@ 2007-10-25 Gary Thomas + + * common/eCosTestUtils.cpp, common/eCosTestUtils.h, + common/eCosTest.h: Further tweaks to function prototypes for + recent GCC. + 2006-07-10 John Dallaway * common/eCosTestUtils.cpp, common/eCosTestUtils.h: Tweak function diff --git a/host/tools/ecostest/common/eCosTestUtils.cpp b/host/tools/ecostest/common/eCosTestUtils.cpp --- a/host/tools/ecostest/common/eCosTestUtils.cpp +++ b/host/tools/ecostest/common/eCosTestUtils.cpp @@ -58,7 +58,7 @@ LPCTSTR const CeCosTestUtils::Tail(LPCT } // File iterator. Gets next file in directory, avoiding _T(".") and _T("..") -bool CeCosTestUtils::NextFile (void *pHandle,String &str) +bool CeCosTestUtils::NextFile (void *&pHandle,String &str) { #ifdef _WIN32 WIN32_FIND_DATA fd; @@ -78,7 +78,7 @@ bool CeCosTestUtils::NextFile (void *pHa } // Start file iteration and return first file. -bool CeCosTestUtils::StartSearch (void *pHandle,String &str) +bool CeCosTestUtils::StartSearch (void *&pHandle,String &str) { #ifdef _WIN32 WIN32_FIND_DATA fd; @@ -103,7 +103,7 @@ bool CeCosTestUtils::StartSearch (void * } // End file iteration -void CeCosTestUtils::EndSearch (void *pHandle) +void CeCosTestUtils::EndSearch (void *&pHandle) { #ifdef _WIN32 FindClose((HANDLE)pHandle); diff --git a/host/tools/ecostest/common/eCosTestUtils.h b/host/tools/ecostest/common/eCosTestUtils.h --- a/host/tools/ecostest/common/eCosTestUtils.h +++ b/host/tools/ecostest/common/eCosTestUtils.h @@ -66,11 +66,11 @@ public: static bool IsFile (LPCTSTR pszFile); // File iterator. Gets next file in directory, avoiding "." and ".." - static bool NextFile (void *pHandle,String &str); + static bool NextFile (void *&pHandle,String &str); // Start file iteration and return first file. - static bool StartSearch (void *pHandle,String &str); + static bool StartSearch (void *&pHandle,String &str); // End file iteration - static void EndSearch (void *pHandle); + static void EndSearch (void *&pHandle); // Get the file name of a "home directory" file static const String HomeFile (LPCTSTR pszFile);