New TUniCheckListBox componentTUniCheckListBox
Posted 28 August 2017 - 01:29 PM
Posted 31 January 2018 - 07:21 AM
I am trying to build and install this component for XE2 but am getting errors in the following line of code:
Compiler seems to be complaining about .ToString and .ToLower and the error is: "E2018 Record, object or class type required"
Does anyone know what changes I would need to make to the above so it builds?
Posted 06 February 2018 - 07:00 AM
Thanks for the update. However I have noticed something odd.
I have a simple project with just the main form, a button and an empty TUniCheckListBox.
On the button click I have the following code:
procedure TMainForm.UniButton1Click(Sender: TObject); begin UniCheckListBox1.Items.Add('Item 1'); UniCheckListBox1.Items.Add('Item 2'); UniCheckListBox1.Items.Add('Item 3'); UniCheckListBox1.Selected := True; end;
When I run the program and click the button I see the items in the listbox but the Selected does not check the checkbox of the item.
Posted 06 February 2018 - 08:13 AM
It is something related to the way events are treated in Unigui.
- populate the CheckListBox at design time or at runtme in the FormCreate event; then handle just the initialization of Selected in the another event
- set EnableSynchronousOperations to TRUE in UniMainModule, then adjust your code in this way:
Posted 06 March 2018 - 05:30 AM
Thank you for all your help so far.
I've notice that highlight bar which is present in a normal UniGUI listbox is not present.
Is it possible to show the highlight bar so the user knows which record is selected when you click on the item text?
Posted 06 March 2018 - 09:06 AM
It should be sufficient to replace "x-checklist-item" with "x-boundlist-item" in procedure TUniCheckListBox.WebCreate,
in this line:
' list.tpl.html = ''<ul class="x-list-plain"><tpl for="."><li role="option" unselectable="on" class="x-boundlist-item" style="cursor: default;">'+
Posted 07 March 2018 - 11:20 AM
I made the change but noticed that you need to click the checkbox before the item is highlighted.
What I would like is for the highlight bar to operate by just clicking on the row item rather than having to click the checkbox.
In other words the checkbox and highlight bar operate independently of each other.
I played around with the change and I now understand what is happening.
If you select an item by clicking the checkbox the item gets highlighted.
Is it possible to remove the highlight bar when a checkbox is checked i.e. In other words I don't want the checked items to be highlighted?
Posted 11 March 2018 - 08:50 PM
Thanks for sharing your component. I was interested with one more event, maybe someone else will need it.
Add new type:
TOnCheckChange = procedure(Sender: TObject; index: integer; newState: boolean) of object;
in private Add new Field:
in public add new property:
property OnCheckChange: TOnCheckChange read FOnCheckChange write FOnCheckChange;
and in implementation of SetSelected method add new lines at the end of the method:
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users