Kaydet (Commit) e97e62a4 authored tarafından Miklos Vajna's avatar Miklos Vajna

convert drawinglayer gradient dialog to new .ui

Change-Id: Iaa91d3b1ab47e02edc69c2b9abdb33ae097571cb
üst 0d47e4c4
...@@ -14,6 +14,7 @@ $(eval $(call gb_UI_add_uifiles,cui,\ ...@@ -14,6 +14,7 @@ $(eval $(call gb_UI_add_uifiles,cui,\
cui/uiconfig/ui/borderpage \ cui/uiconfig/ui/borderpage \
cui/uiconfig/ui/charnamepage \ cui/uiconfig/ui/charnamepage \
cui/uiconfig/ui/colorpage \ cui/uiconfig/ui/colorpage \
cui/uiconfig/ui/gradientpage \
cui/uiconfig/ui/colorconfigwin \ cui/uiconfig/ui/colorconfigwin \
cui/uiconfig/ui/effectspage \ cui/uiconfig/ui/effectspage \
cui/uiconfig/ui/hyphenate \ cui/uiconfig/ui/hyphenate \
......
...@@ -370,30 +370,26 @@ class SvxGradientTabPage : public SfxTabPage ...@@ -370,30 +370,26 @@ class SvxGradientTabPage : public SfxTabPage
using TabPage::DeactivatePage; using TabPage::DeactivatePage;
private: private:
FixedLine aFlProp; ListBox* m_pLbGradientType;
FixedText aFtType; FixedText* m_pFtCenterX;
ListBox aLbGradientType; MetricField* m_pMtrCenterX;
FixedText aFtCenterX; FixedText* m_pFtCenterY;
MetricField aMtrCenterX; MetricField* m_pMtrCenterY;
FixedText aFtCenterY; FixedText* m_pFtAngle;
MetricField aMtrCenterY; MetricField* m_pMtrAngle;
FixedText aFtAngle; FixedText* m_pFtAngleDegrees;
MetricField aMtrAngle; MetricField* m_pMtrBorder;
FixedText aFtBorder; ColorLB* m_pLbColorFrom;
MetricField aMtrBorder; MetricField* m_pMtrColorFrom;
FixedText aFtColorFrom; ColorLB* m_pLbColorTo;
ColorLB aLbColorFrom; MetricField* m_pMtrColorTo;
MetricField aMtrColorFrom; GradientLB* m_pLbGradients;
FixedText aFtColorTo; SvxXRectPreview* m_pCtlPreview;
ColorLB aLbColorTo; PushButton* m_pBtnAdd;
MetricField aMtrColorTo; PushButton* m_pBtnModify;
GradientLB aLbGradients; PushButton* m_pBtnDelete;
SvxXRectPreview aCtlPreview; PushButton* m_pBtnLoad;
PushButton aBtnAdd; PushButton* m_pBtnSave;
PushButton aBtnModify;
PushButton aBtnDelete;
ImageButton aBtnLoad;
ImageButton aBtnSave;
const SfxItemSet& rOutAttrs; const SfxItemSet& rOutAttrs;
......
...@@ -55,22 +55,6 @@ ...@@ -55,22 +55,6 @@
#define LB_HATCHINGS 4 #define LB_HATCHINGS 4
#define LB_LINE_TYPE 1 #define LB_LINE_TYPE 1
#define LB_LINE_COLOR 3 #define LB_LINE_COLOR 3
#define LB_GRADIENTS 3
#define LB_GRADIENT_TYPES 4
#define LB_COLOR_FROM 1
#define LB_COLOR_TO 2
#define FT_COLOR_FROM 1
#define FT_COLOR_TO 2
#define FT_CENTER_X 3
#define FT_CENTER_Y 5
#define FT_ANGLE 4
#define FT_BORDER 6
#define MTR_COLOR_FROM 4
#define MTR_COLOR_TO 5
#define MTR_CENTER_X 2
#define MTR_CENTER_Y 3
#define MTR_BORDER 6
#define MTR_ANGLE 1
#define NUM_FLD_STEPCOUNT 1 #define NUM_FLD_STEPCOUNT 1
#define FT_PIXEL_EDIT 4 #define FT_PIXEL_EDIT 4
#define CTL_PIXEL 2 #define CTL_PIXEL 2
......
...@@ -1001,271 +1001,6 @@ TabPage RID_SVXPAGE_BITMAP ...@@ -1001,271 +1001,6 @@ TabPage RID_SVXPAGE_BITMAP
}; };
}; };
// ------------------------------------------------------
TabPage RID_SVXPAGE_GRADIENT
{
HelpID = HID_AREA_GRADIENT ;
Hide = TRUE ;
Text [ en-US ] = "Gradients" ;
Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
FixedLine FL_PROP
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 248, 8 ) ;
Text [ en-US ] = "Properties";
};
FixedText FT_TYPE
{
Pos = MAP_APPFONT ( 12 , 16 ) ;
Size = MAP_APPFONT ( 26 , 8 ) ;
Text [ en-US ] = "Ty~pe" ;
};
ListBox LB_GRADIENT_TYPES
{
HelpID = "cui:ListBox:RID_SVXPAGE_GRADIENT:LB_GRADIENT_TYPES";
Border = TRUE ;
Pos = MAP_APPFONT ( 49 , 14 ) ;
Size = MAP_APPFONT ( 48, 63 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
StringList [ en-US ] =
{
< "Linear" ; Default ; > ;
< "Axial" ; Default ; > ;
< "Radial" ; Default ; > ;
< "Ellipsoid" ; Default ; > ;
< "Square" ; Default ; > ;
< "Rectangular" ; Default ; > ;
};
};
FixedText FT_CENTER_X
{
Pos = MAP_APPFONT ( 12 , 32 ) ;
Size = MAP_APPFONT ( 37 , 8 ) ;
Text [ en-US ] = "Center ~X" ;
};
MetricField MTR_CENTER_X
{
HelpID = "cui:MetricField:RID_SVXPAGE_GRADIENT:MTR_CENTER_X";
Border = TRUE ;
Pos = MAP_APPFONT ( 49 , 30 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Maximum = 100 ;
StrictFormat = TRUE ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
Last = 100 ;
SpinSize = 5 ;
};
FixedText FT_CENTER_Y
{
Pos = MAP_APPFONT ( 12 , 48 ) ;
Size = MAP_APPFONT ( 37 , 8 ) ;
Text [ en-US ] = "Center ~Y" ;
};
MetricField MTR_CENTER_Y
{
HelpID = "cui:MetricField:RID_SVXPAGE_GRADIENT:MTR_CENTER_Y";
Border = TRUE ;
Pos = MAP_APPFONT ( 49 , 46 ) ;
Size = MAP_APPFONT ( 40, 12 ) ;
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Maximum = 100 ;
StrictFormat = TRUE ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
Last = 100 ;
SpinSize = 5 ;
};
FixedText FT_ANGLE
{
Pos = MAP_APPFONT ( 12 , 64 ) ;
Size = MAP_APPFONT ( 37 , 8 ) ;
Text [ en-US ] = "A~ngle" ;
};
MetricField MTR_ANGLE
{
HelpID = "cui:MetricField:RID_SVXPAGE_GRADIENT:MTR_ANGLE";
Border = TRUE ;
Pos = MAP_APPFONT ( 49 , 62 ) ;
Size = MAP_APPFONT ( 40, 12 ) ;
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Maximum = 359 ;
Unit = FUNIT_CUSTOM ;
CustomUnitText [ en-US ] = " degrees" ;
Last = 359 ;
SpinSize = 15 ;
};
FixedText FT_BORDER
{
Pos = MAP_APPFONT ( 12 , 80 ) ;
Size = MAP_APPFONT ( 32 , 8 ) ;
Text [ en-US ] = "~Border" ;
};
MetricField MTR_BORDER
{
HelpID = "cui:MetricField:RID_SVXPAGE_GRADIENT:MTR_BORDER";
Border = TRUE ;
Pos = MAP_APPFONT ( 49 , 78 ) ;
Size = MAP_APPFONT ( 40, 12 ) ;
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Maximum = 100 ;
StrictFormat = TRUE ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
Last = 100 ;
SpinSize = 5 ;
};
FixedText FT_COLOR_FROM
{
Pos = MAP_APPFONT ( 12 , 99 ) ;
Size = MAP_APPFONT ( 32 , 8 ) ;
Text [ en-US ] = "~From" ;
};
ListBox LB_COLOR_FROM
{
HelpID = "cui:ListBox:RID_SVXPAGE_GRADIENT:LB_COLOR_FROM";
Border = TRUE ;
Pos = MAP_APPFONT ( 49 , 97 ) ;
Size = MAP_APPFONT ( 48, 100 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
DDExtraWidth = TRUE ;
};
MetricField MTR_COLOR_FROM
{
HelpID = "cui:MetricField:RID_SVXPAGE_GRADIENT:MTR_COLOR_FROM";
Border = TRUE ;
Pos = MAP_APPFONT ( 49 , 113 ) ;
Size = MAP_APPFONT ( 40, 12 ) ;
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Maximum = 100 ;
StrictFormat = TRUE ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
Last = 100 ;
SpinSize = 5 ;
};
FixedText FT_COLOR_TO
{
Pos = MAP_APPFONT ( 12 , 133 ) ;
Size = MAP_APPFONT ( 32 , 8 ) ;
Text [ en-US ] = "~To" ;
};
ListBox LB_COLOR_TO
{
HelpID = "cui:ListBox:RID_SVXPAGE_GRADIENT:LB_COLOR_TO";
Border = TRUE ;
Pos = MAP_APPFONT ( 49 , 131 ) ;
Size = MAP_APPFONT ( 48, 100 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
DDExtraWidth = TRUE ;
};
MetricField MTR_COLOR_TO
{
HelpID = "cui:MetricField:RID_SVXPAGE_GRADIENT:MTR_COLOR_TO";
Border = TRUE ;
Pos = MAP_APPFONT ( 49 , 147 ) ;
Size = MAP_APPFONT ( 40, 12 ) ;
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Maximum = 100 ;
StrictFormat = TRUE ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
Last = 100 ;
SpinSize = 5 ;
};
ListBox LB_GRADIENTS
{
HelpID = "cui:ListBox:RID_SVXPAGE_GRADIENT:LB_GRADIENTS";
Border = TRUE ;
Pos = MAP_APPFONT ( 103 , 14 ) ;
Size = MAP_APPFONT ( 88 , 110 ) ;
TabStop = TRUE ;
};
Control CTL_PREVIEW
{
Border = TRUE;
Pos = MAP_APPFONT ( 103 , 131 ) ;
Size = MAP_APPFONT ( 88 , 42 ) ;
};
PushButton BTN_ADD
{
HelpID = "cui:PushButton:RID_SVXPAGE_GRADIENT:BTN_ADD";
Pos = MAP_APPFONT ( 197 , 14 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Add..." ;
TabStop = TRUE ;
};
PushButton BTN_MODIFY
{
HelpID = "cui:PushButton:RID_SVXPAGE_GRADIENT:BTN_MODIFY";
Pos = MAP_APPFONT ( 197 , 32 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Modify..." ;
TabStop = TRUE ;
};
PushButton BTN_DELETE
{
HelpID = "cui:PushButton:RID_SVXPAGE_GRADIENT:BTN_DELETE";
Pos = MAP_APPFONT ( 197 , 68 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Delete..." ;
TabStop = TRUE ;
};
ImageButton BTN_LOAD
{
HelpID = "cui:ImageButton:RID_SVXPAGE_GRADIENT:BTN_LOAD";
Pos = MAP_APPFONT ( 197 , 104 ) ;
Size = MAP_APPFONT ( 16 , 16 ) ;
TabStop = TRUE ;
QuickHelpText [ en-US ] = "Load Gradients List";
ButtonImage = Image
{
ImageBitmap = Bitmap
{
File = "sc05501.bmp" ;
};
};
};
ImageButton BTN_SAVE
{
HelpID = "cui:ImageButton:RID_SVXPAGE_GRADIENT:BTN_SAVE";
Pos = MAP_APPFONT ( 217 , 104 ) ;
Size = MAP_APPFONT ( 16 , 16 ) ;
TabStop = TRUE ;
QuickHelpText [ en-US ] = "Save Gradients List";
ButtonImage = Image
{
ImageBitmap = Bitmap
{
File = "sc05502.bmp" ;
};
};
};
CheckBox BTN_EMBED
{
HelpID = "cui:ImageButton:RID_SVXPAGE_GRADIENT:BTN_EMBED";
Pos = MAP_APPFONT ( 197 , 124 ) ;
Size = MAP_APPFONT ( 122 , 10 ) ;
Text [ en-US ] = "Embed";
};
};
// ------------------------------------------------------ // ------------------------------------------------------
TabDialog RID_SVXDLG_AREA TabDialog RID_SVXDLG_AREA
{ {
......
...@@ -49,32 +49,7 @@ SvxGradientTabPage::SvxGradientTabPage ...@@ -49,32 +49,7 @@ SvxGradientTabPage::SvxGradientTabPage
Window* pParent, Window* pParent,
const SfxItemSet& rInAttrs const SfxItemSet& rInAttrs
) : ) :
SfxTabPage ( pParent, CUI_RES( RID_SVXPAGE_GRADIENT ), rInAttrs ), SfxTabPage ( pParent, "GradientPage", "cui/ui/gradientpage.ui", rInAttrs ),
aFlProp ( this, CUI_RES( FL_PROP ) ),
aFtType ( this, CUI_RES( FT_TYPE ) ),
aLbGradientType ( this, CUI_RES( LB_GRADIENT_TYPES ) ),
aFtCenterX ( this, CUI_RES( FT_CENTER_X ) ),
aMtrCenterX ( this, CUI_RES( MTR_CENTER_X ) ),
aFtCenterY ( this, CUI_RES( FT_CENTER_Y ) ),
aMtrCenterY ( this, CUI_RES( MTR_CENTER_Y ) ),
aFtAngle ( this, CUI_RES( FT_ANGLE ) ),
aMtrAngle ( this, CUI_RES( MTR_ANGLE ) ),
aFtBorder ( this, CUI_RES( FT_BORDER ) ),
aMtrBorder ( this, CUI_RES( MTR_BORDER ) ),
aFtColorFrom ( this, CUI_RES( FT_COLOR_FROM ) ),
aLbColorFrom ( this, CUI_RES( LB_COLOR_FROM ) ),
aMtrColorFrom ( this, CUI_RES( MTR_COLOR_FROM ) ),
aFtColorTo ( this, CUI_RES( FT_COLOR_TO ) ),
aLbColorTo ( this, CUI_RES( LB_COLOR_TO ) ),
aMtrColorTo ( this, CUI_RES( MTR_COLOR_TO ) ),
aLbGradients ( this, CUI_RES( LB_GRADIENTS ) ),
aCtlPreview ( this, CUI_RES( CTL_PREVIEW ) ),
aBtnAdd ( this, CUI_RES( BTN_ADD ) ),
aBtnModify ( this, CUI_RES( BTN_MODIFY ) ),
aBtnDelete ( this, CUI_RES( BTN_DELETE ) ),
aBtnLoad ( this, CUI_RES( BTN_LOAD ) ),
aBtnSave ( this, CUI_RES( BTN_SAVE ) ),
rOutAttrs ( rInAttrs ), rOutAttrs ( rInAttrs ),
...@@ -91,10 +66,37 @@ SvxGradientTabPage::SvxGradientTabPage ...@@ -91,10 +66,37 @@ SvxGradientTabPage::SvxGradientTabPage
aXFillAttr ( pXPool ), aXFillAttr ( pXPool ),
rXFSet ( aXFillAttr.GetItemSet() ) rXFSet ( aXFillAttr.GetItemSet() )
{ {
FreeResource(); get(m_pLbGradientType, "gradienttypelb");
get(m_pFtCenterX, "centerxft");
aCtlPreview.SetAccessibleName(String(CUI_RES(STR_EXAMPLE))); get(m_pMtrCenterX, "centerxmtr");
aLbGradients.SetAccessibleName( GetText()); get(m_pFtCenterY, "centeryft");
get(m_pMtrCenterY, "centerymtr");
get(m_pFtAngle, "angleft");
get(m_pMtrAngle, "anglemtr");
m_pMtrAngle->SetUnit(FUNIT_CUSTOM);
get(m_pFtAngleDegrees, "anglemtrdegrees");
m_pMtrAngle->SetCustomUnitText(m_pFtAngleDegrees->GetText());
get(m_pMtrBorder, "bordermtr");
get(m_pLbColorFrom, "colorfromlb");
get(m_pMtrColorFrom, "colorfrommtr");
get(m_pLbColorTo, "colortolb");
get(m_pMtrColorTo, "colortomtr");
get(m_pLbGradients, "gradientslb");
Size aSize = LogicToPixel(Size(88, 110), MAP_APPFONT);
m_pLbGradients->set_width_request(aSize.Width());
m_pLbGradients->set_height_request(aSize.Height());
get(m_pCtlPreview, "previewctl");
aSize = LogicToPixel(Size(88, 42), MAP_APPFONT);
m_pCtlPreview->set_width_request(aSize.Width());
m_pCtlPreview->set_height_request(aSize.Height());
get(m_pBtnAdd, "add");
get(m_pBtnModify, "modify");
get(m_pBtnDelete, "delete");
get(m_pBtnLoad, "load");
get(m_pBtnSave, "save");
m_pCtlPreview->SetAccessibleName(String(CUI_RES(STR_EXAMPLE)));
m_pLbGradients->SetAccessibleName( GetText());
// this page needs ExchangeSupport // this page needs ExchangeSupport
...@@ -102,56 +104,51 @@ SvxGradientTabPage::SvxGradientTabPage ...@@ -102,56 +104,51 @@ SvxGradientTabPage::SvxGradientTabPage
// as long as NOT supported by the item // as long as NOT supported by the item
aMtrColorTo.SetValue( 100 ); m_pMtrColorTo->SetValue( 100 );
aMtrColorFrom.SetValue( 100 ); m_pMtrColorFrom->SetValue( 100 );
// setting the output device // setting the output device
rXFSet.Put( aXFStyleItem ); rXFSet.Put( aXFStyleItem );
rXFSet.Put( aXGradientItem ); rXFSet.Put( aXGradientItem );
aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() ); m_pCtlPreview->SetAttributes( aXFillAttr.GetItemSet() );
// overload the handler // overload the handler
aLbGradients.SetSelectHdl( m_pLbGradients->SetSelectHdl(
LINK( this, SvxGradientTabPage, ChangeGradientHdl_Impl ) ); LINK( this, SvxGradientTabPage, ChangeGradientHdl_Impl ) );
aBtnAdd.SetClickHdl( LINK( this, SvxGradientTabPage, ClickAddHdl_Impl ) ); m_pBtnAdd->SetClickHdl( LINK( this, SvxGradientTabPage, ClickAddHdl_Impl ) );
aBtnModify.SetClickHdl( m_pBtnModify->SetClickHdl(
LINK( this, SvxGradientTabPage, ClickModifyHdl_Impl ) ); LINK( this, SvxGradientTabPage, ClickModifyHdl_Impl ) );
aBtnDelete.SetClickHdl( m_pBtnDelete->SetClickHdl(
LINK( this, SvxGradientTabPage, ClickDeleteHdl_Impl ) ); LINK( this, SvxGradientTabPage, ClickDeleteHdl_Impl ) );
Link aLink = LINK( this, SvxGradientTabPage, ModifiedHdl_Impl ); Link aLink = LINK( this, SvxGradientTabPage, ModifiedHdl_Impl );
aLbGradientType.SetSelectHdl( aLink ); m_pLbGradientType->SetSelectHdl( aLink );
aMtrCenterX.SetModifyHdl( aLink ); m_pMtrCenterX->SetModifyHdl( aLink );
aMtrCenterY.SetModifyHdl( aLink ); m_pMtrCenterY->SetModifyHdl( aLink );
aMtrAngle.SetModifyHdl( aLink ); m_pMtrAngle->SetModifyHdl( aLink );
aMtrBorder.SetModifyHdl( aLink ); m_pMtrBorder->SetModifyHdl( aLink );
aMtrColorFrom.SetModifyHdl( aLink ); m_pMtrColorFrom->SetModifyHdl( aLink );
aLbColorFrom.SetSelectHdl( aLink ); m_pLbColorFrom->SetSelectHdl( aLink );
aMtrColorTo.SetModifyHdl( aLink ); m_pMtrColorTo->SetModifyHdl( aLink );
aLbColorTo.SetSelectHdl( aLink ); m_pLbColorTo->SetSelectHdl( aLink );
aBtnLoad.SetClickHdl( m_pBtnLoad->SetClickHdl(
LINK( this, SvxGradientTabPage, ClickLoadHdl_Impl ) ); LINK( this, SvxGradientTabPage, ClickLoadHdl_Impl ) );
aBtnSave.SetClickHdl( m_pBtnSave->SetClickHdl(
LINK( this, SvxGradientTabPage, ClickSaveHdl_Impl ) ); LINK( this, SvxGradientTabPage, ClickSaveHdl_Impl ) );
aBtnAdd.SetAccessibleRelationMemberOf( &aFlProp );
aBtnModify.SetAccessibleRelationMemberOf( &aFlProp );
aBtnDelete.SetAccessibleRelationMemberOf( &aFlProp );
aLbGradients.SetAccessibleRelationLabeledBy(&aLbGradients);
// #i76307# always paint the preview in LTR, because this is what the document does // #i76307# always paint the preview in LTR, because this is what the document does
aCtlPreview.EnableRTL( sal_False ); m_pCtlPreview->EnableRTL( sal_False );
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void SvxGradientTabPage::Construct() void SvxGradientTabPage::Construct()
{ {
aLbColorFrom.Fill( pColorList ); m_pLbColorFrom->Fill( pColorList );
aLbColorTo.CopyEntries( aLbColorFrom ); m_pLbColorTo->CopyEntries( *m_pLbColorFrom );
aLbGradients.Fill( pGradientList ); m_pLbGradients->Fill( pGradientList );
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -175,28 +172,28 @@ void SvxGradientTabPage::ActivatePage( const SfxItemSet& ) ...@@ -175,28 +172,28 @@ void SvxGradientTabPage::ActivatePage( const SfxItemSet& )
pColorList = ( (SvxAreaTabDialog*) GetParentDialog() )->GetNewColorList(); pColorList = ( (SvxAreaTabDialog*) GetParentDialog() )->GetNewColorList();
// LbColorFrom // LbColorFrom
nPos = aLbColorFrom.GetSelectEntryPos(); nPos = m_pLbColorFrom->GetSelectEntryPos();
aLbColorFrom.Clear(); m_pLbColorFrom->Clear();
aLbColorFrom.Fill( pColorList ); m_pLbColorFrom->Fill( pColorList );
nCount = aLbColorFrom.GetEntryCount(); nCount = m_pLbColorFrom->GetEntryCount();
if( nCount == 0 ) if( nCount == 0 )
; // this case should not occur ; // this case should not occur
else if( nCount <= nPos ) else if( nCount <= nPos )
aLbColorFrom.SelectEntryPos( 0 ); m_pLbColorFrom->SelectEntryPos( 0 );
else else
aLbColorFrom.SelectEntryPos( nPos ); m_pLbColorFrom->SelectEntryPos( nPos );
// LbColorTo // LbColorTo
nPos = aLbColorTo.GetSelectEntryPos(); nPos = m_pLbColorTo->GetSelectEntryPos();
aLbColorTo.Clear(); m_pLbColorTo->Clear();
aLbColorTo.CopyEntries( aLbColorFrom ); m_pLbColorTo->CopyEntries( m_pLbColorFrom );
nCount = aLbColorTo.GetEntryCount(); nCount = m_pLbColorTo->GetEntryCount();
if( nCount == 0 ) if( nCount == 0 )
; // this case should not occur ; // this case should not occur
else if( nCount <= nPos ) else if( nCount <= nPos )
aLbColorTo.SelectEntryPos( 0 ); m_pLbColorTo->SelectEntryPos( 0 );
else else
aLbColorTo.SelectEntryPos( nPos ); m_pLbColorTo->SelectEntryPos( nPos );
ModifiedHdl_Impl( this ); ModifiedHdl_Impl( this );
} }
...@@ -219,7 +216,7 @@ void SvxGradientTabPage::ActivatePage( const SfxItemSet& ) ...@@ -219,7 +216,7 @@ void SvxGradientTabPage::ActivatePage( const SfxItemSet& )
if ( *pPageType == PT_GRADIENT && *pPos != LISTBOX_ENTRY_NOTFOUND ) if ( *pPageType == PT_GRADIENT && *pPos != LISTBOX_ENTRY_NOTFOUND )
{ {
aLbGradients.SelectEntryPos( *pPos ); m_pLbGradients->SelectEntryPos( *pPos );
} }
// colors could have been deleted // colors could have been deleted
ChangeGradientHdl_Impl( this ); ChangeGradientHdl_Impl( this );
...@@ -248,21 +245,21 @@ int SvxGradientTabPage::DeactivatePage( SfxItemSet* _pSet ) ...@@ -248,21 +245,21 @@ int SvxGradientTabPage::DeactivatePage( SfxItemSet* _pSet )
long SvxGradientTabPage::CheckChanges_Impl() long SvxGradientTabPage::CheckChanges_Impl()
{ {
// is used here in order to NOT lose changes // is used here in order to NOT lose changes
XGradient aTmpGradient( aLbColorFrom.GetSelectEntryColor(), XGradient aTmpGradient( m_pLbColorFrom->GetSelectEntryColor(),
aLbColorTo.GetSelectEntryColor(), m_pLbColorTo->GetSelectEntryColor(),
(XGradientStyle) aLbGradientType.GetSelectEntryPos(), (XGradientStyle) m_pLbGradientType->GetSelectEntryPos(),
static_cast<long>(aMtrAngle.GetValue() * 10), // should be changed in resource static_cast<long>(m_pMtrAngle->GetValue() * 10), // should be changed in resource
(sal_uInt16) aMtrCenterX.GetValue(), (sal_uInt16) m_pMtrCenterX->GetValue(),
(sal_uInt16) aMtrCenterY.GetValue(), (sal_uInt16) m_pMtrCenterY->GetValue(),
(sal_uInt16) aMtrBorder.GetValue(), (sal_uInt16) m_pMtrBorder->GetValue(),
(sal_uInt16) aMtrColorFrom.GetValue(), (sal_uInt16) m_pMtrColorFrom->GetValue(),
(sal_uInt16) aMtrColorTo.GetValue() ); (sal_uInt16) m_pMtrColorTo->GetValue() );
sal_uInt16 nPos = aLbGradients.GetSelectEntryPos(); sal_uInt16 nPos = m_pLbGradients->GetSelectEntryPos();
if( nPos != LISTBOX_ENTRY_NOTFOUND ) if( nPos != LISTBOX_ENTRY_NOTFOUND )
{ {
XGradient aGradient = pGradientList->GetGradient( nPos )->GetGradient(); XGradient aGradient = pGradientList->GetGradient( nPos )->GetGradient();
String aString = aLbGradients.GetSelectEntry(); String aString = m_pLbGradients->GetSelectEntry();
if( !( aTmpGradient == aGradient ) ) if( !( aTmpGradient == aGradient ) )
{ {
...@@ -292,7 +289,7 @@ long SvxGradientTabPage::CheckChanges_Impl() ...@@ -292,7 +289,7 @@ long SvxGradientTabPage::CheckChanges_Impl()
case RET_BTN_2: case RET_BTN_2:
{ {
ClickAddHdl_Impl( this ); ClickAddHdl_Impl( this );
nPos = aLbGradients.GetSelectEntryPos(); nPos = m_pLbGradients->GetSelectEntryPos();
aGradient = pGradientList->GetGradient( nPos )->GetGradient(); aGradient = pGradientList->GetGradient( nPos )->GetGradient();
} }
break; break;
...@@ -303,7 +300,7 @@ long SvxGradientTabPage::CheckChanges_Impl() ...@@ -303,7 +300,7 @@ long SvxGradientTabPage::CheckChanges_Impl()
delete aMessDlg; delete aMessDlg;
} }
} }
nPos = aLbGradients.GetSelectEntryPos(); nPos = m_pLbGradients->GetSelectEntryPos();
if( nPos != LISTBOX_ENTRY_NOTFOUND ) if( nPos != LISTBOX_ENTRY_NOTFOUND )
{ {
*pPos = nPos; *pPos = nPos;
...@@ -321,25 +318,25 @@ sal_Bool SvxGradientTabPage::FillItemSet( SfxItemSet& rSet ) ...@@ -321,25 +318,25 @@ sal_Bool SvxGradientTabPage::FillItemSet( SfxItemSet& rSet )
XGradient* pXGradient = NULL; XGradient* pXGradient = NULL;
String aString; String aString;
sal_uInt16 nPos = aLbGradients.GetSelectEntryPos(); sal_uInt16 nPos = m_pLbGradients->GetSelectEntryPos();
if( nPos != LISTBOX_ENTRY_NOTFOUND ) if( nPos != LISTBOX_ENTRY_NOTFOUND )
{ {
pXGradient = new XGradient( pGradientList->GetGradient( nPos )->GetGradient() ); pXGradient = new XGradient( pGradientList->GetGradient( nPos )->GetGradient() );
aString = aLbGradients.GetSelectEntry(); aString = m_pLbGradients->GetSelectEntry();
} }
else else
// gradient was passed (unidentified) // gradient was passed (unidentified)
{ {
pXGradient = new XGradient( aLbColorFrom.GetSelectEntryColor(), pXGradient = new XGradient( m_pLbColorFrom->GetSelectEntryColor(),
aLbColorTo.GetSelectEntryColor(), m_pLbColorTo->GetSelectEntryColor(),
(XGradientStyle) aLbGradientType.GetSelectEntryPos(), (XGradientStyle) m_pLbGradientType->GetSelectEntryPos(),
static_cast<long>(aMtrAngle.GetValue() * 10), // should be changed in resource static_cast<long>(m_pMtrAngle->GetValue() * 10), // should be changed in resource
(sal_uInt16) aMtrCenterX.GetValue(), (sal_uInt16) m_pMtrCenterX->GetValue(),
(sal_uInt16) aMtrCenterY.GetValue(), (sal_uInt16) m_pMtrCenterY->GetValue(),
(sal_uInt16) aMtrBorder.GetValue(), (sal_uInt16) m_pMtrBorder->GetValue(),
(sal_uInt16) aMtrColorFrom.GetValue(), (sal_uInt16) m_pMtrColorFrom->GetValue(),
(sal_uInt16) aMtrColorTo.GetValue() ); (sal_uInt16) m_pMtrColorTo->GetValue() );
} }
DBG_ASSERT( pXGradient, "XGradient konnte nicht erzeugt werden" ); DBG_ASSERT( pXGradient, "XGradient konnte nicht erzeugt werden" );
rSet.Put( XFillStyleItem( XFILL_GRADIENT ) ); rSet.Put( XFillStyleItem( XFILL_GRADIENT ) );
...@@ -354,21 +351,21 @@ sal_Bool SvxGradientTabPage::FillItemSet( SfxItemSet& rSet ) ...@@ -354,21 +351,21 @@ sal_Bool SvxGradientTabPage::FillItemSet( SfxItemSet& rSet )
void SvxGradientTabPage::Reset( const SfxItemSet& ) void SvxGradientTabPage::Reset( const SfxItemSet& )
{ {
// aLbGradients.SelectEntryPos( 0 ); // m_pLbGradients->SelectEntryPos( 0 );
ChangeGradientHdl_Impl( this ); ChangeGradientHdl_Impl( this );
// determine state of the buttons // determine state of the buttons
if( pGradientList->Count() ) if( pGradientList->Count() )
{ {
aBtnModify.Enable(); m_pBtnModify->Enable();
aBtnDelete.Enable(); m_pBtnDelete->Enable();
aBtnSave.Enable(); m_pBtnSave->Enable();
} }
else else
{ {
aBtnModify.Disable(); m_pBtnModify->Disable();
aBtnDelete.Disable(); m_pBtnDelete->Disable();
aBtnSave.Disable(); m_pBtnSave->Disable();
} }
} }
...@@ -384,27 +381,27 @@ SfxTabPage* SvxGradientTabPage::Create( Window* pWindow, ...@@ -384,27 +381,27 @@ SfxTabPage* SvxGradientTabPage::Create( Window* pWindow,
IMPL_LINK( SvxGradientTabPage, ModifiedHdl_Impl, void *, pControl ) IMPL_LINK( SvxGradientTabPage, ModifiedHdl_Impl, void *, pControl )
{ {
XGradientStyle eXGS = (XGradientStyle) aLbGradientType.GetSelectEntryPos(); XGradientStyle eXGS = (XGradientStyle) m_pLbGradientType->GetSelectEntryPos();
XGradient aXGradient( aLbColorFrom.GetSelectEntryColor(), XGradient aXGradient( m_pLbColorFrom->GetSelectEntryColor(),
aLbColorTo.GetSelectEntryColor(), m_pLbColorTo->GetSelectEntryColor(),
eXGS, eXGS,
static_cast<long>(aMtrAngle.GetValue() * 10), // should be changed in resource static_cast<long>(m_pMtrAngle->GetValue() * 10), // should be changed in resource
(sal_uInt16) aMtrCenterX.GetValue(), (sal_uInt16) m_pMtrCenterX->GetValue(),
(sal_uInt16) aMtrCenterY.GetValue(), (sal_uInt16) m_pMtrCenterY->GetValue(),
(sal_uInt16) aMtrBorder.GetValue(), (sal_uInt16) m_pMtrBorder->GetValue(),
(sal_uInt16) aMtrColorFrom.GetValue(), (sal_uInt16) m_pMtrColorFrom->GetValue(),
(sal_uInt16) aMtrColorTo.GetValue() ); (sal_uInt16) m_pMtrColorTo->GetValue() );
// enable/disable controls // enable/disable controls
if( pControl == &aLbGradientType || pControl == this ) if( pControl == m_pLbGradientType || pControl == this )
SetControlState_Impl( eXGS ); SetControlState_Impl( eXGS );
// displaying in XOutDev // displaying in XOutDev
rXFSet.Put( XFillGradientItem( String(), aXGradient ) ); rXFSet.Put( XFillGradientItem( String(), aXGradient ) );
aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() ); m_pCtlPreview->SetAttributes( aXFillAttr.GetItemSet() );
aCtlPreview.Invalidate(); m_pCtlPreview->Invalidate();
return 0L; return 0L;
} }
...@@ -473,26 +470,26 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl) ...@@ -473,26 +470,26 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl)
if( !nError ) if( !nError )
{ {
XGradient aXGradient( aLbColorFrom.GetSelectEntryColor(), XGradient aXGradient( m_pLbColorFrom->GetSelectEntryColor(),
aLbColorTo.GetSelectEntryColor(), m_pLbColorTo->GetSelectEntryColor(),
(XGradientStyle) aLbGradientType.GetSelectEntryPos(), (XGradientStyle) m_pLbGradientType->GetSelectEntryPos(),
static_cast<long>(aMtrAngle.GetValue() * 10), // should be changed in resource static_cast<long>(m_pMtrAngle->GetValue() * 10), // should be changed in resource
(sal_uInt16) aMtrCenterX.GetValue(), (sal_uInt16) m_pMtrCenterX->GetValue(),
(sal_uInt16) aMtrCenterY.GetValue(), (sal_uInt16) m_pMtrCenterY->GetValue(),
(sal_uInt16) aMtrBorder.GetValue(), (sal_uInt16) m_pMtrBorder->GetValue(),
(sal_uInt16) aMtrColorFrom.GetValue(), (sal_uInt16) m_pMtrColorFrom->GetValue(),
(sal_uInt16) aMtrColorTo.GetValue() ); (sal_uInt16) m_pMtrColorTo->GetValue() );
XGradientEntry* pEntry = new XGradientEntry( aXGradient, aName ); XGradientEntry* pEntry = new XGradientEntry( aXGradient, aName );
pGradientList->Insert( pEntry, nCount ); pGradientList->Insert( pEntry, nCount );
aLbGradients.Append( pEntry ); m_pLbGradients->Append( pEntry );
aLbGradients.SelectEntryPos( aLbGradients.GetEntryCount() - 1 ); m_pLbGradients->SelectEntryPos( m_pLbGradients->GetEntryCount() - 1 );
#ifdef WNT #ifdef WNT
// hack: #31355# W.P. // hack: #31355# W.P.
Rectangle aRect( aLbGradients.GetPosPixel(), aLbGradients.GetSizePixel() ); Rectangle aRect( m_pLbGradients->GetPosPixel(), m_pLbGradients->GetSizePixel() );
if( sal_True ) { // ??? overlapped with pDlg if( sal_True ) { // ??? overlapped with pDlg
// and srolling // and srolling
Invalidate( aRect ); Invalidate( aRect );
...@@ -507,9 +504,9 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl) ...@@ -507,9 +504,9 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl)
// determine button state // determine button state
if( pGradientList->Count() ) if( pGradientList->Count() )
{ {
aBtnModify.Enable(); m_pBtnModify->Enable();
aBtnDelete.Enable(); m_pBtnDelete->Enable();
aBtnSave.Enable(); m_pBtnSave->Enable();
} }
return 0L; return 0L;
} }
...@@ -518,7 +515,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl) ...@@ -518,7 +515,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl)
IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl) IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl)
{ {
sal_uInt16 nPos = aLbGradients.GetSelectEntryPos(); sal_uInt16 nPos = m_pLbGradients->GetSelectEntryPos();
if ( nPos != LISTBOX_ENTRY_NOTFOUND ) if ( nPos != LISTBOX_ENTRY_NOTFOUND )
{ {
...@@ -552,23 +549,23 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl) ...@@ -552,23 +549,23 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl)
if( bDifferent ) if( bDifferent )
{ {
bLoop = sal_False; bLoop = sal_False;
XGradient aXGradient( aLbColorFrom.GetSelectEntryColor(), XGradient aXGradient( m_pLbColorFrom->GetSelectEntryColor(),
aLbColorTo.GetSelectEntryColor(), m_pLbColorTo->GetSelectEntryColor(),
(XGradientStyle) aLbGradientType.GetSelectEntryPos(), (XGradientStyle) m_pLbGradientType->GetSelectEntryPos(),
static_cast<long>(aMtrAngle.GetValue() * 10), // should be changed in resource static_cast<long>(m_pMtrAngle->GetValue() * 10), // should be changed in resource
(sal_uInt16) aMtrCenterX.GetValue(), (sal_uInt16) m_pMtrCenterX->GetValue(),
(sal_uInt16) aMtrCenterY.GetValue(), (sal_uInt16) m_pMtrCenterY->GetValue(),
(sal_uInt16) aMtrBorder.GetValue(), (sal_uInt16) m_pMtrBorder->GetValue(),
(sal_uInt16) aMtrColorFrom.GetValue(), (sal_uInt16) m_pMtrColorFrom->GetValue(),
(sal_uInt16) aMtrColorTo.GetValue() ); (sal_uInt16) m_pMtrColorTo->GetValue() );
XGradientEntry* pEntry = new XGradientEntry( aXGradient, aName ); XGradientEntry* pEntry = new XGradientEntry( aXGradient, aName );
delete pGradientList->Replace( pEntry, nPos ); delete pGradientList->Replace( pEntry, nPos );
aLbGradients.Modify( pEntry, nPos ); m_pLbGradients->Modify( pEntry, nPos );
aLbGradients.SelectEntryPos( nPos ); m_pLbGradients->SelectEntryPos( nPos );
*pnGradientListState |= CT_MODIFIED; *pnGradientListState |= CT_MODIFIED;
} }
...@@ -589,7 +586,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl) ...@@ -589,7 +586,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl)
IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl) IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl)
{ {
sal_uInt16 nPos = aLbGradients.GetSelectEntryPos(); sal_uInt16 nPos = m_pLbGradients->GetSelectEntryPos();
if( nPos != LISTBOX_ENTRY_NOTFOUND ) if( nPos != LISTBOX_ENTRY_NOTFOUND )
{ {
...@@ -599,10 +596,10 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl) ...@@ -599,10 +596,10 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl)
if ( aQueryBox.Execute() == RET_YES ) if ( aQueryBox.Execute() == RET_YES )
{ {
delete pGradientList->Remove( nPos ); delete pGradientList->Remove( nPos );
aLbGradients.RemoveEntry( nPos ); m_pLbGradients->RemoveEntry( nPos );
aLbGradients.SelectEntryPos( 0 ); m_pLbGradients->SelectEntryPos( 0 );
aCtlPreview.Invalidate(); m_pCtlPreview->Invalidate();
ChangeGradientHdl_Impl( this ); ChangeGradientHdl_Impl( this );
...@@ -612,9 +609,9 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl) ...@@ -612,9 +609,9 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl)
// determine button state // determine button state
if( !pGradientList->Count() ) if( !pGradientList->Count() )
{ {
aBtnModify.Disable(); m_pBtnModify->Disable();
aBtnDelete.Disable(); m_pBtnDelete->Disable();
aBtnSave.Disable(); m_pBtnSave->Disable();
} }
return 0L; return 0L;
} }
...@@ -666,8 +663,8 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickLoadHdl_Impl) ...@@ -666,8 +663,8 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickLoadHdl_Impl)
( (SvxAreaTabDialog*) GetParentDialog() )-> ( (SvxAreaTabDialog*) GetParentDialog() )->
SetNewGradientList( pGradientList ); SetNewGradientList( pGradientList );
aLbGradients.Clear(); m_pLbGradients->Clear();
aLbGradients.Fill( pGradientList ); m_pLbGradients->Fill( pGradientList );
Reset( rOutAttrs ); Reset( rOutAttrs );
pGradientList->SetName( aURL.getName() ); pGradientList->SetName( aURL.getName() );
...@@ -701,15 +698,15 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickLoadHdl_Impl) ...@@ -701,15 +698,15 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickLoadHdl_Impl)
// determine button state // determine button state
if( pGradientList->Count() ) if( pGradientList->Count() )
{ {
aBtnModify.Enable(); m_pBtnModify->Enable();
aBtnDelete.Enable(); m_pBtnDelete->Enable();
aBtnSave.Enable(); m_pBtnSave->Enable();
} }
else else
{ {
aBtnModify.Disable(); m_pBtnModify->Disable();
aBtnDelete.Disable(); m_pBtnDelete->Disable();
aBtnSave.Disable(); m_pBtnSave->Disable();
} }
return 0L; return 0L;
} }
...@@ -779,7 +776,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickSaveHdl_Impl) ...@@ -779,7 +776,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickSaveHdl_Impl)
IMPL_LINK_NOARG(SvxGradientTabPage, ChangeGradientHdl_Impl) IMPL_LINK_NOARG(SvxGradientTabPage, ChangeGradientHdl_Impl)
{ {
XGradient* pGradient = NULL; XGradient* pGradient = NULL;
int nPos = aLbGradients.GetSelectEntryPos(); int nPos = m_pLbGradients->GetSelectEntryPos();
if( nPos != LISTBOX_ENTRY_NOTFOUND ) if( nPos != LISTBOX_ENTRY_NOTFOUND )
pGradient = new XGradient( ( (XGradientEntry*) pGradientList->GetGradient( nPos ) )->GetGradient() ); pGradient = new XGradient( ( (XGradientEntry*) pGradientList->GetGradient( nPos ) )->GetGradient() );
...@@ -796,8 +793,8 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ChangeGradientHdl_Impl) ...@@ -796,8 +793,8 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ChangeGradientHdl_Impl)
} }
if( !pGradient ) if( !pGradient )
{ {
aLbGradients.SelectEntryPos( 0 ); m_pLbGradients->SelectEntryPos( 0 );
nPos = aLbGradients.GetSelectEntryPos(); nPos = m_pLbGradients->GetSelectEntryPos();
if( nPos != LISTBOX_ENTRY_NOTFOUND ) if( nPos != LISTBOX_ENTRY_NOTFOUND )
pGradient = new XGradient( ( (XGradientEntry*) pGradientList->GetGradient( nPos ) )->GetGradient() ); pGradient = new XGradient( ( (XGradientEntry*) pGradientList->GetGradient( nPos ) )->GetGradient() );
} }
...@@ -807,43 +804,43 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ChangeGradientHdl_Impl) ...@@ -807,43 +804,43 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ChangeGradientHdl_Impl)
{ {
XGradientStyle eXGS = pGradient->GetGradientStyle(); XGradientStyle eXGS = pGradient->GetGradientStyle();
aLbGradientType.SelectEntryPos( m_pLbGradientType->SelectEntryPos(
sal::static_int_cast< sal_uInt16 >( eXGS ) ); sal::static_int_cast< sal_uInt16 >( eXGS ) );
// if the entry is not in the listbox ist, // if the entry is not in the listbox ist,
// colors are added temporarily // colors are added temporarily
aLbColorFrom.SetNoSelection(); m_pLbColorFrom->SetNoSelection();
aLbColorFrom.SelectEntry( pGradient->GetStartColor() ); m_pLbColorFrom->SelectEntry( pGradient->GetStartColor() );
if ( aLbColorFrom.GetSelectEntryCount() == 0 ) if ( m_pLbColorFrom->GetSelectEntryCount() == 0 )
{ {
aLbColorFrom.InsertEntry( pGradient->GetStartColor(), m_pLbColorFrom->InsertEntry( pGradient->GetStartColor(),
String() ); String() );
aLbColorFrom.SelectEntry( pGradient->GetStartColor() ); m_pLbColorFrom->SelectEntry( pGradient->GetStartColor() );
} }
aLbColorTo.SetNoSelection(); m_pLbColorTo->SetNoSelection();
aLbColorTo.SelectEntry( pGradient->GetEndColor() ); m_pLbColorTo->SelectEntry( pGradient->GetEndColor() );
if ( aLbColorTo.GetSelectEntryCount() == 0 ) if ( m_pLbColorTo->GetSelectEntryCount() == 0 )
{ {
aLbColorTo.InsertEntry( pGradient->GetEndColor(), String() ); m_pLbColorTo->InsertEntry( pGradient->GetEndColor(), String() );
aLbColorTo.SelectEntry( pGradient->GetEndColor() ); m_pLbColorTo->SelectEntry( pGradient->GetEndColor() );
} }
aMtrAngle.SetValue( pGradient->GetAngle() / 10 ); // should be changed in resource m_pMtrAngle->SetValue( pGradient->GetAngle() / 10 ); // should be changed in resource
aMtrBorder.SetValue( pGradient->GetBorder() ); m_pMtrBorder->SetValue( pGradient->GetBorder() );
aMtrCenterX.SetValue( pGradient->GetXOffset() ); m_pMtrCenterX->SetValue( pGradient->GetXOffset() );
aMtrCenterY.SetValue( pGradient->GetYOffset() ); m_pMtrCenterY->SetValue( pGradient->GetYOffset() );
aMtrColorFrom.SetValue( pGradient->GetStartIntens() ); m_pMtrColorFrom->SetValue( pGradient->GetStartIntens() );
aMtrColorTo.SetValue( pGradient->GetEndIntens() ); m_pMtrColorTo->SetValue( pGradient->GetEndIntens() );
// disable/enable controls // disable/enable controls
SetControlState_Impl( eXGS ); SetControlState_Impl( eXGS );
// fill ItemSet and pass it on to aCtlPreview // fill ItemSet and pass it on to aCtlPreview
rXFSet.Put( XFillGradientItem( String(), *pGradient ) ); rXFSet.Put( XFillGradientItem( String(), *pGradient ) );
aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() ); m_pCtlPreview->SetAttributes( aXFillAttr.GetItemSet() );
aCtlPreview.Invalidate(); m_pCtlPreview->Invalidate();
delete pGradient; delete pGradient;
} }
return 0L; return 0L;
...@@ -857,40 +854,40 @@ void SvxGradientTabPage::SetControlState_Impl( XGradientStyle eXGS ) ...@@ -857,40 +854,40 @@ void SvxGradientTabPage::SetControlState_Impl( XGradientStyle eXGS )
{ {
case XGRAD_LINEAR: case XGRAD_LINEAR:
case XGRAD_AXIAL: case XGRAD_AXIAL:
aFtCenterX.Disable(); m_pFtCenterX->Disable();
aMtrCenterX.Disable(); m_pMtrCenterX->Disable();
aFtCenterY.Disable(); m_pFtCenterY->Disable();
aMtrCenterY.Disable(); m_pMtrCenterY->Disable();
aFtAngle.Enable(); m_pFtAngle->Enable();
aMtrAngle.Enable(); m_pMtrAngle->Enable();
break; break;
case XGRAD_RADIAL: case XGRAD_RADIAL:
aFtCenterX.Enable(); m_pFtCenterX->Enable();
aMtrCenterX.Enable(); m_pMtrCenterX->Enable();
aFtCenterY.Enable(); m_pFtCenterY->Enable();
aMtrCenterY.Enable(); m_pMtrCenterY->Enable();
aFtAngle.Disable(); m_pFtAngle->Disable();
aMtrAngle.Disable(); m_pMtrAngle->Disable();
break; break;
case XGRAD_ELLIPTICAL: case XGRAD_ELLIPTICAL:
aFtCenterX.Enable(); m_pFtCenterX->Enable();
aMtrCenterX.Enable(); m_pMtrCenterX->Enable();
aFtCenterY.Enable(); m_pFtCenterY->Enable();
aMtrCenterY.Enable(); m_pMtrCenterY->Enable();
aFtAngle.Enable(); m_pFtAngle->Enable();
aMtrAngle.Enable(); m_pMtrAngle->Enable();
break; break;
case XGRAD_SQUARE: case XGRAD_SQUARE:
case XGRAD_RECT: case XGRAD_RECT:
aFtCenterX.Enable(); m_pFtCenterX->Enable();
aMtrCenterX.Enable(); m_pMtrCenterX->Enable();
aFtCenterY.Enable(); m_pFtCenterY->Enable();
aMtrCenterY.Enable(); m_pMtrCenterY->Enable();
aFtAngle.Enable(); m_pFtAngle->Enable();
aMtrAngle.Enable(); m_pMtrAngle->Enable();
break; break;
} }
} }
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkAdjustment" id="angleadjustment">
<property name="upper">359</property>
<property name="step_increment">15</property>
</object>
<object class="GtkBox" id="GradientPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkFrame" id="frame1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="spacing">12</property>
<child>
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="vexpand">True</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkLabel" id="typeft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Type</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="gradienttypelb">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="entry_text_column">0</property>
<property name="id_column">1</property>
<items>
<item translatable="yes">Linear</item>
<item translatable="yes">Axial</item>
<item translatable="yes">Radial</item>
<item translatable="yes">Ellipsoid</item>
<item translatable="yes">Quadratic</item>
<item translatable="yes">Square</item>
</items>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="centerxft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Center _X</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="centerxmtr:%">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="adjustment">percentadjustment</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="centeryft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="yalign">0.43999999761581421</property>
<property name="label" translatable="yes">Center _Y</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="centerymtr:%">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="adjustment">percentadjustment</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="angleft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="yalign">0.43999999761581421</property>
<property name="label" translatable="yes">A_ngle</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="anglemtr: degrees">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="adjustment">angleadjustment</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="borderft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="yalign">0.43999999761581421</property>
<property name="label" translatable="yes">_Border</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="bordermtr:%">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="adjustment">percentadjustment</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="colorfromft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_From</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="svxlo:ColorLB" id="colorfromlb">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="entry_text_column">0</property>
<property name="id_column">1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">5</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="colorfrommtr:%">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="adjustment">percentadjustment</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">6</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="colortoft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_To</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">7</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="svxlo:ColorLB" id="colortolb">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="entry_text_column">0</property>
<property name="id_column">1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">7</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="colortomtr:%">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="adjustment">percentadjustment</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">8</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkLabel" id="anglemtrdegrees">
<property name="can_focus">False</property>
<property name="label" translatable="yes"> degrees</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">start</property>
<property name="hexpand">True</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<object class="svxlo:GradientLB" id="gradientslb">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="entry_text_column">0</property>
<property name="id_column">1</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="svxlo:SvxXRectPreview" id="previewctl">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox" id="buttonbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<property name="layout_style">start</property>
<child>
<object class="GtkButton" id="add">
<property name="label">gtk-add</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="modify">
<property name="label" translatable="yes">_Modify</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="delete">
<property name="label">gtk-delete</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkButton" id="load">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Load Gradient List</property>
<property name="tooltip_text" translatable="yes">Load Gradient List</property>
<property name="halign">center</property>
<property name="hexpand">True</property>
<property name="use_action_appearance">False</property>
<property name="image">image1</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="save">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Save Gradient List</property>
<property name="tooltip_text" translatable="yes">Save Gradient List</property>
<property name="halign">center</property>
<property name="hexpand">True</property>
<property name="use_action_appearance">False</property>
<property name="image">image2</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">5</property>
<property name="secondary">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="propfl">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Properties</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">res/sc05501.png</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">res/sc05502.png</property>
</object>
<object class="GtkAdjustment" id="percentadjustment">
<property name="upper">100</property>
<property name="step_increment">5</property>
</object>
</interface>
...@@ -237,6 +237,7 @@ class SVX_DLLPUBLIC GradientLB : public ListBox ...@@ -237,6 +237,7 @@ class SVX_DLLPUBLIC GradientLB : public ListBox
sal_Bool mbUserDraw; sal_Bool mbUserDraw;
public: public:
GradientLB( Window* pParent, ResId Id, sal_Bool bUserDraw = sal_True ); GradientLB( Window* pParent, ResId Id, sal_Bool bUserDraw = sal_True );
GradientLB( Window* pParent, WinBits aWB, sal_Bool bUserDraw = sal_True );
virtual void Fill( const XGradientListRef &pList ); virtual void Fill( const XGradientListRef &pList );
virtual void UserDraw( const UserDrawEvent& rUDEvt ); virtual void UserDraw( const UserDrawEvent& rUDEvt );
......
...@@ -1073,6 +1073,21 @@ GradientLB::GradientLB( Window* pParent, ResId Id, sal_Bool bUserDraw /*= sal_Tr ...@@ -1073,6 +1073,21 @@ GradientLB::GradientLB( Window* pParent, ResId Id, sal_Bool bUserDraw /*= sal_Tr
EnableUserDraw( mbUserDraw); EnableUserDraw( mbUserDraw);
} }
GradientLB::GradientLB( Window* pParent, WinBits nWinStyle, sal_Bool bUserDraw /*= sal_True*/ )
: ListBox( pParent, nWinStyle ),
mpList(NULL),
mbUserDraw( bUserDraw )
{
EnableUserDraw( mbUserDraw);
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeGradientLB(Window *pParent, VclBuilder::stringmap &)
{
GradientLB *pListBox = new GradientLB(pParent, WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE);
pListBox->EnableAutoSize(true);
return pListBox;
}
void GradientLB::Fill( const XGradientListRef &pList ) void GradientLB::Fill( const XGradientListRef &pList )
{ {
mpList = pList; mpList = pList;
......
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