widget data mapping 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
entell
Earned some good credits
Earned some good credits
Posts: 117
Joined: Wed Apr 06, 2005 3:55 am

widget data mapping

Post by entell »

Does wxWidgets have a way to map data directly to widgets? Qt has the QDataWidgetMapper class for this. See the link below for details:

http://doc.trolltech.com/qq/qq21-datawidgetmapper.html
mc2r
wxWorld Domination!
wxWorld Domination!
Posts: 1195
Joined: Thu Feb 22, 2007 4:47 pm
Location: Denver, Co
Contact:

Post by mc2r »

is this what you are looking for?

http://docs.wxwidgets.org/stable/wx_val ... oroverview

-Max
entell
Earned some good credits
Earned some good credits
Posts: 117
Joined: Wed Apr 06, 2005 3:55 am

Post by entell »

mc2r wrote:is this what you are looking for?
Not quite. Validators are specifically for transfering data between variables and dialogs.

What I am looking for is transferring data between data sources and widgets in general. I think what I am looking for is called "data binding" in the Microsoft universe.
mc2r
wxWorld Domination!
wxWorld Domination!
Posts: 1195
Joined: Thu Feb 22, 2007 4:47 pm
Location: Denver, Co
Contact:

Post by mc2r »

entell wrote:What I am looking for is transferring data between data sources and widgets in general. I think what I am looking for is called "data binding" in the Microsoft universe.
There isn't anything to do that in wxWidgets that I am aware of.

-Max
phlox81
wxWorld Domination!
wxWorld Domination!
Posts: 1387
Joined: Thu Aug 18, 2005 7:49 pm
Location: Germany
Contact:

Post by phlox81 »

entell wrote: What I am looking for is transferring data between data sources and widgets in general. I think what I am looking for is called "data binding" in the Microsoft universe.
wxWidgets has not buildin such a thing.

Look at DataGrid in CodeDump, it allows you to bind a class to a wxGrid.

Currently I am working on the next version, trying to bin it to a generic DataHandler, which can be plugged in a source and many listeners for changes.

phlox
blizzymadden
Experienced Solver
Experienced Solver
Posts: 50
Joined: Sun Dec 05, 2004 2:44 am

Post by blizzymadden »

entell wrote:Not quite. Validators are specifically for transfering data between variables and dialogs.

What I am looking for is transferring data between data sources and widgets in general. I think what I am looking for is called "data binding" in the Microsoft universe.
wxWidgets certainly has something like this, virtual list controls. Just create a wxListCtrl with the wxLC_VIRTUAL flag and then you can hook it up with a huge amount of data virtually. Changed made to your data behind the scenes is reflected in the control.
entell
Earned some good credits
Earned some good credits
Posts: 117
Joined: Wed Apr 06, 2005 3:55 am

Post by entell »

blizzymadden wrote:wxWidgets certainly has something like this, virtual list controls. Just create a wxListCtrl with the wxLC_VIRTUAL flag and then you can hook it up with a huge amount of data virtually. Changed made to your data behind the scenes is reflected in the control.
It looks like wxListCtrl is the exception. None of the other widgets have this capability as far as I can tell.
Belgabor
I live to help wx-kind
I live to help wx-kind
Posts: 173
Joined: Mon Sep 25, 2006 1:12 pm

Post by Belgabor »

That's not true. wxDataViewCtrl is built around this paradigm. I also believe wxGrid supports custom data backends.
phlox81
wxWorld Domination!
wxWorld Domination!
Posts: 1387
Joined: Thu Aug 18, 2005 7:49 pm
Location: Germany
Contact:

Post by phlox81 »

Belgabor wrote:That's not true. wxDataViewCtrl is built around this paradigm. I also believe wxGrid supports custom data backends.
Yeah, but there is no functionality to bind f.e. a TextCtrl to a variable/value, or other controls.
blizzymadden
Experienced Solver
Experienced Solver
Posts: 50
Joined: Sun Dec 05, 2004 2:44 am

Post by blizzymadden »

phlox81 wrote:
Belgabor wrote:That's not true. wxDataViewCtrl is built around this paradigm. I also believe wxGrid supports custom data backends.
Yeah, but there is no functionality to bind f.e. a TextCtrl to a variable/value, or other controls.
That is true, only "tabular data" controls support virtual backends. Text controls can't do this. That's a limitation of the platforms, MSW's richedit control has no virtual interface, and neither does GTK's GtkTexView. GtkTexView has a buffer interface that you can get direct access to, but I don't know if I would consider it truly virtual. MAC's NSTextView just has set & get functions for its RTF content, I don't believe it has a virtual interface.

Just curious, does QT have virtual text controls? If so, they must be using a custom control for this to work around this platform limitation.
mc2r
wxWorld Domination!
wxWorld Domination!
Posts: 1195
Joined: Thu Feb 22, 2007 4:47 pm
Location: Denver, Co
Contact:

Post by mc2r »

blizzymadden wrote:Just curious, does QT have virtual text controls? If so, they must be using a custom control for this to work around this platform limitation.
QT uses all its own controls and doesn't use native controls.

-Max
entell
Earned some good credits
Earned some good credits
Posts: 117
Joined: Wed Apr 06, 2005 3:55 am

Post by entell »

wxDataViewCtrl appears to be what I am looking for, but it looks like it is still a while away.
Post Reply