View Issue Details

IDProjectCategoryView StatusLast Update
0001656JEDI VCL00 JVCL Componentspublic2004-04-22 01:08
ReporteranonymousAssigned Touser72 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001656: JvLabel Angle property can't be set properly
DescriptionJvLabel's (JVCL3)Angle property when set to other than 0 AND Autosize property set to TRUE causes label to "spin" (ie: is "animated"). Also, text does not display correctly at angles other than 0. (Autosizes incorrectly)
Additional InformationSet "Autosize" to TRUE first, then change Angle property to > 0 to see the problem.

Using JCL and JVCL checked out via CVS on 2004-04-16.
TagsNo tags attached.

Activities

anonymous

2004-04-16 21:47

viewer   ~0003917

It also seems that the Alignment property, when the text is at an angle, is always in "centered" mode. This is not good if one wants to have angled text lined up, all starting from top left corner, for example. The JvAngleLabel component worked fine (not a criticism).

FInally, this is being picky, but the angled text spacing between characters is not even for a font size of 8 (eg: Arial font)

hasse42g

2004-04-19 03:07

reporter   ~0003947

This component could use a complete makeover. It has several problems, and the most severe one is the adjustment of boundaries in it's Paint method.

But, I guess there is a quick and dirty fix for your first problem. Try the following:

1. In TJvCustomLabel.Paint: Replace the call to AdjustBounds with this:

if Angle = 0 then
  AdjustBounds;

2. In the TJvCustomLabel class add a private field variable FDrawing, and set it initially to False in the constructor:

FDrawing := False;

3. In TJvCustomLabel.DrawAngleText, encapsulate the procedure body with a setting and a check for FDrawing, like this:

if FDrawing then
  Exit;
FDrawing := True;
try

  Angle10 := Angle * 10;
  StrLCopy(@Text, PChar(GetLabelCaption), SizeOf(Text) - 1);
  if (Flags and DT_CALCRECT <> 0) and ((Text[0] = #0) or ShowAccelChar and
  [The rest of the code is cut out for clarity...]

finally
  FDrawing := False;
end;

That should take care of the unwanted animation.

Regards

Hans-Eric Grönlund

user72

2004-04-19 04:06

  ~0003948

>This component could use a complete makeover.
I don't disagree: it is a merging of several different labels and so has artifacts from more than one implementor. I don't have the time to do it but if you (or anyone else, of course) wants to give it a shot, please do.

2004-04-20 02:19

 

JvLabel.zip (8,286 bytes)

hasse42g

2004-04-20 02:27

reporter   ~0003964

I made some changes that should take care of the unwanted animation effect of this component (see attached file). I tried to keep the changes at a minimum, and marked them in the code with "HEG" tags (which should be removed before an eventual check in).

There are still minor issues that should be addressed, for instance that it doesn't always autosize, and I shall look into it when I get more time (it may take a while).

user72

2004-04-20 03:59

  ~0003965

If the original reporter can verify that the changes fixes the problem, I can commit to CVS. I have tested myself and it seems to work OK, but always good to hava a second opinion.

anonymous

2004-04-20 21:45

viewer   ~0003975

Thank you for updating the JvLabel component for testing! i'm the original reporter for this bug, but i'm not an expert, so could you please let me know how to update the unit: i've already compiled it and have the .dcu file but don't know how to replace the original in the library.

The original package seems to be in {Delphi}/Projects/bpl/JvStdCtrlsD7D.bpl but i don't know how to update this, or if i'm trying to go about this in the wrong way.

Please let me know briefly what i need to do to install it and i will test it.

Thanks and apologies for my ignorance.

user72

2004-04-21 00:57

  ~0003976

No problem.

If you have a program in packages\bin named "build.exe", you can run it from a command prompt like this:

build d6

to build the d6 packages (use d5, d7, c5, c6 for toher compiler versions).

If you don't have this program, the easiest way to rebuild is to run install.bat from the jvcl root folder and do an update.

anonymous

2004-04-21 16:35

viewer   ~0003978

Thanks Peter. i did the build as you described and did very minor testing of the new JvLabel, namely:

* Tested Angle property in the 4 quadrants with Arial font (another font i use is OK too)
* Tried Autosize property, which no longer causes animation effects.

Also, the apparent problem with the text not LeftJustifying correctly seems to be working fine now.

Thank you for the fixes, Hans-Eric Grönlund! Much appreciated.

As i use the component, if i come accross any other issues, i will post it here.

Thanks again!

user72

2004-04-21 23:46

  ~0003981

OK, updated in CVS. I'm closing this now. In case of further problems, updates etc please post a new issue report.

Thanks to Hans-Eric for the fix!

user72

2004-04-22 01:08

  ~0003992

Please note that I uploaded the wrong file to CVS.

The current version (1.32) should be the correct one

Issue History

Date Modified Username Field Change
2004-04-16 14:59 anonymous New Issue
2004-04-16 21:47 anonymous Note Added: 0003917
2004-04-19 03:07 hasse42g Note Added: 0003947
2004-04-19 04:06 user72 Note Added: 0003948
2004-04-19 04:22 user72 Status new => acknowledged
2004-04-20 02:19 hasse42g File Added: JvLabel.zip
2004-04-20 02:27 hasse42g Note Added: 0003964
2004-04-20 03:59 user72 Note Added: 0003965
2004-04-20 21:45 anonymous Note Added: 0003975
2004-04-21 00:57 user72 Note Added: 0003976
2004-04-21 16:35 anonymous Note Added: 0003978
2004-04-21 16:35 anonymous Note Added: 0003979
2004-04-21 23:46 user72 Status acknowledged => resolved
2004-04-21 23:46 user72 Resolution open => fixed
2004-04-21 23:46 user72 Assigned To => user72
2004-04-21 23:46 user72 Note Added: 0003981
2004-04-22 01:07 user72 Status resolved => feedback
2004-04-22 01:07 user72 Resolution fixed => reopened
2004-04-22 01:08 user72 Status feedback => resolved
2004-04-22 01:08 user72 Resolution reopened => fixed
2004-04-22 01:08 user72 Note Added: 0003992