-
May 15th, 2013, 03:38 AM
#1
How to modify File menu width
Hello,
I derived a class from CRecentFileList in order to set the number of displayed chars for MRU.
The problem is that if I open the app with 256 set for this number (it is read from .ini file) the display is correct. But after I change it to 10 for e.g., File menu width remains unchanged altghough MRU are correctly displayed on 10 (or at least file name lenghts) chars.
Have you any ideea how can I tell to the menu to shrink to actual width?
Thank you,
Move like a snake, think like a snake, be a snake !!!
-
May 15th, 2013, 05:08 AM
#2
Re: How to modify File menu width
Perhaps, DrawMenuBar could help?
Victor Nijegorodov
-
May 15th, 2013, 05:10 AM
#3
Re: How to modify File menu width
I've already tried it, no use.
Move like a snake, think like a snake, be a snake !!!
-
May 15th, 2013, 05:22 AM
#4
Re: How to modify File menu width
Then try to reload menu (CFrameWnd::OnUpdateFrameMenu followed by DrawMenuBar)
Victor Nijegorodov
-
May 15th, 2013, 07:29 AM
#5
Re: How to modify File menu width
I tried this as you adviced me and still no effect.
Can anyone tell me where is the place the system computes necessary width in order for accelerators to be also displayed?
I think knowing this I will be able to accomplish my update.
Move like a snake, think like a snake, be a snake !!!
-
May 15th, 2013, 07:49 AM
#6
Re: How to modify File menu width
Originally Posted by Snakekaa
I tried this as you adviced me and still no effect.
How have you implemented it? Could you show your code?
Originally Posted by Snakekaa
Can anyone tell me where is the place the system computes necessary width in order for accelerators to be also displayed?
I think knowing this I will be able to accomplish my update.
I guess it is calculated in menu draw procedure. Sure you could override it using owner draw menu.
Victor Nijegorodov
-
May 17th, 2013, 07:11 AM
#7
Re: How to modify File menu width
Where can I find that menu draw procedure?
To override menu for this issue is just too much.
Perhaps I can do it without overriding?
Move like a snake, think like a snake, be a snake !!!
-
May 17th, 2013, 07:22 AM
#8
Re: How to modify File menu width
Did you try to completely replace menu? Like it was described in KB How to Use Multiple Menus in MFC App That Uses GetDefaultMenu...
Victor Nijegorodov
-
May 20th, 2013, 05:14 AM
#9
Re: How to modify File menu width
I do not have another menu to replace with.
I just want to tell this menu that I don't need that width anymore.
I saw that this behaviour is the default one in Windows app, but I do not want it.
Move like a snake, think like a snake, be a snake !!!
-
May 20th, 2013, 07:03 AM
#10
Re: How to modify File menu width
You do NOT need "another" menu. Just try to load the same menu and replace the existent one with the loaded one.
Victor Nijegorodov
-
May 21st, 2013, 09:25 AM
#11
Re: How to modify File menu width
Let suppose I do not have a document just open the app.
I have a method attached to a menu ID which changed File options width.
In that method I tried this:
::LoadMenu(AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME));
OnUpdateFrameMenu(NULL);
DrawMenuBar();
Perhaps IDR_MAINFRAME is not found or perhaps something else went wrong the fact is it didn't worked.
Move like a snake, think like a snake, be a snake !!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|