How to draw an image on the app frame |
Post Reply |
Author | |
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 891 |
Post Options
Thanks(0)
Posted: 13 February 2018 at 4:47pm |
I would like to draw a custom company logo image on our application's frame. The image would be positioned to the left of the minimize/maximize/restore/close icons drawn on the right side. So far I have not found an easy way to do that. I haven't found any samples that do anything like that either.
I have found CXTPCommandBarsFrameHook::RepositionCaptionButtons where the standard icons are drawn. Does anyone have any ideals on how to go about doing this? |
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Hello rdhd,
Your task similar to drawing background image in Ribbon. This implemented in method CXTPRibbonOffice2013Theme::DrawBackImage() (Source\Ribbon\Themes\XTPRibbonThemeOffice2013.cpp) Regards, Oleksandr Lebed |
|
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 891 |
Post Options
Thanks(0)
|
I looked at DrawBackImage. I think this is more like drawing the minimize/maximize/restore/close icons. Its just that the UI element is not a clickable button. Resizing the frame needs to reposition the image (RepositionCaptionButtons). If I can get the frame hook I could call GetCaptionButtons and determine which are visible and figure out how to position an image.
DrawBackImage is virtual, so this looks doable. But I have other problems. Although we have our own commandbars class derived from CXTPCommandBars, SetTheme is not virtual. So I see no way (yet) to get to CXTPPaintManager::CreateTheme where the XTPRibbonThemeOffice2013 object is dynamically allocated directly by the code. Plus, this is the only theme that has the DrawBackImage method. We use other themes. Hence, my thought that the frame hook was the more appropriate place to try and do this. |
|
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 |