diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-04-07 22:36:24 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-04-07 22:36:24 +0200 |
commit | 46a3b5deb5df0bc8dc64d2a01956dab08dd7798f (patch) | |
tree | 7f8b9076771ab3f84a96fee15b6661c8761233bf /sd/source/ui/toolpanel/TitleBar.cxx | |
parent | 17d7bf8f871c2b2e04a14c3d9cca27e7e6c84cac (diff) |
slidecopy: outsourced the TaskPane/ToolPanel's drawer (TitleBar, type TBT_CONTROL_TITLE) from sd to svtools, to be used with generic tool panel decks, not only within sd
diff -r b53c58c139b0 -r 348318a2bab4 default_images/sd/res/triangle_down.png
Binary file default_images/sd/res/triangle_down.png has changed
diff -r b53c58c139b0 -r 348318a2bab4 default_images/sd/res/triangle_down_hc.png
Binary file default_images/sd/res/triangle_down_hc.png has changed
diff -r b53c58c139b0 -r 348318a2bab4 default_images/sd/res/triangle_right.png
Binary file default_images/sd/res/triangle_right.png has changed
diff -r b53c58c139b0 -r 348318a2bab4 default_images/sd/res/triangle_right_hc.png
Binary file default_images/sd/res/triangle_right_hc.png has changed
diff -r b53c58c139b0 -r 348318a2bab4 default_images/svtools/res/triangle_down.png
Binary file default_images/svtools/res/triangle_down.png has changed
diff -r b53c58c139b0 -r 348318a2bab4 default_images/svtools/res/triangle_down_hc.png
Binary file default_images/svtools/res/triangle_down_hc.png has changed
diff -r b53c58c139b0 -r 348318a2bab4 default_images/svtools/res/triangle_right.png
Binary file default_images/svtools/res/triangle_right.png has changed
diff -r b53c58c139b0 -r 348318a2bab4 default_images/svtools/res/triangle_right_hc.png
Binary file default_images/svtools/res/triangle_right_hc.png has changed
Diffstat (limited to 'sd/source/ui/toolpanel/TitleBar.cxx')
-rw-r--r-- | sd/source/ui/toolpanel/TitleBar.cxx | 103 |
1 files changed, 1 insertions, 102 deletions
diff --git a/sd/source/ui/toolpanel/TitleBar.cxx b/sd/source/ui/toolpanel/TitleBar.cxx index e54c98428065..a81d478c068c 100644 --- a/sd/source/ui/toolpanel/TitleBar.cxx +++ b/sd/source/ui/toolpanel/TitleBar.cxx @@ -69,7 +69,6 @@ TitleBar::TitleBar ( ::Window* pParent, const String& rsTitle, TitleBarType eTyp , msTitle(rsTitle) , mbExpanded(false) , mbFocused(false) -, mbMouseOver(false) , mpDevice(new VirtualDevice (*this)) , mbIsExpandable (bIsExpandable) { @@ -80,7 +79,6 @@ TitleBar::TitleBar ( ::Window* pParent, const String& rsTitle, TitleBarType eTyp // Change the mouse pointer shape so that it acts as a mouse over effect. switch (meType) { - case TBT_CONTROL_TITLE: case TBT_SUB_CONTROL_HEADLINE: if (mbIsExpandable) SetPointer (POINTER_REFHAND); @@ -170,10 +168,6 @@ void TitleBar::Paint (const Rectangle& rBoundingBox) switch (meType) { - case TBT_CONTROL_TITLE: - PaintPanelControlTitle (); - break; - case TBT_SUB_CONTROL_HEADLINE: PaintSubPanelHeadLineBar (); break; @@ -239,18 +233,6 @@ void TitleBar::LoseFocus() -void TitleBar::SetMouseOver (bool bFlag) -{ - if (bFlag != mbMouseOver) - { - mbMouseOver = bFlag; - // Invalidate(); - } -} - - - - bool TitleBar::HasExpansionIndicator (void) const { bool bHasExpansionIndicator (false); @@ -258,7 +240,6 @@ bool TitleBar::HasExpansionIndicator (void) const { switch (meType) { - case TBT_CONTROL_TITLE: case TBT_SUB_CONTROL_HEADLINE: bHasExpansionIndicator = true; break; @@ -279,21 +260,6 @@ Image TitleBar::GetExpansionIndicator (void) const USHORT nResourceId = 0; switch (meType) { - case TBT_CONTROL_TITLE: - if (mbExpanded) - if (bHighContrastMode) - nResourceId = BMP_TRIANGLE_DOWN_H; - else - nResourceId = BMP_TRIANGLE_DOWN; - else - if (bHighContrastMode) - nResourceId = BMP_TRIANGLE_RIGHT_H; - else - nResourceId = BMP_TRIANGLE_RIGHT; - - aIndicator = IconCache::Instance().GetIcon(nResourceId); - break; - case TBT_SUB_CONTROL_HEADLINE: if (mbExpanded) if (bHighContrastMode) @@ -317,22 +283,6 @@ Image TitleBar::GetExpansionIndicator (void) const -void TitleBar::PaintPanelControlTitle (void) -{ - int nWidth (GetOutputSizePixel().Width()); - Rectangle aTextBox (CalculateTextBoundingBox (nWidth, true)); - PaintBackground(CalculateTitleBarBox(aTextBox, nWidth)); - Rectangle aFocusBox (PaintExpansionIndicator (aTextBox)); - PaintText (aTextBox); - aFocusBox.Union (aTextBox); - aFocusBox.Left() += 2; - PaintFocusIndicator (aFocusBox); - PaintMouseOverIndicator (aTextBox); -} - - - - void TitleBar::PaintSubPanelHeadLineBar (void) { int nWidth (GetOutputSizePixel().Width()); @@ -353,7 +303,6 @@ void TitleBar::PaintSubPanelHeadLineBar (void) aFocusBox.Left() -= 2; aFocusBox.Right() += 1; PaintFocusIndicator (aFocusBox); - PaintMouseOverIndicator (aTextBox); } @@ -390,21 +339,6 @@ void TitleBar::PaintFocusIndicator (const Rectangle& rTextBox) -void TitleBar::PaintMouseOverIndicator (const Rectangle& rTextBox) -{ - if (mbMouseOver) - { - Rectangle aBox (rTextBox); - // Show the line below the focus rectangle (which is painted - // after and over the mouse over indicator.) - // aBox.Bottom() += 2; - // DrawLine (aBox.BottomLeft(), aBox.BottomRight()); - } -} - - - - Rectangle TitleBar::PaintExpansionIndicator (const Rectangle& rTextBox) { Rectangle aExpansionIndicatorArea; @@ -466,29 +400,6 @@ void TitleBar::PaintBackground (const Rectangle& rTitleBarBox) switch (meType) { - case TBT_CONTROL_TITLE: - { - mpDevice->SetFillColor ( - GetSettings().GetStyleSettings().GetDialogColor()); - mpDevice->DrawRect(rTitleBarBox); - - mpDevice->SetFillColor(); - mpDevice->SetLineColor ( - GetSettings().GetStyleSettings().GetLightColor()); - mpDevice->DrawLine( - rTitleBarBox.TopLeft(),rTitleBarBox.TopRight()); - mpDevice->DrawLine( - rTitleBarBox.TopLeft(),rTitleBarBox.BottomLeft()); - - mpDevice->SetLineColor ( - GetSettings().GetStyleSettings().GetShadowColor()); - mpDevice-> DrawLine( - rTitleBarBox.BottomLeft(), rTitleBarBox.BottomRight()); - mpDevice->DrawLine( - rTitleBarBox.TopRight(), rTitleBarBox.BottomRight()); - } - break; - case TBT_SUB_CONTROL_HEADLINE: { Color aColor (GetSettings().GetStyleSettings().GetDialogColor()); @@ -568,11 +479,6 @@ Rectangle TitleBar::CalculateTitleBarBox ( switch (meType) { - case TBT_CONTROL_TITLE: - aTitleBarBox.Bottom() += aTitleBarBox.Top(); - aTitleBarBox.Top() = 0; - break; - case TBT_SUB_CONTROL_HEADLINE: aTitleBarBox.Top() -= 3; aTitleBarBox.Bottom() += 3; @@ -589,15 +495,8 @@ Rectangle TitleBar::CalculateTitleBarBox ( -void TitleBar::MouseMove (const MouseEvent& rEvent) +void TitleBar::MouseMove (const MouseEvent& ) { - Point aRelativePosition = rEvent.GetPosPixel() - GetPosPixel(); - Size aSize = GetSizePixel(); - SetMouseOver ( - aRelativePosition.X() >= 0 - && aRelativePosition.Y() >= 0 - && aRelativePosition.X() < aSize.Width() - && aRelativePosition.Y() < aSize.Height()); } |