Currently, Items.Objects[] is used as a pointer:
 
{ TCheckComboItemState }
TCheckComboItemState = record
State: TCheckBoxState;
Enabled: Boolean;
end;
PTCheckComboItemState = ^TCheckComboItemState;  
 
I needed to hook there because the combo can be sorted and Objects are sorted 
too.
If it is enough, I can extend the record to:
{ TCheckComboItemState }
TCheckComboItemState = record
State: TCheckBoxState;
Enabled: Boolean;
Data: TObject;
end;
PTCheckComboItemState = ^TCheckComboItemState;
 
which will allow to users to have associated object but working with Data will 
be little different
than working with normal Combo.
 
Instead
Items.Objects[i];
it will be
PTCheckComboItemState(Items.Objects[i])^.Data;
 
Although, I can do new property TCheckComboBox.Objects[] and getters + setter 
will do the job.
______________________________________________________________
Od: Mattias Gaertner <[email protected]>
Komu: <[email protected]>
Datum: 10.09.2014 16:14
Předmět: Re: [Lazarus] TComboBoxEx and TCheckComboBox

On Wed, 10 Sep 2014 15:51:03 +0200
Vojtěch Čihák <[email protected]> wrote:


The second is combo with checkboxes. Internally it uses Items.Objects[] for 
storing State and ItemEnabled.

Can you change that? Items.Objects is usually for users custom data.

_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus 
<http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to