Page 1 of 1
Refresh menu
Posted: Sun Oct 17, 2004 10:01 am
by aXend
When I use a menu I find that by dragging the mouse over a menu item it is selected (white) but when I select another menu item the previous one stays selected. By dragging the mouse over all the menu items I get an ugly white/gray menybar. I thought it might be a Windows "feature". It is the same with the PureBasic editor and others. Is it just a fact of life? Is it my PC only? I run Windows XP Home Edition. But if I look at IE 6.0 for example this is not happening. So it can be changed.
Does anyone have an idea what to do about it?
Posted: Sun Oct 17, 2004 7:58 pm
by Sparkie
Are you running a custom Theme for XP?
Run this code and see if the result is "0" or "1".
Code: Select all
#SPI_GETFLATMENU = $1022
SystemParametersInfo_(#SPI_GETFLATMENU, 0, @myBool, 0)
MessageRequester("Info", Str(myBool))
My guess is it will return "0" for you.
Posted: Mon Oct 18, 2004 7:05 am
by aXend
You were absolutely right Sparkie. That was it. I didn't know I was running a custom theme, I only changed the color of the background. I changed it back to XP theme, chose the same background again and changed the color again, but now it's all OK.
Thanks for your help.

Posted: Mon Oct 18, 2004 8:17 am
by IceSoft
Sparkie wrote:Are you running a custom Theme for XP?
But It should running on a custom Theme for XP too.
PB is the only one application with this (wrong) behavior if I use a custom Theme... :roll:
Posted: Wed Feb 16, 2005 9:52 am
by IceSoft
Here is still a BUG (also if I work with the XP Theme).
-> The first menu backgound box is not refreshing if i move to another menu item.
Here are also the code
Code: Select all
#SPI_GETFLATMENU = $1022
SystemParametersInfo_(#SPI_GETFLATMENU, 0, @myBool, 0)
MessageRequester("Info", Str(myBool))
InitSprite()
WindowID = OpenWindow(PB_ANY, 0, 0, 300, 200, #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered, "Bug in menu refresh routine")
If OpenWindowedScreen(WindowID, 0, 0, 300, 200,0,0,0) <> 0
If CreateMenu(0, WindowID )
MenuTitle("One")
MenuItem(PB_ANY, "111")
MenuTitle("Two")
MenuItem(PB_ANY, "222")
MenuTitle("Three")
MenuItem(PB_ANY, "333")
MenuTitle("Four")
MenuItem(PB_ANY, "444")
MenuTitle("Settings")
OpenSubMenu("SubMenu1")
MenuItem( PB_ANY, "Sub_Menu1")
CloseSubMenu()
MenuTitle("Help")
MenuItem(PB_ANY, "About...")
EndIf
EndIf
Repeat
FlipBuffers()
ClearScreen(0,0,0)
event = WaitWindowEvent()
Delay(10)
Until event = #PB_EventCloseWindow
Open a menu and then move to a second one.
The first menu background is not refreshing.
Posted: Mon Feb 21, 2005 4:03 pm
by Sparkie
@IceSoft - Do the menus in Notepad and Calculator work ok for you?
Posted: Tue Feb 22, 2005 7:13 am
by IceSoft
Notepad works fine.
Calculator works also fine.
Posted: Tue Feb 22, 2005 11:06 am
by Fred
The problem is you display a menu over a directX surface (which won't get refreshed while the menu is running) so you get some glitchs.
Posted: Tue Feb 22, 2005 11:10 am
by IceSoft
Right.
But I get only a problem with the first open menu item (which is not correct refreshed).
Maybe a synchronism problem with FlipBuffers()?