Re: [Lazarus] lazcontrols filters

2015-10-11 Thread Ondrej Pokorny

On 10.10.2015 18:47, Juha Manninen wrote:
Rekonq uses both QT and KDE libs. Not directly usable for LCL 
implementation but a nice idea anyway.


It was not exactly an idea to implement it in the LCL but more an 
argument that it is possible to do advanced stuff (custom painting, text 
area moving etc.) even on Linux and not only on Windows.


So that means that it is possible to custom paint an edit at least on 
Qt. It is another problem that we (me definitely) don't know how to do it.


Rekonq source is available on the internet 
https://projects.kde.org/projects/extragear/network/rekonq/repository so 
somebody with Qt knowledge could check how they do it and if it is 
possible to use a similar approach in the LCL.


The fact that TextHint uses the "normal" Text property in TEdit sounds 
more a hack to me. Such custom painting could be safely used for 
TComboBox as well.


Safari is able to do the same on OSX, so I assume that custom painting 
is available on every widgetset.


Ondrej

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-11 Thread Bart
On 10/11/15, Ondrej Pokorny  wrote:

> The fact that TextHint uses the "normal" Text property in TEdit sounds
> more a hack to me. Such custom painting could be safely used for
> TComboBox as well.

Yes it is.
We did it that way because not all widgetsets natively support such a
feature (or at least we were not aware of this).
And we were not willing to make TCustomEdit "custom painted".

TextHint is natively supported on Windows (and most likely on WinCE)
via a system API.
If (and only if) this can be achieved via all other widgetsets (QT,
GTK2, Carbon, Cocoa) the hack can be removed and the code can be moved
to the widgetset implementation.

So, does anybody know wether the other widgetsets offer this
functionalitly natively?

Bart

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-11 Thread zeljko

On 10/10/2015 06:38 PM, Ondrej Pokorny wrote:


This is exactly what I was thinking. The rekonq browser has the same. It
is even able to put a button in front of the text in the edit and start
the text after the edit + the hint text is centered. I admit that I
don't know if rekonq uses Qt or Gtk2.


That's because rekonq uses kdelibs which have their own implementation 
of QLineEdit.


zeljko


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-11 Thread zeljko

On 10/11/2015 08:38 AM, Ondrej Pokorny wrote:

On 10.10.2015 18:47, Juha Manninen wrote:

Rekonq uses both QT and KDE libs. Not directly usable for LCL
implementation but a nice idea anyway.


It was not exactly an idea to implement it in the LCL but more an
argument that it is possible to do advanced stuff (custom painting, text
area moving etc.) even on Linux and not only on Windows.

So that means that it is possible to custom paint an edit at least on
Qt. It is another problem that we (me definitely) don't know how to do it.


Yes, it's possible to achieve that goal with Qt. In event filter of 
TQtLineEdit add QPaintEvent, and:

1.Paint QLineEdit by Qt - use QObject_event(Widget, Event);
2.Now call SlotPaint() which creates TQtDeviceContext and passes it to 
LCL ... if TEdit have Canvas and OnPaint you can do whatever in that case.

3.Now set Result := True in QPaintEvent, so Qt won't paint it again.

zeljko


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-10 Thread Krzysztof
TextHint could be visibile even when edit is focused (but still empty of
course). This is how many edit controls work nowadays, e.g address edit in
FireFox
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-10 Thread Ondrej Pokorny

On 10.10.2015 17:52, Krzysztof wrote:
TextHint could be visibile even when edit is focused (but still empty 
of course). This is how many edit controls work nowadays, e.g address 
edit in FireFox
This is exactly what I was thinking. The rekonq browser has the same. It 
is even able to put a button in front of the text in the edit and start 
the text after the edit + the hint text is centered. I admit that I 
don't know if rekonq uses Qt or Gtk2.


Whereas I know how to achieve it on Windows (one can find a lot of 
sources for it in the internet), on other widgetsets it could be tricky 
as Bart already stated. Unfortunately I don't have the knowledge to do 
it in all widgetsets :(


Ondrej
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-10 Thread Juha Manninen
On Sat, Oct 10, 2015 at 7:38 PM, Ondrej Pokorny  wrote:
> This is exactly what I was thinking. The rekonq browser has the same. It is
> even able to put a button in front of the text in the edit and start the
> text after the edit + the hint text is centered. I admit that I don't know
> if rekonq uses Qt or Gtk2.

Rekonq uses both QT and KDE libs. Not directly usable for LCL
implementation but a nice idea anyway.

Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-09 Thread Bart
On 10/9/15, Ondrej Pokorny  wrote:

> But if we assume that it is possible in TComboBox with OwnerDraw, there
> must be a way how to do it even on Gtk2. Or is OwnerDraw linked with
> some Gtk2-ComboBox property?

It may be possible, but TextHint vailability cannot depend on OwnerDraw.

Bart

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-09 Thread Bart
On 10/8/15, Ondrej Pokorny  wrote:

> Isn't is possible to paint the TextHint text manually into the combobox
> / edit?

At least TCustomEdit does not have a canvas, so that won't work (would
have been so much easier than the current implementation).
Does TComboBox have a canvas?

Bart

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-09 Thread Ondrej Pokorny

On 09.10.2015 18:43, Bart wrote:

On 10/8/15, Ondrej Pokorny  wrote:


Isn't is possible to paint the TextHint text manually into the combobox
/ edit?

At least TCustomEdit does not have a canvas, so that won't work (would
have been so much easier than the current implementation).
Does TComboBox have a canvas?

TComboBox must have a canvas because it supports OwnerDrawing.

Ondrej

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-09 Thread Bart
On 10/9/15, Ondrej Pokorny  wrote:

> TComboBox must have a canvas because it supports OwnerDrawing.

You're right.
And if OwnerDrawing is False then everything you write tothe cnavs
gets erased whenever the control paints itself.
So, maybe not the way to go.

Bart

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-09 Thread Ondrej Pokorny

On 09.10.2015 19:38, Bart wrote:
You're right. And if OwnerDrawing is False then everything you write 
tothe cnavs gets erased whenever the control paints itself. So, maybe 
not the way to go.


True.

I was able to paint custom shapes on TEdit on Windows with this 
approach: 
http://stackoverflow.com/questions/9758016/how-do-i-custom-draw-of-tedit-control-text 
. It works well.


But it fails on Linux/Gtk2. The edit control is always painted after my 
paint procedure, overpainting everything except a tiny space between 
bounds and the edit.


But if we assume that it is possible in TComboBox with OwnerDraw, there 
must be a way how to do it even on Gtk2. Or is OwnerDraw linked with 
some Gtk2-ComboBox property?


Ondrej


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-08 Thread Péter Gábor
Would it be a serious incompatibility that can break compilation of
project sources? (I never used delphi)

Do you think that a new ComboBox implementation (based on TComboBox)
with copy-pasted TextHint support can be a good solution?
...or it would be better to forget this.

2015-10-07 20:30 keltezéssel, Bart írta:
> It would be Delphi incompatible.
> AFAIK TextHint is introduced in TCustomEdit there.

-- 
Péter Gábor
p...@freemail.hu


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-08 Thread Juha Manninen
On Wed, Oct 7, 2015 at 6:47 PM, Péter Gábor  wrote:
> What do you think about moving TextHint related things from TCustomEdit
> to TWinControl to make TextHint available for all TWinControl
> descendants, for example TComboBox.

I don't think it makes sense for all TWinControl derivatives.

> In this case developers may have unified look of controls on a single form.
> Anyway TextHint for ComboBoxes would be welcome.

For TComboBox it would make sense.
It would be an extension and thus not break Delphi compatibility either.
I think it is a good idea.

Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-08 Thread Ondrej Pokorny

On 08.10.2015 18:37, Juha Manninen wrote:

On Thu, Oct 8, 2015 at 7:22 PM, Bart  wrote:

This is rather more tricky than what we did for TCustomEdit.
Mind you that Delphi has it easy,it simply calls some Windows API to
get this done, but we need to implement this cross-platform (hence we
override RealSetText and RealGetText).
Setting Text in a ComboBox may have other side effects then in a TCustomEdit.

Ok, I don't know the details well.


Isn't is possible to paint the TextHint text manually into the combobox 
/ edit?


Ondrej

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-08 Thread Bart
On 10/8/15, Juha Manninen  wrote:

>
> I don't think it makes sense for all TWinControl derivatives.
>
> For TComboBox it would make sense.
> It would be an extension and thus not break Delphi compatibility either.
> I think it is a good idea.

This is rather more tricky than what we did for TCustomEdit.
Mind you that Delphi has it easy,it simply calls some Windows API to
get this done, but we need to implement this cross-platform (hence we
override RealSetText and RealGetText).
Setting Text in a ComboBox may have other side effects then in a TCustomEdit.

Bart

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-08 Thread Juha Manninen
On Thu, Oct 8, 2015 at 7:22 PM, Bart  wrote:
> This is rather more tricky than what we did for TCustomEdit.
> Mind you that Delphi has it easy,it simply calls some Windows API to
> get this done, but we need to implement this cross-platform (hence we
> override RealSetText and RealGetText).
> Setting Text in a ComboBox may have other side effects then in a TCustomEdit.

Ok, I don't know the details well.

Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-07 Thread Péter Gábor
What do you think about moving TextHint related things from TCustomEdit
to TWinControl to make TextHint available for all TWinControl
descendants, for example TComboBox.
In this case developers may have unified look of controls on a single form.
Anyway TextHint for ComboBoxes would be welcome.

2015-10-05 18:40 keltezéssel, Bart írta:
> Please post patches (in bugtracker) for controls (TCustomEdit
> descendants or compound controls that have a TCustomEdit in it) that
> do not pubish these properties.

-- 
Péter Gábor
p...@freemail.hu


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-07 Thread Bart
On 10/7/15, Péter Gábor  wrote:

> What do you think about moving TextHint related things from TCustomEdit
> to TWinControl to make TextHint available for all TWinControl
> descendants, for example TComboBox.

It would be Delphi incompatible.
AFAIK TextHint is introduced in TCustomEdit there.

Bart

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-06 Thread Péter Gábor
Patch is posted: http://bugs.freepascal.org/view.php?id=28781
I hope I did not miss something...

2015-10-05 18:40 keltezéssel, Bart írta:
> Please post patches (in bugtracker) for controls (TCustomEdit
> descendants or compound controls that have a TCustomEdit in it) that
> do not pubish these properties.

-- 
Péter Gábor
p...@freemail.hu


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] lazcontrols filters

2015-10-05 Thread Andrea Mauri

Dear all,

I didn't find a way to change the grey text "(filter)" that appears in 
TListFilterEdit controls and similar.


I think it could be useful to have a property storing that text in order 
to be able to personalize it. It's quite common to put a tip to what can 
be written in that box, something like "Find something..."


I missed it?

Regards,
Andrea Mauri

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-05 Thread Péter Gábor
Hi!

Use can use TListFilterEdit.TextHint if you uye the developer version.
Unfortunately .TextHint does not appear in the Object Inspector yet.

2015-10-05 14:06 keltezéssel, Andrea Mauri írta:
> I didn't find a way to change the grey text "(filter)" that appears in
> TListFilterEdit controls and similar.
> I think it could be useful to have a property storing that text in order
> to be able to personalize it. It's quite common to put a tip to what can
> be written in that box, something like "Find something..."
> 
> I missed it?
> 
> Regards,
> Andrea Mauri

-- 
Péter Gábor
p...@freemail.hu


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-05 Thread Bart
On 10/5/15, Péter Gábor  wrote:


> Trunk has TextHint since a while...
> I hope that the developers will change the classes to allow access of
> .TextHint in the Object Inspector.

Please post patches (in bugtracker) for controls (TCustomEdit
descendants or compound controls that have a TCustomEdit in it) that
do not pubish these properties.
They can be assigned to me.

Bart

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-05 Thread Andrea Mauri

I am using lazarus svn fixes_1_4, no texthint here.
Is TextHint in trunk?

Andrea


Il 05/10/2015 16:18, Péter Gábor ha scritto:

Hi!

Use can use TListFilterEdit.TextHint if you uye the developer version.
Unfortunately .TextHint does not appear in the Object Inspector yet.

2015-10-05 14:06 keltezéssel, Andrea Mauri írta:

I didn't find a way to change the grey text "(filter)" that appears in
TListFilterEdit controls and similar.
I think it could be useful to have a property storing that text in order
to be able to personalize it. It's quite common to put a tip to what can
be written in that box, something like "Find something..."

I missed it?

Regards,
Andrea Mauri



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-05 Thread Péter Gábor
I'm using Lazarus 1.5 from trunk (r49937).
Trunk has TextHint since a while...
I hope that the developers will change the classes to allow access of
.TextHint in the Object Inspector.

2015-10-05 18:09 keltezéssel, Andrea Mauri írta:
> I am using lazarus svn fixes_1_4, no texthint here.
> Is TextHint in trunk?
> 
> Andrea
> 
> 
> Il 05/10/2015 16:18, Péter Gábor ha scritto:
>> Hi!
>>
>> Use can use TListFilterEdit.TextHint if you uye the developer version.
>> Unfortunately .TextHint does not appear in the Object Inspector yet.
>>
>> 2015-10-05 14:06 keltezéssel, Andrea Mauri írta:
>>> I didn't find a way to change the grey text "(filter)" that appears in
>>> TListFilterEdit controls and similar.
>>> I think it could be useful to have a property storing that text in order
>>> to be able to personalize it. It's quite common to put a tip to what can
>>> be written in that box, something like "Find something..."
>>>
>>> I missed it?
>>>
>>> Regards,
>>> Andrea Mauri
> 
> 
> -- 
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
> 
> 

-- 
Péter Gábor
p...@freemail.hu


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus