Subject Re: Form2PopupMenu
From Heinz Kesting <Nobody@Nowhere.com>
Date Fri, 25 Apr 2025 18:54:46 +0200
Newsgroups dbase.getting-started

Hi Tom,
> Given:
>
> set procedure to A2Demo.pop ADDITIVE // local folder ...
> form.popupMenu = new A2DemoPopup(form,"A2POP") // menu belongs to form
> *
> What is the proper way to refer to refer to the popup menu item "List"
> of the popup menu from the form to which it is attached so that I may
> set it's enabled property to true or false? Tried lots of combinations,
> none of which were successful yet. Fingers are tired of typing so I will
> ask. :)

The following works for me.

   function Form_OnOpen
     ...
    set procedure to Standard.pop additive
    this.popupMenu = new StandardPopUp(this, "Standard")
     ...
    return

class EF_DATA(parentObj) of ENTRYFIELD(parentObj) custom
    with (this)
       onRightMouseUp = SHOW_STANDARD_POP
       maxLength = 120
       height = 1.0
       width = 18.8889
       ...
   endwith

    function Show_Standard_Pop(flags, col, row)
    if not type("form.spp") = "O"
       form.SPP = new StandardPopup(form,"STANDARD_POP")
    endif
    form.spp.left = this.left + col
    form.spp.top = this.top + row
    form.spp.sel_all.enabled = form.IsAllSelected()
    form.spp.dele.enabled = not empty(this.value)
    form.spp.proper.enabled = not empty(this.value)
    form.spp.cut.enabled = form.IsAnythingSelected()
    form.spp.copy.enabled = form.IsAnythingSelected()
    form.spp.paste.enabled = form.ClipBoardValue()
    form.spp.open()
    return
...
endclass

Hope this helps.
Kind regards, Heinz

--
Diese E-Mail wurde von Avast-Antivirussoftware auf Viren geprüft.
www.avast.com