Refresh menu

Just starting out? Need help? Post your questions and find answers here.
aXend
Enthusiast
Enthusiast
Posts: 103
Joined: Tue Oct 07, 2003 1:21 pm
Location: Netherlands

Refresh menu

Post 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?
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post 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.
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
aXend
Enthusiast
Enthusiast
Posts: 103
Joined: Tue Oct 07, 2003 1:21 pm
Location: Netherlands

Post 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. :)
User avatar
IceSoft
Addict
Addict
Posts: 1682
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Post 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:
User avatar
IceSoft
Addict
Addict
Posts: 1682
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Post 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.
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

@IceSoft - Do the menus in Notepad and Calculator work ok for you?
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
IceSoft
Addict
Addict
Posts: 1682
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Post by IceSoft »

Notepad works fine.
Calculator works also fine.
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post 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.
User avatar
IceSoft
Addict
Addict
Posts: 1682
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Post 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()?
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
Post Reply