Kaydet (Commit) 06773ff7 authored tarafından Caolán McNamara's avatar Caolán McNamara

move color options .ui to right place and adapt code

Change-Id: I645775bcec9993a2d8fd4b5ea67197ad3b2a9e03
üst 67574804
......@@ -13,6 +13,7 @@ $(eval $(call gb_UI_add_uifiles,cui,\
cui/uiconfig/ui/backgroundpage \
cui/uiconfig/ui/borderpage \
cui/uiconfig/ui/charnamepage \
cui/uiconfig/ui/colorpage \
cui/uiconfig/ui/colorconfigwin \
cui/uiconfig/ui/effectspage \
cui/uiconfig/ui/hyphenate \
......@@ -30,7 +31,7 @@ $(eval $(call gb_UI_add_uifiles,cui,\
cui/uiconfig/ui/objectnamedialog \
cui/uiconfig/ui/objecttitledescdialog \
cui/uiconfig/ui/optaccessibilitypage \
cui/uiconfig/ui/optcolorpage \
cui/uiconfig/ui/optappearancepage \
cui/uiconfig/ui/personalization_tab \
cui/uiconfig/ui/pickbulletpage \
cui/uiconfig/ui/pickgraphicpage \
......
......@@ -635,26 +635,28 @@ public:
virtual Window* GetParentLabeledBy( const Window* pLabeled ) const;
};
/// Load save embed functionality
class SvxLoadSaveEmbed {
/************************************************************************/
struct SvxColorTabPageShadow;
class SvxColorTabPage : public SfxTabPage
{
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
private:
XPropertyListType meType;
XOutdevItemPool* mpXPool;
Window *mpTopDlg;
CheckBox maBoxEmbed;
ImageButton maBtnLoad;
ImageButton maBtnSave;
FixedText maTableName;
CheckBox *m_pBoxEmbed;
PushButton *m_pBtnLoad;
PushButton *m_pBtnSave;
FixedText *m_pTableName;
DECL_LINK( EmbedToggleHdl_Impl, void * );
DECL_LINK( ClickLoadHdl_Impl, void * );
DECL_LINK( ClickSaveHdl_Impl, void * );
public:
SvxLoadSaveEmbed( Window *pParent, Window *pDialog,
const ResId &aLoad, const ResId &aSave,
const ResId &aEmbed, const ResId &aTableName,
XPropertyListType t, XOutdevItemPool* mpXPool );
virtual ~SvxLoadSaveEmbed() {};
XPropertyListRef GetList();
void HideLoadSaveEmbed();
bool GetEmbed();
......@@ -662,48 +664,32 @@ public:
void UpdateTableName();
void EnableSave( bool bCanSave );
virtual bool IsModified() = 0;
virtual void SetModified(bool bIsModified) = 0;
virtual void AddState(ChangeType nState) = 0;
virtual void Update(bool bLoaded) = 0;
};
/************************************************************************/
struct SvxColorTabPageShadow;
class SvxColorTabPage : public SfxTabPage, public SvxLoadSaveEmbed
{
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
private:
SvxColorTabPageShadow *pShadow;
FixedLine aFlProp;
FixedText aFtName;
Edit aEdtName;
FixedText aFtColor;
ColorLB aLbColor;
Edit* m_pEdtName;
ColorLB* m_pLbColor;
ValueSet aValSetColorList;
ValueSet* m_pValSetColorList;
SvxXRectPreview aCtlPreviewOld;
SvxXRectPreview aCtlPreviewNew;
SvxXRectPreview* m_pCtlPreviewOld;
SvxXRectPreview* m_pCtlPreviewNew;
ListBox aLbColorModel;
FixedText aFtColorModel1;
MetricField aMtrFldColorModel1;
FixedText aFtColorModel2;
MetricField aMtrFldColorModel2;
FixedText aFtColorModel3;
MetricField aMtrFldColorModel3;
ListBox* m_pLbColorModel;
FixedText aFtColorModel4;
MetricField aMtrFldColorModel4;
VclContainer* m_pRGB;
NumericField* m_pR;
NumericField* m_pG;
NumericField* m_pB;
PushButton aBtnAdd;
PushButton aBtnModify;
PushButton aBtnWorkOn;
PushButton aBtnDelete;
VclContainer* m_pCYMK;
MetricField* m_pC;
MetricField* m_pY;
MetricField* m_pM;
MetricField* m_pK;
PushButton* m_pBtnAdd;
PushButton* m_pBtnModify;
PushButton* m_pBtnWorkOn;
PushButton* m_pBtnDelete;
const SfxItemSet& rOutAttrs;
......@@ -743,8 +729,6 @@ private:
DECL_LINK( SelectColorModelHdl_Impl, void * );
long ChangeColorHdl_Impl( void* p );
DECL_LINK( ModifiedHdl_Impl, void * );
DECL_LINK( ClickLoadHdl_Impl, void * );
DECL_LINK( ClickSaveHdl_Impl, void * );
long CheckChanges_Impl();
#endif
......
......@@ -23,7 +23,6 @@
// Help-Ids --------------------------------------------------------------
#define HID_OPTIONS_COLOR "CUI_HID_OPTIONS_COLOR"
#define HID_OPTIONS_SAVE "CUI_HID_OPTIONS_SAVE"
#define HID_OPTIONS_PATH "CUI_HID_OPTIONS_PATH"
#define HID_OPTIONS_GENERAL "CUI_HID_OPTIONS_GENERAL"
......@@ -42,7 +41,6 @@
#define HID_EDIT_MODULES "CUI_HID_EDIT_MODULES"
#define HID_LNGDLG_NUM_PREBREAK "CUI_HID_LNGDLG_NUM_PREBREAK"
#define HID_OPTIONS_COLORCONFIG_SAVE_SCHEME "CUI_HID_OPTIONS_COLORCONFIG_SAVE_SCHEME"
#define HID_OPTIONS_COLORCONFIG_NAME_SCHEME "CUI_HID_OPTIONS_COLORCONFIG_NAME_SCHEME"
#define HID_OPTIONS_PATHS_SELECTFOLDER "CUI_HID_OPTIONS_PATHS_SELECTFOLDER"
#define HID_OPTIONS_JAVA "CUI_HID_OPTIONS_JAVA"
#define HID_OPTIONS_JAVA_LIST "CUI_HID_OPTIONS_JAVA_LIST"
......
......@@ -1020,7 +1020,7 @@ IMPL_LINK(ColorConfigCtrl_Impl, ControlFocusHdl, Control*, pCtrl)
SvxColorOptionsTabPage::SvxColorOptionsTabPage(
Window* pParent, const SfxItemSet& rCoreSet)
: SfxTabPage(pParent, "OptColorPage", "cui/ui/optcolorpage.ui", rCoreSet)
: SfxTabPage(pParent, "OptAppearancePage", "cui/ui/optappearancepage.ui", rCoreSet)
, bFillItemSetCalled(false)
, pColorConfig(0)
, pExtColorConfig(0)
......@@ -1153,7 +1153,6 @@ IMPL_LINK(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, PushButton*, pButton )
aNameDlg->SetCheckNameHdl( LINK(this, SvxColorOptionsTabPage, CheckNameHdl_Impl));
aNameDlg->SetText(String(CUI_RES(RID_SVXSTR_COLOR_CONFIG_SAVE1)));
aNameDlg->SetHelpId(HID_OPTIONS_COLORCONFIG_SAVE_SCHEME);
aNameDlg->SetEditHelpId(HID_OPTIONS_COLORCONFIG_NAME_SCHEME);
aNameDlg->SetCheckNameHdl( LINK(this, SvxColorOptionsTabPage, CheckNameHdl_Impl));
if(RET_OK == aNameDlg->Execute())
{
......
......@@ -143,5 +143,4 @@
#define CB_HATCHBCKGRD 21
#define LB_HATCHBCKGRDCOLOR 22
#define STR_CUI_COLORMODEL 5030
#define STR_LB_HATCHINGSTYLE 5031
......@@ -1266,243 +1266,6 @@ TabPage RID_SVXPAGE_GRADIENT
};
};
// ------------------------------------------------------
TabPage RID_SVXPAGE_COLOR
{
HelpId = HID_OPTIONS_COLOR ;
Hide = TRUE ;
Text [ en-US ] = "Colors" ;
SVLook = TRUE ;
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_NAME
{
Pos = MAP_APPFONT ( 12 , 16 ) ;
Size = MAP_APPFONT ( 28 , 8 ) ;
Text [ en-US ] = "~Name" ;
};
Edit EDT_NAME
{
HelpID = "cui:Edit:RID_SVXPAGE_COLOR:EDT_NAME";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 14 ) ;
Size = MAP_APPFONT ( 76 , 12 ) ;
TabStop = TRUE ;
};
FixedText FT_COLOR
{
Pos = MAP_APPFONT ( 12 , 32 ) ;
Size = MAP_APPFONT ( 28 , 8 ) ;
Text [ en-US ] = "C~olor" ;
};
ListBox LB_COLOR
{
HelpID = "cui:ListBox:RID_SVXPAGE_COLOR:LB_COLOR";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 30 ) ;
Size = MAP_APPFONT ( 76 , 100 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
DDExtraWidth = TRUE ;
};
FixedText FT_TABLE_NAME
{
Pos = MAP_APPFONT ( 42 , 48 ) ;
Size = MAP_APPFONT ( 94 , 8 ) ;
Text [ en-US ] = "Color table" ;
};
Control CTL_COLORTABLE
{
Border = TRUE ;
Hide = TRUE ;
Pos = MAP_APPFONT ( 42 , 59 ) ;
Size = MAP_APPFONT ( 94 , 117 ) ;
TabStop = TRUE ;
};
Control CTL_PREVIEW_OLD
{
Border = TRUE;
Pos = MAP_APPFONT ( 157 , 14 ) ;
Size = MAP_APPFONT ( 34 , 25 ) ;
};
Control CTL_PREVIEW_NEW
{
Border = TRUE;
Pos = MAP_APPFONT ( 157, 39 ) ;
Size = MAP_APPFONT ( 34 , 25 ) ;
};
ListBox LB_COLORMODEL
{
HelpID = "cui:ListBox:RID_SVXPAGE_COLOR:LB_COLORMODEL";
Border = TRUE ;
Pos = MAP_APPFONT ( 157 , 71 ) ;
Size = MAP_APPFONT ( 34 , 12 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
StringList [ en-US ] =
{
< "RGB" ; Default ; > ;
< "CMYK" ; Default ; > ;
};
};
FixedText FT_1
{
Pos = MAP_APPFONT ( 142 , 89 ) ;
Size = MAP_APPFONT ( 15 , 8 ) ;
Text [ en-US ] = "~C" ;
};
MetricField MTR_FLD_1
{
HelpID = "cui:MetricField:RID_SVXPAGE_COLOR:MTR_FLD_1";
Border = TRUE ;
Pos = MAP_APPFONT ( 157 , 87 ) ;
Size = MAP_APPFONT ( 30 , 12 ) ;
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Maximum = 100 ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
Last = 100 ;
};
FixedText FT_2
{
Pos = MAP_APPFONT ( 142 , 105 ) ;
Size = MAP_APPFONT ( 15 , 8 ) ;
Text [ en-US ] = "~M" ;
};
MetricField MTR_FLD_2
{
HelpID = "cui:MetricField:RID_SVXPAGE_COLOR:MTR_FLD_2";
Border = TRUE ;
Pos = MAP_APPFONT ( 157 , 103 ) ;
Size = MAP_APPFONT ( 30 , 12 ) ;
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Maximum = 100 ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
Last = 100 ;
};
FixedText FT_3
{
Pos = MAP_APPFONT ( 142 , 121 ) ;
Size = MAP_APPFONT ( 15 , 8 ) ;
Text [ en-US ] = "~Y" ;
};
MetricField MTR_FLD_3
{
HelpID = "cui:MetricField:RID_SVXPAGE_COLOR:MTR_FLD_3";
Border = TRUE ;
Pos = MAP_APPFONT ( 157 , 119 ) ;
Size = MAP_APPFONT ( 30 , 12 ) ;
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Maximum = 100 ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
Last = 100 ;
};
FixedText FT_4
{
Pos = MAP_APPFONT ( 142 , 137 ) ;
Size = MAP_APPFONT ( 15 , 8 ) ;
Text [ en-US ] = "~K" ;
};
MetricField MTR_FLD_4
{
HelpID = "cui:MetricField:RID_SVXPAGE_COLOR:MTR_FLD_4";
Border = TRUE ;
Pos = MAP_APPFONT ( 157 , 135 ) ;
Size = MAP_APPFONT ( 30 , 12 ) ;
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Maximum = 100 ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
Last = 100 ;
};
PushButton BTN_ADD
{
HelpID = "cui:PushButton:RID_SVXPAGE_COLOR:BTN_ADD";
Pos = MAP_APPFONT ( 197 , 14 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Add" ;
TabStop = TRUE ;
};
PushButton BTN_WORK_ON
{
HelpID = "cui:PushButton:RID_SVXPAGE_COLOR:BTN_WORK_ON";
Pos = MAP_APPFONT ( 197 , 50 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Edit..." ;
TabStop = TRUE ;
};
PushButton BTN_DELETE
{
HelpID = "cui:PushButton:RID_SVXPAGE_COLOR:BTN_DELETE";
Pos = MAP_APPFONT ( 197 , 68 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Delete..." ;
TabStop = TRUE ;
};
PushButton BTN_MODIFY
{
HelpID = "cui:PushButton:RID_SVXPAGE_COLOR:BTN_MODIFY";
Pos = MAP_APPFONT ( 197, 32 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Modify" ;
TabStop = TRUE ;
};
ImageButton BTN_LOAD
{
HelpID = "cui:ImageButton:RID_SVXPAGE_COLOR:BTN_LOAD";
Pos = MAP_APPFONT ( 197 , 104 ) ;
Size = MAP_APPFONT ( 16 , 16 ) ;
TabStop = TRUE ;
QuickHelpText [ en-US ] = "Load Color List";
ButtonImage = Image
{
ImageBitmap = Bitmap
{
File = "sc05501.bmp" ;
};
};
};
ImageButton BTN_SAVE
{
HelpID = "cui:ImageButton:RID_SVXPAGE_COLOR:BTN_SAVE";
Pos = MAP_APPFONT ( 217 , 104 ) ;
Size = MAP_APPFONT ( 16 , 16 ) ;
TabStop = TRUE ;
QuickHelpText [ en-US ] = "Save Color List";
ButtonImage = Image
{
ImageBitmap = Bitmap
{
File = "sc05502.bmp" ;
};
};
};
CheckBox BTN_EMBED
{
HelpID = "cui:ImageButton:RID_SVXPAGE_COLOR:BTN_EMBED";
Pos = MAP_APPFONT ( 197 , 124 ) ;
Size = MAP_APPFONT ( 122 , 10 ) ;
Text [ en-US ] = "Embed";
};
};
// ------------------------------------------------------
TabDialog RID_SVXDLG_AREA
{
......@@ -1566,9 +1329,3 @@ String STR_LB_HATCHINGSTYLE
{
Text [ en-US ] = "Hatching Style" ;
};
String STR_CUI_COLORMODEL
{
Text [ en-US ] = "Color Mode" ;
};
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkBox" id="OptColorPage">
<object class="GtkBox" id="OptAppearancePage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
......
......@@ -136,7 +136,6 @@ hidspecial HID_OFAPAGE_QUOTE_CLB { HelpId = HID_OFAPAGE_QUOTE
hidspecial HID_OFAPAGE_QUOTE_SW_CLB { HelpId = HID_OFAPAGE_QUOTE_SW_CLB; };
hidspecial HID_OFA_CONNPOOL_DRIVERLIST { HelpId = HID_OFA_CONNPOOL_DRIVERLIST; };
hidspecial HID_OFA_FONT_SUBST_CLB { HelpId = HID_OFA_FONT_SUBST_CLB; };
hidspecial HID_OPTIONS_COLORCONFIG_NAME_SCHEME { HelpID = HID_OPTIONS_COLORCONFIG_NAME_SCHEME ;};
hidspecial HID_OPTIONS_COLORCONFIG_SAVE_SCHEME { HelpID = HID_OPTIONS_COLORCONFIG_SAVE_SCHEME ;};
hidspecial HID_OPTIONS_JAVA_LIST { HelpId = HID_OPTIONS_JAVA_LIST; };
hidspecial HID_OPTIONS_PATHS_SELECTFOLDER { HelpID = HID_OPTIONS_PATHS_SELECTFOLDER; };
......
......@@ -355,7 +355,8 @@ protected:
void LocalPostPaint();
public:
SvxPreviewBase( Window* pParent, const ResId& rResId );
SvxPreviewBase(Window* pParent, const ResId& rResId);
SvxPreviewBase(Window* pParent);
virtual ~SvxPreviewBase();
// change support
......@@ -409,12 +410,14 @@ private:
SdrObject* mpRectangleObject;
public:
SvxXRectPreview( Window* pParent, const ResId& rResId );
SvxXRectPreview(Window* pParent, const ResId& rResId);
SvxXRectPreview(Window* pParent);
virtual ~SvxXRectPreview();
void SetAttributes(const SfxItemSet& rItemSet);
virtual void Paint( const Rectangle& rRect );
virtual void Resize();
};
/*************************************************************************
......
......@@ -890,6 +890,13 @@ XOBitmap SvxBitmapCtl::GetXBitmap()
return( aXOBitmap );
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeColorLB(Window *pParent, VclBuilder::stringmap &)
{
ColorLB *pListBox = new ColorLB(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE);
pListBox->EnableAutoSize(true);
return pListBox;
}
// Fills the Listbox with color and strings
void ColorLB::Fill( const XColorListRef &pColorTab )
......@@ -1609,6 +1616,20 @@ SvxPreviewBase::SvxPreviewBase( Window* pParent, const ResId& rResId )
mpModel->GetItemPool().FreezeIdRanges();
}
SvxPreviewBase::SvxPreviewBase(Window* pParent)
: Control(pParent, WB_BORDER)
, mpModel(new SdrModel())
, mpBufferDevice(new VirtualDevice(*this))
{
// Draw the control's border as a flat thin black line.
SetBorderStyle(WINDOW_BORDER_MONO);
SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
SetMapMode(MAP_100TH_MM);
// init model
mpModel->GetItemPool().FreezeIdRanges();
}
SvxPreviewBase::~SvxPreviewBase()
{
delete mpModel;
......@@ -1810,6 +1831,37 @@ SvxXRectPreview::SvxXRectPreview( Window* pParent, const ResId& rResId )
mpRectangleObject->SetModel(&getModel());
}
SvxXRectPreview::SvxXRectPreview(Window* pParent)
: SvxPreviewBase(pParent)
, mpRectangleObject(0)
{
InitSettings(true, true);
// create RectangleObject
const Rectangle aObjectSize(Point(), GetOutputSize());
mpRectangleObject = new SdrRectObj(aObjectSize);
mpRectangleObject->SetModel(&getModel());
}
void SvxXRectPreview::Resize()
{
const Rectangle aObjectSize(Point(), GetOutputSize());
SdrObject *pOrigObject = mpRectangleObject;
if (pOrigObject)
{
mpRectangleObject = new SdrRectObj(aObjectSize);
mpRectangleObject->SetModel(&getModel());
SetAttributes(pOrigObject->GetMergedItemSet());
SdrObject::Free(pOrigObject);
}
SvxPreviewBase::Resize();
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxXRectPreview(Window *pParent, VclBuilder::stringmap &)
{
return new SvxXRectPreview(pParent);
}
SvxXRectPreview::~SvxXRectPreview()
{
SdrObject::Free(mpRectangleObject);
......
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