Re: [Lazarus] TextHint in TComboBox

2021-11-16 Thread Marcos Douglas B. Santos via lazarus
On Mon, Nov 15, 2021 at 4:50 PM Juha Manninen via lazarus
 wrote:
>
> On Mon, Nov 15, 2021 at 8:12 PM Marcos Douglas B. Santos via lazarus 
>  wrote:
>>
>> Yes, I'll try to copy from 2.2RC. Thank you.
>
>
> Why can't you use 2.2RC directly? It is very close to the final 2.2.
> Do you experience a regression bug there?

I need to use the same version which all developers in the company are using.
But we're testing 2.2RC to see if we can upgrade directly. Thanks.

Marcos Douglas
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TextHint in TComboBox

2021-11-15 Thread Juha Manninen via lazarus
On Mon, Nov 15, 2021 at 8:12 PM Marcos Douglas B. Santos via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> Yes, I'll try to copy from 2.2RC. Thank you.
>

Why can't you use 2.2RC directly? It is very close to the final 2.2.
Do you experience a regression bug there?

Juha
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TextHint in TComboBox

2021-11-15 Thread Marcos Douglas B. Santos via lazarus
On Mon, Nov 15, 2021 at 2:40 PM Bart via lazarus
 wrote:
>
> On Mon, Nov 15, 2021 at 5:04 PM Marcos Douglas B. Santos via lazarus
>  wrote:
>
> > Yes, after finding the bug issue that I posted in the last email, I
> > tested using trunk...
> > But I'm using 2.0.12.
>
> Well, either copy the relevant parts to your 2.0.12, use the 2.2RC or
> wait just a little bit more for the final release...

Yes, I'll try to copy from 2.2RC. Thank you.

Marcos Douglas
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TextHint in TComboBox

2021-11-15 Thread Bart via lazarus
On Mon, Nov 15, 2021 at 5:04 PM Marcos Douglas B. Santos via lazarus
 wrote:

> Yes, after finding the bug issue that I posted in the last email, I
> tested using trunk...
> But I'm using 2.0.12.

Well, either copy the relevant parts to your 2.0.12, use the 2.2RC or
wait just a little bit more for the final release...


-- 
Bart
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TextHint in TComboBox

2021-11-15 Thread Marcos Douglas B. Santos via lazarus
On Mon, Nov 15, 2021 at 12:56 PM Werner Pamler via lazarus
 wrote:
>
> Am 15.11.2021 um 16:37 schrieb Marcos Douglas B. Santos via lazarus:
> > I need to implement a TextHint property—as we have in TEdit— in a
> >  component inherited from TComboBox. Doesn't matter if it will be
> > "emulated" or not.
> >
> > My first thought was copying from TEdit... however, is this the better
> > way?
> > Maybe sharing this code, in Lazarus code, for other components, would
> > be a better design instead of inside TEdit?
> It's already there, at least in Laz 2.2+.

Yes, after finding the bug issue that I posted in the last email, I
tested using trunk...
But I'm using 2.0.12.

regards,
Marcos Douglas
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TextHint in TComboBox

2021-11-15 Thread Werner Pamler via lazarus

Am 15.11.2021 um 16:37 schrieb Marcos Douglas B. Santos via lazarus:
I need to implement a TextHint property—as we have in TEdit— in a 
 component inherited from TComboBox. Doesn't matter if it will be 
"emulated" or not.


My first thought was copying from TEdit... however, is this the better 
way?
Maybe sharing this code, in Lazarus code, for other components, would 
be a better design instead of inside TEdit?

It's already there, at least in Laz 2.2+.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TextHint in TComboBox

2021-11-15 Thread Marcos Douglas B. Santos via lazarus
On Mon, Nov 15, 2021 at 12:37 PM Marcos Douglas B. Santos
 wrote:
>
> Hi,
> I need to implement a TextHint property—as we have in TEdit— in a  component 
> inherited from TComboBox. Doesn't matter if it will be "emulated" or not.
>
> My first thought was copying from TEdit... however, is this the better way?
> Maybe sharing this code, in Lazarus code, for other components, would be a 
> better design instead of inside TEdit?

I've found this https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/30682

Marcos Douglas
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] TextHint in TComboBox

2021-11-15 Thread Marcos Douglas B. Santos via lazarus
Hi,
I need to implement a TextHint property—as we have in TEdit— in a
 component inherited from TComboBox. Doesn't matter if it will be
"emulated" or not.

My first thought was copying from TEdit... however, is this the better way?
Maybe sharing this code, in Lazarus code, for other components, would be a
better design instead of inside TEdit?

best regards,
Marcos Douglas
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TextHint in TComboBox

2020-08-14 Thread Juha Manninen via lazarus
On Fri, Aug 14, 2020 at 9:32 AM Ondrej Pokorny via lazarus
 wrote:
> Why have you removed the (FTextHint <> '') check in CanShowEmulatedTextHint?
> Why should the emulated text hint be shown if there is none?

It was restored later as I noticed the same error.
First I planned to make it generic code for both TEdit and TCombobox.
Then I just copied it.
The latest revision is 63734.

Juha
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TextHint in TComboBox

2020-08-14 Thread Ondrej Pokorny via lazarus

On 13.08.2020 21:33, Juha Manninen via lazarus wrote:

On Thu, Aug 13, 2020 at 9:54 PM Ondrej Pokorny via lazarus
 wrote:

So for TMemo we need the emulated code, which works now with a minor bug
(the TextHint is not visible when the form is shown the first time).
Strangely the bug is present only in a themed application, not in an
unthemed one.

Please test with the demo by Lagunov Aleksey in
  https://bugs.freepascal.org/view.php?id=37553
adding the line
  Memo1.TextHint:='My own TextHint';
as seen in my note.
Also remember to change function TCustomMemo.CanShowEmulatedTextHint.
It now returns False always.
The emulation does not work with GTK2.


Why have you removed the (FTextHint <> '') check in CanShowEmulatedTextHint?

Why should the emulated text hint be shown if there is none?

Ondrej

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TextHint in TComboBox

2020-08-13 Thread Juha Manninen via lazarus
On Thu, Aug 13, 2020 at 9:54 PM Ondrej Pokorny via lazarus
 wrote:
> So for TMemo we need the emulated code, which works now with a minor bug
> (the TextHint is not visible when the form is shown the first time).
> Strangely the bug is present only in a themed application, not in an
> unthemed one.

Please test with the demo by Lagunov Aleksey in
 https://bugs.freepascal.org/view.php?id=37553
adding the line
 Memo1.TextHint:='My own TextHint';
as seen in my note.
Also remember to change function TCustomMemo.CanShowEmulatedTextHint.
It now returns False always.
The emulation does not work with GTK2.

Juha
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TextHint in TComboBox

2020-08-13 Thread Ondrej Pokorny via lazarus

On 13.08.2020 17:58, Juha Manninen via lazarus wrote:

On Thu, Aug 13, 2020 at 6:50 PM Juha Manninen  wrote:

AFAIK it is not emulated on Windows. LCL-Win32 reports LCLCapability
flag lcTextHint.

Actually it is emulated for older Windows versions.
function TWin32WidgetSet.GetLCLCapability has :
   ...
 lcTextHint:
 begin
   if (ComCtlVersion >= ComCtlVersionIE6) then
 Result := LCL_CAPABILITY_YES
   else
 Result := LCL_CAPABILITY_NO;
 end;

For Windows 10 it should report LCL_CAPABILITY_YES.


Funnily I tested with themes off, so I got LCL_CAPABILITY_NO :)

But yes, you are correct. That is not optimal. We need to split 
lcTextHint into lcTextHintEdit and lcTextHintMemo. Because as I wrote 
before WinAPI doesn't support TextHint for multi-line text boxes 
(TMemo): 
https://docs.microsoft.com/en-us/windows/win32/api/commctrl/nf-commctrl-edit_setcuebannertext


So for TMemo we need the emulated code, which works now with a minor bug 
(the TextHint is not visible when the form is shown the first time). 
Strangely the bug is present only in a themed application, not in an 
unthemed one.


Ondrej

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TextHint in TComboBox

2020-08-13 Thread Vojtěch Čihák via lazarus

Yes, it looks fine now.
 
Thanks!
__

Od: "Juha Manninen via lazarus" 
Komu: "Lazarus mailing list" 
Datum: 13.08.2020 19:36
Předmět: Re: [Lazarus] TextHint in TComboBox


Please test with r63734.
The 3-state type TEmulatedTextHintStatus and its thsChanging was
needed after all.
Should have tested still more. :(
At least here it works now.

Juha
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus 
<https://lists.lazarus-ide.org/listinfo/lazarus>

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TextHint in TComboBox

2020-08-13 Thread Juha Manninen via lazarus
Please test with r63734.
The 3-state type TEmulatedTextHintStatus and its thsChanging was
needed after all.
Should have tested still more. :(
At least here it works now.

Juha
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TextHint in TComboBox

2020-08-13 Thread Juha Manninen via lazarus
On Thu, Aug 13, 2020 at 6:56 PM Vojtěch Čihák via lazarus
 wrote:
> something went wrong. When I open IDE Options or Project Options and I click 
> on any item of TreeView, everything disappear. Content of the filter become 
> "(filter)". When I change it (i.e. non-empty string), content is back.
>
> And many of the content is italic.
>
> Lazarus 2.1.0 r63731M FPC 3.3.1 x86_64-linux-qt

Yours is QT4 I guess.
Damn right, I can reproduce with GTK2 IDE. I mostly tested individual
applications only.
I try to figure out what is going on...

Juha
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TextHint in TComboBox

2020-08-13 Thread Juha Manninen via lazarus
On Thu, Aug 13, 2020 at 6:50 PM Juha Manninen  wrote:
> AFAIK it is not emulated on Windows. LCL-Win32 reports LCLCapability
> flag lcTextHint.

Actually it is emulated for older Windows versions.
function TWin32WidgetSet.GetLCLCapability has :
  ...
lcTextHint:
begin
  if (ComCtlVersion >= ComCtlVersionIE6) then
Result := LCL_CAPABILITY_YES
  else
Result := LCL_CAPABILITY_NO;
end;

For Windows 10 it should report LCL_CAPABILITY_YES.

Juha
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TextHint in TComboBox

2020-08-13 Thread Vojtěch Čihák via lazarus

Hi,
 
something went wrong. When I open IDE Options or Project Options and I click on any item 
of TreeView, everything disappear. Content of the filter become "(filter)". 
When I change it (i.e. non-empty string), content is back.
And many of the content is italic.
 
Lazarus 2.1.0 r63731M FPC 3.3.1 x86_64-linux-qt
 
Vojtěch a.k.a. Blaazen
__

Od: "Juha Manninen via lazarus" 
Komu: "Lazarus mailing list" 
Datum: 13.08.2020 14:10
Předmět: [Lazarus] TextHint in TComboBox


Regarding issue :
https://bugs.freepascal.org/view.php?id=30682 
<https://bugs.freepascal.org/view.php?id=30682>

I added TextHint to TComboBox in r63731. QT5 now works with native
TextHint, GTK2 with emulated one.
Native support for Win32 is not implemented yet. Somebody please implement it.
Other widgetsets that natively support this feature for TComboBox,
should also be updated.

I have a question about TextHint support of TEdit in Win32. The
widgetset binding code tests EmulatedTextHintShowing and calls
CreateEmulatedTextHintFont from generic LCL code.
Does it mean it actually emulates the feature inside the binding code
instead of using a native feature?
It should not be needed as the emulated TextHint works purely in LCL code level.
Same thing with QT4 binding code. It also uses emulated TextHint
specific stuff. Is it needed?

TextHint in TMemo works only with widgetset's native support. It works
with QT5 but not with GTK2.
The emulation for TMemo turned out to be tricky. It may never be
implemented, unless somebody provides a patch of course.

Regards,
Juha
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus 
<https://lists.lazarus-ide.org/listinfo/lazarus>

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TextHint in TComboBox

2020-08-13 Thread Juha Manninen via lazarus
On Thu, Aug 13, 2020 at 6:40 PM Ondrej Pokorny via lazarus
 wrote:
> Emulated TMemo.TextHint (r63708) works perfectly on Win32 (Windows 10).
> I haven't checked your more recent changes. WinAPI doesn't support
> TMemo.TextHint natively.

AFAIK it is not emulated on Windows. LCL-Win32 reports LCLCapability
flag lcTextHint.
There is a related bug report :
 https://bugs.freepascal.org/view.php?id=35967

I tested the emulation only with GTK2.
I should have mentioned the problem comes only when adding lines to a
Memo by code when the Memo has no focus.
It is demonstrated by the example project in issue #37553.

I don't have Windows now at all. I was hoping not to install it again
as I don't need it for anything. Maybe I must have it for Lazarus
testing anyway.

Juha
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TextHint in TComboBox

2020-08-13 Thread Ondrej Pokorny via lazarus

On 13.08.2020 15:15, Juha Manninen via lazarus wrote:

On Thu, Aug 13, 2020 at 3:23 PM Ondrej Pokorny via lazarus
 wrote:

If I am not mistaken, TEdit has TextHint-emulation for WidgetSets
without native support. There is no reason why the same emulation
shouldn't work with TMemo.

It does not. Actually it never worked. Nobody has tested it maybe
because TMemo.TextHint was not published.


Emulated TMemo.TextHint (r63708) works perfectly on Win32 (Windows 10). 
I haven't checked your more recent changes. WinAPI doesn't support 
TMemo.TextHint natively.


Ondrej

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TextHint in TComboBox

2020-08-13 Thread Juha Manninen via lazarus
On Thu, Aug 13, 2020 at 3:23 PM Ondrej Pokorny via lazarus
 wrote:
> If I am not mistaken, TEdit has TextHint-emulation for WidgetSets
> without native support. There is no reason why the same emulation
> shouldn't work with TMemo.

It does not. Actually it never worked. Nobody has tested it maybe
because TMemo.TextHint was not published.
The native support eg. with LCL-QT5 does work.
What happened so far:
The emulated TEdit.TextHint was not updated always. I fixed it :
 https://bugs.freepascal.org/view.php?id=37506
Then I simplified the code in r63725 which broke TMemo's behavior :
 https://bugs.freepascal.org/view.php?id=37553
Then I realized that emulated TMemo.TextHint never worked and disabled
it completely in r63726.
You can test by reverting it. I believe it can be fixed somehow. I
will be happy if you take a look at it.

-- r63726 --
function TCustomMemo.CanShowEmulatedTextHint: Boolean;
 begin
-  Result :=
-Assigned(Lines) // CM_EXIT is sent in destroy -> this
function is called in destructor when Lines are already destroyed
-and (Lines.Count = 0)
-and inherited CanShowEmulatedTextHint;
+  // CM_EXIT is sent in destroy -> this is called in destructor when
Lines are already destroyed
+  //Result := Assigned(Lines) and inherited CanShowEmulatedTextHint;
+  // ToDo: Make this work. The line above does not work with GTK2 at least.
+  Result := False;
 end;


Juha
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TextHint in TComboBox

2020-08-13 Thread Ondrej Pokorny via lazarus

On 13.08.2020 14:10, Juha Manninen via lazarus wrote:

TextHint in TMemo works only with widgetset's native support. It works
with QT5 but not with GTK2.
The emulation for TMemo turned out to be tricky. It may never be
implemented, unless somebody provides a patch of course.


If I am not mistaken, TEdit has TextHint-emulation for WidgetSets 
without native support. There is no reason why the same emulation 
shouldn't work with TMemo.


Ondrej

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] TextHint in TComboBox

2020-08-13 Thread Juha Manninen via lazarus
Regarding issue :
 https://bugs.freepascal.org/view.php?id=30682

I added TextHint to TComboBox in r63731. QT5 now works with native
TextHint, GTK2 with emulated one.
Native support for Win32 is not implemented yet. Somebody please implement it.
Other widgetsets that natively support this feature for TComboBox,
should also be updated.

I have a question about TextHint support of TEdit in Win32. The
widgetset binding code tests EmulatedTextHintShowing and calls
CreateEmulatedTextHintFont from generic LCL code.
Does it mean it actually emulates the feature inside the binding code
instead of using a native feature?
It should not be needed as the emulated TextHint works purely in LCL code level.
Same thing with QT4 binding code. It also uses emulated TextHint
specific stuff. Is it needed?

TextHint in TMemo works only with widgetset's native support. It works
with QT5 but not with GTK2.
The emulation for TMemo turned out to be tricky. It may never be
implemented, unless somebody provides a patch of course.

Regards,
Juha
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] TextHint for TCombobox?

2019-08-11 Thread Alexey Tor. via lazarus
I see that TextHint works for Edit/Memo - but its not supported for 
Combobox (in editable style).


Can you add?

--
Regards,
Alexey

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus