How to customize browse list popup menu

SELF.Popup.AddItemMimic(‘Til Excel’,?TilExcelButton)
SELF.Popup.AddItemMimic(‘Fra Excel’,?FraExcelButton)

SELF.Popup.SetIcon(‘Ny’, ‘WKInsert16.ico’)
SELF.Popup.SetIcon(‘Endre’,‘WKChange16.ico’)
SELF.Popup.SetIcon(‘Slett’,‘WKDelete16.ico’)

SELF.Popup.SetIcon(‘Fra Excel’,‘WKExcel_Import16.ico’)
SELF.Popup.SetIcon(‘Til Excel’,‘WKExcel_Export16.ico’)

Gives this:
image

Carl mentioned adding the tilde to link in the icon - does that make any difference?

so instead of

SELF.Popup.SetIcon(‘Ny’, ‘WKInsert16.ico’)
SELF.Popup.SetIcon(‘Endre’,‘WKChange16.ico’)
SELF.Popup.SetIcon(‘Slett’,‘WKDelete16.ico’)

SELF.Popup.SetIcon(‘Fra Excel’,‘WKExcel_Import16.ico’)
SELF.Popup.SetIcon(‘Til Excel’,‘WKExcel_Export16.ico’)

you would have

SELF.Popup.SetIcon(‘Ny’, ‘~WKInsert16.ico’)
SELF.Popup.SetIcon(‘Endre’,‘~WKChange16.ico’)
SELF.Popup.SetIcon(‘Slett’,‘~WKDelete16.ico’)

SELF.Popup.SetIcon(‘Fra Excel’,‘~WKExcel_Import16.ico’)
SELF.Popup.SetIcon(‘Til Excel’,‘~WKExcel_Export16.ico’)

BTW please be clear, when you say:

Gives this:
image

are you saying that is good or are you saying you are not happy with that (eg. bottom two icons are too big?)

It does not help. The WKExcel_Import16.ico is already linked into the prosject.

SELF.Popup.AddItemMimic('Til &Excel',?TilExcelButton)
SELF.Popup.AddItemMimic('&Fra Excel',?FraExcelButton) 

SELF.Popup.SetIcon('Ny',   'WKInsert16.ico')
SELF.Popup.SetIcon('Endre','WKChange16.ico')
SELF.Popup.SetIcon('Slett','WKDelete16.ico') 

SELF.Popup.SetIcon('Fra Excel','~WKExcel_Import16.ico')
SELF.Popup.SetIcon('Til Excel','~WKExcel_Export16.ico')

image

I don’t use ABC Popup much, but I do often open the AB CLWs to see how they work when I am puzzled…

Maybe the problem is the Name of the Item created by AddItemMimic(Text,ID) e.g. 'Til &Excel',
is not what you have in SetIcon(Name,Icon) e.g. 'Fra Excel',
I.e. the Class did not remove the &Amp, or removed the Space, or did ???

The Prototype in ABPopup.INC/CLW allows you to specify the Name and Menu Text separately in the Omittable 3 parameter <STRING Txt>.

PopupClass.AddItemMimic PROCEDURE(STRING Name, SIGNED ButtonID, <STRING Txt>)

Suggest you use all 3 parms and give it a Unique Name and Menu Txt like this:

SELF.Popup.AddItemMimic('MyTilExcel', ?TilExcelButton,   'Til &Excel')
SELF.Popup.AddItemMimic('MyFraExcel', ?FraExcelButton,   '&Fra Excel') 

SELF.Popup.SetIcon('MyTilExcel','~WKExcel_Import16.ico')
SELF.Popup.SetIcon('MyFraExcel','~WKExcel_Export16.ico')

A way to be sure is to modify ABPopup.CLW to see what it is doing … then restore the original.

I think the conversion of Menu Text to Name is done in GetUniqueName() which sadly is private (in a tricky way). There is no reason it could not be public.

Maybe someone knows a way to get the Name generated by the last Add to the Popup? The Queue is private.

1 Like

Thank you Carl. This did the trick :smiley:

And a thanks you to everyone who tried to help.

Since this demo uses that queue, perhaps you could change &QUEUE to &PopupQueue (whatever the type name is) in this demo? PrivateClass/PrivatePropertyTest.clw at master · jslarve/PrivateClass · GitHub