I have to patches that fix most of my problems
I still get a bunch of warnings from bitmaps/file.xpm
bitmaps/file.xpm:38: warning: deprecated conversion from string constant to
‘char*’
and for some reason on Fedora 11 gcc 4.4.0 the makefile in samples/treelisttest
thinks it should run windres.
make
windres `wx-config --cppflags -rescomp` -i treelisttest.rc -J rc -o
treelisttest.res -O coff
/bin/sh: windres: command not found
make: *** [treelisttest.res] Error 127
Don't think I am going to bother looking at either of them as all I need is
the treelistctrl.cpp to compile and link and I think the patch takes care of
that. Added some typecasts that were missing and through _T() around some
bare quotes.
-Max
On Sunday 16 August 2009 19:02:20 Max Jonathan Spaulding wrote:
> Just checking to see if anyone has compiled the newest release of this?
>
> Trying to get the 07/09/2009 version fo this to build from here
> http://wxcode.sourceforge.net/components/treelistctrl/
>
> I thought from reading the forum that it was stable and would just build.
> But I can't get it to compile with GCC or Mingw
>
> gcc version for linux
> gcc version 4.4.0 20090506 (Red Hat 4.4.0-4) (GCC)
>
> gcc version for mingw cross compiler
> gcc version 4.4.0 20090319 (experimental) (GCC)
>
> Both give me the same errors. Missing <wx/app.h> Passing of
> wxTreeListItem*'s all over where wxTreeItemId&'s are expected etc...
>
> So my question is am I insane and just missing something to make this work,
> or is the latest stable not so stable?
>
> wxWidgets versions
>
> wx-config --list
>
> Default config is gtk2-unicode-release-2.8
>
>
> /usr/i686-pc-mingw32/sys-root/mingw/bin/wx-config --list
>
> Default config is i686-pc-mingw32-msw-unicode-debug-2.8
>
> Default config will be used for output
>
> Alternate matches:
> i686-pc-mingw32-msw-unicode-release-2.8
>
> Output from make in treelisttest
> make
> g++ -c -I../../include `wx-config --cxxflags` -g -o treelistctrl.o
> ../../src/treelistctrl.cpp
> ../../src/treelistctrl.cpp: In member function ‘virtual bool
> wxEditTextCtrl::Destroy()’:
> ../../src/treelistctrl.cpp:1020: error: ‘wxTheApp’ was not declared in this
> scope
> ../../src/treelistctrl.cpp: In member function ‘void
> wxTreeListMainWindow::DoDeleteItem(wxTreeListItem*)’:
> ../../src/treelistctrl.cpp:2509: error: conversion from ‘int’ to ‘const
> wxTreeItemId’ is ambiguous
> /usr/include/wx-2.8/wx/treebase.h:75: note: candidates are:
> wxTreeItemId::wxTreeItemId(long int)
> /usr/include/wx-2.8/wx/treebase.h:59: note:
> wxTreeItemId::wxTreeItemId(void*)
> ../../src/treelistctrl.cpp: In member function ‘void
> wxTreeListMainWindow::PaintItem(wxTreeListItem*, wxDC&)’:
> ../../src/treelistctrl.cpp:3080: error: operands to ?: have different types
> ‘const wxString’ and ‘const char [2]’
> ../../src/treelistctrl.cpp: In member function ‘void
> wxTreeListMainWindow::OnChar(wxKeyEvent&)’:
> ../../src/treelistctrl.cpp:3492: error: conversion from ‘int’ to ‘const
> wxTreeItemId’ is ambiguous
> /usr/include/wx-2.8/wx/treebase.h:75: note: candidates are:
> wxTreeItemId::wxTreeItemId(long int)
> /usr/include/wx-2.8/wx/treebase.h:59: note:
> wxTreeItemId::wxTreeItemId(void*)
> ../../src/treelistctrl.cpp: In member function ‘void
> wxTreeListMainWindow::OnMouse(wxMouseEvent&)’:
> ../../src/treelistctrl.cpp:3938: error: conversion from ‘int’ to ‘const
> wxTreeItemId’ is ambiguous
> /usr/include/wx-2.8/wx/treebase.h:75: note: candidates are:
> wxTreeItemId::wxTreeItemId(long int)
> /usr/include/wx-2.8/wx/treebase.h:59: note:
> wxTreeItemId::wxTreeItemId(void*)
> ../../src/treelistctrl.cpp: In member function ‘void
> wxTreeListMainWindow::CalculateSize(wxTreeListItem*, wxDC&)’:
> ../../src/treelistctrl.cpp:4066: error: operands to ?: have different types
> ‘const wxString’ and ‘const char [2]’
> make: *** [treelistctrl.o] Error 1
>
>
> -Max
--
Max Jonathan Spaulding - MC2 Research, LLC
3658 Shoshone St. Denver, CO 80211
email: m...@groff.net - phone: (303) 325-5013
linkedin: http://www.linkedin.com/in/maxjspaulding
--- treelistctrl.cpp.orig 2009-08-16 19:53:07.964780883 -0600
+++ treelistctrl.cpp 2009-08-16 19:48:08.863780338 -0600
@@ -29,7 +29,7 @@
#pragma hdrstop
#endif
-
+#include <wx/app.h>
#include <wx/treebase.h>
#include <wx/timer.h>
#include <wx/textctrl.h>
@@ -2506,7 +2506,7 @@
// don't stay with invalid m_selectItem: default to current item
if (item == m_selectItem) {
m_selectItem = m_curItem;
- SelectItem(m_selectItem, NULL, true); // unselect others
+ SelectItem(m_selectItem, (wxTreeListItem*)NULL, true); // unselect others
}
// recurse children, starting from the right to prevent multiple selection
@@ -3077,7 +3077,7 @@
int text_w = 0, text_h = 0;
dc.GetTextExtent( item->GetText(GetMainColumn()).size() > 0
? item->GetText(GetMainColumn())
- : " ", // dummy text to avoid zero height and no highlight width
+ : _T(" "), // dummy text to avoid zero height and no highlight width
&text_w, &text_h );
// determine background and show it
@@ -3489,7 +3489,7 @@
#endif
m_curItem = (wxTreeListItem*)GetFirstChild (m_curItem, cookie).m_pItem;
}
- SelectItem(m_curItem, NULL, true); // unselect others
+ SelectItem(m_curItem, (wxTreeListItem*)NULL, true); // unselect others
curItemSet = true;
}
@@ -3815,7 +3815,7 @@
// ---------- DETERMINE EVENT ----------
/*
-wxLogMessage("OnMouse: LMR down=<%d, %d, %d> up=<%d, %d, %d> LDblClick=<%d> dragging=<%d>",
+wxLogMessage(_T("OnMouse: LMR down=<%d, %d, %d> up=<%d, %d, %d> LDblClick=<%d> dragging=<%d>"),
event.LeftDown(), event.MiddleDown(), event.RightDown(),
event.LeftUp(), event.MiddleUp(), event.RightUp(),
event.LeftDClick(), event.Dragging());
@@ -3935,7 +3935,7 @@
m_lastOnSame = false;
// selection reset to that single item which was double-clicked
- if (SelectItem(item, NULL, true)) { // unselect others --return false if vetoed
+ if (SelectItem(item, (wxTreeListItem*)NULL, true)) { // unselect others --return false if vetoed
// selection change not vetoed, send activate event
if (! SendEvent(wxEVT_COMMAND_TREE_ITEM_ACTIVATED, item)) {
@@ -4063,7 +4063,7 @@
dc.SetFont (GetItemFont (item));
dc.GetTextExtent (item->GetText(m_main_column).size() > 0
? item->GetText (m_main_column)
- : " ", // blank to avoid zero height and no highlight width
+ : _T(" "), // blank to avoid zero height and no highlight width
&text_w, &text_h);
// restore normal font
dc.SetFont (m_normalFont);
--- ../../../orig/treelistctrl_2009-07-19/samples/treelisttest/treelisttest.cpp 2009-03-19 01:59:42.000000000 -0600
+++ treelisttest.cpp 2009-08-16 19:58:18.666530773 -0600
@@ -58,7 +58,7 @@
// declarations
//============================================================================
-#define TRACE_MASK "treelisttest"
+#define TRACE_MASK _T("treelisttest")
// define to inherit wxTreeListCtrl and thus be able to get mouse events
// #define WITH_CHILD_CLASS
@@ -576,7 +576,7 @@
#if wxUSE_LOG
sizerTop->Add(logWin, 1, wxEXPAND | wxGROW, 5);
delete log_disabler ;
- wxLogMessage("this is the test sample 'treelisttest' for the wxTreeListCtrl widget - now ready");
+ wxLogMessage(_T("this is the test sample 'treelisttest' for the wxTreeListCtrl widget - now ready"));
#endif // wxUSE_LOG
}
@@ -947,7 +947,7 @@
name = "BUG,unexpected";
}
- wxLogMessage("TREE type=<%s (%d)> item=<%X> label=<%s> col=<%d> isOK=%s keycode=<%d> point=<%d, %d> isEditCancelled=<%s>",
+ wxLogMessage(_T("TREE type=<%s (%d)> item=<%X> label=<%s> col=<%d> isOK=%s keycode=<%d> point=<%d, %d> isEditCancelled=<%s>"),
name, event.GetEventType(),
(unsigned int)(event.GetItem().m_pItem), event.GetLabel().c_str(), event.GetInt(), event.GetItem().IsOk() ? "true" : "false",
event.GetKeyCode(), event.GetPoint().x, event.GetPoint().y, event.IsEditCancelled() ? "true" : "false"
@@ -1003,7 +1003,7 @@
name = "BUG,unexpected";
}
- wxLogMessage("MOUSE type=<%s (%d)> point=(%d, %d)",
+ wxLogMessage(_T("MOUSE type=<%s (%d)> point=(%d, %d)"),
name, event.GetEventType(),
event.GetX(), event.GetY()
);
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
wxCode-users mailing list
wxCode-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxcode-users