-
Hello Luke,
Would you please provide us with a small sample project demonstrating this behavior? This would allow us precisely replicate your scenario on our side and find an appropriate solution. I see that PNG images can be correctly assigned in our demos, so there should be a solution. Thanks in advance.Please see the attached Sample Project. I also included a screen shot showing how it appears on my computer. The other thing I notices was that even though I am loading the same image, the graphic is smaller in the Wizard Button than in the cxButton.
Please note that the graphic was purchased and thus copyrighted. Included several different sizes in case you need to test with them.
Thanks in advance for your assistance.Thanks, Luke. I see that the image is correctly loaded, but in the Wizard Control's button it is automatically resized to better fit the button's size. I mean, you can set the dxWizardControl.Buttons.Common.Height property to 36 to make this image look better (just like in the TcxButton control). Moreover, I see that the focus rectangle overlaps the image in the TcxButton button. So, you can also increase the TcxButton.Height property to make the focused button look better.
I have found that this image is drawn in the TdxWizardControlButtonViewInfo.DrawContent method of the dxCustomWizardControl.pas unit, so Wizard Control uses different painting routines than the TcxButton button. If you modify this method in the following manner, even resized images in your Wizard buttons should be drawn much better:[Delphi]procedure TdxWizardControlButtonViewInfo.DrawContent(ACanvas: TcxCanvas); const EnabledImageDrawModeMap: array [Boolean] of TcxImageDrawMode = (idmNormal, idmDisabled); var AOffset: TPoint; AGlyphBitmap: TBitmap; begin if not FadingHelper.DrawImage(ACanvas.Handle, Bounds) then DrawButtonBackground(ACanvas, Bounds, State); AOffset := Painter.GetButtonOffset(State); if not cxRectIsEmpty(GlyphRect) then begin if not Button.Glyph.Empty then AGlyphBitmap := Button.Glyph.GetAsBitmap else AGlyphBitmap := nil; try cxDrawImage(ACanvas.Handle, cxRectOffset(GlyphRect, AOffset), cxRectOffset(GlyphRect, AOffset), AGlyphBitmap, WizardControl.Buttons.Images, Button.ImageIndex, EnabledImageDrawModeMap[State = cxbsDisabled], True); finally AGlyphBitmap.Free; end; end; ACanvas.SaveState; try ACanvas.Font := Font; ACanvas.Font.Color := Painter.GetButtonTextColor(State); if not cxRectIsEmpty(CaptionRect) then begin cxDrawText(ACanvas, Button.Caption, cxRectOffset(CaptionRect, AOffset), DT_VCENTER or DT_SINGLELINE or DT_CENTER); end; if IsFocused then ACanvas.DrawFocusRect(Painter.GetButtonFocusRect(ACanvas, Bounds)); finally ACanvas.RestoreState; end; end;
With this modification, you will be able to keep the 30 value for the dxWizardControl.Buttons.Common.Height property. I think that we can modify our source code in future builds to make this modified drawing routine default for our Wizard buttons. Please let me know your opinion.
Thank you for your observations. For now, I will just adjust the button height rather than modify the dxCustomWizardControl.pas unit.
Personally, I would think that the wizard would draw the buttons the same way as cxButton does.
You may close this issue and thank you again for your assistance.
Go ahead and make the content of this ticket visible. You do need to remove the attachments as they include graphics that I purchased.Thanks!
Show all comments