Print Page | Close Window

How to draw an image on the app frame

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=23567
Printed Date: 23 December 2024 at 5:31am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to draw an image on the app frame
Posted By: rdhd
Subject: How to draw an image on the app frame
Date 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?



Replies:
Posted By: olebed
Date Posted: 14 February 2018 at 1:13am
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


Posted By: rdhd
Date Posted: 14 February 2018 at 10:54am
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.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net