Didier Cabalé

Your Rank: 70
Points: 24
1. Thanks a lot Remy for your detailed answer!!
2. I'm not sure to understand you correctly, in this paragraph:
example of logic I don't understand : you seem to explain that, in the OnCreate, the CM_RECREATEWND message is undoubtedly achieved because the TListView HWND is 0. If my reformulation is correct, then I don't understand the logic. If not, can you please express it differently?If the DFM then changes an affected property afterwards, RecreateWnd() is called, and its CM_RECREATEWND message *HAS* been processed by the time the OnCreate event is called (as evident by the fact that the ListView's HWND is no longer allocated, so Items.Count returns 0). But, what *HAS NOT* been processed yet by the time of the OnCreate event is the need for a new HWND to be allocated.
3. As a solution, you proposed a "ListView1.HandleNeeded". Note that on my side, I proposed a "ListView1.Handle" at the same place :-)
4. This "bug" does not occur with Delphi 10.3 Rio -> no need to add the handle allocation forcing in the OnCreate with Delphi 10.3 Rio
Read More...
1. I use Delphi 10.2 and a VCL project indeed.
2. Please do not forget the essential condition: TListView must be set as ReadOnly at design-time.
Thanks
Read More...
Dear Didier,
I can answer to your first question, ie "why this"?
because:
1. to get this behavior, you probably had set your TListView.ReadOnly property to true, and analyzing the TListView.ReadOnly setter, you have:
procedure TCustomListView.SetReadOnly(Value: Boolean);
begin
if Value <> ReadOnly then
begin
FReadOnly := Value;
RecreateWnd;
end;
end;
And that is the problem: if the TListView handle is not allocated, the function TListItems.GetCount returns 0:
function TListItems.GetCount: Integer;
begin
if Owner.HandleAllocated then
Result := ListView_GetItemCount(Handle)
else
Result := 0;
end;
However, I cannot tell you if this is a wanted behavior or if it is a bug.
Read More...
Hi all,
I just experienced something weird:
1. Place a TListView on a TForm, and some items (TListItems) inside it.
2. On the TForm's OnCreate event, count its Items (TListView.Items.Count), and state that surprisingly the value is 0.
procedure TForm1.FormCreate(Sender: TObject);
var
i: integer;
begin
i := ListView1.Items.Count; // =0!!
My questions are:
1. why this?
2. Is this wanted or a bug?
Thanks
Read More...
Hi Roger,
1. Thanks for your advice
2. Unfortunately, even after setting a break-point in an "asm" section, running and stopping there, I could not manage to get what you tell me.
-> Have you some simple steps that I could reproduce?
Thanks in advance
Read More...
Not better..understand now?
I still do not understand what makes the advantage of using "shift +F7" vs the classic "F7"
Thanks in advance for your help
Read More...
Hi there,
when I want to know in which case I should use "Trace to next source line" (shift +F7)), I don't find many helpful information:
Delphi help says this ->
docwiki.embarcadero.com/RADStudio/Berlin..._to_Next_Source_Line
Marco Cantu says
here
:
"A third option, Trace to Next Source Line (Shift + F7), will move control to the
next line of the source code of your program being executed, regardless of the control
flow. This source code line might be the following line of the source code (as in a Step
Over command), a line inside a function called by your code (as in a Trace Into
command), or a line of code inside an event handler or a callback function of the program
activated by the system".
But this does not tell me in which specific use case this action is interesting to be used, and especially vs the standard "Step over" (F8) and "Trace into" (F7)
Have someone a clearer idea?
Thanks in advance
Read More...
Hi there,
I realized that I misplaced a new topic I posted, about FireMonkey: instead of "Application Development - UI" category, I put it on "Private - FieldTest - Aitana - FireMonkey" category.
The user that I am should not be tempted to place the subject in the wrong category. Why? Because if he places a post in a "Private" descendant Category, this has the very unlucky consequence that *his post will never be referenced* for not logged-in users (cf Firemonkey_post_whenlogged.jpg and Firemonkey_post_whennotlogged.jpg)
Therefore:
1. It is very important for a user to be able to modify his post Category, once already posted.
If not, then the post has big chances to remain unanswered, because unseen by most forum users.
2. It is very important to remind to the user that he is about to post in a "Private" descendant Category.
Thanks for your action.
Read More...
Sorry, cannot see your attachment.
Note to the moderator: is this feature working?
Read More...
preamble for the webmaster: the attachment is accessible only when in "Reply" mode
Ok, now I understand the conditions:
1. Firemonkey application, with, at design-time, a TListBox.
2. TSearchBox as TListBox child, added at run-time.
3. State that, magically, the TSearchBox filters the TListBox content.
The
DocWiki pageDocWiki
says: "TSearchBox is an edit control that provides search capabilities such as filtering the result in the parent"
Thanks for reminding us this capability.
Read More...
> if i add a searchbox control and set it parent to my listbox ..
I understand that you use the *FMX* TListView control with the SearchVisible property set to true, that makes embed a TSearchBox inside the TListView at its top.
If you use the *VCL* TListView or TListBox, then you cannot embed a TSearchBox inside.
Preferably, could you please attach a sample project describing your starting situation in order to avoid useless assumptions.
Read More...
> if i add a searchbox control and set it parent to my listbox ..
I understand that you use the *FMX* TListView control with the SearchVisible property set to true, that makes embed a TSearchBox inside the TListView at its top.
If you use the *VCL* TListView or TListBox, then you cannot embed a TSearchBox inside.
Preferably, could you please attach a sample project describing your starting situation in order to avoid useless assumptions.
Read More...
> if i add a searchbox control and set it parent to my listbox ..
1. I could not add any standalone FMX.TSearchBox, because as the says
DocWiki TSearchBox help
: "TSearchBox is an edit control that provides search capabilities such as filtering the result in the parent."
2. Thus I understand that you use the *FMX* TListView (not TListBox) control with the SearchVisible property set to true, that makes embed a TSearchBox inside the TListView at its top. Correct?
3. If you use the *VCL* TListView or TListBox, then you cannot embed a TSearchBox inside.
Preferably, could you please attach a sample project describing your starting situation in order to avoid useless assumptions.
Read More...
> if i add a searchbox control and set it parent to my listbox ..
I understand that you use the *FMX* TListView control with the SearchVisible property set to true, that makes embed a TSearchBox inside the TListView at its top.
If you use the *VCL* TListView or TListBox, then you cannot embed a TSearchBox inside.
Preferably, could you please attach a sample project describing your starting situation in order to avoid useless assumptions.
Read More...
1. not sure to understand correctly your question: what is an "automatic search"? search start after typing the 1 char or after typing 2 chars? what is your "listbox" ragarding the TSearchBox?
2. if I assume you want to run a search after the 1st char is typed, then why would'nt you run your search on the TSearchBox.OnChange event (leaving nil the classical TSearchBox.OnInvokeSearch)?
Read More...