Print Page | Close Window

How to make two "Recent file" menu?

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=1224
Printed Date: 06 November 2025 at 4:25pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to make two "Recent file" menu?
Posted By: freehawk
Subject: How to make two "Recent file" menu?
Date Posted: 30 September 2004 at 10:58pm

Hello .

 I want to make two "Recent file" menu as "Recent project file" and "Rcent source file", Please help me how to do?

Thank you .




Replies:
Posted By: Boyd
Date Posted: 01 October 2004 at 8:00am

The approach I took in the ActiveX version will probably apply to MFC as well.  I created a toolbar control for 'Open File' that was of type xtpSplitButtonPopup.  This allows the user to click on the control OR have it also display a popup.  If they click on the control, the 'Execute' event of CommandBars handles that control to open the standard file open dialog.  I also used the 'InitCommandsPopup' event of the of CommandBars to detect when the popup portion of the control was about to be displayed.  At that point, I would remove all the previous child controls from the 'Open File' menu and add my current recent files controls.  Each 'Open Recent' control had the same control ID, and the caption was used to determine which recent file the user wanted to open.

I don't know the exact MFC approach for this, but this technique should be applicable to MFC as well.



Posted By: freehawk
Date Posted: 03 October 2004 at 11:47pm

Thank you very much.

I will try it, BTW, could you have some sample for it?

 

Originally posted by Boyd Boyd wrote:

The approach I took in the ActiveX version will probably apply to MFC as well.  I created a toolbar control for 'Open File' that was of type xtpSplitButtonPopup.  This allows the user to click on the control OR have it also display a popup.  If they click on the control, the 'Execute' event of CommandBars handles that control to open the standard file open dialog.  I also used the 'InitCommandsPopup' event of the of CommandBars to detect when the popup portion of the control was about to be displayed.  At that point, I would remove all the previous child controls from the 'Open File' menu and add my current recent files controls.  Each 'Open Recent' control had the same control ID, and the caption was used to determine which recent file the user wanted to open.

I don't know the exact MFC approach for this, but this technique should be applicable to MFC as well.



Posted By: freehawk
Date Posted: 04 October 2004 at 4:42am

I finished it.

Thanks everyone.

 

Originally posted by freehawk freehawk wrote:

Thank you very much.

I will try it, BTW, could you have some sample for it?

 

Originally posted by Boyd Boyd wrote:

The approach I took in the ActiveX version will probably apply to MFC as well.  I created a toolbar control for 'Open File' that was of type xtpSplitButtonPopup.  This allows the user to click on the control OR have it also display a popup.  If they click on the control, the 'Execute' event of CommandBars handles that control to open the standard file open dialog.  I also used the 'InitCommandsPopup' event of the of CommandBars to detect when the popup portion of the control was about to be displayed.  At that point, I would remove all the previous child controls from the 'Open File' menu and add my current recent files controls.  Each 'Open Recent' control had the same control ID, and the caption was used to determine which recent file the user wanted to open.

I don't know the exact MFC approach for this, but this technique should be applicable to MFC as well.




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