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,\
cui/uiconfig/ui/optuserpage \
cui/uiconfig/ui/optviewpage \
cui/uiconfig/ui/pageformatpage \
cui/uiconfig/ui/paragalignpage \
cui/uiconfig/ui/paraindentspacing \
cui/uiconfig/ui/pastespecial \
cui/uiconfig/ui/personalization_tab \
cui/uiconfig/ui/pickbulletpage \
......
......@@ -54,46 +54,39 @@ class SvxStdParagraphTabPage: public SfxTabPage
private:
SvxStdParagraphTabPage( Window* pParent, const SfxItemSet& rSet );
FixedLine aIndentFrm;
// indention
FixedText aLeftLabel;
SvxRelativeField aLeftIndent;
SvxRelativeField* m_pLeftIndent;
FixedText aRightLabel;
SvxRelativeField aRightIndent;
FixedText* m_pRightLabel;
SvxRelativeField* m_pRightIndent;
FixedText aFLineLabel;
SvxRelativeField aFLineIndent;
CheckBox aAutoCB;
FixedLine aDistFrm;
FixedText* m_pFLineLabel;
SvxRelativeField* m_pFLineIndent;
CheckBox* m_pAutoCB;
// distance
FixedText aTopLabel;
SvxRelativeField aTopDist;
FixedText aBottomLabel;
SvxRelativeField aBottomDist;
CheckBox aContextualCB;
SvxRelativeField* m_pTopDist;
SvxRelativeField* m_pBottomDist;
CheckBox* m_pContextualCB;
// line spacing
FixedLine aLineDistFrm;
ListBox aLineDist;
FixedText aLineDistAtLabel;
MetricField aLineDistAtPercentBox;
MetricField aLineDistAtMetricBox;
String sAbsDist;
SvxParaPrevWindow aExampleWin;
ListBox* m_pLineDist;
FixedText* m_pLineDistAtLabel;
MetricField* m_pLineDistAtPercentBox;
MetricField* m_pLineDistAtMetricBox;
FixedText* m_pAbsDist;
OUString sAbsDist;
SvxParaPrevWindow* m_pExampleWin;
// only writer
FixedLine aRegisterFL;
CheckBox aRegisterCB;
VclFrame* m_pRegisterFL;
CheckBox* m_pRegisterCB;
Edit* pActLineDistFld;
long nAbst;
long nWidth;
long nMinFixDist;
sal_Bool bRelativeMode;
sal_Bool bNegativeIndents;
sal_Bool bRelativeMode;
sal_Bool bNegativeIndents;
void SetLineSpacing_Impl( const SvxLineSpacingItem& rAttr );
void Init_Impl();
......@@ -106,13 +99,14 @@ private:
protected:
virtual int DeactivatePage( SfxItemSet* pSet = 0 );
public:
DECL_LINK(ELRLoseFocusHdl, void *);
static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
static sal_uInt16* GetRanges();
static sal_uInt16* GetRanges();
virtual sal_Bool FillItemSet( SfxItemSet& rSet );
virtual sal_Bool FillItemSet( SfxItemSet& rSet );
virtual void Reset( const SfxItemSet& rSet );
......@@ -124,6 +118,8 @@ public:
void EnableAbsLineDist(long nMinTwip);
void EnableNegativeMode();
virtual void PageCreated(SfxAllItemSet aSet);
virtual ~SvxStdParagraphTabPage();
};
// class SvxParaAlignTabPage ------------------------------------------------
......@@ -133,28 +129,27 @@ class SvxParaAlignTabPage : public SfxTabPage
using TabPage::DeactivatePage;
// alignment
FixedLine aAlignFrm;
RadioButton aLeft;
RadioButton aRight;
RadioButton aCenter;
RadioButton aJustify;
FixedText aLastLineFT;
ListBox aLastLineLB;
CheckBox aExpandCB;
RadioButton* m_pLeft;
RadioButton* m_pRight;
RadioButton* m_pCenter;
RadioButton* m_pJustify;
FixedText* m_pLeftBottom;
FixedText* m_pRightTop;
CheckBox aSnapToGridCB;
FixedText* m_pLastLineFT;
ListBox* m_pLastLineLB;
CheckBox* m_pExpandCB;
CheckBox* m_pSnapToGridCB;
//preview
SvxParaPrevWindow aExampleWin;
SvxParaPrevWindow* m_pExampleWin;
//vertical alignment
FixedLine aVertAlignFL;
FixedText aVertAlignFT;
ListBox aVertAlignLB;
VclFrame* m_pVertAlignFL;
ListBox* m_pVertAlignLB;
FixedLine aPropertiesFL;
FixedText aTextDirectionFT;
svx::FrameDirectionListBox aTextDirectionLB;
VclFrame* m_pPropertiesFL;
svx::FrameDirectionListBox* m_pTextDirectionLB;
DECL_LINK(AlignHdl_Impl, void *);
DECL_LINK(LastLineHdl_Impl, void *);
......@@ -170,9 +165,9 @@ protected:
public:
static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
static sal_uInt16* GetRanges();
static sal_uInt16* GetRanges();
virtual sal_Bool FillItemSet( SfxItemSet& rSet );
virtual sal_Bool FillItemSet( SfxItemSet& rSet );
virtual void Reset( const SfxItemSet& rSet );
void EnableJustifyExt();
......
......@@ -21,55 +21,6 @@
// 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_PAGE_STYLE 5011
#endif
......
This diff is collapsed.
This diff is collapsed.
......@@ -96,6 +96,9 @@
<glade-widget-class title="Table Container" name="svxcorelo-SvxSimpleTableContainer"
generic-name="Simple Table Container" parent="GtkTreeView"
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"
generic-name="Page Preview Window" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
......@@ -183,7 +186,9 @@
<glade-widget-class title="Wrap Field" name="svxlo-WrapField"
generic-name="Wrap Field" parent="GtkSpinButton"
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"
generic-name="ComboBoxText" parent="GtkComboBoxText"
icon-name="widget-gtk-comboboxtext">
......
......@@ -41,7 +41,6 @@ class SVX_DLLPUBLIC SvxParaPrevWindow : public Window
{
using Window::Draw;
private:
Size aWinSize;
Size aSize;
// indentation
......@@ -49,48 +48,50 @@ private:
long nRightMargin;
short nFirstLineOfst;
// distances
sal_uInt16 nUpper;
sal_uInt16 nLower;
sal_uInt16 nUpper;
sal_uInt16 nLower;
// adjustment
SvxAdjust eAdjust;
// last line in justification
SvxAdjust eLastLine;
// line distance
SvxPrevLineSpace eLine;
sal_uInt16 nLineVal;
sal_uInt16 nLineVal;
String aText;
OUString aText;
Rectangle Lines[9];
protected:
virtual void Paint( const Rectangle& rRect );
virtual Size GetOptimalSize() const;
void DrawParagraph( sal_Bool bAll );
public:
SvxParaPrevWindow( Window* pParent, const ResId& rId );
SvxParaPrevWindow( Window* pParent, WinBits nBits);
void SetFirstLineOfst( short nNew ) { nFirstLineOfst = nNew; }
void SetLeftMargin( long nNew ) { nLeftMargin = nNew; }
void SetRightMargin( long nNew ) { nRightMargin = nNew; }
void SetUpper( sal_uInt16 nNew ) { nUpper = nNew; }
void SetLower( sal_uInt16 nNew ) { nLower = nNew; }
void SetFirstLineOfst( short nNew ) { nFirstLineOfst = nNew; }
void SetLeftMargin( long nNew ) { nLeftMargin = nNew; }
void SetRightMargin( long nNew ) { nRightMargin = nNew; }
void SetUpper( sal_uInt16 nNew ) { nUpper = nNew; }
void SetLower( sal_uInt16 nNew ) { nLower = nNew; }
void SetAdjust( SvxAdjust eNew ) { eAdjust = eNew; }
void SetLastLine( SvxAdjust eNew ) { eLastLine = eNew; }
void SetLineSpace( SvxPrevLineSpace eNew, sal_uInt16 nNew = 0 )
{ eLine = eNew; nLineVal = nNew; }
void SetText( const OUString& rStr ) { aText = rStr; }
void SetText( const OUString& rStr ) { aText = rStr; }
void SetSize( Size aNew ) { aSize = aNew; }
short GetFirstLineOfst() const { return nFirstLineOfst; }
long GetLeftMargin() const { return nLeftMargin; }
long GetRightMargin() const { return nRightMargin; }
sal_uInt16 GetUpper() const { return nUpper; }
sal_uInt16 GetLower() const { return nLower; }
sal_uInt16 GetUpper() const { return nUpper; }
sal_uInt16 GetLower() const { return nLower; }
SvxAdjust GetAdjust() const { return eAdjust; }
SvxPrevLineSpace GetLineEnum() const { return eLine; }
sal_uInt16 GetLineValue() const { return nLineVal; }
sal_uInt16 GetLineValue() const { return nLineVal; }
OUString GetText() const { return aText; }
Size GetSize() const { return aSize; }
......
......@@ -40,12 +40,13 @@ protected:
public:
SvxRelativeField( Window* pParent, const ResId& rResId );
SvxRelativeField( Window* pParent, WinBits nBits);
void EnableRelativeMode( sal_uInt16 nMin = 50, sal_uInt16 nMax = 150,
sal_uInt16 nStep = 5 );
sal_Bool IsRelativeMode() const { return bRelativeMode; }
sal_Bool IsRelativeMode() const { return bRelativeMode; }
void SetRelative( sal_Bool bRelative = sal_False );
sal_Bool IsRelative() const { return bRelative; }
sal_Bool IsRelative() const { return bRelative; }
void EnableNegativeMode() {bNegativeEnabled = sal_True;}
};
......
......@@ -18,6 +18,7 @@
*/
#include <svx/paraprev.hxx>
#include <vcl/builder.hxx>
// class SvxParaPrevWindow -----------------------------------------------
......@@ -38,18 +39,45 @@ SvxParaPrevWindow::SvxParaPrevWindow( Window* pParent, const ResId& rId ) :
{
// Count in Twips by default
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 );
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& )
......@@ -63,6 +91,13 @@ void SvxParaPrevWindow::Paint( const Rectangle& )
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 Color& rWinColor = rStyleSettings.GetWindowColor();
Color aGrayColor(COL_LIGHTGRAY);
......
......@@ -18,6 +18,7 @@
*/
#include "svx/relfld.hxx"
#include "vcl/builder.hxx"
// -----------------------------------------------------------------------
......@@ -32,7 +33,22 @@ SvxRelativeField::SvxRelativeField( Window* pParent, const ResId& rResId ) :
SetMin( 0 );
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()
......
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