![]() |
Center vertically the image in a ribbon button |
Post Reply ![]() |
Author | ||
ovidiumvp ![]() Newbie ![]() ![]() Joined: 27 October 2016 Location: Bucharest Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() Posted: 11 November 2016 at 10:30am |
|
I added button controls to a ribbon, changing the default size for each one (that was a requirement). void CMyRibbon::Init() { //... CXTPRibbonGroup* pMyGroup = pMyTab->AddGroup(ID_MY_GROUP); pMyGroup->SetControlsCentering(); pMyGroup->SetArrangeEditCaption(TRUE); AddButtonToGroup(pMyGroup, ID_MY_BUTTON); //... } CXTPControlButton* CMyRibbon::AddButtonToGroup(CXTPRibbonGroup* pParentGroup, int nID) { CXTPControlButton* pButton = (CXTPControlButton*)pParentGroup->Add(xtpControlButton, nID); pButton->SetStyle(xtpButtonIconAndCaptionBelow); pButton->SetWidth(XTP_DPI_X(54)); pButton->SetHeight(XTP_DPI_Y(82)); return pButton; } So far so good but someones complain that doesn't look very well, because the image is aligned to the top of button, the text is aligned to the bottom, so the space between image and text is too large. Is it any easy way to center vertically the image in the button? ![]() Note: I'm using Office 2013 theme.
|
||
Ovidiu
|
||
![]() |
||
olebed ![]() Admin Group ![]() Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
|
Hello Ovidiu,
Algogithm for drawing ribbon buttons is in CXTPPaintManager::DrawControlToolBarParent() method. See for
You can change code to
Regards, Oleksandr Lebed |
||
![]() |
||
ovidiumvp ![]() Newbie ![]() ![]() Joined: 27 October 2016 Location: Bucharest Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() |
|
Thank you very much!
|
||
Ovidiu
|
||
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |