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 » Community » U++ community news and announcements » 2022.3
Re: 2022.3 [message #59480 is a reply to message #59477] Wed, 04 January 2023 10:22 Go to previous messageGo to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Hi Mirek (and happy new year, btw!),

Im'using the ListObject() too... here is the code in my control constructor:

	PopUpList &pt = ListObject();
	prevListSelect = pt.WhenSelect;
	pt.WhenSelect = THISBACK(listSelectCb);


and in the handler:

// catches selections on popuplist
// to handle changes in layer's properties
void LayersDrop::listSelectCb(void)
{
	// get clicked point
	Point p = ::GetMousePos() - GetScreenRect().TopLeft();
	int col;
	if(p.x < 24)
		col = 0;
	else if(p.x < 48)
		col = 1;
	else
		col = 3;
	int iLine = ListObject().GetCursor();
	
	// if no line clicked or clicked on name, normal behaviour
	// of current layer selection
	if(IsNull(iLine) || col == 3)
	{
		prevListSelect();
		return;
	}
	
	// clicked on an item, just call given callback
	// and repost a drop on list
	Value v = GetValue(iLine);
	LayerData ld = ValueTo<LayerData>(v);
	if(col == 0)
		ld.on = !ld.on;
	else if(col == 1)
		ld.locked = !ld.locked;
	v = RawToValue(ld);
	SetValue(iLine, v);
	WhenToggle(ld.name, ld.on, ld.locked);
	PostCallback(THISBACK(Drop));
}


Here the effect :
index.php?t=getfile&id=6740&private=0

You can open the droplist, click on layer name (third column) and the list behaves as usual (the layer is selected and list is closed), but if you click on first 2 columns (layer ON/OFF and layer LOCK/UNLOCK) the list stay open but the state of item is toggled.

By now I solved by the usual "#define private protected" trick before including CtrlLib and re-adding the ListObject() function in my control. Not a very nice way... and I must disable blitz for this package.
It would be nice to have the ListObject() function again, or at least to put the 'list' item as protected instead of private...
  • Attachment: layers.png
    (Size: 29.06KB, Downloaded 385 times)
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: 2022.3rc1
Next Topic: ide insert data/timestep/GUID
Goto Forum:
  


Current Time: Sun Jun 23 04:11:29 CEST 2024

Total time taken to generate the page: 0.02891 seconds