I need some help here,
Im developing and app Win/Linux. Win version is almost done, 99% Pure PB
commands, but I have a small( or big) problem.
Someone could post a small example of how to scroll a ListIcon Gadget
in Linux?
Suppose my ListIcon can show 10 records at a time, Im searching for a record
that is placed in the row 15, how I make it scroll to row 15 and show it in
the ListIcon visible screen?
Thanks for your help...
Scrolling ListIcon in Linux
use
where n is the desired entry....
Is this what you need? or do I missunderstand the question... :roll:
Code: Select all
SetGadgetState(#ListIcon,n)
Is this what you need? or do I missunderstand the question... :roll:
I had some problems with my PC.... but Im back again...
I have a ListIcon which can show 10 records at a time... suppose that I have 20 records.
A user enter in a StringGadget some text and press a ButtonGadget to
start the search.... it happens the search is a success and the record is the
15 row .
The program find the record and select it, but it is out of screen at the
bottom. How can I program this part to scroll down find the row 15 and
show it in the screen.
No, is not... Im bad to explain what I want...walker wrote:usewhere n is the desired entry....Code: Select all
SetGadgetState(#ListIcon,n)
Is this what you need? or do I missunderstand the question... :roll:
I have a ListIcon which can show 10 records at a time... suppose that I have 20 records.
A user enter in a StringGadget some text and press a ButtonGadget to
start the search.... it happens the search is a success and the record is the
15 row .
The program find the record and select it, but it is out of screen at the
bottom. How can I program this part to scroll down find the row 15 and
show it in the screen.
Try the following
type a number not visible on the screen (i.e. 99) in the stringfiled and the appropriate entry is shown... 
Code: Select all
OpenWindow(0,10,10,150,250,"searchtest",#PB_Window_ScreenCentered)
If CreateGadgetList(WindowID(0))
StringGadget(0,10,10,100,25,"")
ListIconGadget(1,10,40,120,200,"MyData",99)
AddGadgetItem(1,-1,"")
For m= 0 To 200
AddGadgetItem(1,-1,Str(m)+"_dataentry")
Next
EndIf
SetActiveGadget(0)
Repeat
event= WaitWindowEvent(1)
If event=#PB_Event_Gadget
Select EventGadget()
Case 0
search.s=GetGadgetText(0)
l=Len(search.s)
If search.s<>""
For n= 0 To CountGadgetItems(1)-1
If Left(LCase(GetGadgetItemText(1,n)),l) = LCase(search.s)
SetGadgetItemState(1,n,#PB_ListIcon_Selected)
SetGadgetState(1,n)
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
SendMessage_(GadgetID(1), #LVM_ENSUREVISIBLE, n, 0)
CompilerElse
; on Linux no else is needed
; on MacOs... don't know
CompilerEndIf
Break; if found
EndIf
Next
Else
SetGadgetState(1,0)
EndIf
Default
;nothing to do
EndSelect
EndIf
Until event=#PB_Event_CloseWindow

