bitmaps in docking panes |
Post Reply |
Author | |
Rhayader
Newbie Joined: 01 September 2006 Location: Italy Status: Offline Points: 3 |
Post Options
Thanks(0)
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!
|
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
|
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
|
|
silentwisdom
Newbie Joined: 18 December 2006 Location: Belgium Status: Offline Points: 4 |
Post Options
Thanks(0)
|
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 ? |
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
|
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
|
|
silentwisdom
Newbie Joined: 18 December 2006 Location: Belgium Status: Offline Points: 4 |
Post Options
Thanks(0)
|
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.
|
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
|
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 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
silentwisdom
Newbie Joined: 18 December 2006 Location: Belgium Status: Offline Points: 4 |
Post Options
Thanks(0)
|
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.
|
|
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 |