Bug Report T713673
Visible to All Users

The Customize dialog does not display a dropdown button for a large bar button whose ButtonStyle property is set to bsDropDown

created 6 years ago

Standard ExpressBars Customization Dialog does not show dropdown arrow for TdxBarLargeButton with ButtonStyle=bsDropDown. In early versions of VCL components this arrow was drawn. I found that TdxBarCustomizationFormPainter.CalcButtonOrSubItemRects, TdxBarCustomizationFormPainter.GetIsNeedDrawSubItemArrow does not see that TdxBarLargeButton is valid for the painting DropDownMenu arrow:

class procedure TdxBarCustomizationFormPainter.CalcButtonOrSubItemRects(
  AItem: TdxBarItem; const R: TRect; out ASideStripRect, ATextRect, AArrowRect: TRect);
begin
  ATextRect := R;
  AArrowRect := R;
  ASideStripRect := R;
  ASideStripRect.Right := ASideStripRect.Left + R.Bottom - R.Top;
  ATextRect.Left := ASideStripRect.Right + 1 + 4;
  if (AItem is TdxBarButton) and (TdxBarButton(AItem).ButtonStyle = bsDropDown) then
    Dec(ATextRect.Right, 4 + 9);
  AArrowRect.Left := ATextRect.Right;
end;

class function TdxBarCustomizationFormPainter.GetIsNeedDrawSubItemArrow(AItem: TdxBarItem): Boolean;
begin
  Result :=
    (AItem is TdxBarButton) and (TdxBarButton(AItem).ButtonStyle = bsDropDown) or
    (AItem is TCustomdxBarSubItem) and not (AItem is TCustomdxBarContainerItem) or
    (AItem is TCustomdxBarContainerItem) and not TCustomdxBarContainerItemAccess(AItem).HideWhenRun;
end;

Perhaps similar checks also exist in other places.
I understand this happened because of a change in the inheritance scheme for the TdxBarLargeButton.
In earlier versions TdxBarLargeButton was inherited directly from TdxBarButton and arrow was drawn. But now both TdxBarButton and TdxBarLargeButton are inherited from TdxBarCustomButton.

Comments (1)
DevExpress Support Team 6 years ago

    Hello Oleg,

    Thank you for sharing your research results. It may take us some time to examine this scenario.

    Answers approved by DevExpress Support

    created 6 years ago (modified 6 years ago)

    We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

    Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.