Popup Class Details of how Checkmark Icon is determined

Might anyone know where/how in the PopupClass the icon file used for a check item is determined?
I’ve done a lot of text searching, but have not found where the actual default file is found.

The checkmark is part of the POPUP() rtl function. It’s designated with a plus sign. The popupclass doesn’t do anything special with an icon for that.

If you want to roll your own, with your own images, I think you could get there from here eventually. https://docs.microsoft.com/en-us/windows/win32/menurc/using-menus#simulating-check-boxes-in-a-menu

Interesting to hear. While I certainly could be mistaken, it seems somewhere along the line in my last few releases, the checkmark has changed - slightly smaller and with a background color now vs transparent before. Wondering if it is a win version change.

Manifest can have a lot to do with it too.

No manifest: image

Manifest: image

1 Like

Of course I’m asking how the hell did that happen. Thanks for helping to clear the fog (or perhaps revealing how thick it is).

You can specify your own ICON, these checks are from Clarion\Images. I link them so use Tilde ~FileName. Instead of PROP:Icon you can use its decimal value 31848

PRAGMA('link(CheckOn.ico)')  !same as PRAGMA('project(#pragma link(CheckOn.ico))') 
PRAGMA('link(CheckOff.ico)') !same as PRAGMA('project(#pragma link(CheckOff.ico))')

P=POPUP('['& PROP:ICON &'(~CheckOn.ico)] This is Checked' & |
              '|-|[31848(~CheckOff.ico)] This is NOT Checked' )

image

1 Like

No problem. You just need to correct the standard class. Unfortunately new users are not allowed to upload files here. So download from here - https://disk.yandex.ru/d/pgFKavAhxiughA.
The standard class has been extended to manage fonts and colors. Also added the ability to position the menu. And your problem is solved too. An example is attached.

Nice. Thanks Kreator

Mark Goldberg wrote about changing the (Popup)font in this article:

Neat-o. For positioning under a button, I use this function.

!------------------------------------------------------------------
PositionPopup  PROCEDURE(SHORT pFEQ,PopupClass pPopup)!,STRING,PROC
!------------------------------------------------------------------

RECT       GROUP
left         SIGNED
top          SIGNED
right        SIGNED
bottom       SIGNED
           END

hwnd       LONG

  CODE

  hwnd = pFEQ{PROP:Handle}
  JSGetWindowRect(hwnd,ADDRESS(Rect))
  RETURN(pPopup.Ask(Rect.Left,Rect.Bottom))

No need for API call, the Popup(,x,y,True) forth Parameter True makes X,Y relative to Window and in DLUs:

OF ?CopyBtn ; P=POPUPunder(?,'Visible List|Debug Queue|Tab Queue|-|FieldQ') 

PopupUnder PROCEDURE(LONG CtrlFEQ, STRING PopMenu)!,LONG
X LONG,AUTO
Y LONG,AUTO
H LONG,AUTO
    CODE
    GETPOSITION(CtrlFEQ,X,Y ,, H )
    IF CtrlFEQ{PROP:InToolBar} THEN 
       Y -= (0{PROP:ToolBar}){PROP:Height}
    END 
    RETURN POPUP(PopMenu,X,Y+H+1,True) 

PopupBeside PROCEDURE(LONG CtrlFEQ, STRING PopMenu)!,LONG
X LONG,AUTO
Y LONG,AUTO
W LONG,AUTO
    CODE
    GETPOSITION(CtrlFEQ,X,Y,W)
    IF CtrlFEQ{PROP:InToolBar} THEN 
    Y -= (0{PROP:ToolBar}){PROP:Height}
    END
    RETURN POPUP(PopMenu,X+W,Y,True)

ABPopup.CLW shows support for the 4th parameter:

    PopupClass.Ask PROCEDURE(SIGNED XPos=0,SIGNED YPos=0, BYTE relActiveWindow)

    PopupClass.ExecutePopup PROCEDURE(STRING MenuText,UNSIGNED XPos,UNSIGNED YPos, BYTE relActiveWindow)

          RETURN POPUP (MenuText, XPos, YPos, relActiveWindow)

This is using a PopupClass object, Carl. Not directly calling POPUP. They did introduce the relActiveWindow parameter to ABPOPUP in 9.1, but I’m in compatibility mode :slight_smile: