wxFlatMenu & wxFlatMenuBar

If you have a cool piece of software to share, but you are not hosting it officially yet, please dump it in here. If you have code snippets that are useful, please donate!
Post Reply
eranif
Moderator
Moderator
Posts: 610
Joined: Tue Nov 29, 2005 7:10 pm
Location: Israel

wxFlatMenu & wxFlatMenuBar

Post by eranif »

Hi,

here is another component I wrote for my own needs, like the name implies, it is a generic menu.

The current implementation was tested on windows, as soon as I will finish all functionlity I will build it on Linux as well.

(the code should compile and run on Linux, but I know there are some still problems with the events)

I tried to provide a full functionlity for menu and menubar.

Some things still needs to be solved, like:

- Radio items are not handled yet
- Linux port ofc
- Integration with docking library (mainly AUI)
- Automatic scroll bar when menu's height capture full screen height
- Accelerators (Alt+F, Alt+S etc)

and probably some other points that I missed out

The above list is what it cant do, so what can it does?
- Fires all the events (UI & Cmd)
- Check items
- Separators
- Enable / Disable
- Images
- etc etc

Link to source files:
http://www.eistware.com/flatmenu/wxFlatMenu.zip

Demo (Zipped win32 exe):
http://www.eistware.com/flatmenu/wxflatmenu_test.zip

I think it looks pretty cool :wink:

here are some screenshots of the demo application:

Modern look:
Image

XP default look:
Image

Modern look hover:
Image
Last edited by eranif on Sun Nov 05, 2006 7:25 pm, edited 1 time in total.
IDE: CodeLite + wxCrafter
OS: All
https://wxcrafter.codelite.org
https://codelite.org
RJP Computing
Experienced Solver
Experienced Solver
Posts: 75
Joined: Sat Dec 10, 2005 10:38 pm
Location: Michigan, USA
Contact:

Post by RJP Computing »

Looks very good. Thanks for sharing. I can't wait for this control to mature.
- Ryan
RJP Computing
wxPack - Precompiled wxWidgets package.

Ubuntu 9.04 x86_64/WinXP, AMD Athlon x2 3000+, 4000MB RAM, AC 97 Audio, nVidia GeForce 9400GS 1GB
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

Andrea has his work cut out for him to surprise the wxPython community again with a good port of your great work eranif!

Looks great! I think a lot of people will like this as it was a long standung request to get office 2003 like menus in common apps with wxWidgets!

Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Infinity_77
Experienced Solver
Experienced Solver
Posts: 89
Joined: Tue Oct 03, 2006 6:30 pm
Location: London, UK
Contact:

Post by Infinity_77 »

Ah, this is excellent Eran! Extremely nice, really.
Andrea has his work cut out for him to surprise the wxPython community again with a good port of your great work eranif!
Well, I have extended the work Eran has done with FancyButtonPanel with a lot *LOT* of new things... Jorg, stay tuned on the wxPython mailing list, I think this evening I will post the latest release :-D

Andrea.
"Imagination Is The Only Weapon In The War Against Reality."

http://xoomer.alice.it/infinity77/
benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte »

Great work guys!

Is it possible to open the top level menus when the mouse moves upon them?
I mean, click on the first top level menu "File", move the mouse on "Style", it makes the "Style" menu open, like it does in other apps.
eranif
Moderator
Moderator
Posts: 610
Joined: Tue Nov 29, 2005 7:10 pm
Location: Israel

Post by eranif »

Is it possible to open the top level menus when the mouse moves upon them?
Basically, I am completing this functionality now (more or less in that order):

- Accelerators for menus - Done
- Accelerators for menubar
- Mouse moving to another menu while menu is opened, should open other menu and close current one
- Radio items in menus
- Integration with AUI (finding a workaroud to co-exist)
- Scrolling when menu is too big to fit the screen
IDE: CodeLite + wxCrafter
OS: All
https://wxcrafter.codelite.org
https://codelite.org
priyank_bolia
wxWorld Domination!
wxWorld Domination!
Posts: 1339
Joined: Wed Aug 03, 2005 8:10 am
Location: BANGALORE, INDIA
Contact:

Post by priyank_bolia »

BEWARE: you are contributing too much to the wxWidgets owner drawn controls. :D
Once again great piece of work.
eranif
Moderator
Moderator
Posts: 610
Joined: Tue Nov 29, 2005 7:10 pm
Location: Israel

Post by eranif »

Hi,

Another update on this control,

I updated the source files + demo.

The changes I have made:

- Accelerators are now supported (inside menus & for the menu bar)
- Hovering with a mouse on another top level menu, while a menu is opened, will close the current one and will open the other one
- It is now possible to navigate between top level menus using the arrows: if a menu is opened, and user press right arrow, the following logic applies:
+ if the menu has sub menu - it will open
+ if the menu has no sub-menu, the menu bar will attempt to open the next top level menu
similar logic for left arrow

Links:
Link to source files:
http://www.eistware.com/flatmenu/wxFlatMenu.zip

Demo (Zipped win32 exe):
http://www.eistware.com/flatmenu/wxflatmenu_test.zip
Eran
IDE: CodeLite + wxCrafter
OS: All
https://wxcrafter.codelite.org
https://codelite.org
tiwag
Earned some good credits
Earned some good credits
Posts: 123
Joined: Tue Dec 21, 2004 8:51 pm
Location: Austria

Post by tiwag »

works great !

thanks !
-tiwag
eranif
Moderator
Moderator
Posts: 610
Joined: Tue Nov 29, 2005 7:10 pm
Location: Israel

Post by eranif »

Update:

It now supports AUI, at least for v0.9.2 (wx2.6.3), it means that you can place a menu bar as an AUI window (the work was to find the correct settings that will result in acceptable behavior). AUI source are unmodified ofc.

I updated the source files & added another executable that includes the AUI binary for windows (so you can get impression, report bugs :wink:):
http://www.eistware.com/flatmenu/wxflat ... th_AUI.zip

Eran
IDE: CodeLite + wxCrafter
OS: All
https://wxcrafter.codelite.org
https://codelite.org
Infinity_77
Experienced Solver
Experienced Solver
Posts: 89
Joined: Tue Oct 03, 2006 6:30 pm
Location: London, UK
Contact:

Post by Infinity_77 »

Hi Eran,

it is very impressive, nice work! If I may report one strange thing in the latest executable (with wxAUI support):

If I drag the top sash to enlarge the frame menu, I am not able anymore to click on "File", "Edit" and so on. The menu texts are correctly positioned in the middle, but the menu highlight is still in the old position (at the top).

@Jorgen: I am afraid it would be impossible to port it to wxPython as it is; other than the platform dependent code (that is easily implemented also in wxPython), there are calls to the MS Windows API which can not be ported to wxPython unless ctypes or win32all extensions are used (and I am not sure it can be done anyway, the MSWGetCreateWindowFlags and similar functions are impossible to translate IMHO). I don't think Robin will accepts something that runs only on Windows. Eran has done an excellent work with this control but wxPythoneers like me should only hope for a class that works also on GTK ans MAC and then wait that Robin wraps it with SWIG.

Andrea.
"Imagination Is The Only Weapon In The War Against Reality."

http://xoomer.alice.it/infinity77/
User avatar
T-Rex
Moderator
Moderator
Posts: 1248
Joined: Sat Oct 23, 2004 9:58 am
Location: Zaporizhzhya, Ukraine
Contact:

Post by T-Rex »

wxAUI+wxFlatMenu-related bug
See screenshot
http://rapidshare.de/files/37030691/fla ... 1.JPG.html
Belgabor
I live to help wx-kind
I live to help wx-kind
Posts: 173
Joined: Mon Sep 25, 2006 1:12 pm

Post by Belgabor »

eranif wrote:Update:

It now supports AUI, at least for v0.9.2 (wx2.6.3), it means that you can place a menu bar as an AUI window (the work was to find the correct settings that will result in acceptable behavior). AUI source are unmodified ofc.

I updated the source files & added another executable that includes the AUI binary for windows (so you can get impression, report bugs :wink:):
http://www.eistware.com/flatmenu/wxflat ... th_AUI.zip

Eran
The demo doesn't work here on Win2k. I get lots of 1407 "window class not found" errors for the menus.
eranif
Moderator
Moderator
Posts: 610
Joined: Tue Nov 29, 2005 7:10 pm
Location: Israel

Post by eranif »

I don't think Robin will accepts something that runs only on Windows
It does not run only on windows, dont let people get the wrong impression...

The WIN API code used there is only for shadow for the menu on windows, and can be safely ignored. (it is surrounded with WXWIN ifdefs)

Once I will complete the control, I will fine tune it to GTK as well.

I compiled it when I started working on it on GTK and it worked perfectly.
The only different is that on GTK it does not have shadow under it.

The demo doesn't work here on Win2k. I get lots of 1407 "window class not found" errors for the menus.
The errors you are getting are probably related to the same issue - using the native windows call to shadow the menu.

Eran
IDE: CodeLite + wxCrafter
OS: All
https://wxcrafter.codelite.org
https://codelite.org
eranif
Moderator
Moderator
Posts: 610
Joined: Tue Nov 29, 2005 7:10 pm
Location: Israel

Post by eranif »

wxAUI+wxFlatMenu-related bug
See screenshot
http://rapidshare.de/files/37030691/fla ... 1.JPG.html
Took me a while before I could see the JPEG, but this bug is same one like Inifinity_77

I already fixed it.

The ideal situation, is not to allow the menubar to expand.
The demo is updated.

Eran
IDE: CodeLite + wxCrafter
OS: All
https://wxcrafter.codelite.org
https://codelite.org
Post Reply