diff options
-rw-r--r-- | sc/source/ui/inc/tphfedit.hxx | 10 | ||||
-rw-r--r-- | sc/source/ui/pagedlg/tphfedit.cxx | 15 |
2 files changed, 18 insertions, 7 deletions
diff --git a/sc/source/ui/inc/tphfedit.hxx b/sc/source/ui/inc/tphfedit.hxx index 79a38c5f29de..f3d5e3307e6c 100644 --- a/sc/source/ui/inc/tphfedit.hxx +++ b/sc/source/ui/inc/tphfedit.hxx @@ -98,9 +98,10 @@ class SC_DLLPUBLIC ScExtIButton : public ImageButton private: Timer aTimer; - ScPopupMenu* pPopupMenu; + PopupMenu* pPopupMenu; Link aMLink; - sal_uInt16 nSelected; + sal_uInt16 nSelected; + OString aSelectedIdent; SC_DLLPRIVATE DECL_LINK( TimerHdl, void*); @@ -116,9 +117,10 @@ public: ScExtIButton(Window* pParent, const ResId& rResId ); - void SetPopupMenu(ScPopupMenu* pPopUp); + void SetPopupMenu(PopupMenu* pPopUp); - sal_uInt16 GetSelected(); + sal_uInt16 GetSelected() const; + OString GetSelectedIdent() const; void SetMenuHdl( const Link& rLink ) { aMLink = rLink; } const Link& GetMenuHdl() const { return aMLink; } diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx index 5fd9d40cc86f..9099e23266ea 100644 --- a/sc/source/ui/pagedlg/tphfedit.cxx +++ b/sc/source/ui/pagedlg/tphfedit.cxx @@ -348,16 +348,21 @@ ScExtIButton::ScExtIButton(Window* pParent, const ResId& rResId ) SetDropDown( true); } -void ScExtIButton::SetPopupMenu(ScPopupMenu* pPopUp) +void ScExtIButton::SetPopupMenu(PopupMenu* pPopUp) { pPopupMenu=pPopUp; } -sal_uInt16 ScExtIButton::GetSelected() +sal_uInt16 ScExtIButton::GetSelected() const { return nSelected; } +OString ScExtIButton::GetSelectedIdent() const +{ + return aSelectedIdent; +} + void ScExtIButton::MouseButtonDown( const MouseEvent& rMEvt ) { if(!aTimer.IsActive()) @@ -368,6 +373,7 @@ void ScExtIButton::MouseButtonDown( const MouseEvent& rMEvt ) ImageButton::MouseButtonDown(rMEvt ); } + void ScExtIButton::MouseButtonUp( const MouseEvent& rMEvt) { aTimer.Stop(); @@ -385,6 +391,7 @@ void ScExtIButton::Click() void ScExtIButton::StartPopup() { nSelected=0; + aSelectedIdent = OString(); if(pPopupMenu!=NULL) { @@ -393,12 +400,14 @@ void ScExtIButton::StartPopup() Point aPoint(0,0); aPoint.Y()=GetOutputSizePixel().Height(); - nSelected=pPopupMenu->Execute( this, aPoint ); + nSelected = pPopupMenu->Execute( this, aPoint ); if(nSelected) { + aSelectedIdent = pPopupMenu->GetItemIdent(nSelected); aMLink.Call(this); } + SetPressed( false); } } |