muXed
New Member
Posts: 15
|
Post by muXed on Sept 13, 2019 12:18:26 GMT -5
Afternoon all.
After a few really good examples of the listview I seem to have cracked it and managed to design a program based all around it for a client.
However I read on microsoft that listviews can contain icons. Is this something that can be achieved with liberty?
Thanks in advance
|
|
|
Post by Carl Gundel on Sept 13, 2019 21:46:45 GMT -5
Afternoon all. After a few really good examples of the listview I seem to have cracked it and managed to design a program based all around it for a client. However I read on microsoft that listviews can contain icons. Is this something that can be achieved with liberty? Thanks in advance This is a feature that I hope to include in Liberty BASIC 5.
|
|
|
Post by Brandon Parker on Sept 14, 2019 21:35:54 GMT -5
I cannot really think of a reason why one would not be able to do this using the Window's ListView control.
{:0)
Brandon Parker
|
|
|
Post by Carl Gundel on Sept 15, 2019 13:45:30 GMT -5
I cannot really think of a reason why one would not be able to do this using the Window's ListView control. {:0) Brandon Parker You mean with API calls? I do not plan to add any new features to the v4.x line of Liberty BASIC.
|
|
|
Post by Rod on Sept 15, 2019 14:59:33 GMT -5
Yep in 4.x listview is API. I have a recollection that images can be included in the API build of the control. But we are well outside 4.x native capability.
Many folks will need to get used to living without API in 5.x
|
|
|
Post by Brandon Parker on Sept 15, 2019 17:08:41 GMT -5
|
|
|
Post by Brandon Parker on Sept 15, 2019 17:10:59 GMT -5
Many folks will need to get used to living without API in 5.x Unfortunately, there's quite a long ways to go before some people could port their working programs over to V5 since a lot of the advanced features are developed by using the Windows API. Don't get me wrong, I am looking forward to the day that can happen, but I also see that it might still be a long way away. {:0) Brandon Parker
|
|
|
Post by Brandon Parker on Sept 15, 2019 19:25:17 GMT -5
Here are a couple of functions that will help you along. It will definitely help out if you search around for the ListView examples that I have thrown out there since the programming style will obviously be the same.
Function createImageList(sizeX, sizeY, flags, numImages, canGrowBy) CallDLL #comctl32, "ImageList_Create", sizeX As long, _ sizeY As long, _ flags As ulong, _ numImages As long, _ canGrowBy As long, _ createImageList As ulong End Function
Function addImageToImageList(hImageList, hBitmap, hBitmapMask) CallDLL #comctl32, "ImageList_Add", hImageList As ulong, _ hBitmap As ulong, _ hBitmapMask As ulong, _ addImageToImageList As long End Function
You will need to send the LVM_SETIMAGELIST message to the ListView, along with the appropriate information, after you create the control.
Here is another tip. You will most likely want to use the LVSIL_SMALL constant. The value of LVSIL_SMALL is 1; it is not a constant that is included within Liberty BASIC so you will have to either use a hard coded one or make a variable for it.
I hope that will help you get started with what you hope to accomplish.
{:0)
Brandon Parker
|
|
muXed
New Member
Posts: 15
|
Post by muXed on Oct 1, 2019 13:38:30 GMT -5
Many thanks all for the help.
Will give it a crack
|
|