Page 1 of 1
Posted: Fri Jun 07, 2002 6:37 pm
by BackupUser
Restored from previous forum. Originally posted by Justin.
Is there any way to have a multiple selection listview?
Posted: Sat Jun 08, 2002 6:51 am
by BackupUser
Restored from previous forum. Originally posted by tranquil.
as far as I know planned for release 3.20
Tranquilizer/ Secretly!
Registred PureBasic User
Posted: Sat Jun 08, 2002 1:08 pm
by BackupUser
Restored from previous forum. Originally posted by Justin.
Any workarounds until we wait for the next release?
i tried changing the style with api calls but it does not work:
hlist=ListViewGadget(1, 10, 10, 100, 100)
oldstyle=getwindowlong_(hlist,#GWL_STYLE)
SetWindowlong_(hlist,#GWL_STYLE,oldstyle Or #LBS_MULTIPLESEL)
Posted: Sat Jun 08, 2002 2:04 pm
by BackupUser
Restored from previous forum. Originally posted by Danilo.
You need a SendMessage_() to the ListView.
Look for LB**** constants in the MS Platform SDK.
(registered PureBasic user)
Posted: Sat Jun 08, 2002 3:25 pm
by BackupUser
Restored from previous forum. Originally posted by Justin.
wich message do i have to send?
with the code i posted the listbox does not appear in the parent window, there are a lot of listbox messages:
http://msdn.microsoft.com/library/en-us ... e#messages
but if the listbox is not there..., has this been done before?
Posted: Sun Jun 09, 2002 1:33 am
by BackupUser
Restored from previous forum. Originally posted by Danilo.
Sorry, Justin - my fault.
Your error: "oldstyle Or #LBS_MULTIPLESEL"
"OR" is logical "OR" and gives back 0 or 1.
What you need here is a bitwise "OR", so
you have to use "|" for "OR".
AND, OR,.. = LOGICAL (return 0 or 1)
|, &,... = BITWISE
Complete example:
Code: Select all
OpenWindow(0,10,10,400,400,#PB_Window_SystemMenu,"ListBox")
CreateGadgetList(WindowID())
hlist=ListViewGadget(1, 10, 10, 380, 380)
oldstyle=getwindowlong_(hlist,#GWL_STYLE)
SetWindowlong_(hlist,#GWL_STYLE,oldstyle | #LBS_EXTENDEDSEL );| #LBS_MULTIPLESEL)
For a = 1 To 100
AddGadgetItem(1,-1,"TEST "+Str(a))
Next a
Repeat
Until WaitWindowEvent() = #PB_EventCloseWindow
Start this little code and select the items.
Hold down SHIFT or CTRL (STRG) for selecting.
cya,
...Danilo
(registered PureBasic user)
Posted: Sun Jun 09, 2002 8:07 pm
by BackupUser
Restored from previous forum. Originally posted by Justin.
It does not work for me, the listbox appears but i can't make a multiple selection with ctrl or shift. In fact i can't change any listbox style, like LBS_NOSEL etc..
It seems i will have to wait until the new release, thanks in any case.
Posted: Sun Jun 09, 2002 8:27 pm
by BackupUser
Restored from previous forum. Originally posted by PB.
> It does not work for me
Confirmed: doesn't work for me either (W2K).
PB - Registered PureBasic Coder