Kaydet (Commit) 324141f2 authored tarafından Olivier Hallot's avatar Olivier Hallot Kaydeden (comit) Caolán McNamara

Convert Paragraph Alignment & Indent to Widget UI

Conver Paragraph Alignment and Indent & Spacing to widget UI.

Change-Id: Ib3b7d76a63bd677d5d94f7385bbf589f18eceeda
Reviewed-on: https://gerrit.libreoffice.org/4047Reviewed-by: 's avatarOlivier Hallot <olivier.hallot@edx.srv.br>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 878b09a1
...@@ -58,6 +58,8 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ ...@@ -58,6 +58,8 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/optuserpage \ cui/uiconfig/ui/optuserpage \
cui/uiconfig/ui/optviewpage \ cui/uiconfig/ui/optviewpage \
cui/uiconfig/ui/pageformatpage \ cui/uiconfig/ui/pageformatpage \
cui/uiconfig/ui/paragalignpage \
cui/uiconfig/ui/paraindentspacing \
cui/uiconfig/ui/pastespecial \ cui/uiconfig/ui/pastespecial \
cui/uiconfig/ui/personalization_tab \ cui/uiconfig/ui/personalization_tab \
cui/uiconfig/ui/pickbulletpage \ cui/uiconfig/ui/pickbulletpage \
......
...@@ -54,41 +54,34 @@ class SvxStdParagraphTabPage: public SfxTabPage ...@@ -54,41 +54,34 @@ class SvxStdParagraphTabPage: public SfxTabPage
private: private:
SvxStdParagraphTabPage( Window* pParent, const SfxItemSet& rSet ); SvxStdParagraphTabPage( Window* pParent, const SfxItemSet& rSet );
FixedLine aIndentFrm;
// indention // indention
FixedText aLeftLabel; SvxRelativeField* m_pLeftIndent;
SvxRelativeField aLeftIndent;
FixedText aRightLabel; FixedText* m_pRightLabel;
SvxRelativeField aRightIndent; SvxRelativeField* m_pRightIndent;
FixedText aFLineLabel; FixedText* m_pFLineLabel;
SvxRelativeField aFLineIndent; SvxRelativeField* m_pFLineIndent;
CheckBox aAutoCB; CheckBox* m_pAutoCB;
FixedLine aDistFrm;
// distance // distance
FixedText aTopLabel; SvxRelativeField* m_pTopDist;
SvxRelativeField aTopDist; SvxRelativeField* m_pBottomDist;
FixedText aBottomLabel; CheckBox* m_pContextualCB;
SvxRelativeField aBottomDist;
CheckBox aContextualCB;
// line spacing // line spacing
FixedLine aLineDistFrm; ListBox* m_pLineDist;
ListBox aLineDist; FixedText* m_pLineDistAtLabel;
FixedText aLineDistAtLabel; MetricField* m_pLineDistAtPercentBox;
MetricField aLineDistAtPercentBox; MetricField* m_pLineDistAtMetricBox;
MetricField aLineDistAtMetricBox; FixedText* m_pAbsDist;
String sAbsDist; OUString sAbsDist;
SvxParaPrevWindow aExampleWin; SvxParaPrevWindow* m_pExampleWin;
// only writer // only writer
FixedLine aRegisterFL; VclFrame* m_pRegisterFL;
CheckBox aRegisterCB; CheckBox* m_pRegisterCB;
Edit* pActLineDistFld;
long nAbst; long nAbst;
long nWidth; long nWidth;
long nMinFixDist; long nMinFixDist;
...@@ -106,6 +99,7 @@ private: ...@@ -106,6 +99,7 @@ private:
protected: protected:
virtual int DeactivatePage( SfxItemSet* pSet = 0 ); virtual int DeactivatePage( SfxItemSet* pSet = 0 );
public: public:
DECL_LINK(ELRLoseFocusHdl, void *); DECL_LINK(ELRLoseFocusHdl, void *);
...@@ -124,6 +118,8 @@ public: ...@@ -124,6 +118,8 @@ public:
void EnableAbsLineDist(long nMinTwip); void EnableAbsLineDist(long nMinTwip);
void EnableNegativeMode(); void EnableNegativeMode();
virtual void PageCreated(SfxAllItemSet aSet); virtual void PageCreated(SfxAllItemSet aSet);
virtual ~SvxStdParagraphTabPage();
}; };
// class SvxParaAlignTabPage ------------------------------------------------ // class SvxParaAlignTabPage ------------------------------------------------
...@@ -133,28 +129,27 @@ class SvxParaAlignTabPage : public SfxTabPage ...@@ -133,28 +129,27 @@ class SvxParaAlignTabPage : public SfxTabPage
using TabPage::DeactivatePage; using TabPage::DeactivatePage;
// alignment // alignment
FixedLine aAlignFrm; RadioButton* m_pLeft;
RadioButton aLeft; RadioButton* m_pRight;
RadioButton aRight; RadioButton* m_pCenter;
RadioButton aCenter; RadioButton* m_pJustify;
RadioButton aJustify; FixedText* m_pLeftBottom;
FixedText aLastLineFT; FixedText* m_pRightTop;
ListBox aLastLineLB;
CheckBox aExpandCB;
CheckBox aSnapToGridCB; FixedText* m_pLastLineFT;
ListBox* m_pLastLineLB;
CheckBox* m_pExpandCB;
CheckBox* m_pSnapToGridCB;
//preview //preview
SvxParaPrevWindow aExampleWin; SvxParaPrevWindow* m_pExampleWin;
//vertical alignment //vertical alignment
FixedLine aVertAlignFL; VclFrame* m_pVertAlignFL;
ListBox* m_pVertAlignLB;
FixedText aVertAlignFT;
ListBox aVertAlignLB;
FixedLine aPropertiesFL; VclFrame* m_pPropertiesFL;
FixedText aTextDirectionFT; svx::FrameDirectionListBox* m_pTextDirectionLB;
svx::FrameDirectionListBox aTextDirectionLB;
DECL_LINK(AlignHdl_Impl, void *); DECL_LINK(AlignHdl_Impl, void *);
DECL_LINK(LastLineHdl_Impl, void *); DECL_LINK(LastLineHdl_Impl, void *);
......
...@@ -21,55 +21,6 @@ ...@@ -21,55 +21,6 @@
// StandardTabPage ---------------------------------------------------------- // StandardTabPage ----------------------------------------------------------
#define FT_LEFTINDENT 10
#define ED_LEFTINDENT 11
#define FT_FLINEINDENT 12
#define ED_FLINEINDENT 13
#define FT_RIGHTINDENT 14
#define ED_RIGHTINDENT 15
#define FL_INDENT 16
#define FT_TOPDIST 20
#define ED_TOPDIST 21
#define FT_BOTTOMDIST 22
#define ED_BOTTOMDIST 23
#define FL_DIST 24
#define CB_CONTEXTUALSPACING 25
#define BTN_LEFTALIGN 30
#define BTN_RIGHTALIGN 31
#define BTN_CENTERALIGN 32
#define BTN_JUSTIFYALIGN 33
#define FL_ALIGN 34
#define FL_VERTALIGN 35
#define LB_VERTALIGN 36
#define CB_SNAP 38
#define FT_VERTALIGN 39
#define LB_LINEDIST 40
#define FT_LINEDIST 41
#define ED_LINEDISTPERCENT 42
#define ED_LINEDISTMETRIC 43
#define FL_LINEDIST 44
#define WN_EXAMPLE 46
#define CB_AUTO 48
#define FT_LASTLINE 49
#define LB_LASTLINE 50
#define CB_EXPAND 51
#define ST_LINEDIST_ABS 52
#define ST_LEFTALIGN_ASIAN 53
#define ST_RIGHTALIGN_ASIAN 54
#define CB_REGISTER 84
#define FL_REGISTER 85
#define FL_PROPERTIES 90
#define FT_TEXTDIRECTION 91
#define LB_TEXTDIRECTION 92
#define STR_EXAMPLE 5010 #define STR_EXAMPLE 5010
#define STR_PAGE_STYLE 5011 #define STR_PAGE_STYLE 5011
#endif #endif
......
This diff is collapsed.
This diff is collapsed.
...@@ -96,6 +96,9 @@ ...@@ -96,6 +96,9 @@
<glade-widget-class title="Table Container" name="svxcorelo-SvxSimpleTableContainer" <glade-widget-class title="Table Container" name="svxcorelo-SvxSimpleTableContainer"
generic-name="Simple Table Container" parent="GtkTreeView" generic-name="Simple Table Container" parent="GtkTreeView"
icon-name="widget-gtk-treeview"/> icon-name="widget-gtk-treeview"/>
<glade-widget-class title="Paragraph Preview" name="svxlo-SvxParaPrevWindow"
generic-name="Paragraph Preview Window" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="Page Preview" name="svxlo-SvxPageWindow" <glade-widget-class title="Page Preview" name="svxlo-SvxPageWindow"
generic-name="Page Preview Window" parent="GtkDrawingArea" generic-name="Page Preview Window" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/> icon-name="widget-gtk-drawingarea"/>
...@@ -183,7 +186,9 @@ ...@@ -183,7 +186,9 @@
<glade-widget-class title="Wrap Field" name="svxlo-WrapField" <glade-widget-class title="Wrap Field" name="svxlo-WrapField"
generic-name="Wrap Field" parent="GtkSpinButton" generic-name="Wrap Field" parent="GtkSpinButton"
icon-name="widget-gtk-spinbutton"/> icon-name="widget-gtk-spinbutton"/>
<glade-widget-class title="Relative Numeric Field" name="svxlo-SvxRelativeField"
generic-name="Relative Numeric Field" parent="GtkSpinButton"
icon-name="widget-gtk-spinbutton"/>
<glade-widget-class title="VclComboBoxText" name="VclComboBoxText" <glade-widget-class title="VclComboBoxText" name="VclComboBoxText"
generic-name="ComboBoxText" parent="GtkComboBoxText" generic-name="ComboBoxText" parent="GtkComboBoxText"
icon-name="widget-gtk-comboboxtext"> icon-name="widget-gtk-comboboxtext">
......
...@@ -41,7 +41,6 @@ class SVX_DLLPUBLIC SvxParaPrevWindow : public Window ...@@ -41,7 +41,6 @@ class SVX_DLLPUBLIC SvxParaPrevWindow : public Window
{ {
using Window::Draw; using Window::Draw;
private: private:
Size aWinSize;
Size aSize; Size aSize;
// indentation // indentation
...@@ -59,16 +58,18 @@ private: ...@@ -59,16 +58,18 @@ private:
SvxPrevLineSpace eLine; SvxPrevLineSpace eLine;
sal_uInt16 nLineVal; sal_uInt16 nLineVal;
String aText; OUString aText;
Rectangle Lines[9]; Rectangle Lines[9];
protected: protected:
virtual void Paint( const Rectangle& rRect ); virtual void Paint( const Rectangle& rRect );
virtual Size GetOptimalSize() const;
void DrawParagraph( sal_Bool bAll ); void DrawParagraph( sal_Bool bAll );
public: public:
SvxParaPrevWindow( Window* pParent, const ResId& rId ); SvxParaPrevWindow( Window* pParent, const ResId& rId );
SvxParaPrevWindow( Window* pParent, WinBits nBits);
void SetFirstLineOfst( short nNew ) { nFirstLineOfst = nNew; } void SetFirstLineOfst( short nNew ) { nFirstLineOfst = nNew; }
void SetLeftMargin( long nNew ) { nLeftMargin = nNew; } void SetLeftMargin( long nNew ) { nLeftMargin = nNew; }
......
...@@ -40,6 +40,7 @@ protected: ...@@ -40,6 +40,7 @@ protected:
public: public:
SvxRelativeField( Window* pParent, const ResId& rResId ); SvxRelativeField( Window* pParent, const ResId& rResId );
SvxRelativeField( Window* pParent, WinBits nBits);
void EnableRelativeMode( sal_uInt16 nMin = 50, sal_uInt16 nMax = 150, void EnableRelativeMode( sal_uInt16 nMin = 50, sal_uInt16 nMax = 150,
sal_uInt16 nStep = 5 ); sal_uInt16 nStep = 5 );
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
#include <svx/paraprev.hxx> #include <svx/paraprev.hxx>
#include <vcl/builder.hxx>
// class SvxParaPrevWindow ----------------------------------------------- // class SvxParaPrevWindow -----------------------------------------------
...@@ -38,18 +39,45 @@ SvxParaPrevWindow::SvxParaPrevWindow( Window* pParent, const ResId& rId ) : ...@@ -38,18 +39,45 @@ SvxParaPrevWindow::SvxParaPrevWindow( Window* pParent, const ResId& rId ) :
{ {
// Count in Twips by default // Count in Twips by default
SetMapMode( MapMode( MAP_TWIP ) ); SetMapMode( MapMode( MAP_TWIP ) );
aWinSize = GetOutputSizePixel();
aWinSize = PixelToLogic( aWinSize );
Size aTmp(1, 1);
aTmp = PixelToLogic(aTmp);
aWinSize.Width() -= aTmp.Width() /2;
aWinSize.Height() -= aTmp.Height() /2;
aSize = Size( 11905, 16837 ); aSize = Size( 11905, 16837 );
SetBorderStyle( WINDOW_BORDER_MONO ); SetBorderStyle( WINDOW_BORDER_MONO );
} }
SvxParaPrevWindow::SvxParaPrevWindow( Window* pParent, WinBits nBits) :
Window( pParent, nBits),
nLeftMargin ( 0 ),
nRightMargin ( 0 ),
nFirstLineOfst ( 0 ),
nUpper ( 0 ),
nLower ( 0 ),
eAdjust ( SVX_ADJUST_LEFT ),
eLastLine ( SVX_ADJUST_LEFT ),
eLine ( SVX_PREV_LINESPACE_1 ),
nLineVal ( 0 )
{
// Count in Twips by default
SetMapMode( MapMode( MAP_TWIP ) );
aSize = Size( 11905, 16837 );
SetBorderStyle( WINDOW_BORDER_MONO );
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxParaPrevWindow(Window *pParent, VclBuilder::stringmap &)
{
return new SvxParaPrevWindow(pParent, WB_BORDER);
}
Size SvxParaPrevWindow::GetOptimalSize() const
{
return LogicToPixel(Size(68 , 112), MAP_APPFONT);
}
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void SvxParaPrevWindow::Paint( const Rectangle& ) void SvxParaPrevWindow::Paint( const Rectangle& )
...@@ -63,6 +91,13 @@ void SvxParaPrevWindow::Paint( const Rectangle& ) ...@@ -63,6 +91,13 @@ void SvxParaPrevWindow::Paint( const Rectangle& )
void SvxParaPrevWindow::DrawParagraph( sal_Bool bAll ) void SvxParaPrevWindow::DrawParagraph( sal_Bool bAll )
{ {
Size aWinSize = GetOutputSizePixel();
aWinSize = PixelToLogic( aWinSize );
Size aTmp(1, 1);
aTmp = PixelToLogic(aTmp);
aWinSize.Width() -= aTmp.Width() /2;
aWinSize.Height() -= aTmp.Height() /2;
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
const Color& rWinColor = rStyleSettings.GetWindowColor(); const Color& rWinColor = rStyleSettings.GetWindowColor();
Color aGrayColor(COL_LIGHTGRAY); Color aGrayColor(COL_LIGHTGRAY);
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
#include "svx/relfld.hxx" #include "svx/relfld.hxx"
#include "vcl/builder.hxx"
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -32,7 +33,22 @@ SvxRelativeField::SvxRelativeField( Window* pParent, const ResId& rResId ) : ...@@ -32,7 +33,22 @@ SvxRelativeField::SvxRelativeField( Window* pParent, const ResId& rResId ) :
SetMin( 0 ); SetMin( 0 );
SetMax( 9999 ); SetMax( 9999 );
} }
SvxRelativeField::SvxRelativeField( Window* pParent, WinBits nBits) :
MetricField( pParent, nBits)
{
bNegativeEnabled = sal_False;
bRelativeMode = sal_False;
bRelative = sal_False;
SetDecimalDigits( 2 );
SetMin( 0 );
SetMax( 9999 );
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxRelativeField(Window *pParent, VclBuilder::stringmap &)
{
return new SvxRelativeField(pParent, WB_BORDER | WB_SPIN | WB_REPEAT | WB_LEFT | WB_GROUP);
}
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void SvxRelativeField::Modify() void SvxRelativeField::Modify()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment