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 » Ctrls<>() Callback / Disable some rows
Re: Ctrls<>() Callback / Disable some rows [message #9998 is a reply to message #9991] Wed, 13 June 2007 09:33 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14266
Registered: November 2005
Ultimate Member
kcabobert wrote on Tue, 12 June 2007 16:31


2) My ArrayCtrl has an Index column (via AddIndex("primary_key","id")), a column of options (via AddColumn("use","Use").Ctrls<Option>()), and a name column (via AddColumn("name","Name")).



Just a note: This was supposed to use those Id (or SqlId) things, like:

Id PRIMARY_KEY("PRIMARY_KEY"); // possibly global, "Id constant"
....
AddIndex(PRIMARY_KEY, "id");


Using char * there works as well, but it is a but more error prone (you can mistype the string) and U++ has to perform char * -> Id conversion. That is especially not very helpful if you are looping through the ArrayCtrl values.

3.a) I need to SOMETIMES assign a callback to the option column that will uncheck all other options (like a radio ctrl), other times multiple selections are OK.  I can do this if I can reliably figure out in which row the option that triggered the callback resides (I need people to be able to select via mouse or keyboard).

3.b) In some cases I may want one option completely disabled (in other words one row disabled).  However, I still need the row to list.  In these cases removing the option ctrl is acceptable.


Well, Ctrls part of ArrayCtrl seems to be really deficient.

I was thinking about the issue a lot and really the problem seems to be that we have stepped out of U++ paradigm here, introducing class factory, which is nice to solve simple problems, but fails with more complicated ones.

I plan to add some other interface for embeding widgets into ArrayCtrl that will rather use widgets that belong outside the ArrayCtrl (e.g. in the dialog). Something like:

struct MyDialog {
    Array<Option> option;

    void OptionColumn(Ptr<Ctrl>& ctrl, int index)
    {
        ctrl = &option.At(index);
    }

    MyDialog() {
        list.AddColumn("Options").Ctrls(THISBACK(OptionColumn));
    }
};


This way, you would have the full access to the list of options.

What do you think?

Mirek
 
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
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: GridCtrl align text in column
Next Topic: GridCtrl - Child Ctrl, selected row, focus issue
Goto Forum:
  


Current Time: Fri Jul 18 07:19:00 CEST 2025

Total time taken to generate the page: 0.03374 seconds