Hi all,
Is it possible to make your window's scroll bars a larger (or smaller) without adjusting the display settings. I am trying to write a program with a touch screen interface so could do with larger buttons to push!
Also, is it possible to initiate an event by pressing the column headers on a listicon gadget? I need to redraw the table from an SQLite query!
Thanks in advance,
Lee
Scroll bars and ListIcon's
I don't know about your first question, but the following reports which header item is clicked etc.
Code: Select all
;The HDN_ITEMCLICK notification message notifies a header control's parent window (i.e. the
;ListIcon in this case) that the user clicked the control. This notification message is
;sent in the form of a #WM_NOTIFY message.
Global oldListProc
Procedure.l listproc(hwnd, uMsg, wParam, lParam)
Protected result, *phdr.HD_NOTIFY
result=CallWindowProc_(oldListProc, hwnd, uMsg, wParam, lParam)
Select uMsg
Case #WM_NOTIFY
*phdr=lParam
If *phdr\hdr\code=#HDN_ITEMCLICK
Debug "Header item " + Str(*phdr\iItem) + " clicked."
EndIf
EndSelect
ProcedureReturn result
EndProcedure
If OpenWindow(0, 100, 100, 500, 500, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If CreateGadgetList(WindowID(0))
ListIconGadget(0, 5, 5, 400, 400, "Name", 100, #PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection)
AddGadgetColumn(0, 1, "Address", 250)
AddGadgetItem(0, -1, "Harry Rannit"+Chr(10)+"12 Parliament Way, Battle Street, By the Bay")
AddGadgetItem(0, -1, "Ginger Brokeit"+Chr(10)+"130 PureBasic Road, BigTown, CodeCity")
;Subclass the ListIcon.
oldListProc = SetWindowLong_(GadgetID(0), #GWL_WNDPROC, @listproc())
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf
EndIf
I may look like a mule, but I'm not a complete ass.
Thanks again srod, you seem to be answering all my questions recently! The code works a treat - thanks 
I spent ages searching the internet for sample code to adjust the size of a scroll bar. Couldn't find anything I could understand and adapt. I'll have to make a custom one or think of another way!! Never mind.
Lee

I spent ages searching the internet for sample code to adjust the size of a scroll bar. Couldn't find anything I could understand and adapt. I'll have to make a custom one or think of another way!! Never mind.
Lee
As for changing the ListIcon's scroll-bars, I wouldn't have thought it was possible as their dimensions are governed by certain system settings (e.g. #SM_CXVSCROLL etc.) Changing these values (if it is even possible) would affect every window with standard scroll-bars.
I may look like a mule, but I'm not a complete ass.
You can use a ScrollBarGadget() to make your own scrollbar. It's not perfect, but it's better than nothing.
Code: Select all
If OpenWindow(0, 0, 0, 300, 400, "ScrollBarGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
ScrollBarGadget (0, 240, 10, 50, 380 ,0, 300, 50, #PB_ScrollBar_Vertical)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf