wxFlatMenu & wxFlatMenuBar
I have a question on dual monitor:
Does the menu always appear on primary monitor (in my implementation, menu is a child of the desktop)?
If the answer is yes, does the following is a valid solution:
- Query a system about number of monitors
- Query the main window on which monitor it is shown (is this feasible??)
- if appliocation main frame is on secondary screen, add to the menu popup position an offset of the primary monitor size
Am I going the right way, or I am wrong?
Please assume that I am a complete newbi when it comes to dual monitors
PS:
Are you the one who opened me same bug on wxFlatNotebook, dual monitoring & CodeBlocks?
With regards,
Eran
Does the menu always appear on primary monitor (in my implementation, menu is a child of the desktop)?
If the answer is yes, does the following is a valid solution:
- Query a system about number of monitors
- Query the main window on which monitor it is shown (is this feasible??)
- if appliocation main frame is on secondary screen, add to the menu popup position an offset of the primary monitor size
Am I going the right way, or I am wrong?
Please assume that I am a complete newbi when it comes to dual monitors
PS:
Are you the one who opened me same bug on wxFlatNotebook, dual monitoring & CodeBlocks?
With regards,
Eran
eranif wrote:Does the menu always appear on primary monitor (in my implementation, menu is a child of the desktop)?
YES
don't know exactly, but on my dual monitor setup the desktop has continous coordinates of both screens.eranif wrote:If the answer is yes, does the following is a valid solution:
- Query a system about number of monitors
- Query the main window on which monitor it is shown (is this feasible??)
- if appliocation main frame is on secondary screen, add to the menu popup position an offset of the primary monitor size
example
primary: 1280 x 1024 = (Xp x Yp , left monitor )
secondary: 1024 x 768 = (Xs x Ys , right monitor )
virtual desktop : X ( Xp + Xs ) , Y ( Yp) = 2304 x 1024
X range: 0 ... 2303
Y range: 0 ... 1023
because the setup of the two monitors is choosen so,
that the bottom line of screen matches the two monitors,
the area on top of the right side (1279, 0 ... 2303,255)
cannot be shown.
no, but i noticed it too.eranif wrote: Are you the one who opened me same bug on wxFlatNotebook, dual monitoring & CodeBlocks?
brgds, tiwag
-tiwag
Hi all,
I just updated the source files of wxFlatMenu,
The only change I did, is that it now compiles and run on Linux (makefile is provided).
to compile it on Linux, untar the zip and simply run the makefile
make type=release [clean] (or debug, debug_unicode, release_unicode)
Here is a screenshot from my ubuntu machine:
@Infinity_77 - start converting
Eran
I just updated the source files of wxFlatMenu,
The only change I did, is that it now compiles and run on Linux (makefile is provided).
to compile it on Linux, untar the zip and simply run the makefile
make type=release [clean] (or debug, debug_unicode, release_unicode)
Here is a screenshot from my ubuntu machine:
@Infinity_77 - start converting
Eran
-
- Experienced Solver
- Posts: 89
- Joined: Tue Oct 03, 2006 6:30 pm
- Location: London, UK
- Contact:
I'll do my best Eran@Infinity_77 - start converting
But at the moment I believe that those nice and eye-capturing shadows behind the menus (in MSW) will be a prerogative of wxWidgets... unless some magic thing appears with low-level modules in Python.
Very nice also on Linux! Congratulations!
Andrea.
-
- Experienced Solver
- Posts: 89
- Joined: Tue Oct 03, 2006 6:30 pm
- Location: London, UK
- Contact:
Hi Eran,
sorry for my immense ignorance in C++, but I have a couple of questions about FlatMenu.
1) Looking at the 2 following declarations:
flat_menu.cpp:
flat_menu.h
wxMenuDeclaration is a subclass of what? wxPopupWindow or wxShadowPopupWindow?
2) wxMenuDecoration initialization (flat_menu.cpp):
Uhm... why wxPopupWindow is created only on MSW? Don't the other platforms need an initialization too?
I am surely missing something, sorry for my ingnorance
Thanks for any explanation.
Andrea.
sorry for my immense ignorance in C++, but I have a couple of questions about FlatMenu.
1) Looking at the 2 following declarations:
flat_menu.cpp:
Code: Select all
BEGIN_EVENT_TABLE(wxMenuDecoration, wxPopupWindow)
Code: Select all
class WXMAKINGDLL_FLATMENU_EXPIMP wxMenuDecoration :
public wxShadowPopupWindow
2) wxMenuDecoration initialization (flat_menu.cpp):
Code: Select all
wxMenuDecoration::wxMenuDecoration(wxMenuDecType type, const wxString& text, bool dropDownArrow)
: m_type(type)
, m_text(text)
, m_bDropDownArrow(dropDownArrow)
, m_bmp(wxNullBitmap)
{
#ifndef __WXMSW__
wxWindow* parent = wxTheApp->GetTopWindow();
wxASSERT_MSG(parent, wxT("Can't create menu without parent!"));
wxPopupWindow::Create(parent, wxBORDER_NONE );
#endif
}
Uhm... why wxPopupWindow is created only on MSW? Don't the other platforms need an initialization too?
I am surely missing something, sorry for my ingnorance
Thanks for any explanation.
Andrea.
Ok,
I will draw the class structure:
On windows:
wxPopupWindow
-wxShadowPopupWindow
---wxFlatMenuBase
-------wxFlatMenu
On GTK:
wxPopupWindow
- wxFlatMenuBase
----wxFlatMenu
On GTK and other platforms, the class wxShadowPopupWindow is a define for wxPopupWindow (acronym)
On all platforms, the initialisation take place in wxFlatMenuBase constructor, On windows, I needed to override it to call my own CreateMSW() function.
On GTK, wxShadowPopupWindow *is* wxPopupWindow.
The class wxShadowPopupWindow, was needed so I could register it to windows with window style flag set, so we can get this nice shadows around the custom menus.
On GTK, I am currently implemeting a shadow using a technique that will work in 95% of the cases, using placing the background image behind the menu and using PNG images for the shadow, I willl post a screenshot once it is done.
Hope it cleared it for you,
Eran
I will draw the class structure:
On windows:
wxPopupWindow
-wxShadowPopupWindow
---wxFlatMenuBase
-------wxFlatMenu
On GTK:
wxPopupWindow
- wxFlatMenuBase
----wxFlatMenu
On GTK and other platforms, the class wxShadowPopupWindow is a define for wxPopupWindow (acronym)
On all platforms, the initialisation take place in wxFlatMenuBase constructor, On windows, I needed to override it to call my own CreateMSW() function.
wxMenuDecration, on windows is subclass of wxShadowPopupWindow ( which is a subclass of wxPopupWindow)wxMenuDeclaration is a subclass of what? wxPopupWindow or wxShadowPopupWindow?
On GTK, wxShadowPopupWindow *is* wxPopupWindow.
The class wxShadowPopupWindow, was needed so I could register it to windows with window style flag set, so we can get this nice shadows around the custom menus.
On GTK, I am currently implemeting a shadow using a technique that will work in 95% of the cases, using placing the background image behind the menu and using PNG images for the shadow, I willl post a screenshot once it is done.
Hope it cleared it for you,
Eran
Hi,
Here is an update of my new little project menu & menu bar:
- The menu bar got some face lift ...
- New drop down arrow button was added to the right of the menu, it always contains the "Customize" option, which will popup an options dialog, the dialog functionality is not completed, but it will have:
- Ability to add/remove menus (done)
- Select different colour schems for the menu bar
- Control various options, such as: colour for highlight menu item, draw border around menu (classic look only), display decorations for popup menus (menus which are not related to menu bar)
- Ability to change accelerators for menu items (maybe after first release)
- To complete the set, I will provide also a toolbar to keep look and feel consistency
The source files are now under SVN, and can be found here:
https://opensvn.csie.org/wxFlatMenu
Compiled demo with AUI:
http://www.eistware.com/flatmenu/22_oct ... th_AUI.zip
Here are some (6) screenshots for the updated menu:
classic look (AKA XP):
customize dialog (with new wxLabelBook )
Hidden menus are shown in the 'more' button:
Dark colour scheme for the menu bar.
I hope that sometime next week or the week after I will release the first version (announcement will be posted in 'Announcment and discoveries' section)
Btw, all are running on Linux as well (too lazy to post screenshot from my Llinux)
With regards,
Eran
Here is an update of my new little project menu & menu bar:
- The menu bar got some face lift ...
- New drop down arrow button was added to the right of the menu, it always contains the "Customize" option, which will popup an options dialog, the dialog functionality is not completed, but it will have:
- Ability to add/remove menus (done)
- Select different colour schems for the menu bar
- Control various options, such as: colour for highlight menu item, draw border around menu (classic look only), display decorations for popup menus (menus which are not related to menu bar)
- Ability to change accelerators for menu items (maybe after first release)
- To complete the set, I will provide also a toolbar to keep look and feel consistency
The source files are now under SVN, and can be found here:
https://opensvn.csie.org/wxFlatMenu
Compiled demo with AUI:
http://www.eistware.com/flatmenu/22_oct ... th_AUI.zip
Here are some (6) screenshots for the updated menu:
classic look (AKA XP):
customize dialog (with new wxLabelBook )
Hidden menus are shown in the 'more' button:
Dark colour scheme for the menu bar.
I hope that sometime next week or the week after I will release the first version (announcement will be posted in 'Announcment and discoveries' section)
Btw, all are running on Linux as well (too lazy to post screenshot from my Llinux)
With regards,
Eran
Good work Eran!
What are your plans, create a second alternative to wxAUI ? I guess your approach is very cool, skinning a lot of controls to a flat family on wxWidgets, but I can't help noticing you and the wxAUI guys are sharing a lot of common code. Maybe you should team up and making it an even cooler library?
It's just a thought. I did follow the thread on wx-users where you Vadim and Robert are pondering about integrating custom drawing in wxWidgets. That would be very cool ..
Regards,
- Jorgen
What are your plans, create a second alternative to wxAUI ? I guess your approach is very cool, skinning a lot of controls to a flat family on wxWidgets, but I can't help noticing you and the wxAUI guys are sharing a lot of common code. Maybe you should team up and making it an even cooler library?
It's just a thought. I did follow the thread on wx-users where you Vadim and Robert are pondering about integrating custom drawing in wxWidgets. That would be very cool ..
Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
ThanksJorg wrote:Good work Eran!
No, I think wxAUI is great, If I didnt think so, I would not have bother supplying a support for it with my new menu bar alternative.Jorg wrote: What are your plans, create a second alternative to wxAUI ?
In fact, I am working on integrating wxFlatNotebook inside wxAUI (with bwilliams, wxAUI author), becuase I think wxFlatNotebook tabs, can offer alot to wxAUI.
I plan to achieve a proper alternative for wxMenu* family.Jorg wrote:What are your plans
My ultimate goal is to complete a wxRibbonBar
http://www.codejock.com/downloads/sampl ... bbonsample
Eran
-
- Experienced Solver
- Posts: 89
- Joined: Tue Oct 03, 2006 6:30 pm
- Location: London, UK
- Contact:
Hi Eran,
excellent work, really! If I may show you something, that uses your custom controls, I would like to present my latest creature, called Symphony. This is a screenshot of Symphony (with luna blue theme) using FlatNotebook in the middle (I can't show the real plot 'cause I am not allowed to, but it is something VTK-based) and an improved version of FancyButtonPanel that handles also separators, controls, buttons with text and much more:
http://xoomer.alice.it/infinity77/Symphony_lunablue.png
And another screenshot that implements FlatMenu in wxPython (I just finished it), with luna grey theme:
http://xoomer.alice.it/infinity77/Symph ... atMenu.png
Unfortunately, shadows behind menus still baffles me, but I think it is nice anyway and I will write to Robin to see if there is something we can do to obtain those nice shadows.
I hope you like it, and thanks so much for your great efforts!
Andrea.
excellent work, really! If I may show you something, that uses your custom controls, I would like to present my latest creature, called Symphony. This is a screenshot of Symphony (with luna blue theme) using FlatNotebook in the middle (I can't show the real plot 'cause I am not allowed to, but it is something VTK-based) and an improved version of FancyButtonPanel that handles also separators, controls, buttons with text and much more:
http://xoomer.alice.it/infinity77/Symphony_lunablue.png
And another screenshot that implements FlatMenu in wxPython (I just finished it), with luna grey theme:
http://xoomer.alice.it/infinity77/Symph ... atMenu.png
Unfortunately, shadows behind menus still baffles me, but I think it is nice anyway and I will write to Robin to see if there is something we can do to obtain those nice shadows.
I hope you like it, and thanks so much for your great efforts!
Andrea.
Very nice and impressive,
this kind of replies encourage me to improve the control!
I am now working on completing the menu bar.
BTW, by looking at your screenshot, I remembered a small bug that I intended to fix and forgot about it: when poping up a menu, the menu caption, is drawn 4 pixels too low
Beside that, Once I will complete it, you will be able to choose colours scheme for the menu bar using the right side button (user will be able to save/load its settings to/from a wxString)
I am also planing to add toolbar as part of the menu bar, very similar to the FancyButtonPanel, but will integrate with the menu bar (disabling, receive the UpdateUI events, etc)
You should really convince Robbin to accept the shadow code, even if it windows only, it adds *alot* to the menus
With regards,
Eran
this kind of replies encourage me to improve the control!
I am now working on completing the menu bar.
BTW, by looking at your screenshot, I remembered a small bug that I intended to fix and forgot about it: when poping up a menu, the menu caption, is drawn 4 pixels too low
Beside that, Once I will complete it, you will be able to choose colours scheme for the menu bar using the right side button (user will be able to save/load its settings to/from a wxString)
I am also planing to add toolbar as part of the menu bar, very similar to the FancyButtonPanel, but will integrate with the menu bar (disabling, receive the UpdateUI events, etc)
You should really convince Robbin to accept the shadow code, even if it windows only, it adds *alot* to the menus
With regards,
Eran
-
- Experienced Solver
- Posts: 89
- Joined: Tue Oct 03, 2006 6:30 pm
- Location: London, UK
- Contact:
Hi Eran,
I am glad you liked it! However, as for convince Robin, it is not really an issue. The problem I am having is related to the code itself, not to Robin acceptance of it. If I have understood correctly, in your code you have:
ShadowPopupWindow inherits from wx.PopupWindow
BUT:
In the initialization code of ShadowPopupWindow, you have:
So it does not inherit anymore from wx.PopupWindow, but from wx.Window (?!?!?).
In wxPython, if ShadowPopupWindow inherits from wx.PopupWindow, I have to do either this:
class ShadowPopupWindow(wx.PopupWindow):
def __init__(self, parent):
wx.PopupWindow.__init__(self, parent)
OR:
class ShadowPopupWindow(wx.PopupWindow):
def __init__(self, parent):
pre = wx.PrePopupWindow()
pre.Create(parent, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, style, "flat_menu")
I still haven't found a way to Create() a wx.Window even if I inherit from wx.PopupWindow... maybe someone from the C++ side can share some suggestion on this issue.
Andrea.
I am glad you liked it! However, as for convince Robin, it is not really an issue. The problem I am having is related to the code itself, not to Robin acceptance of it. If I have understood correctly, in your code you have:
ShadowPopupWindow inherits from wx.PopupWindow
BUT:
In the initialization code of ShadowPopupWindow, you have:
Code: Select all
long style = wxBORDER_NONE | wxWANTS_CHARS | wxPOPUP_WINDOW;
wxWindow::Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, style, wxT("flat_menu"));
In wxPython, if ShadowPopupWindow inherits from wx.PopupWindow, I have to do either this:
class ShadowPopupWindow(wx.PopupWindow):
def __init__(self, parent):
wx.PopupWindow.__init__(self, parent)
OR:
class ShadowPopupWindow(wx.PopupWindow):
def __init__(self, parent):
pre = wx.PrePopupWindow()
pre.Create(parent, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, style, "flat_menu")
I still haven't found a way to Create() a wx.Window even if I inherit from wx.PopupWindow... maybe someone from the C++ side can share some suggestion on this issue.
Andrea.
Cool! It would be great to combine those two greatnesses, wxAUI for the docking, and your great libs for the eye candy...In fact, I am working on integrating wxFlatNotebook inside wxAUI (with bwilliams, wxAUI author), becuase I think wxFlatNotebook tabs, can offer alot to wxAUI.
That looks really nice and can be a new revolutioonary way of designing menus in the GUI. I hope you succeed in this, it will greatly add value to wxWidgets!My ultimate goal is to complete a wxRibbonBar
Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb