Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-04

Feature request/inquiry

18 messages · 8 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt

Hi,

I was wondering about the following:

Many websites have a feature where, in a form that you must fill in, some explanatory text is shown in fields. This explanatory text is somewhat grayed in appearance, and disappears as soon as you start typing.

Something like: (use fixed font to see this):
+---------+--------------------------------------+ | Name : | <Type your first and last name> | +---------+--------------------------------------+

I use a web toolkit called ExtJS, and it has a property 'emptyText'. This is the text that appears in the edit field when empty. We started using it extensively after we heard from our customers this is really valuable. (more so than a tooltip)

Is there such a thing for Lazarus' TEdit and related controls ? if not, is it planned ?

Michael.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt
Michael Van Canneyt wrote
Is there such a thing for Lazarus' TEdit and related controls ? if not, is it planned ?

I may be wrong, but I don't believe all LCL's backend toolkits support this, and probably why TEdit doesn't support it yet.

Now, if you used fpGUI you could simply set the ExtraHint value and be done. [Graeme runs and hides] :-)

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

zeljko
to Juha Manninen
Juha Manninen wrote 10 lines
On Sun, Apr 26, 2015 at 1:26 PM, Michael Van Canneyt wrote: > Is there such a thing for Lazarus' TEdit and related controls ? if not, is > it planned ? It is planned : http://bugs.freepascal.org/view.php?id=21307 I don't know how many widgetsets support it but we can implement it like already done in the FilterEdit components.

if FilterEdit works on all widgetsets (and I don't see any reason why it should not work), then it won't be problem to implement it imo.

z.

Reply by email

Michael Van Canneyt
to zeljko
zeljko wrote 14 lines
On 04/26/2015 01:41 PM, Juha Manninen wrote: > On Sun, Apr 26, 2015 at 1:26 PM, Michael Van Canneyt > wrote: >> Is there such a thing for Lazarus' TEdit and related controls ? if not, is >> it planned ? > > It is planned : > http://bugs.freepascal.org/view.php?id=21307 > > I don't know how many widgetsets support it but we can implement it > like already done in the FilterEdit components. if FilterEdit works on all widgetsets (and I don't see any reason why it should not work), then it won't be problem to implement it imo.

Good :)

A small note concerning TFilterEdit for listviews: I tried using it but it's not usable.

You cannot associate any data pointer with the list items, which is essential for my needs. You also cannot set the icon for the items (in fact, no properties can be set but the caption)

At first I thought it would operate directly on the list items itself, but it seems it has it's private copy of the data and rebuilds the listview using that. For some strange reason the author decided it was enough to use an array of strings. Quod non :(

Michael.

Reply by email

zeljko
to Michael Van Canneyt
Michael Van Canneyt wrote 14 lines
Good :) A small note concerning TFilterEdit for listviews: I tried using it but it's not usable. You cannot associate any data pointer with the list items, which is essential for my needs. You also cannot set the icon for the items (in fact, no properties can be set but the caption) At first I thought it would operate directly on the list items itself, but it seems it has it's private copy of the data and rebuilds the listview using that. For some strange reason the author decided it was enough to use an array of strings. Quod non :(

AFAIR, Juha is the author. So ask him and propose some beers on next conference :))))))))))

zeljko

Reply by email

Dmitry Boyarintsev
to Michael Van Canneyt: Good :) A small note concerning TFilterEdit for listviews: I tried using it but it's not…

On Sun, Apr 26, 2015 at 8:13 AM, Michael Van Canneyt <

Show quoted text 8 lines
wrote: At first I thought it would operate directly on the list items itself, but it seems it has it's private copy of the data and rebuilds the listview using that. For some strange reason the author decided it was enough to use an array of strings. Quod non :(

Check this thread, please.
http://forum.lazarus.freepascal.org/index.php/topic,27901.msg

Certainly, having only TextHint property only is not enough.

thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150426/9987cd5b/attachment.html>

Reply by email

Juha Manninen
to Michael Van Canneyt: Good :) A small note concerning TFilterEdit for listviews: I tried using it but it's not…
Michael Van Canneyt wrote
A small note concerning TFilterEdit for listviews: I tried using it but it's not usable.

Yes, the ListViewFilterEdit is the latest addition to FilterEdit family. I made it initially for the Package -> Open Loaded Package view, it will (hopefully) be improved later.
ListView is a problematic component, let's see if all features can be supported.

Juha

Reply by email

Michael Van Canneyt
to Juha Manninen
Juha Manninen wrote 9 lines
On Sun, Apr 26, 2015 at 3:13 PM, Michael Van Canneyt wrote: > A small note concerning TFilterEdit for listviews: I tried using it but > it's not usable. Yes, the ListViewFilterEdit is the latest addition to FilterEdit family. I made it initially for the Package -> Open Loaded Package view, it will (hopefully) be improved later. ListView is a problematic component, let's see if all features can be supported.

No problem, I just wanted to point out that the usage with the current implementation is limited.

Michael.

Reply by email

luiz americo pereira camara
to Juha Manninen: On Sun, Apr 26, 2015 at 1:26 PM, Michael Van Canneyt It is planned :…

2015-04-26 8:41 GMT-03:00 Juha Manninen :

Show quoted text 12 lines
On Sun, Apr 26, 2015 at 1:26 PM, Michael Van Canneyt wrote: > Is there such a thing for Lazarus' TEdit and related controls ? if not, is > it planned ? It is planned : http://bugs.freepascal.org/view.php?id=21307 I don't know how many widgetsets support it but we can implement it like already done in the FilterEdit components.

I implemented here long time ago:
https://code.google.com/p/luipack/source/browse/trunk/luicontrols/searchedit.pas

If agreed i can add to LCL as TEdit.TextHint

Luiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150426/6091b768/attachment-0001.html>

Reply by email

Dmitry Boyarintsev
to luiz americo pereira camara: 2015-04-26 8:41 GMT-03:00 Juha Manninen : I implemented here long time ago:…

On Sun, Apr 26, 2015 at 1:35 PM, luiz americo pereira camara <

Show quoted text 8 lines
wrote: I implemented here long time ago: https://code.google.com/p/luipack/source/browse/trunk/luicontrols/searchedit.pas If agreed i can add to LCL as TEdit.TextHint

Two notes here:

#1
for the case of TSearchEdit - it should be (optionally) a stand alone widget, rather than a hard-coded pure LCL control. otherwise it would not be rendered properly for OSX https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/OSXHIGuidelines/ControlsText.html#//apple_ref/doc/uid/20000957-CH51-SW5

and maybe (https://developer.gnome.org/gtk3/stable/GtkSearchBar.html) gtk3 ?

Win32 as well as Qt doesn't seem to have "native" controls, thus having LCL-level wrapper is a good solution for them.

#2
Is luipack being moved to other source hosting service? (i.e. github, sourceforge). code.google is closing.

thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150426/997f0103/attachment.html>

Reply by email

silvioprog
to Dmitry Boyarintsev

On Sun, Apr 26, 2015 at 3:18 PM, Dmitry Boyarintsev <

Show quoted text 34 lines
wrote: On Sun, Apr 26, 2015 at 1:35 PM, luiz americo pereira camara < > wrote: > > I implemented here long time ago: > https://code.google.com/p/luipack/source/browse/trunk/luicontrols/searchedit.pas > > If agreed i can add to LCL as TEdit.TextHint > Two notes here: #1 for the case of TSearchEdit - it should be (optionally) a stand alone widget, rather than a hard-coded pure LCL control. otherwise it would not be rendered properly for OSX https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/OSXHIGuidelines/ControlsText.html#//apple_ref/doc/uid/20000957-CH51-SW5 and maybe (https://developer.gnome.org/gtk3/stable/GtkSearchBar.html) gtk3 ? Win32 as well as Qt doesn't seem to have "native" controls, thus having LCL-level wrapper is a good solution for them. #2 Is luipack being moved to other source hosting service? (i.e. github, sourceforge). code.google is closing. thanks, Dmitry

In Windows:

uses
  Windows;
procedure TForm1.FormCreate(Sender: TObject);
const
  ECM_FIRST = $1500;
  EM_SETCUEBANNER = ECM_FIRST + 1;
begin
  SendMessage(Edit1.Handle, EM_SETCUEBANNER, 0,
    LParam(PWideChar(WideString('My placeholder on Windows'))));
end;

I implemented this feature in an old project that I maintain, LazSolutions, and it was cross-platform.

Silvio Cl?cio My public projects - github.com/silvioprog -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150426/e234cbe5/attachment.html>

Reply by email

Dmitry Boyarintsev
to silvioprog
silvioprog wrote 5 lines
I implemented this feature in an old project that I maintain, LazSolutions, and it was cross-platform.

Nice! EM_SETCUEBANNER doesn't have Ansi version, it only accepts WideChars (even for Ansi windows)
But, why was cross-platform? Is it broken now?

thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150426/40904c9e/attachment.html>

Reply by email

luiz americo pereira camara
to Dmitry Boyarintsev: On Sun, Apr 26, 2015 at 1:35 PM, luiz americo pereira camara < Two notes here: #1 for the…

2015-04-26 15:18 GMT-03:00 Dmitry Boyarintsev :

Show quoted text 17 lines
On Sun, Apr 26, 2015 at 1:35 PM, luiz americo pereira camara < > wrote: > > I implemented here long time ago: > https://code.google.com/p/luipack/source/browse/trunk/luicontrols/searchedit.pas > > If agreed i can add to LCL as TEdit.TextHint > Two notes here: #1 for the case of TSearchEdit - it should be (optionally) a stand alone widget, rather than a hard-coded pure LCL control. otherwise it would not be rendered properly for OSX

Only TextHint support would be merged to TEdit.

In fact SearchEdit is a bad name. Better would be ActionEdit

Luiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150426/4f9dcc1b/attachment-0001.html>

Reply by email

Dmitry Boyarintsev
to luiz americo pereira camara

On Sun, Apr 26, 2015 at 8:58 PM, luiz americo pereira camara <

Show quoted text 5 lines
wrote: Only TextHint support would be merged to TEdit.

True. TextHint is required for Delphi compatibility in the first place. But to go a bit better than Delphi, IconHint method could be introduced as well... as requested by MVC originally!

In fact SearchEdit is a bad name. Better would be ActionEdit

why ActionEdit?

thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150426/89866dc9/attachment.html>

Reply by email

luiz americo pereira camara
to Dmitry Boyarintsev

2015-04-26 23:04 GMT-03:00 Dmitry Boyarintsev :

Show quoted text 17 lines
On Sun, Apr 26, 2015 at 8:58 PM, luiz americo pereira camara < > wrote: > > Only TextHint support would be merged to TEdit. > True. TextHint is required for Delphi compatibility in the first place. But to go a bit better than Delphi, IconHint method could be introduced as well... as requested by MVC originally! > In fact SearchEdit is a bad name. Better would be ActionEdit > why ActionEdit?

Add convenience feature to execute action on response to editing

To be clear: is not intended to add such control whatever it is name

Luiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150427/7d904248/attachment.html>

Reply by email

silvioprog
to Dmitry Boyarintsev: Nice! EM_SETCUEBANNER doesn't have Ansi version, it only accepts WideChars (even for…

On Sun, Apr 26, 2015 at 5:07 PM, Dmitry Boyarintsev <

Show quoted text 16 lines
wrote: On Sun, Apr 26, 2015 at 3:17 PM, silvioprog wrote: > > I implemented this feature in an old project that I maintain, > LazSolutions, and it was cross-platform. > > Nice! EM_SETCUEBANNER doesn't have Ansi version, it only accepts WideChars (even for Ansi windows) But, why was cross-platform? Is it broken now? thanks, Dmitry

Oops, I'm sorry for fast typing. =)

It is cross-platform, and it works in more popular widgets like Windows, GTK and Qt.

Silvio Cl?cio My public projects - github.com/silvioprog -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150430/819afe33/attachment.html>

Reply by email