Does someone know how to open the attached popup menu with a click on the button.
(Like in WORD Button: “Formatvorlagen”)
Regards,
Otto
Does someone know how to open the attached popup menu with a click on the button.
(Like in WORD Button: “Formatvorlagen”)
Regards,
Otto
DEFINE BUTTON OF oBar NOBORDER ;
PROMPT 'SubMenu' ;
MENU MyPopUp() ;
ACTION MsgInfo('Can have action and also submenu')
....
....
// -------------------
STATIC FUNCTION MyPopUp()
LOCAL oPop
MENU oPop POPUP
MENUITEM 'One'
MENUITEM 'Two'
ENDMENU
RETURN oPop

METHOD ShowPopup() CLASS TBtnBmp
local oWnd
if ::oPopup != nil
if ::oWnd:oWnd != nil .and. Upper( ::oWnd:oWnd:Classname() ) == "TBAR"
oWnd := ::oWnd:oWnd
else
oWnd := ::oWnd
endif
if GetClassName( GetParent( Self:hWnd ) ) != "TBAR"
oWnd = oWndFromhWnd( GetParent( Self:hWnd ) )
endif
oWnd:NcMouseMove() // close the tooltip
oWnd:oPopup = ::oPopup
::oPopup:Activate( ::nTop + ::nHeight(), ::nLeft, oWnd, .f. )
oWnd:oPopup = nil
::Refresh()
endif
return nil MENU oPopup POPUP
MENUITEM "One" ACTION MsgInfo( 1 )
MENUITEM "Two" ACTION MsgInfo( 2 )
ENDMENU
DEFINE BUTTON oBtn OF oBar ACTION oBtn:ShowPopup() ;
RESOURCE "people" PROMPT "Clients" GROUP ;
MENU oPopupThank you, Antonio.
It is working.
Regards,
Otto
@ 5, 145 ADD BUTTON oBtnBearbeiten GROUP oFunktionen BITMAP ".\bitmaps2\11.bmp" MENU oMenuBearbeiten ;
SIZE 65, 75 PROMPT "Bearbeiten" SPLITPOPUP TOP ROUND ;
ACTION ( oBtnBearbeiten:ShowPopup() )

Otto,
I don't exactly understand what you mean
DEFINE BUTTON OF oBar ;
RESOURCE "REPORT" TOP ;
PROMPT "Report" ;
MENU ReportMenu( oBrw ) ;
ACTION This:ShowPopUp() ;
MESSAGE "Print the browse contents" ;
TOOLTIP { "Print Report", "Report" }
Otto,
Does it fit in the right side ?
Antonio,
yes it fits in the right side.
Best regards,
Otto
Otto,
Then it means that the left coordinate of the popup is wrongly calculated.
We are going to review it, thanks ![]()
case ::nTypeButton == TYPE_SPLITPOPUP
if nRow >= ::nPopupMargin .or. ! lAction
oWnd := ::oWnd
oWnd:NcMouseMove() // close the tooltip
oWnd:oPopup = ::oPopup
::oPopup:Activate( ::nHeight, 0, Self, .F. )
oWnd:oPopup = nil
::Refresh()
else
::click()
endif
case ::nTypeButton == TYPE_POPUP
if nCol >= ::nPopupMargin .or. !lAction
oWnd := ::oWnd
oWnd:NcMouseMove() // close the tooltip
oWnd:oPopup = ::oPopup
::oPopup:Activate( ::nHeight, 0, Self, .F. )
oWnd:oPopup = nil
::Refresh()
else
::click()
endifMETHOD ShowPopup() CLASS TRBtn
local oWnd
msginfo("asdfla")
if ::oPopup != nil
if GetClassName( GetParent( Self:hWnd ) ) != "TBAR"
oWnd = oWndFromhWnd( GetParent( Self:hWnd ) )
endif
oWnd:NcMouseMove() // close the tooltip
oWnd:oPopup = ::oPopup
::oPopup:Activate( ::nTop + ::nHeight(), ::nLeft - oWnd:nLeft + 500, oWnd, .f. )
oWnd:oPopup = nil
::Refresh()
endif
return nil
//----------------------------------------------------------------------------//Hello Daniel,
Would you be so kind to have another look at this problem?
Best regards,
Otto