Buttonbar 2007 button with a attached Popup menu
Buttonbar 2007 button with a attached Popup menu
Does someone know how to open the attached popup menu with a click on the button.
(Like in WORD Button: “Formatvorlagen”)
Regards,
Otto
(Like in WORD Button: “Formatvorlagen”)
Regards,
Otto
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Code: Select all
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
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Otto,
Please add this method to class TBtnBmp:
To use it, simply do:
Please add this method to class TBtnBmp:
Code: Select all
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
Code: Select all
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 oPopup
Re: Buttonbar 2007 button with a attached Popup menu
Hello Antonio,
I have seen that popup is included in 10.3. Thank you.
How can I align the popup menu if I use oBtn:ShowPopup()?
Best regards,
Otto
I have seen that popup is included in 10.3. Thank you.
How can I align the popup menu if I use oBtn:ShowPopup()?
Best regards,
Otto
Code: Select all
@ 5, 145 ADD BUTTON oBtnBearbeiten GROUP oFunktionen BITMAP ".\bitmaps2\11.bmp" MENU oMenuBearbeiten ;
SIZE 65, 75 PROMPT "Bearbeiten" SPLITPOPUP TOP ROUND ;
ACTION ( oBtnBearbeiten:ShowPopup() )
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Buttonbar 2007 button with a attached Popup menu
Otto,
I don't exactly understand what you mean
I don't exactly understand what you mean
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Buttonbar 2007 button with a attached Popup menu
Mr Antonio.
ShowPopup was already there in the FWH long time back.
This kind of code was working since many versions of FWH. I think we do not need to add the above code again:
The code below is an extract from testxbr3.prg:
ShowPopup was already there in the FWH long time back.
This kind of code was working since many versions of FWH. I think we do not need to add the above code again:
The code below is an extract from testxbr3.prg:
Code: Select all
DEFINE BUTTON OF oBar ;
RESOURCE "REPORT" TOP ;
PROMPT "Report" ;
MENU ReportMenu( oBrw ) ;
ACTION This:ShowPopUp() ;
MESSAGE "Print the browse contents" ;
TOOLTIP { "Print Report", "Report" }
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Buttonbar 2007 button with a attached Popup menu
Hello Antonio,
Best regards,
Otto
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Buttonbar 2007 button with a attached Popup menu
Otto,
Does it fit in the right side ?
Does it fit in the right side ?
Re: Buttonbar 2007 button with a attached Popup menu
Antonio,
yes it fits in the right side.
Best regards,
Otto
yes it fits in the right side.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Buttonbar 2007 button with a attached Popup menu
Otto,
Then it means that the left coordinate of the popup is wrongly calculated.
We are going to review it, thanks
Then it means that the left coordinate of the popup is wrongly calculated.
We are going to review it, thanks
- Daniel Garcia-Gil
- Posts: 2365
- Joined: Wed Nov 02, 2005 11:46 pm
- Location: Isla de Margarita
- Contact:
Re: Buttonbar 2007 button with a attached Popup menu
Hello Otto...
in METHOD LButtonUp( nRow, nCol ) CLASS TRBtn
find and replace this section...
in METHOD LButtonUp( nRow, nCol ) CLASS TRBtn
find and replace this section...
Code: Select all
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()
endif
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Re: Buttonbar 2007 button with a attached Popup menu
Hello Daniel,
thank you for your help.
I did a short test but the code does not resolve my problem.
If I change as well showpopup() (left + 500) this way I would get the right alignment – only for this special case.
Thanks in advance
Otto
thank you for your help.
I did a short test but the code does not resolve my problem.
If I change as well showpopup() (left + 500) this way I would get the right alignment – only for this special case.
Thanks in advance
Otto
Code: Select all
METHOD 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
//----------------------------------------------------------------------------//
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
Re: Buttonbar 2007 button with a attached Popup menu
Hello Daniel,
Would you be so kind to have another look at this problem?
Best regards,
Otto
Would you be so kind to have another look at this problem?
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************