WxPropGrid -> cannot access wxString-object Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
xpmstos
Knows some wx things
Knows some wx things
Posts: 37
Joined: Mon Aug 30, 2004 8:16 am
Location: Wismar, Germany
Contact:

WxPropGrid -> cannot access wxString-object

Post by xpmstos » Sun Nov 06, 2005 10:48 pm

Hi,

i would test wxPropGrid in a clear minimal-sample and added following lines:

Code: Select all

 
#include <wx/propgrid/propgrid.h> 
#include <wx/propgrid/advprops.h> 
 
wxPropertyGrid* pg = new wxPropertyGrid(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxPG_AUTO_SORT | wxPG_BOLD_MODIFIED | wxPG_SPLITTER_AUTO_CENTER | wxPG_DEFAULT_STYLE); 

and now, with a simple string property, i have no problems:

Code: Select all

pg->Append( wxStringProperty(wxT("Label"),wxT("Name1"),wxT("Initial Value")) ); 

but with all other propertys, like the following, the compiler says error C2248: 'wxString::wxString' : cannot access private member declared in class 'wxString'

Code: Select all

 
pg->Append ( wxIntProperty ( wxT("IntProperty"), wxID_ANY, 12345678 ) ); 
pg->Append(wxColourProperty(_("MenuColour"), wxID_ANY, wxColour(242,109,0))); 


what does i wrong?
My System is WinXP/SP2 & VC++7.0 & wxWidgets-2.6.2 & wxPropGrid 1.0.6

eco
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 203
Joined: Tue Aug 31, 2004 7:06 pm
Location: Behind a can of Mountain Dew
Contact:

Post by eco » Mon Nov 07, 2005 3:04 am

This error happens when a wxString is being implicitly cast to an integer. Make sure no argument expects an integer but is recieving a wxString.

xpmstos
Knows some wx things
Knows some wx things
Posts: 37
Joined: Mon Aug 30, 2004 8:16 am
Location: Wismar, Germany
Contact:

Post by xpmstos » Mon Nov 07, 2005 8:45 pm

I found my failure. i used now wxPG_LABEL, not wxID_ANY and it will be work. :oops:

Code: Select all

pg->Append ( wxIntProperty ( wxT("IntProperty"), wxPG_LABEL, 12345678 ) );
pg->Append(wxColourProperty(_("MenuColour"), wxPG_LABEL, wxColour(242,109,0))); 

Post Reply