Page 1 of 1
[DONE] Strange menu behaviour in Windows 8
Posted: Wed Dec 11, 2013 2:32 pm
by Kukulkan
Hello,
a customer reported the following Problem to me:
On windows 8, the menu is display in a 'random' position, not align correctly (see picture).
On my machines, the menu appears directly below the "Ordner" menu. I can not reproduce, but customers complain...
I'm doing it like this:
Code: Select all
; do menu
MenuTitle(LG(61))
MenuItem(#Menu_Window_0_Configuration, LG(62))
MenuItem(#Menu_Window_0_Exit, LG(63))
MenuTitle(LG(144))
MenuItem(#Menu_Window_0_OpenInput, LG(145))
MenuItem(#Menu_Window_0_OpenBilldir, LGS(146, "APP_NAME", productName))
MenuItem(#Menu_Window_0_OpenDonedir, LG(147))
MenuItem(#Menu_Window_0_OpenErrdir, LG(197))
If FileSize(globalEventLogPath) > 0
MenuItem(#Menu_Window_0_OpenEventlog, LG(198))
EndIf
MenuTitle(LG(64))
MenuItem(#Menu_Window_0_Manual, LG(165))
MenuItem(#Menu_Window_0_Wizard, LG(65))
MenuItem(#Menu_Window_0_About, LGS(66, "APP_NAME", productName))
LG() is the function to get translated language sentence. LG(144) is the word "Ordner".
What can I do?
Kukulkan
Re: Strange menu behaviour in Windows 8
Posted: Wed Dec 11, 2013 2:58 pm
by True29
perhaps you post a test code , or share the programm with us to test it.
Re: Strange menu behaviour in Windows 8
Posted: Wed Dec 11, 2013 3:24 pm
by Kukulkan
The program does only work if you have an account. It is quite complex. So, easy test is not possible. But I'm not doing any magic. It is the code above to create the menu. And that's it. The event loop simply reacts to the #PB_Event_Menu events. Never got complains before but now.
I try to reproduce this at one of the customers with a reduced repro. If I get more info, I will write it here.
In the meanwhile, any ideas?
Kukulkan
Re: Strange menu behaviour in Windows 8
Posted: Wed Dec 11, 2013 3:51 pm
by Kukulkan
Ok, customer reports that it also happens with this small executable:
Code: Select all
If OpenWindow(0, 100, 150, 195, 260, "PureBasic - Menu")
;
; Create the menu. The indent is very important here for a good lisibility
;
If CreateMenu(0, WindowID(0))
MenuTitle("File")
MenuItem( 1, "&Load...")
MenuItem( 2, "Save")
MenuItem( 3, "Save As...")
MenuBar()
OpenSubMenu("Recents")
MenuItem( 5, "Pure.png")
MenuItem( 6, "Basic.jpg")
OpenSubMenu("Even more !")
MenuItem( 12, "Yeah")
CloseSubMenu()
MenuItem( 13, "Rocks.tga")
CloseSubMenu()
MenuBar()
MenuItem( 7, "&Quit")
MenuTitle("Edition")
MenuItem( 8, "Cut")
MenuItem( 9, "Copy")
MenuItem(10, "Paste")
MenuTitle("?")
MenuItem(11, "About")
EndIf
DisableMenuItem(0, 3, 1)
DisableMenuItem(0, 13, 1)
;
; This is the 'event loop'. All the user actions are processed here.
; It's very easy to understand: when an action occurs, the Event
; isn't 0 and we just have to see what have happened...
;
Repeat
Select WaitWindowEvent()
Case #PB_Event_Menu
Select EventMenu() ; To see which menu has been selected
Case 11 ; About
MessageRequester("About", "Cool Menu example", 0)
Default
MessageRequester("Info", "MenuItem: "+Str(EventMenu()), 0)
EndSelect
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
Until Quit = 1
EndIf
End
Therefore I believe it is not PB related. Do you have any idea what Windows setting might cause this? Customer says he only installed Firefox and Thunderbird.
UPDATE: He also just told me that Notepad is also having such problem. So definitely no PB Problem. Sorry for bothering here
Best
Kukulkan
Re: Strange menu behaviour in Windows 8
Posted: Wed Dec 11, 2013 4:01 pm
by luis
On win 8.1 a standard PB menu seems to work as it should. Your test code also work.
I can tell you on windows 7 this happened to me once (menus right aligned instead of left) after I had installed the tablet pen extensions to play with a Wacom tablet. There was a gui setting somewhere (I don't remember exactly) which made the menus go back to the right place. Don't know if it can be relevant in some way to your case.
Maybe you could try to check on his system the MenuDropAlignment key in the registry (google for it, don't know if it's a key valid for win 8.* too).
Re: Strange menu behaviour in Windows 8
Posted: Thu Dec 12, 2013 3:30 pm
by Kukulkan
Hi Luis,
Hey, that hint about
MenuDropAlignment really fixed this thing! THANK YOU
Best
Kukulkan