Home » Community » U++ community news and announcements » 2022.3
|
Re: 2022.3 [message #59445 is a reply to message #59444] |
Thu, 29 December 2022 10:16 |
Tom1
Messages: 1253 Registered: March 2007
|
Senior Contributor |
|
|
Hi,
Thank you again for your great effort on U++!
Is the official 2022.3 release 16660? Status and Roadmap, U++ front page and Download resources need to be updated accordingly.
Best regards,
Tom
|
|
|
|
|
|
|
|
|
|
Re: 2022.3 [message #59457 is a reply to message #59455] |
Sat, 31 December 2022 04:33 |
Satervalley
Messages: 18 Registered: December 2022
|
Promising Member |
|
|
in previous version, list is an instance of PopupTable which derived from ArrayCtrl, in newest version, list is an instance of PopupList which with no base class, instead, PopupList has a protected member popup which is a pointer(One) of Popup which derived from Ctrl and has a public member named "ac" which is an instance of PopupArrayCtrl which derived from ArrayCtrl, so it's not just an uncommentting thing.
[Updated on: Sat, 31 December 2022 04:35] Report message to a moderator
|
|
|
Re: 2022.3 [message #59461 is a reply to message #59457] |
Sun, 01 January 2023 16:48 |
|
mirek
Messages: 14113 Registered: November 2005
|
Ultimate Member |
|
|
Satervalley wrote on Sat, 31 December 2022 04:33in previous version, list is an instance of PopupTable which derived from ArrayCtrl, in newest version, list is an instance of PopupList which with no base class, instead, PopupList has a protected member popup which is a pointer(One) of Popup which derived from Ctrl and has a public member named "ac" which is an instance of PopupArrayCtrl which derived from ArrayCtrl, so it's not just an uncommentting thing.
Correct. I am sorry about this, but that method is gone for good - popup and ArrayCtrl are now created on demand, as size optimisation. Saves several KBs per each DropList. This change was in master since June...
Anyway, if you tell what is your usage scenario, maybe we can something to solve it.
|
|
|
Re: 2022.3 [message #59471 is a reply to message #59461] |
Tue, 03 January 2023 05:30 |
Satervalley
Messages: 18 Registered: December 2022
|
Promising Member |
|
|
my use case is very simple, when click the down arrow, popupped drop list has 2 columes(I use it to show database fields, first column is field name, 2nd column is field data type). I use ListObject to get the arrayctrl instance, and then AddColumn to archive 2 columns droplist.
[Updated on: Tue, 03 January 2023 05:31] Report message to a moderator
|
|
|
|
Re: 2022.3 [message #59476 is a reply to message #59474] |
Tue, 03 January 2023 16:44 |
Satervalley
Messages: 18 Registered: December 2022
|
Promising Member |
|
|
1st, in my TopWindow derived class's constructor,I add 2 columns:
PopUpTable& pt = dlFields.ListObject(); // dlFields ref to DropList
pt.AddColumn("Name");
pt.AddColumn("Type");
2nd, when I got the database fields info:
dlFields.Clear();
PopUpTable& pt = dlFields.ListObject();
for(auto i = 0; i < vFields.GetCount(); i++) // vFields is a Vector of String contains field names
{
dlFields.Add(vFields[i]);
}
for(int i = 0; i < vFieldsType.GetCount(); i++) // vFieldsType is a Vector of String contains field type
{
pt.Set(i, 1, vFieldsType[i]);
}
I have to add the first column rows, then set the second column rows, the code works fine. when select a row, the first column's content of selected row is showed.
[Updated on: Tue, 03 January 2023 17:07] by Moderator Report message to a moderator
|
|
|
|
Re: 2022.3 [message #59480 is a reply to message #59477] |
Wed, 04 January 2023 10:22 |
mdelfede
Messages: 1308 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 :
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 435 times)
|
|
|
|
Re: 2022.3 [message #59482 is a reply to message #59481] |
Wed, 04 January 2023 16:10 |
mdelfede
Messages: 1308 Registered: September 2007
|
Ultimate Contributor |
|
|
mirek wrote on Wed, 04 January 2023 11:36
Uhm, have you seen the post before your post?
Mirek
Well, I didn't, but now I tried and the behaviour is not the same
I mean:
1) I must use WhenLeftClick event, and that's ok
2) When I click on a toggle item, it does toggle correctly, BUT when I re-open the droplist
using PostCallback(THISBACK(Drop)) (which I need to keep the droplist in drop state) the ArrayCtrl
cursor gets re-set to current item, and not the one under mouse.
So, if I don't move the mouse (even slightly...) when I click it it gets the wrong line.
I mean, I simply can't toggle and re-toggle an item without moving the mouse between toggles.
Here you can see : I clicked on small lock (which was yellow and got correctly toggled to black), the droplist re-opened
correctly BUT its cursor is on third item and didn't follow mouse cursor which is on item 2.
If I re-click on black lock to toggle it again the lock doesn't toggle
BTW, putting some logs it shows firing WhenAction events even clicking on toggle elements, and it shouldn't.
Anyways I'll try to solve my problem with new upp code.
Thank you!
Massimo
-
Attachment: layers.png
(Size: 16.93KB, Downloaded 371 times)
|
|
|
|
Goto Forum:
Current Time: Tue Nov 12 14:08:02 CET 2024
Total time taken to generate the page: 0.01754 seconds
|