This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Build configtool against wxWindows 2.4.0
- From: John Dallaway <jld at ecoscentric dot com>
- To: ecos-patches at sources dot redhat dot com
- Date: Tue, 18 Mar 2003 16:53:20 +0000
- Subject: Build configtool against wxWindows 2.4.0
- Organization: eCosCentric Limited
This patch allows the wxWindows configtool to build and run
against wxWindows 2.4.0. wxWindows 2.4.0 resolves issues with
wxCheckListBox in the wxWindows snapshot used previously and
brings many other benefits. This patch also resolves scroll bar
jitter in the output pane during eCos builds under Windows and
allows the configtool to look for a default repository relative
to its own location on first invocation.
John Dallaway
eCosCentric Limited
--cut here--
Index: standalone/wxwin/appsettings.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/appsettings.cpp,v
retrieving revision 1.8
diff -u -5 -r1.8 appsettings.cpp
--- standalone/wxwin/appsettings.cpp 7 Mar 2003 15:09:06 -0000 1.8
+++ standalone/wxwin/appsettings.cpp 18 Mar 2003 16:31:47 -0000
@@ -768,12 +768,12 @@
}
cont = dir.GetNext(& filename);
}
}
- if (latestDir.IsEmpty())
- latestDir = wxGetCwd();
+// if (latestDir.IsEmpty())
+// latestDir = wxGetCwd();
return latestDir;
#else
wxMessageBox(wxT("FindLatestVersion() is only implemented for Unix."));
return wxEmptyString;
#endif
Index: standalone/wxwin/configtool.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/configtool.cpp,v
retrieving revision 1.13
diff -u -5 -r1.13 configtool.cpp
--- standalone/wxwin/configtool.cpp 19 Feb 2003 09:29:24 -0000 1.13
+++ standalone/wxwin/configtool.cpp 18 Mar 2003 16:31:56 -0000
@@ -486,27 +486,42 @@
if (!doc->RebuildHelpIndex(TRUE))
{
wxString msg;
msg.Printf(wxT("Sorry, there was a problem compiling the help index."));
wxMessageBox(msg, wxGetApp().GetSettings().GetAppName(), wxICON_EXCLAMATION|wxOK);
- return FALSE;
+ return FALSE;
}
}
else
{
wxString msg;
msg.Printf(wxT("Sorry, there was no current document when compiling the help index."));
wxMessageBox(msg, wxGetApp().GetSettings().GetAppName(), wxICON_EXCLAMATION|wxOK);
- return FALSE;
+ return FALSE;
}
// Return FALSE in order to quit the application
return FALSE;
}
}
else
{
+ if (GetSettings().m_strRepository.IsEmpty()) // first invocation by this user
+ {
+ // we have no clues as to the location of the repository so
+ // test for ../../packages relative to the configtool location
+ wxFileName repository = wxFileName (m_appDir, wxEmptyString);
+ repository.Normalize(); // remove trailing "./" if present
+ repository.RemoveDir (repository.GetDirCount()-1);
+ repository.RemoveDir (repository.GetDirCount()-1);
+ repository.AppendDir (wxT("packages"));
+ if (repository.DirExists()) // we've found a repository
+ {
+ repository.RemoveDir (repository.GetDirCount()-1);
+ GetSettings().m_strRepository = repository.GetFullPath();
+ }
+ }
m_docManager->CreateDocument(wxString(""), wxDOC_NEW);
}
return TRUE;
}
@@ -847,11 +862,11 @@
{
frame->GetOutputWindow()->AppendText(msg /* + wxT("\n") */ );
if ((msg == wxEmptyString) || (msg.Last() != wxT('\n')))
frame->GetOutputWindow()->AppendText(wxT("\n"));
- frame->GetOutputWindow()->ShowPosition(frame->GetOutputWindow()->GetLastPosition());
+// frame->GetOutputWindow()->ShowPosition(frame->GetOutputWindow()->GetLastPosition());
}
}
void ecApp::SetStatusText(const wxString& text, bool clearFailingRulesPane)
{
@@ -1455,11 +1470,11 @@
bool ecPipedProcess::HasInput()
{
bool hasInput = FALSE;
wxInputStream& is = *GetInputStream();
- if ( !is.Eof() )
+ if ( IsInputAvailable() )
{
wxTextInputStream tis(is);
// this assumes that the output is always line buffered
wxString msg;
@@ -1469,11 +1484,11 @@
hasInput = TRUE;
}
wxInputStream& es = *GetErrorStream();
- if ( !es.Eof() )
+ if ( IsErrorAvailable() )
{
wxTextInputStream tis(es);
// this assumes that the output is always line buffered
wxString msg;
Index: standalone/wxwin/configtool.rc
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/configtool.rc,v
retrieving revision 1.1
diff -u -5 -r1.1 configtool.rc
--- standalone/wxwin/configtool.rc 1 Jun 2001 22:16:29 -0000 1.1
+++ standalone/wxwin/configtool.rc 18 Mar 2003 16:31:56 -0000
@@ -42,7 +42,6 @@
radiooff_dis ICON "bitmaps/radiooff_dis.ico"
text ICON "bitmaps/text.ico"
text_dis ICON "bitmaps/text_dis.ico"
#include "wx/msw/wx.rc"
-#include "wx/html/msw/wxhtml.rc"
-
+//#include "wx/html/msw/wxhtml.rc"
Index: standalone/wxwin/mainwin.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/mainwin.cpp,v
retrieving revision 1.11
diff -u -5 -r1.11 mainwin.cpp
--- standalone/wxwin/mainwin.cpp 17 Feb 2003 17:05:22 -0000 1.11
+++ standalone/wxwin/mainwin.cpp 18 Mar 2003 16:32:04 -0000
@@ -547,11 +547,11 @@
void ecMainFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
// ecAboutDialog dialog(this, ecID_ABOUT_DIALOG, _("About eCos Configuration Tool"));
// dialog.ShowModal();
- wxMessageBox(_("eCos Configuration Tool 2.12.net\n\nCopyright (c) Red Hat, Inc. 1998-2002\nCopyright (c) John Dallaway 2003"), _("About eCos Configuration Tool"), wxICON_INFORMATION | wxOK);
+ wxMessageBox(_("eCos Configuration Tool 2.13.net\n\nCopyright (c) Red Hat, Inc. 1998-2002\nCopyright (c) John Dallaway 2003"), _("About eCos Configuration Tool"), wxICON_INFORMATION | wxOK);
}
void ecMainFrame::OnSize(wxSizeEvent& WXUNUSED(event))
{
// First, we need to resize the sash windows proportionately,
@@ -1327,11 +1327,11 @@
static wxEvent* s_lastEvent = NULL;
if (& event == s_lastEvent)
return FALSE;
- if (event.IsCommandEvent())
+ if (event.IsCommandEvent() && !event.IsKindOf(CLASSINFO(wxChildFocusEvent)))
{
s_lastEvent = & event;
wxWindow* focusWin = wxFindFocusDescendant(this);
bool success = FALSE;
Index: standalone/wxwin/makefile.gnu
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/makefile.gnu,v
retrieving revision 1.5
diff -u -5 -r1.5 makefile.gnu
--- standalone/wxwin/makefile.gnu 25 Feb 2003 17:28:17 -0000 1.5
+++ standalone/wxwin/makefile.gnu 18 Mar 2003 16:32:04 -0000
@@ -30,12 +30,12 @@
CPPFLAGS=-I$(WXDIR)/include -I$(WXDIR)/lib/wx/include -DSTRICT -DWINVER=0x0400 -D_WIN32 -D__GNUWIN32__ -D__WIN95__ -D__WIN32__ -D_X86_=1 -DWIN32
LDFLAGS=-L$(WXDIR)/lib -lwx -lstdc++ -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lwsock32 -lglu32 -lgdi32 -lcomdlg32 -lole32 -luuid -lshlwapi -lpng -lzlib
EXTRAOBJECTS=$(CTBUILDDIR)/configtoolres.o
else
PROGRAM=configtool
- CPPFLAGS=-I$(WXDIR)/include -I$(WXDIR)/lib/wx/include -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D__USE_WXCONFIG__
- LDFLAGS=-L$(WXDIR)/lib -L/usr/X11R6/lib -lwx_gtk -lgtk -lgdk -rdynamic -lgmodule -lgthread -lglib -lpthread -ldl -lXi -lXext -lX11 -lm
+ CPPFLAGS=`$(WXDIR)/bin/wx-config --cppflags`
+ LDFLAGS=`$(WXDIR)/bin/wx-config --libs`
EXTRAOBJECTS=
endif
ifneq "$(LEVEL)" "debug"
CPPDEBUGOPTIONS=-O2