wxFlatMenu & wxFlatMenuBar
Shoot
Hi Eran!
You are was doing a great work! Thanks very murch for this job! Im changed a some things at this, for example adding grip and dockable style.
And doing two panel - panel Menu and Tools. Then i taken next problem:
1. The grip - is not repaint needed colour, and in general, looks disgustingly
2. When movable, the Bar consist size at all screen! and i doing all, but that not want resizing to needed size!
3. And Last, what reading this class from .xrc resource file?
Please help! say me please, what i doing that all?
best regards Shoot.
You are was doing a great work! Thanks very murch for this job! Im changed a some things at this, for example adding grip and dockable style.
And doing two panel - panel Menu and Tools. Then i taken next problem:
1. The grip - is not repaint needed colour, and in general, looks disgustingly
2. When movable, the Bar consist size at all screen! and i doing all, but that not want resizing to needed size!
3. And Last, what reading this class from .xrc resource file?
Please help! say me please, what i doing that all?
best regards Shoot.
Code: Select all
void wxFlatMenuBar::PositionAUI(wxFrameManager *mgr, size_t pos)
{
wxPaneInfo pn;
int xx = wxSystemSettings::GetMetric(wxSYS_SCREEN_X);
// We add our menu bar as a toolbar, with the following settings
pn.ToolbarPane();
pn.BestSize(wxSize(xx, this->GetSize().y));
pn.FloatingSize(wxSize((xx>>1), this->GetSize().y));
pn.LeftDockable(false);
pn.RightDockable(false);
pn.CaptionVisible(false);
pn.PaneBorder(false);
pn.MinSize(wxSize(xx, this->GetSize().y));
pn.MaxSize(wxSize(xx, this->GetSize().y));
pn.Top();
pn.ToolbarPane().Top().Row(pos);
pn.Name(GetName()+_T("_MenuBar"));
pn.Caption(wxT("Menu Bar"));
mgr->AddPane(this, pn);
}
-
- In need of some credit
- Posts: 4
- Joined: Tue May 30, 2006 12:10 am
- Contact:
How to make the menus smaller
Hi Eran,
I'm experimenting with your wxFlatMenu classes for aUCBLogo,
since Bryan Petty told me about it, and I think they are great code!
My question:
How can I reduce the size of the menubar,
so that it has the size of an old-style XP or 98 menubar?
I have found "SPACER",
but it does not change the horizontal space between the menubar items.
Thanks,
Andreas
I'm experimenting with your wxFlatMenu classes for aUCBLogo,
since Bryan Petty told me about it, and I think they are great code!
My question:
How can I reduce the size of the menubar,
so that it has the size of an old-style XP or 98 menubar?
I have found "SPACER",
but it does not change the horizontal space between the menubar items.
Thanks,
Andreas
-
- In need of some credit
- Posts: 4
- Joined: Tue May 30, 2006 12:10 am
- Contact:
How to "Check" a menu item?
Hi Eran,
I hope I don't get on your nerves!
A second question:
I have lots of CheckItem's in my menus.
How can I "Check" it programmatically?
Or must I save the wxFlatMenuItem pointer, then access that?
Thanks,
Andreas
I hope I don't get on your nerves!
A second question:
I have lots of CheckItem's in my menus.
How can I "Check" it programmatically?
Or must I save the wxFlatMenuItem pointer, then access that?
Thanks,
Andreas
If I understood correctly what you want then you need to change this line:
flat_menu_bar.cpp, function OnPaint(), line: 201: (In SVN at least)
and set padding to be whatever you want.
In addition, make sure you are using the sources from SVN, since they contains small bug fixes, and I recently added an option to popup a context menu for every menu item (wxFlatMenuItem::SetContextMenu(wxFlatMenu * context_menu))
Eran
flat_menu_bar.cpp, function OnPaint(), line: 201: (In SVN at least)
Code: Select all
if( padding == -1 ){
dc.GetTextExtent(wxT("W"), &padding, &dummy);
}
In addition, make sure you are using the sources from SVN, since they contains small bug fixes, and I recently added an option to popup a context menu for every menu item (wxFlatMenuItem::SetContextMenu(wxFlatMenu * context_menu))
Eran
-
- In need of some credit
- Posts: 4
- Joined: Tue May 30, 2006 12:10 am
- Contact:
-
- Super wx Problem Solver
- Posts: 264
- Joined: Mon Aug 07, 2006 3:25 pm
- Location: Baia Mare, Romania
- Contact:
Hey Eran,
There is a problem with the flatmenu when a submenu has alot of items.
I have a main menu with a submenu containing lots of children. What happens is that the submenu is positioned in the top left corner point(0,0) and no scroll buttons are shown.
I made a change to void wxFlatMenuBase::AdjustPosition(wxPoint& pos) and it seems to work.
Changed
to
and it seems to work.
Regards,
Robert
There is a problem with the flatmenu when a submenu has alot of items.
I have a main menu with a submenu containing lots of children. What happens is that the submenu is positioned in the top left corner point(0,0) and no scroll buttons are shown.
I made a change to void wxFlatMenuBase::AdjustPosition(wxPoint& pos) and it seems to work.
Changed
Code: Select all
// we are a submenu
// try to decrese the y value of the menu position
int newy = pos.y;
newy -= (size.y + pos.y) - scrHeight;
if(newy + size.y > scrHeight)
{
// probably the menu size is too high to fit
// the screen, we need scrollbuttons
m_showScrollButtons = true;
}
else
{
pos.y = newy;
}
Code: Select all
// we are a submenu
// try to decrese the y value of the menu position
if(size.y > scrHeight)
{
m_showScrollButtons = true;
pos.y = 0;
}
else
{
int newy = pos.y;
newy -= (size.y + pos.y) - scrHeight;
if(newy + size.y > scrHeight)
{
// probably the menu size is too high to fit
// the screen, we need scrollbuttons
m_showScrollButtons = true;
}
else
{
pos.y = newy;
}
}
Regards,
Robert
Software is like sex,
It's better when it's free.
~Linus Torvalds
It's better when it's free.
~Linus Torvalds
Re: Shoot
Hi Eran!
I have made all that is written in last my post. I wish to give you it. Can be it is useful. Tell as to forward you the advanced project?
Whether and still there is an opportunity of processing of your project thus that it was compiled if wxWidgets are collected and using as DLL?
Best Regards, Alex
I have made all that is written in last my post. I wish to give you it. Can be it is useful. Tell as to forward you the advanced project?
Whether and still there is an opportunity of processing of your project thus that it was compiled if wxWidgets are collected and using as DLL?
Best Regards, Alex
Feature request
Hi, eranif
There is no Alt handler for menu, like that:
- Press Alt button
- first menu must be highlighted (as mouse over menu)
It's standart behaviour. Could you implement it?
There is no Alt handler for menu, like that:
- Press Alt button
- first menu must be highlighted (as mouse over menu)
It's standart behaviour. Could you implement it?
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact:
http://sourceforge.net/projects/wxflatnotebook/
You might also want to look at the eranif new creation: http://forums.wxwidgets.org/viewtopic.php?t=19081
You might also want to look at the eranif new creation: http://forums.wxwidgets.org/viewtopic.php?t=19081
For the flat menu, you can download the sources directly from here:
svn co https://OpenSVN.csie.org/wxFlatMenu/ wxflatmenu
Eran
svn co https://OpenSVN.csie.org/wxFlatMenu/ wxflatmenu
Eran
-
- Experienced Solver
- Posts: 89
- Joined: Tue Oct 03, 2006 6:30 pm
- Location: London, UK
- Contact:
Hi Eran & All,
since I have switched to wxWidgets/wxPython version 2.8.8.1, I have noticed that the menu accelerators in FlatMenu do not work anymore (in wxPython). Is there someone who could test if they do work in wxWidgets (using C++) so that I can understand if it is a bug in my Python translation of FlatMenu (highly probable), a bug in wxPython or a bug in wxWidgets?
Using Eran's demo of FlatMenu is enough to test if accelerators work or not.
Thank you for your help.
Andrea.
since I have switched to wxWidgets/wxPython version 2.8.8.1, I have noticed that the menu accelerators in FlatMenu do not work anymore (in wxPython). Is there someone who could test if they do work in wxWidgets (using C++) so that I can understand if it is a bug in my Python translation of FlatMenu (highly probable), a bug in wxPython or a bug in wxWidgets?
Using Eran's demo of FlatMenu is enough to test if accelerators work or not.
Thank you for your help.
Andrea.