Added: 
openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlineControl.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlineControl.cxx?rev=1459509&view=auto
==============================================================================
--- 
openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlineControl.cxx
 (added)
+++ 
openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlineControl.cxx
 Thu Mar 21 20:23:16 2013
@@ -0,0 +1,281 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#include "precompiled_svx.hxx"
+#include "TextUnderlineControl.hxx"
+#include "TextPropertyPanel.hrc"
+#include <sfx2/sidebar/propertypanel.hrc>
+#include <svx/dialogs.hrc>
+#include <svx/dialmgr.hxx>
+#include <unotools/viewoptions.hxx>
+#include <editeng/kernitem.hxx>
+#include <sfx2/bindings.hxx>
+#include <sfx2/dispatch.hxx>
+#include <sfx2/sidebar/Theme.hxx>
+#include <editeng/udlnitem.hxx>
+
+namespace svx { namespace sidebar {
+
+TextUnderlineControl::TextUnderlineControl(Window* pParent, 
svx::sidebar::TextPropertyPanel& rPanel)
+:      svx::sidebar::PopupControl( 
pParent,SVX_RES(RID_POPUPPANEL_TEXTPAGE_UNDERLINE))
+,      mrTextPropertyPanel(rPanel)
+,      mpBindings(NULL)
+,      maVSUnderline( this, SVX_RES(VS_UNDERLINE))
+,      maPBOptions     (this, SVX_RES(PB_OPTIONS),Bitmap( SVX_RES( 
BMP_UNDERLINE_MORE )), Bitmap( SVX_RES( BMP_UNDERLINE_MORE_H )) )
+
+,      maIMGSingle             (SVX_RES(IMG_SINGLE))
+,      maIMGDouble             (SVX_RES(IMG_DOUBLE))
+,      maIMGBold               (SVX_RES(IMG_BOLD2))
+,      maIMGDot                (SVX_RES(IMG_DOT))
+,      maIMGDotBold    (SVX_RES(IMG_DOT_BOLD))
+,      maIMGDash               (SVX_RES(IMG_DASH))
+,      maIMGDashLong   (SVX_RES(IMG_DASH_LONG))
+,      maIMGDashDot    (SVX_RES(IMG_DASH_DOT))
+,      maIMGDashDotDot (SVX_RES(IMG_DASH_DOT_DOT))
+,      maIMGWave               (SVX_RES(IMG_WAVE))
+
+// high contrast
+,      maIMGSingleH    (SVX_RES(IMG_SINGLE_H))
+,      maIMGDoubleH    (SVX_RES(IMG_DOUBLE_H))
+,      maIMGBoldH              (SVX_RES(IMG_BOLD2_H))
+,      maIMGDotH               (SVX_RES(IMG_DOT_H))
+,      maIMGDotBoldH   (SVX_RES(IMG_DOT_BOLD_H))
+,      maIMGDashH              (SVX_RES(IMG_DASH_H))
+,      maIMGDashLongH  (SVX_RES(IMG_DASH_LONG_H))
+,      maIMGDashDotH   (SVX_RES(IMG_DASH_DOT_H))
+,      maIMGDashDotDotH(SVX_RES(IMG_DASH_DOT_DOT_H))
+,      maIMGWaveH              (SVX_RES(IMG_WAVE_H))
+
+,      maIMGSingleSel          (SVX_RES(IMG_SINGLE_SEL))
+,      maIMGDoubleSel          (SVX_RES(IMG_DOUBLE_SEL))
+,      maIMGBoldSel            (SVX_RES(IMG_BOLD2_SEL))
+,      maIMGDotSel                     (SVX_RES(IMG_DOT_SEL))
+,      maIMGDotBoldSel         (SVX_RES(IMG_DOT_BOLD_SEL))
+,      maIMGDashSel            (SVX_RES(IMG_DASH_SEL))
+,      maIMGDashLongSel        (SVX_RES(IMG_DASH_LONG_SEL))
+,      maIMGDashDotSel         (SVX_RES(IMG_DASH_DOT_SEL))
+,      maIMGDashDotDotSel      (SVX_RES(IMG_DASH_DOT_DOT_SEL))
+,      maIMGWaveSel            (SVX_RES(IMG_WAVE_SEL))
+
+{
+       initial();
+       FreeResource();
+       mpBindings = mrTextPropertyPanel.GetBindings();
+}
+
+void TextUnderlineControl::initial()
+{
+       
maPBOptions.SetDefBkColor(GetSettings().GetStyleSettings().GetHighContrastMode()?
+               GetSettings().GetStyleSettings().GetMenuColor():
+               sfx2::sidebar::Theme::GetColor( 
sfx2::sidebar::Theme::Paint_DropDownBackground ));//Color(244,245,249)//for 
high contract
+       
maPBOptions.SetHoverBkColor(GetSettings().GetStyleSettings().GetHighContrastMode()?
+               GetSettings().GetStyleSettings().GetMenuColor():
+               sfx2::sidebar::Theme::GetColor( 
sfx2::sidebar::Theme::Paint_PanelBackground ) );//Color( 93, 120, 163 )
+       maPBOptions.SetHoverTxtColor( sfx2::sidebar::Theme::GetColor( 
sfx2::sidebar::Theme::Color_PanelTitleFont ) );//Color( 255, 255, 255 )
+       maPBOptions.SetIcoPosX( 2);
+       
maVSUnderline.SetColor(GetSettings().GetStyleSettings().GetHighContrastMode()?
+               GetSettings().GetStyleSettings().GetMenuColor():
+               sfx2::sidebar::Theme::GetColor( 
sfx2::sidebar::Theme::Paint_PanelBackground ));
+       
maVSUnderline.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
+               GetSettings().GetStyleSettings().GetMenuColor():
+               sfx2::sidebar::Theme::GetColor( 
sfx2::sidebar::Theme::Paint_PanelBackground ));
+
+       Link aLink = LINK( this, TextUnderlineControl, PBClickHdl ) ;
+       maPBOptions.SetClickHdl(aLink);
+
+       maVSUnderline.SetStyle( maVSUnderline.GetStyle()| WB_3DLOOK |  
WB_NO_DIRECTSELECT  );// WB_NAMEFIELD | WB_ITEMBORDER |WB_DOUBLEBORDER | 
WB_NONEFIELD |
+
+       maVSUnderline.InsertItem(1, maIMGSingle ,String(SVX_RES(STR_SINGLE)));
+       maVSUnderline.SetItemData(1, (void*)(sal_uInt64)UNDERLINE_SINGLE);
+
+       maVSUnderline.InsertItem(2, maIMGDouble ,String(SVX_RES(STR_DOUBLE)));
+       maVSUnderline.SetItemData(2, (void*)(sal_uInt64)UNDERLINE_DOUBLE);
+
+       maVSUnderline.InsertItem(3, maIMGBold, String(SVX_RES(STR_BOLD)));
+       maVSUnderline.SetItemData(3,(void*)(sal_uInt64)UNDERLINE_BOLD);
+
+       maVSUnderline.InsertItem(4, maIMGDot, String(SVX_RES(STR_DOT)));
+       maVSUnderline.SetItemData(4,(void*)(sal_uInt64)UNDERLINE_DOTTED);
+
+       maVSUnderline.InsertItem(5, maIMGDotBold, 
String(SVX_RES(STR_DOT_BOLD)));
+       maVSUnderline.SetItemData(5,(void*)(sal_uInt64)UNDERLINE_BOLDDOTTED);
+
+       maVSUnderline.InsertItem(6, maIMGDash, String(SVX_RES(STR_DASH)));
+       maVSUnderline.SetItemData(6,(void*)(sal_uInt64)UNDERLINE_DASH);
+
+       maVSUnderline.InsertItem(7, 
maIMGDashLong,String(SVX_RES(STR_DASH_LONG)));
+       maVSUnderline.SetItemData(7,(void*)(sal_uInt64)UNDERLINE_LONGDASH);
+
+       maVSUnderline.InsertItem(8, maIMGDashDot, 
String(SVX_RES(STR_DASH_DOT)));
+       maVSUnderline.SetItemData(8,(void*)(sal_uInt64)UNDERLINE_DASHDOT);
+
+       maVSUnderline.InsertItem(9, maIMGDashDotDot, 
String(SVX_RES(STR_DASH_DOT_DOT)));
+       maVSUnderline.SetItemData(9,(void*)(sal_uInt64)UNDERLINE_DASHDOTDOT);
+
+       maVSUnderline.InsertItem(10, maIMGWave, String(SVX_RES(STR_WAVE)));
+       maVSUnderline.SetItemData(10,(void*)(sal_uInt64)UNDERLINE_WAVE);
+
+       maVSUnderline.SetColCount( 1 );
+       aLink =  LINK( this, TextUnderlineControl, VSSelectHdl ) ;
+    maVSUnderline.SetSelectHdl(aLink);
+
+       maVSUnderline.StartSelection();
+       maVSUnderline.Show();
+}
+
+void TextUnderlineControl::GetFocus()
+{
+       maVSUnderline.GrabFocus();
+}
+void TextUnderlineControl::Rearrange(FontUnderline eLine)
+{
+       // high contrast
+       maVSUnderline.SetItemImage(1,  
GetDisplayBackground().GetColor().IsDark()? maIMGSingleH :maIMGSingle);
+       maVSUnderline.SetItemImage(2,  
GetDisplayBackground().GetColor().IsDark()? maIMGDoubleH : maIMGDouble );
+       maVSUnderline.SetItemImage(3, 
GetDisplayBackground().GetColor().IsDark()? maIMGBoldH : maIMGBold);
+       maVSUnderline.SetItemImage(4, 
GetDisplayBackground().GetColor().IsDark()? maIMGDotH : maIMGDot);
+       maVSUnderline.SetItemImage(5, 
GetDisplayBackground().GetColor().IsDark()? maIMGDotBoldH :maIMGDotBold);
+       maVSUnderline.SetItemImage(6,  
GetDisplayBackground().GetColor().IsDark()? maIMGDashH :maIMGDash);
+       maVSUnderline.SetItemImage(7, 
GetDisplayBackground().GetColor().IsDark()? maIMGDashLongH : maIMGDashLong);
+       maVSUnderline.SetItemImage(8, 
GetDisplayBackground().GetColor().IsDark()? maIMGDashDotH : maIMGDashDot); 
+       maVSUnderline.SetItemImage(9, 
GetDisplayBackground().GetColor().IsDark()? maIMGDashDotDotH : maIMGDashDotDot);
+       maVSUnderline.SetItemImage(10, 
GetDisplayBackground().GetColor().IsDark()? maIMGWaveH : maIMGWave);
+//     maVSUnderline.SelectItem(0);            //delete 
+//     maVSUnderline.SetNoSelection();
+
+       switch(eLine)
+       {
+       case UNDERLINE_SINGLE:
+               maVSUnderline.SetItemImage(1, maIMGSingleSel);
+               maVSUnderline.SelectItem(1);    //add 
+               maVSUnderline.GrabFocus();
+               break;
+       case UNDERLINE_DOUBLE:
+               maVSUnderline.SetItemImage(2, maIMGDoubleSel);
+               maVSUnderline.SelectItem(2);    //add 
+               maVSUnderline.GrabFocus();
+               break;
+       case UNDERLINE_BOLD:
+               maVSUnderline.SetItemImage(3, maIMGBoldSel);
+               maVSUnderline.SelectItem(3);    //add 
+               maVSUnderline.GrabFocus();
+               break;  
+       case UNDERLINE_DOTTED:
+               maVSUnderline.SetItemImage(4, maIMGDotSel);
+               maVSUnderline.SelectItem(4);    //add 
+               maVSUnderline.GrabFocus();
+               break;
+       case UNDERLINE_BOLDDOTTED:
+               maVSUnderline.SetItemImage(5, maIMGDotBoldSel);
+               maVSUnderline.SelectItem(5);    //add 
+               maVSUnderline.GrabFocus();
+               break;
+       case UNDERLINE_DASH:
+               maVSUnderline.SetItemImage(6, maIMGDashSel);
+               maVSUnderline.SelectItem(6);    //add 
+               maVSUnderline.GrabFocus();
+               break;
+       case UNDERLINE_LONGDASH:
+               maVSUnderline.SetItemImage(7, maIMGDashLongSel);
+               maVSUnderline.SelectItem(7);    //add 
+               maVSUnderline.GrabFocus();
+               break;
+       case UNDERLINE_DASHDOT:
+               maVSUnderline.SetItemImage(8, maIMGDashDotSel);
+               maVSUnderline.SelectItem(8);    //add 
+               maVSUnderline.GrabFocus();
+               break;
+       case UNDERLINE_DASHDOTDOT:
+               maVSUnderline.SetItemImage(9, maIMGDashDotDotSel);
+               maVSUnderline.SelectItem(9);    //add 
+               maVSUnderline.GrabFocus();
+               break;
+       case UNDERLINE_WAVE:
+               maVSUnderline.SetItemImage(10, maIMGWaveSel);
+               maVSUnderline.SelectItem(10);   //add 
+               maVSUnderline.GrabFocus();
+               break;
+       case UNDERLINE_NONE:
+       default:
+               maVSUnderline.SelectItem(1);
+               maVSUnderline.SetNoSelection();//add 
+               maPBOptions.GrabFocus();
+       }
+       maVSUnderline.StartSelection();
+       //removed 
+       //if(mpPage->meContextType == PROPERTY_CONTEXT_SC_CELL)
+       //      maPBOptions.Disable();
+       //else
+       //      maPBOptions.Enable();
+       //removed end
+}
+ValueSet& TextUnderlineControl::GetValueSet()
+{
+       return maVSUnderline;
+}
+Control& TextUnderlineControl::GetPB()
+{
+       return maPBOptions;
+}
+IMPL_LINK(TextUnderlineControl, VSSelectHdl, void *, pControl)
+{
+       if(pControl == &maVSUnderline)  
+       {
+               sal_uInt16 iPos = maVSUnderline.GetSelectItemId();
+               FontUnderline eUnderline = 
(FontUnderline)(sal_uInt64)maVSUnderline.GetItemData( iPos );
+
+               //<<modified 
+               //SvxTextLineItem aLineItem(eUnderline, 
SID_ATTR_CHAR_UNDERLINE);
+               SvxUnderlineItem aLineItem(eUnderline, SID_ATTR_CHAR_UNDERLINE);
+               //modify end>>
+
+               //<<add , this line of code will keep the new underline use 
pre-color
+               aLineItem.SetColor(mrTextPropertyPanel.GetUnderlineColor());   
+               //add end>>
+               mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_UNDERLINE, 
SFX_CALLMODE_RECORD, &aLineItem, 0L);
+
+               //add , for the popup page not update immediately
+               mrTextPropertyPanel.SetUnderline(eUnderline);
+               //add end
+               //mrTextPropertyPanel.SetDefaultUnderline(eUnderline);
+
+               mrTextPropertyPanel.EndUnderlinePopupMode();
+       }
+       return( 0L );
+}
+
+IMPL_LINK(TextUnderlineControl, PBClickHdl, PushButton *, pPBtn)
+{
+       if(pPBtn == &maPBOptions)  
+       {
+               if (mpBindings)
+               {
+                       SfxDispatcher* pDisp = mpBindings->GetDispatcher();
+                       pDisp->Execute( SID_CHAR_DLG_EFFECT, 
SFX_CALLMODE_ASYNCHRON );
+               }
+               //add 
+               mrTextPropertyPanel.EndUnderlinePopupMode();
+               //add end
+       }
+       return 0;
+}
+
+}}

Propchange: 
openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlineControl.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: 
openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlineControl.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlineControl.hxx?rev=1459509&view=auto
==============================================================================
--- 
openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlineControl.hxx
 (added)
+++ 
openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlineControl.hxx
 Thu Mar 21 20:23:16 2013
@@ -0,0 +1,94 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+#ifndef _SVX_SIDEBAR_UNDERLINE_CONTROL_HXX_
+#define _SVX_SIDEBAR_UNDERLINE_CONTROL_HXX_
+ 
+#include "svx/sidebar/PopupControl.hxx"
+#include <sfx2/bindings.hxx>
+#include <svtools/ctrlbox.hxx>
+#include <svtools/ctrltool.hxx>
+#include "TextPropertyPanel.hxx"
+#include <vcl/fixed.hxx>
+#include <svtools/button.hxx>
+
+#include <vcl/vclenum.hxx>
+#include <svtools/valueset.hxx>
+
+namespace svx{ namespace sidebar {
+
+class TextUnderlineControl:public svx::sidebar::PopupControl
+{
+public:
+       TextUnderlineControl(Window* pParent, svx::sidebar::TextPropertyPanel& 
rPanel);
+       void GetFocus();
+       void Rearrange(FontUnderline eLine);
+       ValueSet& GetValueSet();
+       Control& GetPB();
+private:       
+       svx::sidebar::TextPropertyPanel&     mrTextPropertyPanel;
+       SfxBindings*            mpBindings;
+       ValueSet                        maVSUnderline;
+       SidebarCustomButton::HoverButton                        maPBOptions;
+
+       Image                           maIMGSingle;
+       Image                           maIMGDouble;
+       Image                           maIMGBold;
+       Image                           maIMGDot;
+       Image                           maIMGDotBold;
+       Image                           maIMGDash;
+       Image                           maIMGDashLong;
+       Image                           maIMGDashDot;
+       Image                           maIMGDashDotDot;
+       Image                           maIMGWave;
+
+       //add  for high contract
+       Image                           maIMGSingleH;
+       Image                           maIMGDoubleH;
+       Image                           maIMGBoldH;
+       Image                           maIMGDotH;
+       Image                           maIMGDotBoldH;
+       Image                           maIMGDashH;
+       Image                           maIMGDashLongH;
+       Image                           maIMGDashDotH;
+       Image                           maIMGDashDotDotH;
+       Image                           maIMGWaveH;
+
+       Image                           maIMGSingleSel;
+       Image                           maIMGDoubleSel;
+       Image                           maIMGBoldSel;
+       Image                           maIMGDotSel;
+       Image                           maIMGDotBoldSel;
+       Image                           maIMGDashSel;
+       Image                           maIMGDashLongSel;
+       Image                           maIMGDashDotSel;
+       Image                           maIMGDashDotDotSel;
+       Image                           maIMGWaveSel;
+
+       void initial();
+
+       DECL_LINK( PBClickHdl, PushButton *);
+       DECL_LINK(VSSelectHdl, void *);
+};
+}}
+
+
+#endif
+

Propchange: 
openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlineControl.hxx
------------------------------------------------------------------------------
    svn:executable = *

Added: 
openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlinePopup.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlinePopup.cxx?rev=1459509&view=auto
==============================================================================
--- 
openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlinePopup.cxx 
(added)
+++ 
openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlinePopup.cxx 
Thu Mar 21 20:23:16 2013
@@ -0,0 +1,60 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#include "TextUnderlinePopup.hxx"
+#include "TextUnderlineControl.hxx"
+
+
+namespace svx { namespace sidebar {
+
+TextUnderlinePopup::TextUnderlinePopup (
+    Window* pParent,
+    const ::boost::function<PopupControl*(PopupContainer*)>& rControlCreator)
+    : Popup(
+        pParent,
+        rControlCreator, 
+        ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Character Spacing")))
+{
+}
+
+
+
+
+TextUnderlinePopup::~TextUnderlinePopup (void)
+{
+}
+
+
+
+
+void TextUnderlinePopup::Rearrange (FontUnderline eLine)
+{
+    ProvideContainerAndControl();
+
+    TextUnderlineControl* pControl = 
dynamic_cast<TextUnderlineControl*>(mpControl.get());
+    if (pControl != NULL)
+        pControl->Rearrange(eLine);    
+}
+
+
+} } // end of namespace svx::sidebar
+
+

Propchange: 
openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlinePopup.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: 
openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlinePopup.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlinePopup.hxx?rev=1459509&view=auto
==============================================================================
--- 
openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlinePopup.hxx 
(added)
+++ 
openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlinePopup.hxx 
Thu Mar 21 20:23:16 2013
@@ -0,0 +1,47 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#ifndef _SVX_SIDEBAR_UNDERLINE_POPUP_HXX_
+#define _SVX_SIDEBAR_UNDERLINE_POPUP_HXX_
+
+#include "svx/sidebar/Popup.hxx"
+
+#include <boost/function.hpp>
+#include <vcl/vclenum.hxx>
+namespace svx { namespace sidebar {
+
+class TextUnderlinePopup
+    : public Popup
+{
+public :
+    TextUnderlinePopup (
+        Window* pParent,
+        const ::boost::function<PopupControl*(PopupContainer*)>& 
rControlCreator);
+    ~TextUnderlinePopup (void);
+
+    void Rearrange (FontUnderline eLine);
+};
+
+} } // end of namespace svx::sidebar
+
+#endif
+
+

Propchange: 
openoffice/branches/sidebar/main/svx/source/sidebar/text/TextUnderlinePopup.hxx
------------------------------------------------------------------------------
    svn:executable = *

Modified: 
openoffice/branches/sidebar/main/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/tools/ValueSetWithTextControl.cxx?rev=1459509&r1=1459508&r2=1459509&view=diff
==============================================================================
--- 
openoffice/branches/sidebar/main/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
 (original)
+++ 
openoffice/branches/sidebar/main/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
 Thu Mar 21 20:23:16 2013
@@ -34,6 +34,8 @@ ValueSetWithTextControl::ValueSetWithTex
     : ValueSet( pParent, rResId )
     , meControlType( eControlType )
     , maItems()
+    ,  bHaveCus(false)
+    ,  bCusEnable(false)
 {
     SetColCount( 1 );
 }
@@ -43,6 +45,58 @@ ValueSetWithTextControl::~ValueSetWithTe
 {
 }
 
+void ValueSetWithTextControl::InsertCustom(Image imgEnable, Image imgDisable, 
XubString str)
+{
+       bHaveCus = true;
+       imgCusEnable = imgEnable;
+       imgCusDisable = imgDisable;
+       strLastCustom = str;
+       InsertItem(maItems.size() + 1);
+}
+
+void  ValueSetWithTextControl::SetDefaultTip(XubString* pStrList, sal_Bool 
bRealTip)
+{
+       for(sal_uInt16 i=1; i <= maItems.size(); i++)
+       {
+               //if (bRealTip)
+               //      SetItemHelpText(i, pStrList[i-1]);
+               //else
+                       SetItemText(i, pStrList[i-1]);
+       }
+}
+
+void  ValueSetWithTextControl::SetCustomTip(XubString str, sal_Bool bRealTip)
+{
+       if(bHaveCus)
+       {
+               //if (bRealTip)
+               //      SetItemHelpText(GetItemCount() + 1 , str);
+               //else
+                       SetItemText(maItems.size()+ 1 , str);
+       }
+}
+
+void ValueSetWithTextControl::SetCusEnable(bool bEnable)
+{
+       bCusEnable = bEnable;
+}
+
+void ValueSetWithTextControl::SetSelItem(sal_uInt16 nSel)
+{
+       //nSelItem = nSel;
+       //add by wj for sym2_5397
+       if(nSel == 0)
+       {
+               SelectItem(1);
+               SetNoSelection();
+       }
+       else
+       {
+               SelectItem(nSel);       
+               GrabFocus();
+       }
+}
+
 
 void ValueSetWithTextControl::AddItem(
     const Image& rItemImage,
@@ -131,7 +185,34 @@ void ValueSetWithTextControl::UserDraw( 
         aSize.Height() = (nRectHeight*4)/9;
         aFont.SetSize( aSize );
     }
-
+    if(nItemId == (maItems.size() + 1)  && bHaveCus)
+       {
+               //Point aStrStart(aBLPos.X() + 
imgCusEnable.GetSizePixel().Width() + 20 , aBLPos.Y() + nRectHeight/6);
+               Rectangle aStrRect = aRect;
+               aStrRect.Top() += nRectHeight/6;
+               aStrRect.Bottom() -= nRectHeight/6;
+               aStrRect.Left() += imgCusEnable.GetSizePixel().Width() + 20;
+
+               pDev->SetFillColor( COL_TRANSPARENT );
+               pDev->DrawRect(aRect);
+
+               if(bCusEnable)
+               {
+                       Point aImgStart(aBLPos.X() + 5,                 
aBLPos.Y() + ( nRectHeight - imgCusEnable.GetSizePixel().Height() ) / 2);
+                       pDev->DrawImage(aImgStart, imgCusEnable);       
+                       
aFont.SetColor(GetSettings().GetStyleSettings().GetFieldTextColor());           
//GetSettings().GetStyleSettings().GetHighContrastMode() ? COL_WHITE : 
COL_BLACKadd for sym2_7246 for high contrast
+               }
+               else
+               {
+                       Point aImgStart(aBLPos.X() + 5,                 
aBLPos.Y() + ( nRectHeight - imgCusDisable.GetSizePixel().Height() ) / 2);
+                       pDev->DrawImage(aImgStart, imgCusDisable);      
+                       //Color aCol(155,155,155);
+                       
aFont.SetColor(GetSettings().GetStyleSettings().GetDisableColor());
+               }
+               pDev->SetFont(aFont);                       
+               pDev->DrawText(aStrRect, strLastCustom, TEXT_DRAW_ENDELLIPSIS); 
//add by wj for sym2_4049
+       }    
+    else
     {
         //draw backgroud
         if ( GetSelectItemId() == nItemId )

Modified: openoffice/branches/sidebar/main/svx/source/svdraw/svdopath.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/svdraw/svdopath.cxx?rev=1459509&r1=1459508&r2=1459509&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/svdraw/svdopath.cxx (original)
+++ openoffice/branches/sidebar/main/svx/source/svdraw/svdopath.cxx Thu Mar 21 
20:23:16 2013
@@ -1038,8 +1038,8 @@ String ImpPathForDragAndCreate::getSpeci
                }
 
                // dx=0.00 dy=0.00                // Beide Seiten Bezier
-               // dx=0.00 dy=0.00  l=0.00 0.00ø  // Anfang oder Ende oder eine 
Seite Bezier bzw. Hebel
-               // dx=0.00 dy=0.00  l=0.00 0.00ø / l=0.00 0.00ø   // Mittendrin
+               // dx=0.00 dy=0.00  l=0.00 0.00? // Anfang oder Ende oder eine 
Seite Bezier bzw. Hebel
+               // dx=0.00 dy=0.00  l=0.00 0.00?/ l=0.00 0.00?  // Mittendrin
                XubString aMetr;
                Point aBeg(rDrag.GetStart());
                Point aNow(rDrag.GetNow());

Modified: openoffice/branches/sidebar/main/sw/sdi/_annotsh.sdi
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/sdi/_annotsh.sdi?rev=1459509&r1=1459508&r2=1459509&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sw/sdi/_annotsh.sdi (original)
+++ openoffice/branches/sidebar/main/sw/sdi/_annotsh.sdi Thu Mar 21 20:23:16 
2013
@@ -206,6 +206,13 @@ interface _Annotation
                StateMethod = GetState ;
                DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
        ]
+
+       SID_CHAR_DLG_EFFECT
+       [
+               ExecMethod = Exec ;
+               StateMethod = GetState ;
+               DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+       ]
        
        SID_ATTR_CHAR_WEIGHT // api:
        [

Modified: openoffice/branches/sidebar/main/sw/sdi/_textsh.sdi
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/sdi/_textsh.sdi?rev=1459509&r1=1459508&r2=1459509&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sw/sdi/_textsh.sdi (original)
+++ openoffice/branches/sidebar/main/sw/sdi/_textsh.sdi Thu Mar 21 20:23:16 2013
@@ -1446,6 +1446,12 @@ interface BaseText
                ExecMethod = Execute ;
                DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
        ]
+
+       SID_CHAR_DLG_EFFECT
+       [
+               ExecMethod = Execute ;
+               DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+       ]
     SID_CHAR_DLG_FOR_PARAGRAPH
     [
         ExecMethod = Execute ;

Modified: openoffice/branches/sidebar/main/sw/sdi/drwtxtsh.sdi
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/sdi/drwtxtsh.sdi?rev=1459509&r1=1459508&r2=1459509&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sw/sdi/drwtxtsh.sdi (original)
+++ openoffice/branches/sidebar/main/sw/sdi/drwtxtsh.sdi Thu Mar 21 20:23:16 
2013
@@ -299,6 +299,13 @@ interface TextDrawText
                StateMethod = GetState ;
                DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
        ]
+
+       SID_CHAR_DLG_EFFECT
+       [
+               ExecMethod = Execute ;
+               StateMethod = GetState ;
+               DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+       ]
     SID_CHAR_DLG_FOR_PARAGRAPH
     [
         ExecMethod = Execute ;

Modified: openoffice/branches/sidebar/main/sw/source/ui/shells/annotsh.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/source/ui/shells/annotsh.cxx?rev=1459509&r1=1459508&r2=1459509&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sw/source/ui/shells/annotsh.cxx (original)
+++ openoffice/branches/sidebar/main/sw/source/ui/shells/annotsh.cxx Thu Mar 21 
20:23:16 2013
@@ -428,6 +428,7 @@ void SwAnnotationShell::Exec( SfxRequest
                        delete pDialog;
                }
                break;
+               case SID_CHAR_DLG_EFFECT:
                case SID_CHAR_DLG:
                {
                        const SfxItemSet* pArgs = rReq.GetArgs();
@@ -452,6 +453,10 @@ void SwAnnotationShell::Exec( SfxRequest
 
                                SfxAbstractTabDialog* pDlg = 
pFact->CreateSwCharDlg( rView.GetWindow(), rView, aDlgAttr, DLG_CHAR,0, 
sal_True );
                                DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
+                               if (nSlot == SID_CHAR_DLG_EFFECT)
+                               {
+                                       pDlg->SetCurPageId(TP_CHAR_EXT);
+                               }
                                sal_uInt16 nRet = pDlg->Execute();
                                if(RET_OK == nRet )
                 {

Modified: openoffice/branches/sidebar/main/sw/source/ui/shells/drwtxtex.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/source/ui/shells/drwtxtex.cxx?rev=1459509&r1=1459508&r2=1459509&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sw/source/ui/shells/drwtxtex.cxx (original)
+++ openoffice/branches/sidebar/main/sw/source/ui/shells/drwtxtex.cxx Thu Mar 
21 20:23:16 2013
@@ -286,6 +286,7 @@ void SwDrawTextShell::Execute( SfxReques
                }
                break;
 
+               case SID_CHAR_DLG_EFFECT: 
                case SID_CHAR_DLG:
                case SID_CHAR_DLG_FOR_PARAGRAPH:
                {
@@ -317,6 +318,10 @@ void SwDrawTextShell::Execute( SfxReques
 
                 SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg( 
pView->GetWindow(), *pView, aDlgAttr, DLG_CHAR,0, sal_True );
                 DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                               if (nSlot == SID_CHAR_DLG_EFFECT)
+                               {
+                                       pDlg->SetCurPageId(TP_CHAR_EXT);
+                               }
                                sal_uInt16 nRet = pDlg->Execute();
                                if(RET_OK == nRet )
                 {

Modified: openoffice/branches/sidebar/main/sw/source/ui/shells/textsh1.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/source/ui/shells/textsh1.cxx?rev=1459509&r1=1459508&r2=1459509&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sw/source/ui/shells/textsh1.cxx (original)
+++ openoffice/branches/sidebar/main/sw/source/ui/shells/textsh1.cxx Thu Mar 21 
20:23:16 2013
@@ -185,6 +185,10 @@ void lcl_CharDialog( SwWrtShell &rWrtSh,
                if( FN_INSERT_HYPERLINK == nSlot )
                        pDlg->SetCurPageId(TP_CHAR_URL);
        }
+       if (nSlot == SID_CHAR_DLG_EFFECT)
+       {
+               pDlg->SetCurPageId(TP_CHAR_EXT);
+       }
 
        const SfxItemSet* pSet = NULL;
        if ( !bUseDialog )
@@ -838,6 +842,7 @@ void SwTextShell::Execute(SfxRequest &rR
             // intentionally no break
         }
                case SID_CHAR_DLG:
+               case SID_CHAR_DLG_EFFECT:
                {
             lcl_CharDialog( rWrtSh, bUseDialog, nSlot, pArgs, &rReq );
                }

Modified: openoffice/branches/sidebar/main/vcl/inc/vcl/button.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/vcl/inc/vcl/button.hxx?rev=1459509&r1=1459508&r2=1459509&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/vcl/inc/vcl/button.hxx (original)
+++ openoffice/branches/sidebar/main/vcl/inc/vcl/button.hxx Thu Mar 21 20:23:16 
2013
@@ -204,6 +204,9 @@ public:
 
     void            SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; }
     const Link&     GetToggleHdl() const { return maToggleHdl; }
+
+       virtual sal_Bool        CustomDraw( sal_uInt16 nButtonStyle, 
ControlState nState );
+
 };
 
 inline void PushButton::Check( sal_Bool bCheck )

Modified: openoffice/branches/sidebar/main/vcl/source/control/button.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/vcl/source/control/button.cxx?rev=1459509&r1=1459508&r2=1459509&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/vcl/source/control/button.cxx (original)
+++ openoffice/branches/sidebar/main/vcl/source/control/button.cxx Thu Mar 21 
20:23:16 2013
@@ -1131,6 +1131,17 @@ void PushButton::ImplDrawPushButton( boo
     }
 
     sal_Bool bDropDown = ( IsSymbol() && (GetSymbol()==SYMBOL_SPIN_DOWN) && 
!GetText().Len() );
+       ControlState        nState = 0;
+
+       if ( mbPressed )                                                nState 
|= CTRL_STATE_PRESSED;
+       if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED )       nState |= 
CTRL_STATE_PRESSED;
+       if ( HasFocus() )                                               nState 
|= CTRL_STATE_FOCUSED;
+       if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT )       nState |= 
CTRL_STATE_DEFAULT;
+       if ( Window::IsEnabled() )                              nState |= 
CTRL_STATE_ENABLED;
+
+       if ( IsMouseOver() && aInRect.IsInside( GetPointerPosPixel() ) )
+               nState |= CTRL_STATE_ROLLOVER;
+       if( CustomDraw( nButtonStyle, nState ) ) return;
 
     if( bDropDown && (aCtrlType == CTRL_COMBOBOX || aCtrlType == CTRL_LISTBOX 
) )
     {
@@ -4254,6 +4265,10 @@ TriStateBox::~TriStateBox()
 }
 
 // =======================================================================
+sal_Bool       PushButton::CustomDraw( sal_uInt16 nButtonStyle, ControlState 
nState )
+{
+       return sal_False;
+}
 
 DisclosureButton::DisclosureButton( Window* pParent, WinBits ) :
     CheckBox( pParent, WB_NOBORDER )


Reply via email to