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

Convert line tab page to widget UI

Change-Id: I26ee6e0b5b6d17dfb9a65d16aaee0db1b64f5e05
Reviewed-on: https://gerrit.libreoffice.org/5244Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst f3d2b533
......@@ -38,6 +38,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/insertoleobject \
cui/uiconfig/ui/insertplugin \
cui/uiconfig/ui/insertrowcolumn \
cui/uiconfig/ui/linetabpage \
cui/uiconfig/ui/macroselectordialog \
cui/uiconfig/ui/messbox \
cui/uiconfig/ui/namedialog \
......
......@@ -87,36 +87,32 @@ class SvxLineTabPage : public SvxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
private:
FixedLine aFlLine;
FixedText aFtLineStyle;
LineLB aLbLineStyle;
FixedText aFtColor;
ColorLB aLbColor;
FixedText aFtLineWidth;
MetricField aMtrLineWidth;
FixedText aFtTransparent;
MetricField aMtrTransparent;
FixedLine aFlLineEnds;
LineEndLB aLbStartStyle;
MetricField aMtrStartWidth;
TriStateBox aTsbCenterStart;
FixedText aFtLineEndsStyle;
LineEndLB aLbEndStyle;
FixedText aFtLineEndsWidth;
MetricField aMtrEndWidth;
TriStateBox aTsbCenterEnd;
CheckBox aCbxSynchronize;
FixedLine aFLSeparator;
SvxXLinePreview aCtlPreview;
VclBox* m_pBoxStyle;
LineLB* m_pLbLineStyle;
ColorLB* m_pLbColor;
MetricField* m_pMtrLineWidth;
MetricField* m_pMtrTransparent;
VclFrame* m_pFlLineEnds;
VclBox* m_pBoxArrowStyles;
LineEndLB* m_pLbStartStyle;
VclBox* m_pBoxStart;
MetricField* m_pMtrStartWidth;
TriStateBox* m_pTsbCenterStart;
VclBox* m_pBoxEnd;
LineEndLB* m_pLbEndStyle;
MetricField* m_pMtrEndWidth;
TriStateBox* m_pTsbCenterEnd;
CheckBox* m_pCbxSynchronize;
SvxXLinePreview* m_pCtlPreview;
// #116827#
FixedLine maFLEdgeStyle;
FixedText maFTEdgeStyle;
LineEndLB maLBEdgeStyle;
VclFrame* m_pFLEdgeStyle;
VclGrid* m_pGridEdgeCaps;
ListBox* m_pLBEdgeStyle;
// LineCaps
FixedText maFTCapStyle;
LineEndLB maLBCapStyle;
ListBox* m_pLBCapStyle;
//#58425# symbols on a line (e. g. StarChart) ->
/** a list of symbols to be shown in menu. Symbol at position SID_ATTR_SYMBOLTYPE is to be shown in preview.
......@@ -129,13 +125,12 @@ private:
long nSymbolType;
/// attributes for the shown symbols; only necessary if not equal to line properties
SfxItemSet* pSymbolAttr;
FixedLine aFlSymbol;
MenuButton aSymbolMB;
FixedText aSymbolWidthFT;
MetricField aSymbolWidthMF;
FixedText aSymbolHeightFT;
MetricField aSymbolHeightMF;
CheckBox aSymbolRatioCB;
VclFrame* m_pFlSymbol;
VclGrid* m_pGridIconSize;
MenuButton* m_pSymbolMB;
MetricField* m_pSymbolWidthMF;
MetricField* m_pSymbolHeightMF;
CheckBox* m_pSymbolRatioCB;
std::vector<OUString> aGrfNames;
SvxBmpItemInfoList aGrfBrushItems;
sal_Bool bLastWidthModified;
......
......@@ -246,7 +246,7 @@
#define HID_TPSHADOW_CTRL "CUI_HID_TPSHADOW_CTRL"
#define HID_LINE_ENDDEF "CUI_HID_LINE_ENDDEF"
#define HID_LINE_LINE "CUI_HID_LINE_LINE"
#define HID_LINE_DEF "CUI_HID_LINE_DEF"
#define HID_SPELLDLG_SETWORD "CUI_HID_SPELLDLG_SETWORD"
#define HID_PAGE_TEXTATTR "CUI_HID_PAGE_TEXTATTR"
......
......@@ -18,27 +18,6 @@
*/
#define TAB_CONTROL 1
#define LB_COLOR 1
#define FT_COLOR 1
#define LB_LINE_STYLE 2
#define FT_LINE_STYLE 3
#define FT_LINE_WIDTH 2
#define MTR_FLD_LINE_WIDTH 1
#define TSB_INVISIBLE 1
#define FL_LINE 1
#define FL_LINE_ENDS 2
#define FT_LINE_ENDS_STYLE 5
#define FT_LINE_ENDS_WIDTH 6
#define LB_START_STYLE 3
#define LB_END_STYLE 4
#define STR_STYLE (LB_END_STYLE+1)
#define STR_LB_START_STYLE 30
#define STR_LB_END_STYLE 31
#define STR_MTR_FLD_START_WIDTH 32
#define STR_MTR_FLD_END_WIDTH 33
#define STR_CENTER_START 34
#define STR_CENTER_END 35
#define STR_START_TYPE 36
#define STR_END_TYPE 37
#define STR_START_NUM 38
......@@ -46,8 +25,6 @@
#define STR_START_LENGTH 40
#define STR_END_LENGTH 41
#define MTR_FLD_START_WIDTH 3
#define MTR_FLD_END_WIDTH 2
#define CBX_SYNCHRONIZE 1
#define CTL_POSITION 2
#define FT_POSITION 9
......@@ -75,40 +52,7 @@
#define LB_LINEENDS 1
#define FL_TIP 1
#define FI_TIP 10
#define TSB_CENTER_START 4
#define TSB_CENTER_END 5
#define FT_TRANSPARENT 10
#define MTR_LINE_TRANSPARENT 5
#define FL_SEPARATOR 4
#define FT_LINE_END_STYLE 11
#define FT_TITLE 12
// #116827#
#define FL_EDGE_STYLE 5
#define FT_EDGE_STYLE 13
#define LB_EDGE_STYLE 5
// since LO3.6
#define FT_CAP_STYLE 14
#define LB_CAP_STYLE 6
// not sure about IAccessibility2, add it nevertheless
#define STR_LB_CAP_STYLE 42
//Symbole (fuer StarChart)
#define FT_SYMBOL_WIDTH 20
#define FT_SYMBOL_HEIGHT 21
#define MF_SYMBOL_WIDTH 22
#define MF_SYMBOL_HEIGHT 23
#define CB_SYMBOL_RATIO 24
#define FL_SYMBOL_FORMAT 25
#define MB_SYMBOL_BITMAP 26
#define MN_GRAPHIC_DLG 1
#define MN_GALLERY 2
#define MN_SYMBOLS 3
#define MN_SYMBOLS_NONE 4
#define MN_SYMBOLS_AUTO 5
#define MN_GALLERY_ENTRY 100
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -67,8 +67,8 @@
</properties>
</glade-widget-class>
<glade-widget-class title="Color ListBox" name="svtlo-ColorListBox"
generic-name="Color ListBox" parent="GtkComboBox"
<glade-widget-class title="Svt Color ListBox" name="svtlo-ColorListBox"
generic-name="Svt Color ListBox" parent="GtkComboBox"
icon-name="widget-gtk-combobox">
<properties>
<property save="True" query="False" id="dropdown" default="True" name="Use DropDown">
......@@ -79,8 +79,8 @@
</properties>
</glade-widget-class>
<glade-widget-class title="Other Color ListBox" name="svxlo-ColorLB"
generic-name="Other Color ListBox" parent="GtkComboBox"
<glade-widget-class title="Svx Color ListBox" name="svxlo-ColorLB"
generic-name="Svx Color ListBox" parent="GtkComboBox"
icon-name="widget-gtk-combobox">
<properties>
<property save="True" query="False" id="dropdown" default="True" name="Use DropDown">
......@@ -151,7 +151,31 @@
</properties>
</glade-widget-class>
<glade-widget-class title="Line ListBox" name="svtlo-LineListBox"
<glade-widget-class title="Svx Line End ListBox" name="svxlo-LineEndLB"
generic-name="Line End ListBox" parent="GtkComboBox"
icon-name="widget-gtk-combobox">
<properties>
<property save="True" query="False" id="dropdown" default="True" name="Use DropDown">
<parameter-spec>
<type>GParamBoolean</type>
</parameter-spec>
</property>
</properties>
</glade-widget-class>
<glade-widget-class title="Svx Line ListBox" name="svxlo-LineLB"
generic-name="Line ListBox" parent="GtkComboBox"
icon-name="widget-gtk-combobox">
<properties>
<property save="True" query="False" id="dropdown" default="True" name="Use DropDown">
<parameter-spec>
<type>GParamBoolean</type>
</parameter-spec>
</property>
</properties>
</glade-widget-class>
<glade-widget-class title="Svt Line ListBox" name="svtlo-LineListBox"
generic-name="Line ListBox" parent="GtkComboBox"
icon-name="widget-gtk-combobox">
<properties>
......@@ -218,6 +242,9 @@
<glade-widget-class title="Rectangle Preview" name="svxlo-SvxXRectPreview"
generic-name="Rectangle Preview Window" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="SvxXLinePreview" name="svxlo-SvxXLinePreview"
generic-name="Line Preview Window" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="Shadow Preview" name="svxlo-SvxXShadowPreview"
generic-name="Shadow Preview Window" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
......
......@@ -321,6 +321,7 @@ public:
void SelectEntryByList(const XDashList* pList, const String& rStr, const XDash& rDash, sal_uInt16 nDist = 0);
};
/************************************************************************/
class SVX_DLLPUBLIC LineEndLB : public ListBox
......@@ -340,6 +341,7 @@ public:
//////////////////////////////////////////////////////////////////////////////
class SdrObject;
class SdrPathObj;
class SdrModel;
class SvxPreviewBase : public Control
......@@ -380,9 +382,9 @@ public:
class SVX_DLLPUBLIC SvxXLinePreview : public SvxPreviewBase
{
private:
SdrObject* mpLineObjA;
SdrObject* mpLineObjB;
SdrObject* mpLineObjC;
SdrPathObj* mpLineObjA;
SdrPathObj* mpLineObjB;
SdrPathObj* mpLineObjC;
Graphic* mpGraphic;
sal_Bool mbWithSymbol;
......@@ -390,6 +392,7 @@ private:
public:
SvxXLinePreview( Window* pParent, const ResId& rResId );
SvxXLinePreview( Window* pParent );
virtual ~SvxXLinePreview();
void SetLineAttributes(const SfxItemSet& rItemSet);
......@@ -399,6 +402,7 @@ public:
void ResizeSymbol( const Size& s );
virtual void Paint( const Rectangle& rRect );
virtual void Resize();
};
/*************************************************************************
......
......@@ -1468,6 +1468,20 @@ LineLB::LineLB(Window* pParent, WinBits aWB)
// No EdgeBlending for LineStyle/Dash SetEdgeBlending(true);
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeLineLB(Window *pParent, VclBuilder::stringmap &rMap)
{
bool bDropdown = VclBuilder::extractDropdown(rMap);
WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE|WB_TABSTOP;
if (bDropdown)
nWinBits |= WB_DROPDOWN;
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinBits |= WB_BORDER;
LineLB *pListBox = new LineLB(pParent, nWinBits);
pListBox->EnableAutoSize(true);
return pListBox;
}
LineLB::~LineLB()
{
}
......@@ -1566,6 +1580,20 @@ LineEndLB::LineEndLB( Window* pParent, WinBits aWB )
// No EdgeBlending for LineEnds SetEdgeBlending(true);
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeLineEndLB(Window *pParent, VclBuilder::stringmap &rMap)
{
bool bDropdown = VclBuilder::extractDropdown(rMap);
WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE|WB_TABSTOP;
if (bDropdown)
nWinBits |= WB_DROPDOWN;
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinBits |= WB_BORDER;
LineEndLB *pListBox = new LineEndLB(pParent, nWinBits);
pListBox->EnableAutoSize(true);
return pListBox;
}
LineEndLB::~LineEndLB(void)
{
}
......@@ -1808,9 +1836,23 @@ SvxXLinePreview::SvxXLinePreview( Window* pParent, const ResId& rResId )
mpGraphic( 0L ),
mbWithSymbol( sal_False )
{
const Size aOutputSize(GetOutputSize());
InitSettings( sal_True, sal_True );
mpLineObjA = new SdrPathObj(OBJ_LINE);
mpLineObjA->SetModel(&getModel());
mpLineObjB = new SdrPathObj(OBJ_PLIN);
mpLineObjB->SetModel(&getModel());
mpLineObjC = new SdrPathObj(OBJ_PLIN);
mpLineObjC->SetModel(&getModel());
}
void SvxXLinePreview::Resize()
{
SvxPreviewBase::Resize();
const Size aOutputSize(GetOutputSize());
const sal_Int32 nDistance(500L);
const sal_Int32 nAvailableLength(aOutputSize.Width() - (4 * nDistance));
......@@ -1821,6 +1863,52 @@ SvxXLinePreview::SvxXLinePreview( Window* pParent, const ResId& rResId )
basegfx::B2DPolygon aPolygonA;
aPolygonA.append(aPointA1);
aPolygonA.append(aPointA2);
mpLineObjA->SetPathPoly(basegfx::B2DPolyPolygon(aPolygonA));
// create DrawObectB
const sal_Int32 aYPosB1((aOutputSize.Height() * 3) / 4);
const sal_Int32 aYPosB2((aOutputSize.Height() * 1) / 4);
const basegfx::B2DPoint aPointB1( aPointA2.getX() + nDistance, aYPosB1);
const basegfx::B2DPoint aPointB2( aPointB1.getX() + ((nAvailableLength * 2) / 20), aYPosB2 );
const basegfx::B2DPoint aPointB3( aPointB2.getX() + ((nAvailableLength * 2) / 20), aYPosB1 );
basegfx::B2DPolygon aPolygonB;
aPolygonB.append(aPointB1);
aPolygonB.append(aPointB2);
aPolygonB.append(aPointB3);
mpLineObjB->SetPathPoly(basegfx::B2DPolyPolygon(aPolygonB));
// create DrawObectC
basegfx::B2DPolygon aPolygonC;
const basegfx::B2DPoint aPointC1( aPointB3.getX() + nDistance, aYPosB1);
const basegfx::B2DPoint aPointC2( aPointC1.getX() + ((nAvailableLength * 1) / 20), aYPosB2 );
const basegfx::B2DPoint aPointC3( aPointC2.getX() + ((nAvailableLength * 1) / 20), aYPosB1 );
aPolygonC.append(aPointC1);
aPolygonC.append(aPointC2);
aPolygonC.append(aPointC3);
mpLineObjC->SetPathPoly(basegfx::B2DPolyPolygon(aPolygonC));
}
SvxXLinePreview::SvxXLinePreview( Window* pParent)
: SvxPreviewBase( pParent ),
mpLineObjA( 0L ),
mpLineObjB( 0L ),
mpLineObjC( 0L ),
mpGraphic( 0L ),
mbWithSymbol( sal_False )
{
const Size aOutputSize(GetOutputSize());
InitSettings( true, true );
const sal_Int32 nDistance(500L);
const sal_Int32 nAvailableLength(aOutputSize.Width() - (4 * nDistance));
// create DrawObjectA
const sal_Int32 aYPosA(aOutputSize.Height() / 2);
const basegfx::B2DPoint aPointA1( nDistance, aYPosA);
const basegfx::B2DPoint aPointA2( aPointA1.getX() + ((nAvailableLength * 14) / 20), aYPosA );
basegfx::B2DPolygon aPolygonA;
aPolygonA.append(aPointA1);
aPolygonA.append(aPointA2);
mpLineObjA = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPolygonA));
mpLineObjA->SetModel(&getModel());
......@@ -1848,12 +1936,20 @@ SvxXLinePreview::SvxXLinePreview( Window* pParent, const ResId& rResId )
mpLineObjC = new SdrPathObj(OBJ_PLIN, basegfx::B2DPolyPolygon(aPolygonC));
mpLineObjC->SetModel(&getModel());
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxXLinePreview(Window *pParent, VclBuilder::stringmap &)
{
return new SvxXLinePreview(pParent);
}
SvxXLinePreview::~SvxXLinePreview()
{
SdrObject::Free( mpLineObjA );
SdrObject::Free( mpLineObjB );
SdrObject::Free( mpLineObjC );
SdrObject *pFoo = mpLineObjA;
SdrObject::Free( pFoo );
pFoo = mpLineObjB;
SdrObject::Free( pFoo );
pFoo = mpLineObjC;
SdrObject::Free( pFoo );
}
// -----------------------------------------------------------------------
......
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