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 message Go to previous message](theme/default/images/up.png) ![Go to next message Go to previous message](theme/default/images/down.png) |
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](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 403 times)
|
|
|
![Read Message Read Message](theme/default/images/read.png) |
|
2022.3
By: mirek on Thu, 29 December 2022 09:26
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2022.3
By: Tom1 on Thu, 29 December 2022 10:16
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2022.3
By: zsolt on Thu, 29 December 2022 11:15
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2022.3
By: Klugier on Thu, 29 December 2022 11:43
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2022.3
By: unodgs on Thu, 29 December 2022 23:20
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2022.3
By: Lance on Fri, 30 December 2022 00:47
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2022.3
By: Oblivion on Fri, 30 December 2022 04:37
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2022.3
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2022.3
By: Klugier on Fri, 30 December 2022 18:44
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2022.3
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2022.3
By: mirek on Sun, 01 January 2023 16:48
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2022.3
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2022.3
By: mirek on Tue, 03 January 2023 10:35
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2022.3
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2022.3
By: mirek on Tue, 03 January 2023 23:26
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2022.3
By: mdelfede on Wed, 04 January 2023 10:22
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2022.3
By: mirek on Wed, 04 January 2023 11:36
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2022.3
By: mdelfede on Wed, 04 January 2023 16:10
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2022.3
|
Goto Forum:
Current Time: Sat Jul 27 03:14:39 CEST 2024
Total time taken to generate the page: 0.00795 seconds
|