PB 6.30 Beta 4 - ScreenGadget library - bug report

Post bugreports for the Windows version here
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 426
Joined: Thu Jul 09, 2015 9:07 am

PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by pf shadoko »

I fixed the reported bugs except for:

- keyboard repetition
STARGÅTE:
- ButtonScreenGadget events are triggered, even if the button is pressed but the mouse button is released somewhere else. Usual behavior (e.g. under windows) is that the event is not triggered. To trigger an event, the mouse button must be released over the gadget.
-The TrackBarScreenGadget can be changed by mouse wheel even if it is in the background of an other window, hiding the gadget. Same for scroll areas
-Text in the StringScreenGadget can't be selected, the selection always vanishes immediately
(only occurs when the gadget height is insufficient for the font)
My :
- The window does not come to the foreground when clicking on one of its gadgets.
- When using the scroll wheel on a list view that is not completely filled, the content scrolls.

@STARGÅTE:
Mouse wheel action is inverted on a TrackBarScreenGadget(). The value decreases, when the mouse wheel is rotated up
I don't understand, for me it works like the trackbar gadget.

There are still many features to add: tooltip, requester, set color... No need to make requests right now.

You would be very kind to find a little fewer bugs this time! :mrgreen:

Get to work!
Last edited by pf shadoko on Mon Oct 27, 2025 10:13 am, edited 1 time in total.
User avatar
STARGÅTE
Addict
Addict
Posts: 2263
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by STARGÅTE »

pf shadoko wrote: Fri Oct 24, 2025 9:52 am Mouse wheel action is inverted on a TrackBarScreenGadget(). The value decreases, when the mouse wheel is rotated up
I don't understand, for me it works like the trackbar gadget.
Thanks for the fixes.

Unfortunately, I never tried the original track bar gadget of PureBasic.
To my surprise, it's also there inverted :shock: .
If you create two TrackBarGadgets (one vertical, one horizontal),
the values are increased when you rotate the mouse wheel upwards on the vertical one (like I would expect),
but the values are decreasing when you rotate the mouse wheel upwards on the horizontal one (which makes absolutely no sens to me).
@Fred: Is this intentional? Because it is also inverted compare to the usual behavior on other programs on windows, e.g. like the mouse cursor speed setting or the sound volume.
I think this is a bug isn't it?

Code: Select all

If OpenWindow(0, 0, 0, 320, 320, "TrackBarGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
	TrackBarGadget(1, 50, 10, 250, 30, 0, 10, #PB_TrackBar_Ticks)
	TrackBarGadget(2, 10, 50, 30, 250, 0, 10, #PB_TrackBar_Ticks|#PB_TrackBar_Vertical)
	SetGadgetState(1, 5)
	SetGadgetState(2, 5)
	Repeat
		Select WaitWindowEvent()
			Case #PB_Event_CloseWindow
			Case #PB_Event_Gadget
				Debug GetGadgetState(EventGadget())
		EndSelect
	ForEver
EndIf
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
Fred
Administrator
Administrator
Posts: 18383
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by Fred »

I agree it's weird, but it seems to be the default behavior for Win32 trackbar as we don't have any callback for the mouse wheel stuff. I also tried in Notepad++ which use Win32 controls and it's the same (Settings -> Preferences -> Editing -> Blinking Rate)
User_Russian
Addict
Addict
Posts: 1601
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by User_Russian »

Beta 4 has not been released yet. :?
Or is this a message from the future? :D
drgolf
Enthusiast
Enthusiast
Posts: 119
Joined: Tue Mar 03, 2009 3:40 pm
Location: france

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by drgolf »

Hello Pf, me again :

Screenwindowanimation bug : the window n-ui appear with animation.
Click buttons close and show : no animation !

PB 6.30 b4 x64 CBE, windows 11 pro

I know, i know, i am the only one to have this bug...

Code: Select all

#HelloWindow = 0
#QuitButton = 0
;
#nwind=1
#showwindow=1
#closewindow=2
;
InitSprite()
InitKeyboard():InitMouse()

ExamineDesktops():dx=DesktopWidth(0)*0.8:dy=DesktopHeight(0)*0.8

OpenWindow(0, 0, 0, DesktopUnscaledX(dx),DesktopUnscaledY(dy), "[Escape] to quit", #PB_Window_BorderLess | #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, dx, dy, 0, 0, 0)

; Create the Screen UI
InitScreenGadgets()

TextScreenGadget(#PB_Any, 50, 0,500, 24, "The screen is a container, you can put gadgets without windows")
ButtonScreenGadget(#showwindow, 150, 260, 100, 32, "show")
ButtonScreenGadget(#closewindow, 270, 260, 100, 32, "close")

;
OpenScreenWindow(#HelloWindow, 100, 100, 300, 100, "Screen UI")
ScreenWindowAnimation(#HelloWindow, 0, 1000, 1, 0, -1, 0, -1)

TextScreenGadget(#PB_Any, 10, 25, 300, 24, "Hello World !")
ButtonScreenGadget(#QuitButton, 70, 60, 160, 32, "Quit")
;
OpenScreenWindow(#nwind, 100, 300, 300, 100, "N UI",0)
ScreenWindowAnimation(#nwind, 0, 1000, 1, 0, 1, 1, 1)
ScreenWindowAnimation(#nwind, 1, 1000, 1, 0, 1, 1, 1)
Repeat
  ; Top Window
  While WindowEvent() : Wend
  
  ClearScreen(RGB(0,0,0))
  
  ExamineMouse()
  ExamineKeyboard()
  
  ; Handle the screen UI events
  If ScreenWindowEvent() = #PB_Event_Gadget
    Select EventScreenGadget()
      Case #QuitButton
        End
      Case #showwindow
        HideScreenWindow(#nwind,0)
      Case #closewindow
        HideScreenWindow(#nwind,1)
        
    EndSelect
  EndIf
  
  RenderScreenGadgets()
  
  FlipBuffers()
Until KeyboardReleased(#PB_Key_Escape) Or MouseButton(3)

PeDe
Enthusiast
Enthusiast
Posts: 313
Joined: Sun Nov 26, 2017 3:13 pm

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by PeDe »

PB v6.30b4 x64, Raspberry Pi OS (Trixie, P500)

I can see the error too.
examples/3d/ScreenGadgetMultipleWindow.pb
1. Window 1: click button 'Show/Hide W2' -> Animation Window 2
2. Move Window 1; click button 'Show/Hide W2' -> No animation Window 2
3. Move Window 2; click button 'Show/Hide W2' -> Animation Window 2
4. goto 2.

Peter
Last edited by PeDe on Sat Oct 25, 2025 2:30 pm, edited 1 time in total.
User avatar
minimy
Enthusiast
Enthusiast
Posts: 728
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by minimy »

Hello, here some times is animated, other times is at cut with not animation.
If translation=Error: reply="Sorry, Im Spanish": Endif
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 426
Joined: Thu Jul 09, 2015 9:07 am

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by pf shadoko »

Gold medal to drgolf, the first to find the context of the bug (I couldn't reproduce it)
Silver medal to PeDe
Nothing for Minimy, who didn't find the context

Corrected
miso
Enthusiast
Enthusiast
Posts: 506
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by miso »

If I leftclick a button, mouse right click repeats, triggers last gadget anywhere on screen. (except, if I leftclick anywhere on screen before rightclicking, nongadget leftclick clears the triggered gadget) A bit confusing description, but I could not describe with better words.
User avatar
minimy
Enthusiast
Enthusiast
Posts: 728
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by minimy »

Ohhhh! :cry:

At least one consolation prize for participating. I don't know, a clip or a thumbtack. :lol:
If translation=Error: reply="Sorry, Im Spanish": Endif
miso
Enthusiast
Enthusiast
Posts: 506
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by miso »

Not, bug, but important. Rendering the mouse should be a separate command, not included in the renderscreengadgets().
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 426
Joined: Thu Jul 09, 2015 9:07 am

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by pf shadoko »

@minimy
nothing !

@miso
no, but i implemented "ScreenMouseVisible" to show or hide mouse pointer
miso
Enthusiast
Enthusiast
Posts: 506
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by miso »

@PfShadoko
Fair enough, thats the same ;)
If I can hide the pointer, I can render mine later.

(the reason is to have control of the layering, like user sprites --> gui sprites --> user sprites --> mouse cursor)
benubi
Enthusiast
Enthusiast
Posts: 236
Joined: Tue Mar 29, 2005 4:01 pm

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by benubi »

I hope those questions aren't reposts, but my curiosity grows over time.

Will there be an event-list implementation so as to write "classical" event loops or will it remain confined to 1 event per frame?

I am very delighted about the addition, but I'd also like to use menus and popup menus that would do great in homebrew 2D/3D editors. Do you plan on implementing this one day or are excluding it for the next few years/ever?

Merci tout le monde.
Post Reply