View Issue Details

IDProjectCategoryView StatusLast Update
0005311JEDI VCL00 JVCL Componentspublic2012-02-29 16:53
ReporterralfiiiAssigned Toobones 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.39 
Target VersionFixed in Version3.45 
Summary0005311: Height can't be set below 21 for TJvDateEdit/TJvComboEdit/TJvMaskEdit
DescriptionWhen the borderstyle of one of TJvComboEdit is set to bsNone it should generally be possible to make the component (in the IDE) smaller.

The original VCL-MaskEdit can even be made as small as you like no
matter which borderstyle.
All the Jedi-components mentioned above can't be made smaller (On my screen they
always stay at a minimum of 21 pixels).

In TJvCustomComboEdit there's even code that checks for that
(GetMinHeight), but it seems to be overruled somewhere.
TagsNo tags attached.

Activities

ralfiii

2010-08-26 10:02

reporter   ~0017628

The problem was located in TJvCustomComboEdit.AdjustHeight - BorderStyle was ignored.
Patch attached.

2010-08-26 10:02

 

JvCustomComboEdit_SetHeight.patch (912 bytes)
Index: JvToolEdit.pas
===================================================================
--- JvToolEdit.pas	(revision 14418)
+++ JvToolEdit.pas	(working copy)
@@ -1708,17 +1708,25 @@
   I: Integer;
   SysMetrics, Metrics: TTextMetric;
 begin
+  // Get text height
   DC := GetDC(HWND_DESKTOP);
   GetTextMetrics(DC, SysMetrics);
   SaveFont := SelectObject(DC, Font.Handle);
   GetTextMetrics(DC, Metrics);
   SelectObject(DC, SaveFont);
   ReleaseDC(HWND_DESKTOP, DC);
-  if not Flat then
-    I := 8
-  else
-    I := 6;
-  I := GetSystemMetrics(SM_CYBORDER) * I;
+
+  // if necessary reserve space for border
+  i:=0;
+  if BorderStyle<>bsNone then
+  begin
+       if not Flat then
+         I := 8
+       else
+         I := 6;
+       I := GetSystemMetrics(SM_CYBORDER) * I;
+  end;
+
   if Height < Metrics.tmHeight + I then
     Height := Metrics.tmHeight + I;
 end;

obones

2010-10-11 09:59

administrator   ~0017859

Thanks, this is now in SVN

Issue History

Date Modified Username Field Change
2010-08-26 10:01 ralfiii New Issue
2010-08-26 10:02 ralfiii Note Added: 0017628
2010-08-26 10:02 ralfiii File Added: JvCustomComboEdit_SetHeight.patch
2010-10-11 09:59 obones Note Added: 0017859
2010-10-11 09:59 obones Status new => resolved
2010-10-11 09:59 obones Fixed in Version => Daily / SVN
2010-10-11 09:59 obones Resolution open => fixed
2010-10-11 09:59 obones Assigned To => obones
2012-02-29 16:53 obones Fixed in Version Daily / SVN => 3.45