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 » Newbie corner » Option ctrl in a sqlarray
Option ctrl in a sqlarray [message #46334] Fri, 22 April 2016 14:32 Go to next message
Giorgio is currently offline  Giorgio
Messages: 218
Registered: August 2015
Experienced Member
Hi there,
I have this easy problem but I can't solve it by myself... Embarassed
In a SqlArray there is a "bool" column:

Option OpProspect;

...

Customers.AddColumn(PROSPECT, "Prosp.", 5).Edit(OpProspect);


When the user wants to modify the value, clicks on the field and toggles the option control: this works perfectly.
My problem is that when the row is in "visualization" mode (i.e. not in edit mode), values are shown as 0 or 1, and I would like to have them as option controls also in visualization.
I tried to use .Ctrls <Option>(); but in this case I cannot modify the record.
Hints?
Thanks,
Gio
Re: Option ctrl in a sqlarray [message #46350 is a reply to message #46334] Mon, 25 April 2016 14:01 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
Hi Giorgio:

.Edit(OpProspect) tell the ArrayCtrl (derivative) that all the cells in the column will use this option control for edit purpose. Since there is only one share OpProspect, you cannot have it in all cells (in the column) in the same time.

You might be able to assign a seperate Option control for each cells in the column, but I don't recommend that. Do a DUMP(sizeof(Option)) somewhere in you code, you might be surprised. The base Ctrl has some 200 size, SrollBar has over 1k. Option like close to 300. It's no big deal if it's necessary. But in your case, I will use Display to draw the column if you cannot find a better way. I am not really very familiar with the ArrayCtrl, so I cannot tell if it support your use case more conveniently. Hope some more knowledgeable will tell us. If you don't want to wait, use customized Display.

Re: Option ctrl in a sqlarray [message #46351 is a reply to message #46350] Mon, 25 April 2016 14:24 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
I inspected some example in reference,

you can probably fix you problem simply by changing

Customers.AddColumn(PROSPECT, "Prosp.", 5).Edit(OpProspect);

to
	a.AddColumn(PROSPECT, "Prosp.", 5).Ctrls<Option>();


Turns out Mirek has taken care of your situation long long time ago. But again, use customized Display to draw a picture requires more coding, but will save you some memory. Whether it's worth it is your own decision.


Lance

[Updated on: Mon, 25 April 2016 14:24]

Report message to a moderator

Re: Option ctrl in a sqlarray [message #46413 is a reply to message #46351] Mon, 09 May 2016 11:18 Go to previous message
Giorgio is currently offline  Giorgio
Messages: 218
Registered: August 2015
Experienced Member
Hi Lance,
thank you for your answer; I did try the .Ctrls<Option>(); but in that case I cannot edit the field i.e. I can toggle the option control, buy in the database the field remains unchanged.
Regards,
Gio
Previous Topic: error compiling with upp9801
Next Topic: Use Gstreamer with Upp
Goto Forum:
  


Current Time: Thu Mar 28 18:51:34 CET 2024

Total time taken to generate the page: 0.01173 seconds