View Issue Details

IDProjectCategoryView StatusLast Update
0005869JEDI VCL00 JVCL Componentspublic2012-09-10 14:15
Reporterboerema1Assigned Toobones 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
Product Version 
Target VersionFixed in Version3.46 
Summary0005869: JvOfficeColorPanel: the default hint for the custom color button is not given a pretty name
DescriptionThe custom color button showing the custom user selected color is by default given the value clDefault. For the hint this value is not translated to a "pretty name" but left as is in contrary to all the other color buttons. For end users it should show Default as they won't understand why the clDefault.
We also can't change the value of this hint (this is not Properties.CustomColorHint but the button to the right of that, see image).
Solution would be for FCustomColorDrawer.Hint to call ColorToPrettyName and update that to also handle clDefault and adding a resourcestring for that.
TagsNo tags attached.

Activities

2012-04-25 15:18

 

clDefault.png (20,559 bytes)
clDefault.png (20,559 bytes)

boerema1

2012-04-25 16:20

reporter   ~0019721

I made a diff file with the proposed changes, see attachment.

2012-04-25 16:21

 

clDefault.diff (2,014 bytes)
Index: JvResources.pas
===================================================================
--- JvResources.pas	(revision 13287)
+++ JvResources.pas	(working copy)
@@ -2204,6 +2204,9 @@
   RsMenuBar ='Menu Bar';
   RsMenuHighlight ='Menu Highlight';
 
+  // clNone and clDefault
+  RsClNone = 'None';
+  RsClDefault = 'Default';
 
 //=== JvUrlGrabbers.pas ======================================================
 resourcestring
Index: JvOfficeColorPanel.pas
===================================================================
--- JvOfficeColorPanel.pas	(revision 13287)
+++ JvOfficeColorPanel.pas	(working copy)
@@ -1337,7 +1337,7 @@
     Tag := FButtonCustomColor.Tag + 1;
     Flat := True;
     DrawColor := clDefault;
-    Hint := ColorToString(DrawColor);
+    Hint := ColorToPrettyName(DrawColor);
     CanDrawColorQuad := True;
     CanDrawGlyph := False;
     CanDrawInnerFrame := False;
Index: JvJCLUtils.pas
===================================================================
--- JvJCLUtils.pas	(revision 13287)
+++ JvJCLUtils.pas	(working copy)
@@ -8543,6 +8543,12 @@
       Result := SysColorValues[Index].Description;
       Exit;
     end;
+  for Index := Low(MiscColorValues) to High(MiscColorValues) do
+    if Value = MiscColorValues[Index].Value then
+    begin
+      Result := MiscColorValues[Index].Description;
+      Exit;
+    end;
   Result := ColorToString(Value);
 end;
 
Index: JvTypes.pas
===================================================================
--- JvTypes.pas	(revision 13287)
+++ JvTypes.pas	(working copy)
@@ -485,6 +485,11 @@
     (Value: clMenuHighlight;           Constant: 'clMenuHighlight';          Description: RsMenuHighlight)
   );
 
+  MiscColorValues: array [0 .. 1] of TDefColorItem = (
+    (Value: clNone;                Constant: 'clNone';                Description: RsClNone),
+    (Value: clDefault;             Constant: 'clDefault';             Description: RsClDefault)
+  );
+
 type
   TJvCustomThread = class(TThread)
   private
clDefault.diff (2,014 bytes)

obones

2012-06-11 17:31

administrator   ~0019862

Please use the latest SVN version and provide the zipped sources of a sample application showing this.

boerema1

2012-06-15 14:15

reporter   ~0020003

It seems that the proposed changes in the supplied diff file were already added to the latest svn version so I'm guessing that a sample application is not needed anymore, thanks.

obones

2012-06-18 11:24

administrator   ~0020010

Thanks for letting us know

Issue History

Date Modified Username Field Change
2012-04-25 15:18 boerema1 New Issue
2012-04-25 15:18 boerema1 File Added: clDefault.png
2012-04-25 16:20 boerema1 Note Added: 0019721
2012-04-25 16:21 boerema1 File Added: clDefault.diff
2012-06-11 17:31 obones Note Added: 0019862
2012-06-11 17:31 obones Status new => feedback
2012-06-15 14:15 boerema1 Note Added: 0020003
2012-06-18 11:24 obones Note Added: 0020010
2012-06-18 11:24 obones Status feedback => resolved
2012-06-18 11:24 obones Fixed in Version => Daily / SVN
2012-06-18 11:24 obones Resolution open => no change required
2012-06-18 11:24 obones Assigned To => obones
2012-09-10 14:15 obones Fixed in Version Daily / SVN => 3.46