ListIcon - Adding/deleting items and redrawing.
Posted: Mon Jun 10, 2013 10:19 pm
I have a listicon that gets some log info; but I discard anything over 8 hours old. Along with the deletes, I add new items to the end.
So the pseudo code is:
while GetGadgetItem(#lstLog,0,0) < Current-Cut-Off-Date
RemoveGadgetItem(#lstLog,0)
wend
AddGadgetItem(#lstLog,-1,"New item")
My problem is that the list icon flashes during both adds and deletes.
Currently the log shows the "last item" (auto-scrolling to end) - but when deleting items, the gadget flashes. Especially the grid appears and disappears.
Similarly, if the list isn't in "auto scroll" mode ("looking at the middle" the gadgets items appear to scroll while deleting items from the top -- I would like the user to be able to remain looking at what they are, even when items are being deleted (that are not in view).
So:
1) Is there a way to keep a currently selected gadget item "in view" so it doesn't scroll due to deleting items from the head of the list?
2) Is there a way to stop the gadget from being redrawn? I had hte code below, but it doesn't seem to be helping me any...
So the pseudo code is:
while GetGadgetItem(#lstLog,0,0) < Current-Cut-Off-Date
RemoveGadgetItem(#lstLog,0)
wend
AddGadgetItem(#lstLog,-1,"New item")
My problem is that the list icon flashes during both adds and deletes.
Currently the log shows the "last item" (auto-scrolling to end) - but when deleting items, the gadget flashes. Especially the grid appears and disappears.
Similarly, if the list isn't in "auto scroll" mode ("looking at the middle" the gadgets items appear to scroll while deleting items from the top -- I would like the user to be able to remain looking at what they are, even when items are being deleted (that are not in view).
So:
1) Is there a way to keep a currently selected gadget item "in view" so it doesn't scroll due to deleting items from the head of the list?
2) Is there a way to stop the gadget from being redrawn? I had hte code below, but it doesn't seem to be helping me any...
Code: Select all
Procedure DisableGadgetRedraw(nGadget, bDisabled.b)
If IsGadget(nGadget)
If bDisabled
SendMessage_(GadgetID(nGadget),#WM_SETREDRAW,#False,0)
Else
SendMessage_(GadgetID(nGadget),#WM_SETREDRAW,#True,0)
RedrawWindow_(GadgetID(nGadget),#Null,#Null,#RDW_INVALIDATE)
EndIf
EndIf
EndProcedure