Print Page | Close Window

Attaching pane causes form view paint problems!

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=4691
Printed Date: 15 May 2024 at 12:28am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Attaching pane causes form view paint problems!
Posted By: znakeeye
Subject: Attaching pane causes form view paint problems!
Date Posted: 01 August 2006 at 4:10am
I have an MDI application where all views are held by a  CXTPTabClientWnd variable. In one of my form views I have a auto-hiding pane placed at the top of the frame. If I attach it, the whole view gets repainted incorrectly.
 
I have to minimize the window and then maximize it again to get back my controls in their original shape. I have a similar pane in a calendar view, but the calendar seems to understand that it should repaint itself.
 
I have tried this inside my docking notification handler:
if (wParam == XTP_DPN_ACTION)
{
    XTP_DOCKINGPANE_ACTION* pAction = (XTP_DOCKINGPANE_ACTION*)lParam;
    if (pAction->action == xtpPaneActionAttached)
        GetActiveView()->Invalidate();
}
 
I have also been playing with the WS_CLIPSIBLINGS and WS_CLIPCHILDREN styles, with no success. What is causing this redraw problem?
 
Please help!



Replies:
Posted By: Oleg
Date Posted: 01 August 2006 at 9:30am
Hello,
You can attach project here and I will show where problem.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 01 August 2006 at 6:40pm

The project found at the address below has three problems:

1) It paints incorrectly when the pane is attached (see attached screenshot).
2) The auto-resizing controls do not behave correctly when the window is being resized in certain ways (see attached screenshot).
3) I get a lot of warnings when compiling. Where should I turn these off (I do not always want to ignore C4244)?
 
http://www.bostream.nu/krisse/Codejock-problem.zip - http://www.bostream.nu/krisse/Codejock-problem.zip
 
If you have time, then I wonder another thing too:
How do I attach a CXTPToolBar to the left of a specific view? That is, it should only appear when, say CMyViewWithAMenu is active. There is no sample showing this, and I haven't been able to figure out how to accomplish it.
 
Thanks in advance!


Posted By: Oleg
Date Posted: 01 August 2006 at 7:31pm

Hi,

yes problem was in clip styles. Fixed files attached.
http://forum.codejock.com/uploads/20060801_193038_MyProgramFix.zip - MyProgramFix.zip
 


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Oleg
Date Posted: 01 August 2006 at 7:34pm
ps.
About warning - use search in forum, or update sources to 10.3
About toolbar - see GUI_Whidbey sample.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 01 August 2006 at 8:11pm
Thank you very much! All problems solved! \o/
 
Though, I wonder about this call: SetScaleToFitSize(CSize(1, 1)).
All controls are placed correctly, but they can be resized to non-visible. How would you make the controls "grow, but not shrink more than (cx, cy)"? Is the only way to handle OnGetMinMaxInfo in the main frame?


Posted By: znakeeye
Date Posted: 01 August 2006 at 10:21pm

Hi again!

I played a bit with the Whidbey sample, and it suffers the same problem I have encountered: The menus loaded elsewhere than in CMainFrame are not dockable and cannot be placed vertically.
 
// This is a modified version of the CPropertiesPane in the Whidbey sample
int CPropertiesPane::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
 if (CWnd::OnCreate(lpCreateStruct) == -1)
  return -1;
 VERIFY(m_wndToolBar.CreateToolBar(WS_TABSTOP|WS_VISIBLE|WS_CHILD|CBRS_TOOLTIPS | CBRS_LEFT | CBRS_GRIPPER, this)); // CBRS_LEFT does not help!
 VERIFY(m_wndToolBar.LoadToolBar(IDR_PANE_PROPERTIES));
...
}
 
What I want to do is to add a toolbar to the left, INSIDE ONE of my views. I do not want it to be visible in other views. Can it be done?



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