PDA

View Full Version : PopupControl bugs



Pieter van Dieren
5-Aug-2009, 06:16 AM
Error in cSigCjPopupControl:



Function pvItemHandle Variant vItemHandle Returns Integer
Variant[] vItemHandles
Integer iCount iRetval
Get pvItemHandles to vItemHandles
For iCount from 0 to (SizeOfArray(vItemHandles)-1)
If (IsSameComObject(vItemHandle, vItemHandles[iCount])) Begin
Move iCount to iRetval
End
Loop
Function_Return (iRetval+1)
End_Function


Should be:



Function pvItemHandle Variant vItemHandle Returns Integer
Variant[] vItemHandles
Integer iCount iRetval
Get pvItemHandles to vItemHandles
For iCount from 0 to (SizeOfArray(vItemHandles)-1)
If (IsSameComObject(vItemHandle, vItemHandles[iCount])) Begin
Move iCount to iRetval
End
Loop
Function_Return iRetval
End_Function


Also:
ComRemoveAllItems should be augmented to empty the pvItemHandles array:



{ MethodType=Method }
Procedure ComRemoveAllItems
Forward Send ComRemoveAllItems
Set pvItemHandles to (ResizeArray(pvItemHandles(Self),0))
End_Procedure



I attached the modified package with 2 other suggestions:
- A property piCloseItem.
If you have an item in the popup with which you want to close the popup (e.g. a small x in the top right corner), give this property the number of that particular item.

- A method Add_Image_Button_Item to add an image which mimics a button.

Ian Smith
15-Aug-2009, 06:19 AM
Hi Pieter

I agree that all of your changes should be added to the class. But (there’s always a but) some of them will create compatibility issues for other users.

The class is due a rewrite. I have lodge your version of the class in our “work in progress” area and we will make sure that you enhancement are included during the rewrite.