ButtonWidth property not working on TwwDBComboBox and TwwDBComboDlg
The ButtonWidth property doesn't work when applied to TwwDBComboBox and TwwDBComboDlg components. The property works fine with other IP components.
I'm just setting the property value at design time, as for other IP components, but neither at design time nor at runtime the button has got the correct size.
Working w/ Delphi Rio 10.3.3 and IP 20.0.5 (11/22/2019).
May you help me or fix it?
Thanks a lot!
Massimo Clot
Objectway
-
Official comment
I have reproduced your problem and will incorporate a fix in future builds. If you require immediate resolution, you can modify our source in vcl.wwdotdot.pas as follows. Please note the code labeled 4/28/2020
Procedure TwwDBCustomCombo.UpdateButtonPosition; var offset :Integer; begin if Frame.IsFrameEffective then begin offset:= 2; end else offset:= 0; // Update now, as it can get rescaled incorrectly in high dpi if FButtonWidth=0 then // 4/28/2020 FButton.Width:= wwmax(GetSystemMetrics(SM_CXVSCROLL), wwAdjustPixels(15, 96)) // 4/2/18 else FButton.Width:= wwAdjustPixels(FButtonWidth, 96); if UseRightToLeftAlignment then // Support bidimode for button - 8/26/08 begin if (not NewStyleControls) or (BorderStyle = bsNone) or (not Ctl3d) then FBtnControl.SetBounds (1, offset, FButton.Width, ClientHeight-offset*2) else FBtnControl.SetBounds (0, offset, FButton.Width, ClientHeight-offset); end else begin if (not NewStyleControls) or (BorderStyle = bsNone) or (not Ctl3d) then FBtnControl.SetBounds (Width - FButton.Width - offset, offset, FButton.Width, ClientHeight-offset*2) else FBtnControl.SetBounds (Width - FButton.Width - 4, offset, FButton.Width, ClientHeight-offset); end; if BorderStyle = bsNone then begin FButton.Top:= -1; {Allows bitmap to be larger } FButton.Height := FBtnControl.Height+1; end else begin FButton.Top:= 0; {Allows bitmap to be larger } FButton.Height := FBtnControl.Height; end; SetEditRect; // 3/10/18 - Or dbchecku.pas demo has wrong height for comboboxes if (Screen.PixelsPerInch>96) then begin if (BorderStyle=bsNone) and AutoSize and not wwIsClass(parent, 'TCustomGrid') then Frame.AdjustHeight; end; end;
Comment actions
Please sign in to leave a comment.
Comments
2 comments