Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Attaching pane causes form view paint problems!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Attaching pane causes form view paint problems!

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: Attaching pane causes form view paint problems!
    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!
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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)?
 
 
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!
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 01 August 2006 at 7:31pm

Hi,

yes problem was in clip styles. Fixed files attached.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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?
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.171 seconds.