Print Page | Close Window

Drawing 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=213
Printed Date: 04 May 2024 at 5:07am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Drawing problems
Posted By: jamiei
Subject: Drawing problems
Date Posted: 04 November 2003 at 3:37pm

I've got a standard SDI MFC app that I'm using two docking panes with.

When these are docked to the left and then hidden, it seems to have trouble drawing them correctly on expanding, once it gets to a certain point it flickers and misses part of the dock + view.

I've attached a picture of what I'm talking about. Weirdly, if I dock them on the bottom or top it seems to work ok.

http://forum.codejock.com/uploads/jamiei/396_DockDraw.zip - 396_DockDraw.zip




Replies:
Posted By: kstowell
Date Posted: 04 November 2003 at 6:37pm

Hello,

Try adding the WS_CLIPCHILDREN style to your CMainFrame class, for example:

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
    if( !CFrameWnd::PreCreateWindow(cs) )
        return FALSE;

    // TODO: Modify the Window class or styles here by modifying
    // the CREATESTRUCT cs

    cs.style |= WS_CLIPCHILDREN|WS_CLIPSIBLINGS;

    return TRUE;
}

Please let me know if this helps.

Cheers,
Codejock Support



Posted By: jamiei
Date Posted: 05 November 2003 at 5:58pm

That worked great, thanks.

Incidentally, I'm having trouble with a context menu in the docking pane (well the view that's attached to one anyway). It seems that I can only provide implementations for the ON_COMMAND or ON_UPDATE_COMMAND_UI handlers, not both. I was wondering if you might be able to suggest any reasons why this might be happening?

Thanks again,

Jamie



Posted By: Oleg
Date Posted: 05 November 2003 at 11:32pm

I tring to add context menu in "Advanced" sample

void CHeroesView::OnContextMenu(CWnd* pWnd, CPoint point)

{

CMenu mnu;

mnu.LoadMenu(IDR_MAINFRAME);

CXTPCommandBars::TrackPopupMenu(&mnu, 0, point.x, point.y, this);

}

 

All work as expected.  How do you call the menu?



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


Posted By: jamiei
Date Posted: 13 November 2003 at 4:29pm

Oleg,

Sorry for not replying sooner.

I tried using your code above, but for some reason my ON_COMMAND_UPDATE handler isn't being called. However, I was using the following and it almost worked:

 CMenu menu;
 menu.LoadMenu(IDR_MONITORS_MENU);

 CMenu* pSubMenu = menu.GetSubMenu(0);
 // Display the menu at the current mouse location. There's a "bug"
 // (Microsoft calls it a feature) in Windows 95 that requires calling
 // SetForegroundWindow. To find out more, search for Q135788 in MSDN.
 //
 CPoint point;
 GetCursorPos(&point);
 ::SetForegroundWindow(m_hWnd);
 //ClientToScreen(&point);
 GetCursorPos(&m_ptCursorPos);
 
 CXTPFrameWnd* pFrameWnd = (CXTPFrameWnd*)AfxGetMainWnd();
 ASSERT_VALID(pFrameWnd);
 CXTPCommandBars::TrackPopupMenu(pSubMenu, 0, point.x, point.y, this);
 
 ::PostMessage(m_hWnd, WM_NULL, 0, 0);
 
 menu.DestroyMenu();

 

I'm using this context menu in a TreeView derived class (within a docking pane). If a user highlights a tree item it should enable one of the menu options. Although this works (enabling/disabling), if I then click on the item to action the handler, it doesn't do anything and I get a warning in the debug window: "Warning: not executing disabled command 39776"

Is it something odd to do with the cursor being updated when I click on the item and the update handler's called again, and disables it?

 




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