View Issue Details

IDProjectCategoryView StatusLast Update
0000798JEDI VCL03 Donationspublic2004-03-09 02:47
Reporterboerema1Assigned Touser72 
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Product Version3.00 BETA 
Target VersionFixed in Version 
Summary0000798: Show entire text as hint in TJvEdit when the control is to small to show the entire text
DescriptionI made some additions to TJvEdit so you can see the entire edit control text when the control is to small to see everything if you go over it with the mouse.
Additional InformationI added a function to TJvMaxPixel because it's very similar to the one that's already there to do the work.
See the included zip file.
TagsNo tags attached.

Activities

2003-03-12 12:24

 

JvEdit and JvMaxPixel.zip (6,407 bytes)

user72

2003-07-12 02:10

  ~0002327

Will be revisited in JVCL3

user72

2004-01-28 15:33

  ~0002862

How about adding an AutoHint property that just sets the Hint to be equivalent to Text (and is updated as Text changes, of course)?

I don't exactly understand the need to preserve the old Hint if Text < Width. I can't think of a scenario where switching between them would be useful.

Thoughts?

boerema1

2004-01-28 16:59

reporter   ~0002863

Just the AutoHint is fine by me. Personally I don't need the previous hint to be preserved but I thought maybe someone else might need it.

By the way, I seem to remember that the computation of the width is a little bit of. I can't check it though because I haven't yet converted the project where I use this from JVCL 2.1 to 3.

user72

2004-01-28 22:41

  ~0002864

OK, I'll do a simple implementation and then we can test if it is enough. If not, we can beef it up as we go along. I'll be back<g>

2004-01-29 10:13

 

JvEditAutoHint.zip (5,328 bytes)

user72

2004-01-29 10:14

  ~0002870

Try the attached JvEditAutoHint. It is essentially the same as your initial implementation but without the JvMaxPixel stuff.

user72

2004-01-29 10:54

  ~0002873

I think we should use an empty original Hint as an indication that Hint should always be set to Text, even if the text is fully visible, so try adding this to UpdateAutoHint:

  if AutoHint and HandleAllocated then
  begin
    if FOldHint = '' then
    begin
      Hint := Text;
      Exit;
    end;
...

boerema1

2004-01-29 11:39

reporter   ~0002874

I'm really short on time at the moment so I don't know when I will be able to check this. Probably not before the weekend and maybe even later.

user72

2004-01-29 13:12

  ~0002876

We have a code freeze coming up (monday probably) after which things like this cannot be added until JVCL3 final is released, so if you can find the time (it won't take many minutes to try it, just rebuild the JvStdCtrls package after updating JvEdit) and report back before mid-sunday, that would be great but not a necessity. It is not such a vital thing that it cannot wait until later.

user72

2004-01-29 13:24

  ~0002878

Last edited: 2004-01-29 13:53

Tell you what: I'll add it just the same and we can then massage it into shape later if needed.

edited on: 01-29-04 13:48

boerema1

2004-01-29 22:26

reporter   ~0002887

Well, I found some time to look at it.
I think you need to make some changes:

UpdateAutoHint needs to be added to TJvCustomEdit.Change otherwise the changes in the text will not be reflected in the hint

In TJvCustomEdit.UpdateAutoHint change
this:
    if FOldHint = '' then
    begin
      Hint := Text;
      Exit;
    end;
to this:
    if FOldHint <> '' then
      Exit;
Otherwise the Hint will get changed to the text if both AutoHint is true and a Hint text is set.

user72

2004-01-29 23:48

  ~0002889

> Otherwise the Hint will get changed to the
> text if both AutoHint is true and a Hint text is set.
If AutoHint is true, you cannot change the Hint manually.

This might be seen as a limitation but it is easy enough - once you know about it - to set AutoHint to false before changing Hint and the set AutoHint to true again. When you think about it, it makes sense that you cannot specify a value for Hint if it is automatically handled for you.

Compare to AutoHint in TStatusbar: when set, noone expects to be able to change the value of Statusbar.Panels[0]

(BTW, I've already documented this behavior in the help docs)

boerema1

2004-01-30 13:34

reporter   ~0002895

> This might be seen as a limitation but it is easy enough
> - once you know about it - to set AutoHint to false before
> changing Hint and the set AutoHint to true again. When you
> think about it, it makes sense that you cannot specify a
> value for Hint if it is automatically handled for you.

Ok by me.
Seems to work fine now though I haven't tested it extensively.

user72

2004-02-01 00:15

  ~0002907

Tested pretty extensively and seems to work satisfactorily

Issue History

Date Modified Username Field Change
2004-01-27 02:25 user72 Status acknowledged => assigned
2004-01-27 02:25 user72 Assigned To => user72
2004-01-28 15:33 user72 Note Added: 0002862
2004-01-28 16:59 boerema1 Note Added: 0002863
2004-01-28 22:41 user72 Note Added: 0002864
2004-01-29 10:13 user72 File Added: JvEditAutoHint.zip
2004-01-29 10:14 user72 Note Added: 0002870
2004-01-29 10:14 user72 Status assigned => feedback
2004-01-29 10:54 user72 Note Added: 0002873
2004-01-29 11:39 boerema1 Note Added: 0002874
2004-01-29 13:12 user72 Note Added: 0002876
2004-01-29 13:24 user72 Note Added: 0002878
2004-01-29 13:53 user72 Note Edited: 0002878
2004-01-29 22:26 boerema1 Note Added: 0002887
2004-01-29 23:48 user72 Note Added: 0002889
2004-01-30 13:34 boerema1 Note Added: 0002895
2004-02-01 00:15 user72 Status feedback => resolved
2004-02-01 00:15 user72 Resolution open => fixed
2004-02-01 00:15 user72 Note Added: 0002907
2004-03-09 02:47 user72 Status resolved => closed