Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - How to make two "Recent file" menu?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to make two "Recent file" menu?

 Post Reply Post Reply
Author
Message
freehawk View Drop Down
Groupie
Groupie


Joined: 22 April 2004
Status: Offline
Points: 95
Post Options Post Options   Thanks (0) Thanks(0)   Quote freehawk Quote  Post ReplyReply Direct Link To This Post Topic: How to make two "Recent file" menu?
    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 .

Back to Top
Boyd View Drop Down
Senior Member
Senior Member


Joined: 08 December 2003
Location: United States
Status: Offline
Points: 285
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boyd Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
freehawk View Drop Down
Groupie
Groupie


Joined: 22 April 2004
Status: Offline
Points: 95
Post Options Post Options   Thanks (0) Thanks(0)   Quote freehawk Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
freehawk View Drop Down
Groupie
Groupie


Joined: 22 April 2004
Status: Offline
Points: 95
Post Options Post Options   Thanks (0) Thanks(0)   Quote freehawk Quote  Post ReplyReply Direct Link To This Post 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.

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.047 seconds.