Print Page | Close Window

Error in DockingDemo

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=905
Printed Date: 25 December 2024 at 8:54am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Error in DockingDemo
Posted By: Gian
Subject: Error in DockingDemo
Date Posted: 01 July 2004 at 6:49am
i've tried to add a ON_WM_RBUTTONDOWN() event function to display a popup menu in the TreeCtrl controls (CTabClassTree)  when the right mouse button is pressed.
The function is

    CPoint pt = point;
    ClientToScreen(&pt);

    CXTMenu menu;
    VERIFY(menu.LoadMenu(IDR_POPUP));

    CXTMenu* pPopup = menu.GetSubMenu(0);
    pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y,
        this);

IDR_POPUP is a simple menu with ID_EDIT_COPY, ID_EDIT_CUT, ID_EDIT_PASTE

when the menu is displayed the icons of Copy Cut Paste  are not visible. Only changing the CWnd owner parameter in the TrackPopupMenu call to CFrameWnd the icons are loaded.

In a program of mine i need to show the icons but also link the menu item selection to some functions in the TreeCtrl class, so i cant make CFrameWnd the owner.

How i can fix this?

Thanks



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