Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » ArrayCtrl & Option == CheckListBox ?
ArrayCtrl & Option == CheckListBox ? [message #10110] Thu, 21 June 2007 00:50 Go to next message
arturbac is currently offline  arturbac
Messages: 91
Registered: May 2007
Location: Reda, Poland
Member

The problem is I need Some checklistbox with capability
of callback of "WhenChecked" with knowing which row of ArrayCtrl was checked, ie knowing the Index associated to ArrayCtrl column

ArrayCtrl lst_layers;

void MakeOption(One<Ctrl> & res)
{
   res.Create<Option>();
}


SomeConstructor() {
 lst_layers.AddColumn(t_("Layer"));
 lst_layers.AddIndex();
 lst_layers.AddColumn().Ctrls(&MakeOption);
 lst_layers.WhenCtrlsAction = THISBACK(MapLayerChecked);
}

void MapLayerChecked()
{
	Option *o = (Option *)lst_layers.GetActiveCtrl();
}




How to get value from Index column in MapLayerChecked() ? Rolling Eyes
Or maybe there is some simpler , better solution ?

PS. Checking the checkbox will not make adequate arrayctrl row selected ...

Artur

[Updated on: Thu, 21 June 2007 00:55]

Report message to a moderator

Re: ArrayCtrl & Option == CheckListBox ? [message #10112 is a reply to message #10110] Thu, 21 June 2007 05:10 Go to previous messageGo to next message
kcabobert is currently offline  kcabobert
Messages: 51
Registered: January 2007
Location: USA
Member
I needed to do something similar recently. I was told to use GridCtrl instead of ArrayCtrl.

It seems to work fairly well, and, more importantly, I think do what you want easily. GridCtrl seems to actually update the 'select row' "pointer" such that you can discover which row was clicked.
Re: ArrayCtrl & Option == CheckListBox ? [message #10172 is a reply to message #10110] Sat, 23 June 2007 07:49 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, see the related thread (week ago).

You can do it simply, but only with the actual (uvs) version of U++, using the new "SetCtrl" method.

(It turns out that "factory" Ctrls idea is fine for very simple cases, but fails when anything more complicated is to be done...)

Mirek
Previous Topic: GridCtrl 'Key' modifications / questions
Next Topic: GridCtrl Question
Goto Forum:
  


Current Time: Thu Apr 25 00:48:15 CEST 2024

Total time taken to generate the page: 0.03568 seconds