diff options
author | Jan Holesovsky <kendy@suse.cz> | 2012-04-14 21:02:53 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2012-04-14 22:49:32 +0200 |
commit | cecde99da64ff3de1cc8066aa9612e67f3db60e0 (patch) | |
tree | 23c4a55fe7014fa613fd2653db13cf906c957131 /sd | |
parent | af77ec0d7ed0a40a1efe9a380b2bab74c02d9fec (diff) |
Slidesorter: Kill useless ImageButton abstraction.
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/slidesorter/inc/view/SlsButtonBar.hxx | 49 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/view/SlsButtonBar.cxx | 64 |
2 files changed, 36 insertions, 77 deletions
diff --git a/sd/source/ui/slidesorter/inc/view/SlsButtonBar.hxx b/sd/source/ui/slidesorter/inc/view/SlsButtonBar.hxx index afa7781c5f96..a6a3482ec380 100644 --- a/sd/source/ui/slidesorter/inc/view/SlsButtonBar.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlsButtonBar.hxx @@ -188,6 +188,12 @@ class Button public: Button ( SlideSorter& rSlideSorter, + const BitmapEx& rLargeIcon, + const BitmapEx& rLargeHoverIcon, + const BitmapEx& rMediumIcon, + const BitmapEx& rMediumHoverIcon, + const BitmapEx& rSmallIcon, + const BitmapEx& rSmallHoverIcon, const ::rtl::OUString& rsHelpText); virtual ~Button (void); @@ -201,12 +207,12 @@ public: */ bool SetState (const State eState); - virtual void Place (const Rectangle aButtonBarBox) = 0; + virtual void Place (const Rectangle aButtonBarBox); virtual void Paint ( OutputDevice& rDevice, const Point aOffset, const double nAlpha, - const ::boost::shared_ptr<Theme>& rpTheme) const = 0; + const ::boost::shared_ptr<Theme>& rpTheme) const; virtual void ProcessClick (const model::SharedPageDescriptor& rpDescriptor) = 0; /** Return the bounding box of the layouted button. @@ -215,8 +221,8 @@ public: /** Return the minimum size required to completely paint the button. */ - virtual Size GetSize (void) const = 0; - virtual Size GetSize (const IconSize eIconSize) const = 0; + virtual Size GetSize (void) const; + virtual Size GetSize (const IconSize eIconSize) const; ::rtl::OUString GetHelpText (void) const; bool IsDown (void) const; void SetActiveState (const bool bIsActive); @@ -234,33 +240,7 @@ protected: // Buttons that lie (partly) outside the button bar are deactivated. bool mbIsActive; IconSize meIconSize; -}; - - -class ImageButton : public Button -{ -public: - ImageButton ( - SlideSorter& rSlideSorter, - const BitmapEx& rLargeIcon, - const BitmapEx& rLargeHoverIcon, - const BitmapEx& rMediumIcon, - const BitmapEx& rMediumHoverIcon, - const BitmapEx& rSmallIcon, - const BitmapEx& rSmallHoverIcon, - const ::rtl::OUString& rsHelpText); - - virtual void Place (const Rectangle aButtonBarBox); - virtual void Paint ( - OutputDevice& rDevice, - const Point aOffset, - const double nAlpha, - const ::boost::shared_ptr<Theme>& rpTheme) const; - virtual Size GetSize (void) const; - virtual Size GetSize (const IconSize eIconSize) const; - -private: const BitmapEx maLargeIcon; const BitmapEx maLargeHoverIcon; const BitmapEx maMediumIcon; @@ -270,7 +250,8 @@ private: }; -class UnhideButton : public ImageButton + +class UnhideButton : public Button { public: UnhideButton (SlideSorter& rSlideSorter); @@ -280,7 +261,7 @@ protected: }; -class StartShowButton : public ImageButton +class StartShowButton : public Button { public: StartShowButton (SlideSorter& rSlideSorter); @@ -291,7 +272,7 @@ protected: }; -class HideButton : public ImageButton +class HideButton : public Button { public: HideButton (SlideSorter& rSlideSorter); @@ -301,7 +282,7 @@ protected: }; -class DuplicateButton : public ImageButton +class DuplicateButton : public Button { public: DuplicateButton (SlideSorter& rSlideSorter); diff --git a/sd/source/ui/slidesorter/view/SlsButtonBar.cxx b/sd/source/ui/slidesorter/view/SlsButtonBar.cxx index 3814c32680f2..afe64c994770 100644 --- a/sd/source/ui/slidesorter/view/SlsButtonBar.cxx +++ b/sd/source/ui/slidesorter/view/SlsButtonBar.cxx @@ -857,19 +857,29 @@ void ButtonBar::BackgroundTheme::Layout (void) Button::Button ( SlideSorter& rSlideSorter, + const BitmapEx& rLargeIcon, + const BitmapEx& rLargeHoverIcon, + const BitmapEx& rMediumIcon, + const BitmapEx& rMediumHoverIcon, + const BitmapEx& rSmallIcon, + const BitmapEx& rSmallHoverIcon, const ::rtl::OUString& rsHelpText) : mrSlideSorter(rSlideSorter), meState(State_Normal), maBoundingBox(), msHelpText(rsHelpText), mbIsActive(false), - meIconSize(IconSize_Large) + meIconSize(IconSize_Large), + maLargeIcon(rLargeIcon), + maLargeHoverIcon(rLargeHoverIcon.IsEmpty() ? rLargeIcon : rLargeHoverIcon), + maMediumIcon(rMediumIcon), + maMediumHoverIcon(rMediumHoverIcon.IsEmpty() ? rMediumIcon : rMediumHoverIcon), + maSmallIcon(rSmallIcon), + maSmallHoverIcon(rSmallHoverIcon.IsEmpty() ? rSmallIcon : rSmallHoverIcon) { } - - Button::~Button (void) { } @@ -951,33 +961,7 @@ bool Button::IsEnabled (void) const } - - -//===== ImageButon ============================================================ - -ImageButton::ImageButton ( - SlideSorter& rSlideSorter, - const BitmapEx& rLargeIcon, - const BitmapEx& rLargeHoverIcon, - const BitmapEx& rMediumIcon, - const BitmapEx& rMediumHoverIcon, - const BitmapEx& rSmallIcon, - const BitmapEx& rSmallHoverIcon, - const ::rtl::OUString& rsHelpText) - : Button(rSlideSorter, rsHelpText), - maLargeIcon(rLargeIcon), - maLargeHoverIcon(rLargeHoverIcon.IsEmpty() ? rLargeIcon : rLargeHoverIcon), - maMediumIcon(rMediumIcon), - maMediumHoverIcon(rMediumHoverIcon.IsEmpty() ? rMediumIcon : rMediumHoverIcon), - maSmallIcon(rSmallIcon), - maSmallHoverIcon(rSmallHoverIcon.IsEmpty() ? rSmallIcon : rSmallHoverIcon) -{ -} - - - - -void ImageButton::Place (const Rectangle aButtonBarBox) +void Button::Place (const Rectangle aButtonBarBox) { const sal_Int32 nWidth (GetSize().Width()); maBoundingBox = Rectangle( @@ -989,9 +973,7 @@ void ImageButton::Place (const Rectangle aButtonBarBox) } - - -void ImageButton::Paint ( +void Button::Paint ( OutputDevice& rDevice, const Point aOffset, const double nAlpha, @@ -1052,17 +1034,13 @@ void ImageButton::Paint ( } - - -Size ImageButton::GetSize (void) const +Size Button::GetSize (void) const { return GetSize(meIconSize); } - - -Size ImageButton::GetSize (const Button::IconSize eIconSize) const +Size Button::GetSize (const Button::IconSize eIconSize) const { switch (eIconSize) { @@ -1084,7 +1062,7 @@ Size ImageButton::GetSize (const Button::IconSize eIconSize) const //===== UnhideButton ========================================================== UnhideButton::UnhideButton (SlideSorter& rSlideSorter) - : ImageButton( + : Button( rSlideSorter, rSlideSorter.GetTheme()->GetIcon(Theme::Icon_Command2BLarge), rSlideSorter.GetTheme()->GetIcon(Theme::Icon_Command2BLargeHover), @@ -1116,7 +1094,7 @@ void UnhideButton::ProcessClick (const model::SharedPageDescriptor& rpDescriptor //===== StartSlideShowButton ================================================== StartShowButton::StartShowButton (SlideSorter& rSlideSorter) - : ImageButton( + : Button( rSlideSorter, rSlideSorter.GetTheme()->GetIcon(Theme::Icon_Command1Large), rSlideSorter.GetTheme()->GetIcon(Theme::Icon_Command1LargeHover), @@ -1182,7 +1160,7 @@ void StartShowButton::ProcessClick (const model::SharedPageDescriptor& rpDescrip //===== HideButton ============================================================ HideButton::HideButton (SlideSorter& rSlideSorter) - : ImageButton( + : Button( rSlideSorter, rSlideSorter.GetTheme()->GetIcon(Theme::Icon_Command2Large), rSlideSorter.GetTheme()->GetIcon(Theme::Icon_Command2LargeHover), @@ -1214,7 +1192,7 @@ void HideButton::ProcessClick (const model::SharedPageDescriptor& rpDescriptor) //===== DuplicateButton ======================================================= DuplicateButton::DuplicateButton (SlideSorter& rSlideSorter) - : ImageButton( + : Button( rSlideSorter, rSlideSorter.GetTheme()->GetIcon(Theme::Icon_Command3Large), rSlideSorter.GetTheme()->GetIcon(Theme::Icon_Command3LargeHover), |