ListIcon not want to return in back [Resolved]

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

ListIcon not want to return in back [Resolved]

Post by Kwai chang caine »

Hello at all :D

I search since several hours to remote a horizontal scroll of a ListIcon without succes :|

My ListIcon want advance...but she never "will be back", even if my Scrollbar return in back :shock:

Image

Code: Select all

Enumeration
 #container
 #listicon
 #ScrollBar
EndEnumeration

Procedure WinCallback(hwnd, msg, wparam, lparam)

 Select msg
   
  Case #WM_HSCROLL
   
   Debug GetGadgetState(#ScrollBar)
   SendMessage_(GadgetID(#listicon), #LVM_SCROLL, GetGadgetState(#ScrollBar),0 )
      
 EndSelect
 
 ProcedureReturn #PB_ProcessPureBasicEvents 
EndProcedure

OpenWindow(0, 0, 0, 300, 500, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
ContainerGadget(#container,5,5,290,390,#PB_Container_Flat)
ListIconGadget(#listicon, 0, 0, 290, 410, "", 100, #PB_ListIcon_FullRowSelect | #PB_ListIcon_GridLines)
CloseGadgetList()
SetWindowCallback(@WinCallback())

ScrollBarGadget(#ScrollBar, 20, 420, 260, 20, 0, 290, 2)

For i = 1 To 50
 AddGadgetColumn(#listicon, i, Str(i), 100)
Next i

For i = 1 To 50
 AddGadgetItem(#listicon, -1, Str(Random(1000, 0)))
Next i

Repeat
 Delay(1)
Until  WaitWindowEvent() = #PB_Event_CloseWindow
If someone know why, my ListIcon don't like TERMINATOR :cry:

Have a good day
Last edited by Kwai chang caine on Mon Oct 23, 2017 6:24 pm, edited 1 time in total.
ImageThe happiness is a road...
Not a destination
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4637
Joined: Sun Apr 12, 2009 6:27 am

Re: ListIcon not want to return in back

Post by RASHAD »

Hi KCC

Code: Select all

Global oldpos

Procedure WinCallback(hwnd, msg, wparam, lparam)

 Select msg   
  Case #WM_HSCROLL 
   SendMessage_(GadgetID(#listicon), #LVM_SCROLL, GetGadgetState(#ScrollBar) - oldpos,0 )
   oldpos = GetGadgetState(#ScrollBar)
     
 EndSelect
 
 ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure

Egypt my love
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: ListIcon not want to return in back

Post by Kwai chang caine »

Hello RASHAD.... :D
It's always so simple, after i see your solution :shock:

When KCC grow up, he would like to be RASHAD :D

Thanks a lot great MASTER 8)
ImageThe happiness is a road...
Not a destination
Post Reply