summaryrefslogtreecommitdiff
path: root/cui/source/options
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/options')
-rw-r--r--cui/source/options/optchart.cxx134
-rw-r--r--cui/source/options/optchart.hrc32
-rw-r--r--cui/source/options/optchart.hxx24
-rw-r--r--cui/source/options/optchart.src56
4 files changed, 67 insertions, 179 deletions
diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx
index 34e5c1af59c9..5f70a123ebba 100644
--- a/cui/source/options/optchart.cxx
+++ b/cui/source/options/optchart.cxx
@@ -20,56 +20,47 @@
#include <unotools/pathoptions.hxx>
#include <cuires.hrc>
#include "optchart.hxx"
-#include "optchart.hrc"
#include <dialmgr.hxx>
#include <vcl/msgbox.hxx>
#include <svx/svxids.hrc> // for SID_SCH_EDITOPTIONS
-// ====================
-// class ChartColorLB
-// ====================
-void ChartColorLB::FillBox( const SvxChartColorTable & rTab )
+namespace
{
- long nCount = rTab.size();
- SetUpdateMode( sal_False );
-
- for( long i = 0; i < nCount; i++ )
+ void FillBoxChartColorLB(ColorLB *pLB, const SvxChartColorTable & rTab)
{
- Append( rTab[ i ] );
+ pLB->SetUpdateMode(false);
+ pLB->Clear();
+ long nCount = rTab.size();
+ for(long i = 0; i < nCount; ++i)
+ {
+ pLB->Append(rTab[i]);
+ }
+ pLB->SetUpdateMode(true);
}
- SetUpdateMode( sal_True );
}
-
-// ====================
-// class SvxDefaultColorOptPage
-// ====================
-SvxDefaultColorOptPage::SvxDefaultColorOptPage( Window* pParent, const SfxItemSet& rInAttrs ) :
-
- SfxTabPage( pParent, CUI_RES( RID_OPTPAGE_CHART_DEFCOLORS ), rInAttrs ),
-
- aGbChartColors ( this, CUI_RES( FL_CHART_COLOR_LIST ) ),
- aLbChartColors ( this, CUI_RES( LB_CHART_COLOR_LIST ) ),
- aGbColorBox ( this, CUI_RES( FL_COLOR_BOX ) ),
- aValSetColorBox ( this, CUI_RES( CT_COLOR_BOX ) ),
- aPBDefault ( this, CUI_RES( PB_RESET_TO_DEFAULT ) ),
- aPBAdd ( this, CUI_RES( PB_ADD_CHART_COLOR ) ),
- aPBRemove ( this, CUI_RES( PB_REMOVE_CHART_COLOR ) )
+SvxDefaultColorOptPage::SvxDefaultColorOptPage(Window* pParent, const SfxItemSet& rInAttrs)
+ : SfxTabPage(pParent, "OptChartColorsPage","cui/ui/optchartcolorspage.ui", rInAttrs)
{
- FreeResource();
-
- aPBDefault.SetClickHdl( LINK( this, SvxDefaultColorOptPage, ResetToDefaults ) );
- aPBAdd.SetClickHdl( LINK( this, SvxDefaultColorOptPage, AddChartColor ) );
- aPBRemove.SetClickHdl( LINK( this, SvxDefaultColorOptPage, RemoveChartColor ) );
- aLbChartColors.SetSelectHdl( LINK( this, SvxDefaultColorOptPage, ListClickedHdl ) );
- aValSetColorBox.SetSelectHdl( LINK( this, SvxDefaultColorOptPage, BoxClickedHdl ) );
-
- aValSetColorBox.SetStyle( aValSetColorBox.GetStyle()
+ get(m_pPBRemove, "delete");
+ get(m_pPBAdd, "add");
+ get(m_pPBDefault, "default");
+ get(m_pValSetColorBox, "table");
+ get(m_pLbChartColors, "colors");
+ m_pLbChartColors->set_height_request(m_pLbChartColors->GetTextHeight()*16);
+
+ m_pPBDefault->SetClickHdl( LINK( this, SvxDefaultColorOptPage, ResetToDefaults ) );
+ m_pPBAdd->SetClickHdl( LINK( this, SvxDefaultColorOptPage, AddChartColor ) );
+ m_pPBRemove->SetClickHdl( LINK( this, SvxDefaultColorOptPage, RemoveChartColor ) );
+ m_pLbChartColors->SetSelectHdl( LINK( this, SvxDefaultColorOptPage, ListClickedHdl ) );
+ m_pValSetColorBox->SetSelectHdl( LINK( this, SvxDefaultColorOptPage, BoxClickedHdl ) );
+
+ m_pValSetColorBox->SetStyle( m_pValSetColorBox->GetStyle()
| WB_ITEMBORDER | WB_NAMEFIELD );
- aValSetColorBox.SetColCount( 8 );
- aValSetColorBox.SetLineCount( 13 );
- aValSetColorBox.SetExtraSpacing( 0 );
- aValSetColorBox.Show();
+ m_pValSetColorBox->SetColCount( 8 );
+ m_pValSetColorBox->SetLineCount( 13 );
+ m_pValSetColorBox->SetExtraSpacing( 0 );
+ m_pValSetColorBox->Show();
pChartOptions = new SvxChartOptions;
pColorList = XColorList::CreateStdColorList();
@@ -103,12 +94,12 @@ SvxDefaultColorOptPage::~SvxDefaultColorOptPage()
void SvxDefaultColorOptPage::Construct()
{
if( pColorConfig )
- aLbChartColors.FillBox( pColorConfig->GetColorList() );
+ FillBoxChartColorLB(m_pLbChartColors, pColorConfig->GetColorList());
FillColorBox();
- aLbChartColors.SelectEntryPos( 0 );
- ListClickedHdl( &aLbChartColors );
+ m_pLbChartColors->SelectEntryPos( 0 );
+ ListClickedHdl(m_pLbChartColors);
}
@@ -127,8 +118,8 @@ sal_Bool SvxDefaultColorOptPage::FillItemSet( SfxItemSet& rOutAttrs )
void SvxDefaultColorOptPage::Reset( const SfxItemSet& )
{
- aLbChartColors.SelectEntryPos( 0 );
- ListClickedHdl( &aLbChartColors );
+ m_pLbChartColors->SelectEntryPos( 0 );
+ ListClickedHdl(m_pLbChartColors);
}
void SvxDefaultColorOptPage::FillColorBox()
@@ -139,12 +130,12 @@ void SvxDefaultColorOptPage::FillColorBox()
XColorEntry* pColorEntry;
if( nCount > 104 )
- aValSetColorBox.SetStyle( aValSetColorBox.GetStyle() | WB_VSCROLL );
+ m_pValSetColorBox->SetStyle( m_pValSetColorBox->GetStyle() | WB_VSCROLL );
for( long i = 0; i < nCount; i++ )
{
pColorEntry = pColorList->GetColor( i );
- aValSetColorBox.InsertItem( (sal_uInt16) i + 1, pColorEntry->GetColor(), pColorEntry->GetName() );
+ m_pValSetColorBox->InsertItem( (sal_uInt16) i + 1, pColorEntry->GetColor(), pColorEntry->GetName() );
}
}
@@ -181,12 +172,11 @@ IMPL_LINK_NOARG(SvxDefaultColorOptPage, ResetToDefaults)
{
pColorConfig->GetColorList().useDefault();
- aLbChartColors.Clear();
- aLbChartColors.FillBox( pColorConfig->GetColorList() );
+ FillBoxChartColorLB(m_pLbChartColors, pColorConfig->GetColorList());
- aLbChartColors.GetFocus();
- aLbChartColors.SelectEntryPos( 0 );
- aPBRemove.Enable( sal_True );
+ m_pLbChartColors->GetFocus();
+ m_pLbChartColors->SelectEntryPos( 0 );
+ m_pPBRemove->Enable( sal_True );
}
return 0L;
@@ -203,12 +193,11 @@ IMPL_LINK_NOARG(SvxDefaultColorOptPage, AddChartColor)
pColorConfig->GetColorList().append (XColorEntry ( black, pColorConfig->GetColorList().getDefaultName(pColorConfig->GetColorList().size())));
- aLbChartColors.Clear();
- aLbChartColors.FillBox( pColorConfig->GetColorList() );
+ FillBoxChartColorLB(m_pLbChartColors, pColorConfig->GetColorList());
- aLbChartColors.GetFocus();
- aLbChartColors.SelectEntryPos( pColorConfig->GetColorList().size() - 1 );
- aPBRemove.Enable( sal_True );
+ m_pLbChartColors->GetFocus();
+ m_pLbChartColors->SelectEntryPos( pColorConfig->GetColorList().size() - 1 );
+ m_pPBRemove->Enable( sal_True );
}
return 0L;
@@ -219,9 +208,9 @@ IMPL_LINK_NOARG(SvxDefaultColorOptPage, AddChartColor)
IMPL_LINK( SvxDefaultColorOptPage, RemoveChartColor, PushButton*, pButton )
{
- size_t nIndex = aLbChartColors.GetSelectEntryPos();
+ size_t nIndex = m_pLbChartColors->GetSelectEntryPos();
- if (aLbChartColors.GetSelectEntryCount() == 0)
+ if (m_pLbChartColors->GetSelectEntryCount() == 0)
return 0L;
if( pColorConfig )
@@ -234,48 +223,47 @@ IMPL_LINK( SvxDefaultColorOptPage, RemoveChartColor, PushButton*, pButton )
{
pColorConfig->GetColorList().remove( nIndex );
- aLbChartColors.Clear();
- aLbChartColors.FillBox( pColorConfig->GetColorList() );
+ FillBoxChartColorLB(m_pLbChartColors, pColorConfig->GetColorList());
- aLbChartColors.GetFocus();
+ m_pLbChartColors->GetFocus();
- if (nIndex == aLbChartColors.GetEntryCount() && aLbChartColors.GetEntryCount() > 0)
- aLbChartColors.SelectEntryPos( pColorConfig->GetColorList().size() - 1 );
- else if (aLbChartColors.GetEntryCount() > 0)
- aLbChartColors.SelectEntryPos( nIndex );
+ if (nIndex == m_pLbChartColors->GetEntryCount() && m_pLbChartColors->GetEntryCount() > 0)
+ m_pLbChartColors->SelectEntryPos( pColorConfig->GetColorList().size() - 1 );
+ else if (m_pLbChartColors->GetEntryCount() > 0)
+ m_pLbChartColors->SelectEntryPos( nIndex );
else
- aPBRemove.Enable(true);
+ m_pPBRemove->Enable(true);
}
}
return 0L;
}
-IMPL_LINK( SvxDefaultColorOptPage, ListClickedHdl, ChartColorLB*, _pColorList )
+IMPL_LINK( SvxDefaultColorOptPage, ListClickedHdl, ColorLB*, _pColorList )
{
Color aCol = _pColorList->GetSelectEntryColor();
long nIndex = GetColorIndex( aCol );
if( nIndex == -1 ) // not found
- aValSetColorBox.SetNoSelection();
+ m_pValSetColorBox->SetNoSelection();
else
- aValSetColorBox.SelectItem( (sal_uInt16)nIndex + 1 ); // ValueSet is 1-based
+ m_pValSetColorBox->SelectItem( (sal_uInt16)nIndex + 1 ); // ValueSet is 1-based
return 0L;
}
IMPL_LINK_NOARG(SvxDefaultColorOptPage, BoxClickedHdl)
{
- sal_uInt16 nIdx = aLbChartColors.GetSelectEntryPos();
+ sal_uInt16 nIdx = m_pLbChartColors->GetSelectEntryPos();
if( nIdx != LISTBOX_ENTRY_NOTFOUND )
{
- const XColorEntry aEntry( aValSetColorBox.GetItemColor( aValSetColorBox.GetSelectItemId() ), aLbChartColors.GetSelectEntry() );
+ const XColorEntry aEntry( m_pValSetColorBox->GetItemColor( m_pValSetColorBox->GetSelectItemId() ), m_pLbChartColors->GetSelectEntry() );
- aLbChartColors.Modify( aEntry, nIdx );
+ m_pLbChartColors->Modify( aEntry, nIdx );
pColorConfig->ReplaceColorByIndex( nIdx, aEntry );
- aLbChartColors.SelectEntryPos( nIdx ); // reselect entry
+ m_pLbChartColors->SelectEntryPos( nIdx ); // reselect entry
}
return 0L;
diff --git a/cui/source/options/optchart.hrc b/cui/source/options/optchart.hrc
deleted file mode 100644
index 8b9d132bf660..000000000000
--- a/cui/source/options/optchart.hrc
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-// tab page for setting the default colors used for new charts
-
-#define FL_CHART_COLOR_LIST 1
-#define LB_CHART_COLOR_LIST 2
-
-#define FL_COLOR_BOX 3
-#define CT_COLOR_BOX 4
-
-#define PB_RESET_TO_DEFAULT 5
-#define PB_ADD_CHART_COLOR 6
-#define PB_REMOVE_CHART_COLOR 7
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/optchart.hxx b/cui/source/options/optchart.hxx
index 9d70ac411f42..487534bd1979 100644
--- a/cui/source/options/optchart.hxx
+++ b/cui/source/options/optchart.hxx
@@ -34,27 +34,15 @@
#include "cfgchart.hxx"
-class ChartColorLB : public ColorLB
-{
-public:
- ChartColorLB( Window* pParent, ResId Id ) : ColorLB( pParent, Id ) {}
- ChartColorLB( Window* pParent, WinBits aWB ) : ColorLB( pParent, aWB ) {}
-
- void FillBox( const SvxChartColorTable & rTab );
-};
-
-
class SvxDefaultColorOptPage : public SfxTabPage
{
private:
- FixedLine aGbChartColors;
- ChartColorLB aLbChartColors;
- FixedLine aGbColorBox;
- ValueSet aValSetColorBox;
- PushButton aPBDefault;
- PushButton aPBAdd;
- PushButton aPBRemove;
+ ColorLB* m_pLbChartColors;
+ ValueSet* m_pValSetColorBox;
+ PushButton* m_pPBDefault;
+ PushButton* m_pPBAdd;
+ PushButton* m_pPBRemove;
SvxChartOptions* pChartOptions;
SvxChartColorTableItem* pColorConfig;
@@ -63,7 +51,7 @@ private:
DECL_LINK( ResetToDefaults, void * );
DECL_LINK( AddChartColor, void * );
DECL_LINK( RemoveChartColor, PushButton * );
- DECL_LINK( ListClickedHdl, ChartColorLB * );
+ DECL_LINK( ListClickedHdl, ColorLB * );
DECL_LINK(BoxClickedHdl, void *);
void FillColorBox();
diff --git a/cui/source/options/optchart.src b/cui/source/options/optchart.src
index 1653216e5d0c..8c1cd2441bf8 100644
--- a/cui/source/options/optchart.src
+++ b/cui/source/options/optchart.src
@@ -17,67 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "optchart.hrc"
#include <cuires.hrc>
#include "helpid.hrc"
// tab page for setting the default colors used for new charts
-TabPage RID_OPTPAGE_CHART_DEFCOLORS
-{
- HelpID = HID_OPTIONS_CHART_DEFCOLORS;
- Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
- Hide = TRUE;
- Text [ en-US ] = "Default Colors";
- FixedLine FL_CHART_COLOR_LIST
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 80 , 8 ) ;
- Text [ en-US ] = "Chart colors";
- };
- ListBox LB_CHART_COLOR_LIST
- {
- HelpID = "cui:ListBox:RID_OPTPAGE_CHART_DEFCOLORS:LB_CHART_COLOR_LIST";
- Border = TRUE;
- Pos = MAP_APPFONT ( 12 , 15 );
- Size = MAP_APPFONT ( 68 , 152 );
- DropDown = FALSE;
- TabStop = TRUE ;
- };
- FixedLine FL_COLOR_BOX
- {
- Pos = MAP_APPFONT ( 92 , 3 ) ;
- Size = MAP_APPFONT ( 106 , 8 ) ;
- Text [ en-US ] = "Color table" ;
- };
- Control CT_COLOR_BOX
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 98 , 15 );
- Size = MAP_APPFONT ( 94 , 152 );
- TabStop = TRUE ;
- };
- PushButton PB_ADD_CHART_COLOR
- {
- Pos = MAP_APPFONT ( 204 , 15 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Add";
- };
- PushButton PB_REMOVE_CHART_COLOR
- {
- Pos = MAP_APPFONT ( 204 , 32 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Remove";
- };
- PushButton PB_RESET_TO_DEFAULT
- {
- HelpID = "cui:PushButton:RID_OPTPAGE_CHART_DEFCOLORS:PB_RESET_TO_DEFAULT";
- Pos = MAP_APPFONT ( 204 , 165 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Default";
- };
-};
-
String RID_SVXSTR_DIAGRAM_ROW
{
// $(ROW) can be a number or the caption of the row in quotes