Print Page | Close Window

bitmaps in docking panes

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=5807
Printed Date: 12 December 2024 at 9:31am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: bitmaps in docking panes
Posted By: Rhayader
Subject: bitmaps in docking panes
Date Posted: 15 December 2006 at 8:14am
Hi all,
I'd like to insert a bitmap within a docking pane; i tried with a dialog that contains a picture control, but there is a problem: there aren't the scrollbars, so, when the docking window is smaller than the image it isn't possible to scroll the image...
 
Is there another way? I tried to put a CStatic control directy within a docking pane but it didn't work...
 
many thanks!



Replies:
Posted By: mgampi
Date Posted: 15 December 2006 at 9:04am
Hi;
 
One solution could be using a CSrollView derived class that draws the bitmap (CScrollView::OnDraw).
Use SetScrollSizes() to adjust the view according your bitmap size.
Then attach the view to the pane.
 
Hope this helps...
 
Martin
 


Posted By: silentwisdom
Date Posted: 20 December 2006 at 2:36am

Hi everyone,

I've tried to make the scrollview work inside the dockingpane but

i can't scroll, the pane draws all elements corectly but the scrollbars aren't clickable..

Someone any ideas ?



Posted By: mgampi
Date Posted: 23 December 2006 at 3:06pm
What to you mean with 'not clickable'?
Are the scrollbars disabled? If they're disabled, have you set the scroll sizes by calling SetScrollSizes()? When in MM_TEXT mode you should set the max possible extensions in both x and y direction in pixels.
 
Martin 


Posted By: silentwisdom
Date Posted: 26 December 2006 at 3:16am
Originally posted by mgampi mgampi wrote:

What to you mean with 'not clickable'?
Are the scrollbars disabled? If they're disabled, have you set the scroll sizes by calling SetScrollSizes()? When in MM_TEXT mode you should set the max possible extensions in both x and y direction in pixels.
 
Martin 
Hi martin,
I mean that the scrollbars are visible and enabled but when I try to click them the program doesn't seem te react on it.
I've set the scrollsize like this:
SetScrollSizes(MM_TEXT, CSize(m_curBmWidth,m_curBmHeight));
here are the main cpp and header files of the project: https://forum.codejock.com/uploads/20061226_031535_code.zip - uploads/20061226_031535_code.zip
 
 
I really don't get it why it won't work.


Posted By: mgampi
Date Posted: 27 December 2006 at 8:04am

Hi,

I checked your sample files and most obvious issue to mention is the part where you create the CScrollView derived object. First of all I have never created a toolbar inside a CScrollView object. I did not try this at the moment. Next you attach the panes content two times - first time in CChildWnd::OnCreate and the second time in the OnDockingPaneNotify handler.

Since you call your own CPreview2::CreatePane() function - which indeed creates a STATIC control (class name "STATIC") you actually do not create a CSrollView object!

I created a small sample application that shows you how to create C(Scroll)View derived objects as children of panes. I did neither implement scaling and/or zooming nor create a toolbar object. http://forum.codejock.com/uploads/20061227_080303_BitmapPane.zip - uploads/20061227_080303_BitmapPane.zip

In your case, I think you have to implement it a little bit more 'complicated': Create your own CWnd derived object that contains the toolbar and the additional CWnd object used to implement a 'canvas' for bitmaps with scrollbars (CWnd::EnableScrollBar()) and the management for scrollbars (OnVScroll, OnHScroll). Finally attach this compound object to the pane by calling its Attach() function. Perhaps someone else has done this before and could give you a hint on this.
 


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022


Posted By: silentwisdom
Date Posted: 28 December 2006 at 2:47am
Thanks a lot for the answer mgampi,
I'll take a look at the code one of the next days,
currently iI'm occupied on another project.



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