PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Right, if I now understand correctly, you wish to be notified when the user clicks to change the checkmark (from true to false for example) but does not select the cell?
Am I correct?
I may look like a mule, but I'm not a complete ass.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Case #egrid_CellUpdated
result = #True
If CountSelected() <> Count
Count = CountSelected()
SetWindowTitle(0, "Lib2PBImport - " + LibName + " [" + Str(CountSelected()) + " of " + Str(egrid_NumberOfRows(#egrid)) + " Functions selected]")
EndIf
doesn't work
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
All I can say is that I'm sitting here with a quickly bashed up example which works fine!
I can't comment upon the contents of your #egrid_CellUpdated handler, but you can at least test out if the message is firing by placing a messagerequester immediately after the case #egrid_CellUpdated command etc.
I'll pm you.
I may look like a mule, but I'm not a complete ass.
Procedure CountSelected()
Protected i.l, count.l
For i = 0 To egrid_NumberOfRows(#egrid) -1
If egrid_GetCellText(#egrid, 0, i) = "TRUE"
count + 1
EndIf
Next
ProcedureReturn count
EndProcedure
count is a static variable
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
@ts-soft: here's the problem. When the #egrid_CellUpdated message fires, the cell that has just been clicked has NOT had it's contents physically changed. This gives the developer the chance to refuse the alteration etc.
So, what you'll need to do is, for the cell which has just been clicked, rather than use egrid_GetCellText() (which will contain the old value) simply examine the value of *cellinfo\text instead; this contains the new contents if you allow the alteration to proceed.
The sequence is as follows: (imagine cell (0, 0) is a checkbox which currently holds the value "FALSE")
User clicks the checkmark in cell (0, 0)
The #egrid_CellUpdated message fires. Cell (0, 0) still contains the value "FALSE", but *cellinfo\text contains "TRUE"
You call your CountSelected() procedure.
Return control to egrid which only now changes cell (0, 0) to "TRUE" (unless you've refused the change).
Hope this helps.
I may look like a mule, but I'm not a complete ass.
If message = #WM_NOTIFY
*ptr.NMHDR = lParam
If *ptr\HwndFrom = GadgetID(#List_1)
Select *ptr\code
Case #LVN_ITEMCHANGED
MyChangeEvent(#True)
fires on a checkmark change, dunno if it helps you or not.
This message will not work as it is with an egrid because the underlying cell of the listicon is not always kept up to date with what is going on in the edit controls / comboboxes etc. (in fact there are no actual checkbox controls as egrid simulates these).
This was done to combat flickering etc.
This is all dealt with by egrid.
I may look like a mule, but I'm not a complete ass.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
The next problem, if the checkbox is selected, i become no changes
I'm tested all, but nothing fires this event.
I hope, you can give me a tip
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.