[Done] [5.70] ScrollAreaGadget

Found an issue in the documentation ? Please report it here !

Moderator: Documentation Editors

WilliamL
Addict
Addict
Posts: 1142
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

[Done] [5.70] ScrollAreaGadget

Post by WilliamL »

The text size needs to be defined for the text "This is the content of a ScrollAreaGadget!" to fit into the TextGadget.. or the gadget needs to be wider.

BindGadgetEvent - doesn't do anything. I don't get an event in the loop or an update in BindScrollDatas() on my Mac.
MacBook Pro-r, OSX 10.14.6 , PB 5.73LTS
User avatar
Demivec
Addict
Addict
Posts: 3847
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: [5.70] ScrollAreaGadget

Post by Demivec »

You mentioned a ScrollAreaGadget, a TextGadget and BindGadgetEvent and BindScrollDatas().

What is the bug?

Do you have a runnable sample code demonstrating the bug?
WilliamL
Addict
Addict
Posts: 1142
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: [5.70] ScrollAreaGadget

Post by WilliamL »

Sorry about the confusion. I am referring to the code in the 'Help' documentation under 'ScrollAreaGadget()'.

When I run this code I don't get an event (in the event loop) for the ScrollAreaGadget (Case 0) when I move the scroll bars and the info in 'BindScrollDatas()' never gets updated.

Maybe I don't understand how the code works...

Code: Select all

Procedure BindScrollDatas()
    SetWindowTitle(0, "ScrollAreaGadget " +
                      "(" +
                      GetGadgetAttribute(0, #PB_ScrollArea_X) +
                      "," +                      
                      GetGadgetAttribute(0, #PB_ScrollArea_Y) +
                      ")" )
  EndProcedure
  
  If OpenWindow(0, 0, 0, 405, 240, "ScrollAreaGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    ScrollAreaGadget(0, 10, 10, 390,220, 575, 555, 30)
      ButtonGadget  (1, 10, 10, 230, 30,"Button 1")
      ButtonGadget  (2, 50, 50, 230, 30,"Button 2")
      ButtonGadget  (3, 90, 90, 230, 30,"Button 3")
      TextGadget    (4,130,130, 230, 20,"This is the content of a ScrollAreaGadget!",#PB_Text_Right)
      CloseGadgetList()
  
    BindGadgetEvent(0, @ BindScrollDatas())
  
    Repeat
      Select WaitWindowEvent()
        Case  #PB_Event_CloseWindow
          End
        Case  #PB_Event_Gadget
          Select EventGadget()
            Case 0
              MessageRequester("Info","A Scroll has been used ! (" +
                                      GetGadgetAttribute(0, #PB_ScrollArea_X) +
                                      "," +                      
                                      GetGadgetAttribute(0, #PB_ScrollArea_Y) +
                                      ")" ,#PB_MessageRequester_Ok)
            Case 1
              MessageRequester("Info","Button 1 was pressed!",#PB_MessageRequester_Ok)
            Case 2
              MessageRequester("Info","Button 2 was pressed!",#PB_MessageRequester_Ok)
            Case 3
              MessageRequester("Info","Button 3 was pressed!",#PB_MessageRequester_Ok)
          EndSelect
      EndSelect
    ForEver
  EndIf
MacBook Pro-r, OSX 10.14.6 , PB 5.73LTS
User avatar
Caronte3D
Enthusiast
Enthusiast
Posts: 221
Joined: Fri Jan 22, 2016 5:33 pm
Location: Spain

Re: [5.70] ScrollAreaGadget

Post by Caronte3D »

The code works as expected (message popup if you move scroll bars)
User avatar
mk-soft
Addict
Addict
Posts: 3191
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: [5.70] ScrollAreaGadget

Post by mk-soft »

The example is actually wrong. It works on Windows and macOS, but not on Linux.
The only correct EventType is #PB_EventType_Resize. In the example no EventType is evaluated, but under Windows and macOS the EventType #PB_EventType_LeftClick (No. 0).

So in my opinion the example is wrong, even if it partly works.
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace
WilliamL
Addict
Addict
Posts: 1142
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: [5.70] ScrollAreaGadget

Post by WilliamL »

No message pops up here.

Like I said in my first post...
MacBook Pro-r, OSX 10.14.6 , PB 5.73LTS
User avatar
mk-soft
Addict
Addict
Posts: 3191
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: [5.70] ScrollAreaGadget

Post by mk-soft »

PB v5.72 (x64)
Scroll popup message on Window 7 and macOS Catalina at release mouse button
Linux Ubuntu 18.04 LTS alway popup messages on mouse move
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace
WilliamL
Addict
Addict
Posts: 1142
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

[Done] Re: [5.70] ScrollAreaGadget

Post by WilliamL »

mk-soft you are absolutely right :!:

It does work in 5.72.

I have been using 5.70 and it doesn't work there.

I guess my report is incorrect since it works in the most recent version.

My posting was unnecessary.
MacBook Pro-r, OSX 10.14.6 , PB 5.73LTS
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 1877
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: [5.70] ScrollAreaGadget

Post by Andre »

WilliamL wrote:My posting was unnecessary.
So I will mark this posting as [Done] :D

If you still see room for improvement, feel free to add suggestions to this topic.
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
Post Reply