ListIconGadget
ListIconGadget
Hello,
I don't understand the use of the ListIconGadget gadget!
I am creating a ListIconGadget with 3 columns.
I would like, by clicking, for example, on the second column of an element (without having to click on the first, to be able to change its value, a bit like in an Excel table).
This is not possible, except, apparently, to have to scan and test all the lines.
I honestly don't see the use of this gadget!
I don't understand the use of the ListIconGadget gadget!
I am creating a ListIconGadget with 3 columns.
I would like, by clicking, for example, on the second column of an element (without having to click on the first, to be able to change its value, a bit like in an Excel table).
This is not possible, except, apparently, to have to scan and test all the lines.
I honestly don't see the use of this gadget!
Re: ListIconGadget
Then simply don't use it
But honestly: without a code example I don't help you, because (as already wrtitten multiple times) it costs to many time of many people
to code an example.
If you provide one, everybody can extend it and have not to write it from scratch.
If you write an example it costs you 15 minutes.
If 10 people wants to help you it costs 10 x 15 minutes. What a waste of time.
Re: ListIconGadget
It's to show columns and rows of data; kind of like you said for Excel. But unlike Excel, it's not an interactive spreadsheet gadget.
Maybe you want something like this? -> https://www.purebasic.fr/english/viewtopic.php?t=54022
I just tried it and you can click and edit cells, sort columns, have images in cells, etc. Screenshot:

Re: ListIconGadget
Hello infratec,
Indeed, an example is worth a thousand words.
In the following small example, I want to:
By clicking, for example on "white" of the third line, change "white" to "orange". If I now click again on "orange", I would like to change "orange" to "green".
If I click on "green", then I change to "white" and the cycle repeats itself each time I click.
I only want to click on the "white" and not on the first column (CCCCCCCCC in the example)
Indeed, an example is worth a thousand words.
In the following small example, I want to:
By clicking, for example on "white" of the third line, change "white" to "orange". If I now click again on "orange", I would like to change "orange" to "green".
If I click on "green", then I change to "white" and the cycle repeats itself each time I click.
I only want to click on the "white" and not on the first column (CCCCCCCCC in the example)
Code: Select all
EnableExplicit
Global fenetre.i
Global event.i
Global liste_icon.i
Global i.i
Global resultat.i=-1
fenetre = OpenWindow(#PB_Any, 0, 0, 800,600, "Test ListIconGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
liste_icon = ListIconGadget(#PB_Any, 10,10, 330, 550, "Titre série", 250)
AddGadgetColumn(liste_icon, 1, "Etat", 60)
For i = 0 To 25
AddGadgetItem(liste_icon, -1, RSet(Chr(i + 65), 8, Chr(i + 65)) + Chr(10) + "white")
Next i
Repeat
event = WaitWindowEvent()
Select event
Case #PB_Event_Gadget
Select EventGadget()
Case liste_icon
Select EventType()
Case #PB_EventType_LeftClick
resultat = GetGadgetState(liste_icon)
; ??????????????????????????????
EndSelect
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindowRe: ListIconGadget
Hello BarryG,
Indeed this is what I am looking for but with only 2 columns.
Thanks
Indeed this is what I am looking for but with only 2 columns.
Thanks
Re: ListIconGadget
Just a sidenote: speaking for Windows, the ListIconGadget (or ListView as it's called natively by Windows) was never intended to work like Excel, though it already provides all needed messages and notifications to react on clicking on a specific cell. It was meant as an addition and enhancement of the ListBox (ListViewGadget in terms of PureBasic). The ListBox is limited in matters of columns, count of items, and messages, plus it also does not provide a header, sorting, icons and so on and so on...
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Re: ListIconGadget
Hello everyone,
Thanks for all your messages.
After thinking about it, I found the solution for what I want to do by using a ScrollAreaGadget().
I can add as many gadgets as I want by aligning them and it works very well for what I want to do.
Thanks again for taking your time to help me.
Thanks for all your messages.
After thinking about it, I found the solution for what I want to do by using a ScrollAreaGadget().
I can add as many gadgets as I want by aligning them and it works very well for what I want to do.
Thanks again for taking your time to help me.
Re: ListIconGadget
Said hasn't been in touch for a long time and I've already edited a few things.
It is therefore better to use MyGrid_16Feb22.
GitHub: https://github.com/mk-soft-65/MyGrid/tr ... e-function
It is therefore better to use MyGrid_16Feb22.
GitHub: https://github.com/mk-soft-65/MyGrid/tr ... e-function
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: ListIconGadget
I would say that your requirement may be better met by Rashad's grid. The code for this grid is short and easily maintainable and can look and operate closer to Visual Basic's Data Grid, which you might have been referring to, Jak64 :jak64 wrote: Sat Mar 08, 2025 11:11 am I am creating a ListIconGadget with 3 columns. I would like, by clicking, for example, on the second column of an element (without having to click on the first, to be able to change its value, a bit like in an Excel table).
https://www.purebasic.fr/english/viewto ... 50#p630250
The link mentioned by Barry looks impressive on the face of it but for me at least, it wasn't practical to consider using in a professional application — most of the time all we need is the ability to input and validate cells, as Visual Basic's Data Grid provides.



