Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - bitmaps in docking panes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

bitmaps in docking panes

 Post Reply Post Reply
Author
Message
Rhayader View Drop Down
Newbie
Newbie


Joined: 01 September 2006
Location: Italy
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rhayader Quote  Post ReplyReply Direct Link To This Post Topic: bitmaps in docking panes
    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!
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
 
Back to Top
silentwisdom View Drop Down
Newbie
Newbie


Joined: 18 December 2006
Location: Belgium
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote silentwisdom Quote  Post ReplyReply Direct Link To This Post 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 ?

Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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 
Back to Top
silentwisdom View Drop Down
Newbie
Newbie


Joined: 18 December 2006
Location: Belgium
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote silentwisdom Quote  Post ReplyReply Direct Link To This Post 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:uploads/20061226_031535_code.zip
 
 
I really don't get it why it won't work.
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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. 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 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
silentwisdom View Drop Down
Newbie
Newbie


Joined: 18 December 2006
Location: Belgium
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote silentwisdom Quote  Post ReplyReply Direct Link To This Post 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.
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.125 seconds.