Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - How to draw an image on the app frame
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to draw an image on the app frame

 Post Reply Post Reply
Author
Message Reverse Sort Order
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 867
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Topic: How to draw an image on the app frame
    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.
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 867
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.