ListIconGadget and SpinGadget interraction

Post bugreports for the Windows version here
paulr
User
User
Posts: 70
Joined: Sat Sep 27, 2003 2:53 pm

ListIconGadget and SpinGadget interraction

Post by paulr »

I believe I've isolated a bug that causes touchpad double taps go undetected. It manifests in the following code, adapted from the GadgetAdvanced.pb example.

PB version: 6.12 LTS
Windows 10

Expected behaviour:
Clicking on a list item causes a corresponding message to display in the SpinGadget.
Double-clicking on a list item causes a message requester box to pop up.

Observed behaviour:
Program works as expected when using a mouse, but when using the touchpad on my ThinkPad (specifically the touchpad, not the buttons), the message requester does not pop up, although this action in any other app emulates a double click.

Observations:
If you swap the SpinGadget for a TextGadget, everything works as expected.
My attempts at debugging show that updating the SpinGadget after the first tap interrupts the double tap, causing it to be interpreted as two single taps.
Windows virtual touchpad can be used to demonstrate the same behaviour. Double tapping on the virtual touchpad's surface recreates the problem. Double tapping on the virtual touchpad's virtual buttons actually works fine.

Code: Select all

#WindowWidth  = 450
#WindowHeight = 305

LoadImage(3, #PB_Compiler_Home + "examples/sources/Data/Drive.bmp")

If OpenWindow(0, 100, 200, #WindowWidth, #WindowHeight, "PureBasic - Advanced Gadget Demonstration", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget)

  ListIconGadget(5, 170, 50, 265, 200, "Column 1", 131)
  AddGadgetColumn(5, 1, "Column 2", 300)
  AddGadgetColumn(5, 2, "Column 3", 80)
  
  ;TextGadget(4, 10, 16, 180, 24, "")
  SpinGadget(4, 10, 16, 280, 24, 1, 10)
      
  ; Fill Up the ListIcon gadget. Notice than the column are separated by Chr(10) (NewLine) character
  ;
  For k=0 To 100
    AddGadgetItem(5, -1, "Element "+Str(k)+Chr(10)+"C 2"+Chr(10)+"Comment 3", ImageID(3))
  Next
  
  SetGadgetState(5, 8)
  
  Repeat
    Event = WaitWindowEvent()

    If Event = #PB_Event_Gadget
      
      Select EventGadget()
        Case 5
          SetGadgetText(4, "ListIcon Gadget. Item selected: "+Str(GetGadgetState(5)))
          
          If EventType() = 2
            MessageRequester("Information", "Doubleclick: item"+Str(GetGadgetState(5))+", Text: "+GetGadgetText(5), 0)
          EndIf
          
     EndSelect

    EndIf
    
  Until Event = #PB_Event_CloseWindow
EndIf

End
Fred
Administrator
Administrator
Posts: 18153
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [Done] ListIconGadget and SpinGadget interraction

Post by Fred »

Should be fixed, can you confirm ?
User avatar
Blue
Addict
Addict
Posts: 964
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Re: ListIconGadget and SpinGadget interraction

Post by Blue »

Fix confirmed.
Everything works as expected with PB 6.21 X64, using the trackpad on an Asus machine.
PB Forums : Proof positive that 2 heads (or more...) are better than one :idea:
Post Reply