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

convert chart data dialog to .ui

this one was a complete pig to convert with the
conflicting home-grown existing layout code.

Change-Id: I135bd486d10f7d972e143daae44d6b24a6e8fdb8
üst 34b3f019
......@@ -27,7 +27,6 @@ $(eval $(call gb_SrsTarget_set_include,chart2/res,\
))
$(eval $(call gb_SrsTarget_add_files,chart2/res,\
chart2/source/controller/dialogs/dlg_DataEditor.src \
chart2/source/controller/dialogs/res_BarGeometry.src \
chart2/source/controller/dialogs/Strings_AdditionalControls.src \
chart2/source/controller/dialogs/Strings_ChartTypes.src \
......
......@@ -33,6 +33,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\
chart2/uiconfig/ui/3dviewdialog \
chart2/uiconfig/ui/attributedialog \
chart2/uiconfig/ui/chardialog \
chart2/uiconfig/ui/chartdatadialog \
chart2/uiconfig/ui/charttypedialog \
chart2/uiconfig/ui/datarangedialog \
chart2/uiconfig/ui/dlg_DataLabel \
......
......@@ -39,6 +39,7 @@
#include <vcl/fixed.hxx>
#include <vcl/image.hxx>
#include <vcl/layout.hxx>
#include <vcl/msgbox.hxx>
#include <rtl/math.hxx>
......@@ -118,7 +119,9 @@ SeriesHeaderEdit::SeriesHeaderEdit( Window * pParent ) :
Edit( pParent ),
m_nStartColumn( 0 ),
m_bShowWarningBox( false )
{}
{
SetHelpId(HID_SCH_DATA_SERIES_LABEL);
}
SeriesHeaderEdit::~SeriesHeaderEdit()
{}
......@@ -150,7 +153,7 @@ void SeriesHeaderEdit::MouseButtonDown( const MouseEvent& rMEvt )
class SeriesHeader
{
public:
explicit SeriesHeader( Window * pParent );
explicit SeriesHeader(Window * pParent, Window *pColorParent);
void SetColor( const Color & rCol );
void SetPos( const Point & rPos );
......@@ -160,7 +163,6 @@ public:
void SetSeriesName( const OUString & rName );
void SetRange( sal_Int32 nStartCol, sal_Int32 nEndCol );
void SetPixelPosX( sal_Int32 nPos );
void SetPixelWidth( sal_Int32 nWidth );
sal_Int32 GetStartColumn() const;
......@@ -169,6 +171,7 @@ public:
static sal_Int32 GetRelativeAppFontXPosForNameField();
void Show();
void Hide();
/** call this before destroying the class. This notifies the listeners to
changes of the edit field for the series name.
......@@ -203,10 +206,10 @@ private:
bool m_bSeriesNameChangePending;
};
SeriesHeader::SeriesHeader( Window * pParent ) :
SeriesHeader::SeriesHeader( Window * pParent, Window *pColorParent ) :
m_spSymbol( new FixedImage( pParent, WB_NOBORDER )),
m_spSeriesName( new SeriesHeaderEdit( pParent )),
m_spColorBar( new FixedText( pParent, WB_NOBORDER )),
m_spColorBar( new FixedText( pColorParent, WB_NOBORDER )),
m_pDevice( pParent ),
m_nStartCol( 0 ),
m_nEndCol( 0 ),
......@@ -255,29 +258,32 @@ void SeriesHeader::SetPos( const Point & rPos )
m_aPos = rPos;
// chart type symbol
Point aPos( rPos );
aPos.setY( aPos.getY() + nSymbolDistance );
Size aSize( nSymbolHeight, nSymbolHeight );
m_spSymbol->SetPosPixel( m_pDevice->LogicToPixel( aPos, MAP_APPFONT ));
m_spSymbol->SetSizePixel( m_pDevice->LogicToPixel( aSize, MAP_APPFONT ));
aPos.setY( aPos.getY() - nSymbolDistance );
aSize = m_pDevice->LogicToPixel( aSize, MAP_APPFONT );
m_spSymbol->set_width_request(aSize.Width());
m_spSymbol->set_height_request(aSize.Height());
// series name edit field
aPos.setX( aPos.getX() + nSymbolHeight + nSymbolDistance );
aSize.setWidth(nSymbolDistance);
aSize = m_pDevice->LogicToPixel( aSize, MAP_APPFONT );
m_spSeriesName->set_margin_left(aSize.Width() + 2);
aSize.setWidth( m_nWidth - nSymbolHeight - nSymbolDistance );
sal_Int32 nHeight = 12;
aSize.setHeight( nHeight );
m_spSeriesName->SetPosPixel( m_pDevice->LogicToPixel( aPos, MAP_APPFONT ));
m_spSeriesName->SetSizePixel( m_pDevice->LogicToPixel( aSize, MAP_APPFONT ));
aSize = m_pDevice->LogicToPixel( aSize, MAP_APPFONT );
m_spSeriesName->set_width_request(aSize.Width());
m_spSeriesName->set_height_request(aSize.Height());
// color bar
aPos.setX( rPos.getX() + 1 );
aPos.setY( aPos.getY() + nHeight + 2 );
aSize.setWidth(1);
aSize = m_pDevice->LogicToPixel( aSize, MAP_APPFONT );
m_spColorBar->set_margin_left(aSize.Width() + 2);
nHeight = 3;
aSize.setWidth( m_nWidth - 1 );
aSize.setHeight( nHeight );
m_spColorBar->SetPosPixel( m_pDevice->LogicToPixel( aPos, MAP_APPFONT ));
m_spColorBar->SetSizePixel( m_pDevice->LogicToPixel( aSize, MAP_APPFONT ));
aSize = m_pDevice->LogicToPixel( aSize, MAP_APPFONT );
m_spColorBar->set_width_request(aSize.Width());
m_spColorBar->set_height_request(aSize.Height());
}
void SeriesHeader::SetWidth( sal_Int32 nWidth )
......@@ -286,13 +292,6 @@ void SeriesHeader::SetWidth( sal_Int32 nWidth )
SetPos( m_aPos );
}
void SeriesHeader::SetPixelPosX( sal_Int32 nPos )
{
Point aPos( m_pDevice->LogicToPixel( m_aPos, MAP_APPFONT ));
aPos.setX( nPos );
SetPos( m_pDevice->PixelToLogic( aPos, MAP_APPFONT ));
}
void SeriesHeader::SetPixelWidth( sal_Int32 nWidth )
{
SetWidth( m_pDevice->PixelToLogic( Size( nWidth, 0 ), MAP_APPFONT ).getWidth());
......@@ -335,6 +334,13 @@ void SeriesHeader::Show()
m_spColorBar->Show();
}
void SeriesHeader::Hide()
{
m_spSymbol->Hide();
m_spSeriesName->Hide();
m_spColorBar->Hide();
}
void SeriesHeader::SetEditChangedHdl( const Link & rLink )
{
m_aChangeLink = rLink;
......@@ -465,8 +471,8 @@ sal_Int32 lcl_getColumnInDataOrHeader(
} // anonymous namespace
DataBrowser::DataBrowser( Window* pParent, const ResId& rId, bool bLiveUpdate ) :
::svt::EditBrowseBox( pParent, rId, EBBF_SMART_TAB_TRAVEL | EBBF_HANDLE_COLUMN_TEXT, BROWSER_STANDARD_FLAGS ),
DataBrowser::DataBrowser( Window* pParent, WinBits nStyle, bool bLiveUpdate ) :
::svt::EditBrowseBox( pParent, nStyle, EBBF_SMART_TAB_TRAVEL | EBBF_HANDLE_COLUMN_TEXT, BROWSER_STANDARD_FLAGS ),
m_nSeekRow( 0 ),
m_bIsReadOnly( false ),
m_bIsDirty( false ),
......@@ -485,6 +491,7 @@ DataBrowser::DataBrowser( Window* pParent, const ResId& rId, bool bLiveUpdate )
SetClean();
}
DataBrowser::~DataBrowser()
{
}
......@@ -589,9 +596,9 @@ void DataBrowser::RenewTable()
GoToRow( ::std::min( nOldRow, GetRowCount() - 1 ));
GoToColumnId( ::std::min( nOldColId, static_cast< sal_uInt16 >( ColCount() - 1 )));
Window * pWin = this->GetParent();
if( !pWin )
pWin = this;
Dialog* pDialog = GetParentDialog();
Window* pWin = pDialog->get<VclContainer>("columns");
Window* pColorWin = pDialog->get<VclContainer>("colorcolumns");
// fill series headers
clearHeaders();
......@@ -602,7 +609,7 @@ void DataBrowser::RenewTable()
for( DataBrowserModel::tDataHeaderVector::const_iterator aIt( aHeaders.begin());
aIt != aHeaders.end(); ++aIt )
{
::boost::shared_ptr< impl::SeriesHeader > spHeader( new impl::SeriesHeader( pWin ));
::boost::shared_ptr< impl::SeriesHeader > spHeader( new impl::SeriesHeader( pWin, pColorWin ));
Reference< beans::XPropertySet > xSeriesProp( aIt->m_xDataSeries, uno::UNO_QUERY );
sal_Int32 nColor = 0;
// @todo: Set "DraftColor", i.e. interpolated colors for gradients, bitmaps, etc.
......@@ -1236,9 +1243,9 @@ void DataBrowser::EndScroll()
void DataBrowser::RenewSeriesHeaders()
{
Window * pWin = this->GetParent();
if( !pWin )
pWin = this;
Dialog* pDialog = GetParentDialog();
Window* pWin = pDialog->get<VclContainer>("columns");
Window* pColorWin = pDialog->get<VclContainer>("colorcolumns");
clearHeaders();
DataBrowserModel::tDataHeaderVector aHeaders( m_apDataBrowserModel->getDataHeaders());
......@@ -1248,7 +1255,7 @@ void DataBrowser::RenewSeriesHeaders()
for( DataBrowserModel::tDataHeaderVector::const_iterator aIt( aHeaders.begin());
aIt != aHeaders.end(); ++aIt )
{
::boost::shared_ptr< impl::SeriesHeader > spHeader( new impl::SeriesHeader( pWin ));
::boost::shared_ptr< impl::SeriesHeader > spHeader( new impl::SeriesHeader( pWin, pColorWin ));
Reference< beans::XPropertySet > xSeriesProp( aIt->m_xDataSeries, uno::UNO_QUERY );
sal_Int32 nColor = 0;
if( xSeriesProp.is() &&
......@@ -1279,10 +1286,20 @@ void DataBrowser::ImplAdjustHeaderControls()
// width of header column
nCurrentPos += this->GetColumnWidth( 0 );
Dialog* pDialog = GetParentDialog();
Window* pWin = pDialog->get<VclContainer>("columns");
Window* pColorWin = pDialog->get<VclContainer>("colorcolumns");
pWin->set_margin_left(nCurrentPos);
pColorWin->set_margin_left(nCurrentPos);
tSeriesHeaderContainer::iterator aIt( m_aSeriesHeaders.begin());
sal_uInt16 i = this->GetFirstVisibleColumNumber();
while( (aIt != m_aSeriesHeaders.end()) && ((*aIt)->GetStartColumn() < i) )
{
(*aIt)->Hide();
++aIt;
}
for( ; i < nColCount && aIt != m_aSeriesHeaders.end(); ++i )
{
if( (*aIt)->GetStartColumn() == i )
......@@ -1294,12 +1311,19 @@ void DataBrowser::ImplAdjustHeaderControls()
{
if( nStartPos < nMaxPos )
{
(*aIt)->SetPixelPosX( nStartPos + 2 );
(*aIt)->SetPixelWidth( nCurrentPos - nStartPos - 3 );
(*aIt)->Show();
if (pWin)
{
pWin->set_margin_left(nStartPos);
pColorWin->set_margin_left(nStartPos);
pWin = pColorWin = NULL;
}
}
else
// do not hide, to get focus events. Move outside the dialog for "hiding"
(*aIt)->SetPixelPosX( nMaxPos + 42 );
(*aIt)->Hide();
++aIt;
}
}
......
......@@ -67,7 +67,7 @@ protected:
void SetDirty();
public:
DataBrowser( Window* pParent, const ResId & rId, bool bLiveUpdate );
DataBrowser( Window* pParent, WinBits nStyle, bool bLiveUpdate );
virtual ~DataBrowser();
/** GetCellText returns the text at the given position
......
......@@ -18,7 +18,6 @@
*/
#include "dlg_DataEditor.hxx"
#include "dlg_DataEditor.hrc"
#include "Strings.hrc"
#include "DataBrowser.hxx"
......@@ -43,34 +42,42 @@ using ::com::sun::star::uno::Reference;
namespace chart
{
DataEditor::DataEditor(
Window* pParent,
DataEditor::DataEditor(Window* pParent,
const Reference< chart2::XChartDocument > & xChartDoc,
const Reference< uno::XComponentContext > & xContext ) :
ModalDialog( pParent, SchResId( DLG_DIAGRAM_DATA )),
m_bReadOnly( false ),
m_apBrwData( new DataBrowser( this, SchResId( CTL_DATA ), true /* bLiveUpdate */)),
m_aTbxData( this, SchResId( TBX_DATA )),
m_xChartDoc( xChartDoc ),
m_xContext( xContext ),
m_aToolboxImageList( SchResId( IL_DIAGRAM_DATA ))
const Reference< uno::XComponentContext > & xContext)
: ModalDialog(pParent, "ChartDataDialog",
"modules/schart/ui/chartdatadialog.ui")
, m_bReadOnly(false)
, m_xChartDoc(xChartDoc)
, m_xContext(xContext)
{
FreeResource();
// set min size to current size
SetMinOutputSizePixel( GetOutputSizePixel() );
ApplyImageList();
m_aTbxData.SetSizePixel( m_aTbxData.CalcWindowSizePixel() );
m_aTbxData.SetSelectHdl( LINK( this, DataEditor, ToolboxHdl ));
m_apBrwData->SetCursorMovedHdl( LINK( this, DataEditor, BrowserCursorMovedHdl ));
m_apBrwData->SetCellModifiedHdl( LINK( this, DataEditor, CellModified ));
m_xBrwData.reset(new DataBrowser(get<Window>("datawindow"), WB_BORDER | WB_TABSTOP, true /* bLiveUpdate */));
m_xBrwData->set_hexpand(true);
m_xBrwData->set_vexpand(true);
m_xBrwData->set_expand(true);
Size aSize(m_xBrwData->LogicToPixel(Size(232, 121), MAP_APPFONT));
m_xBrwData->set_width_request(aSize.Width());
m_xBrwData->set_height_request(aSize.Height());
m_xBrwData->Show();
get(m_pTbxData, "toolbar");
TBI_DATA_INSERT_ROW = m_pTbxData->GetItemId("InsertRow");
TBI_DATA_INSERT_COL = m_pTbxData->GetItemId("InsertColumn");
TBI_DATA_INSERT_TEXT_COL = m_pTbxData->GetItemId("InsertTextColumn");
TBI_DATA_DELETE_ROW = m_pTbxData->GetItemId("RemoveRow");
TBI_DATA_DELETE_COL = m_pTbxData->GetItemId("RemoveColumn");
TBI_DATA_SWAP_COL = m_pTbxData->GetItemId("SwapColumn");
TBI_DATA_SWAP_ROW = m_pTbxData->GetItemId("SwapRow");
m_pTbxData->SetSelectHdl( LINK( this, DataEditor, ToolboxHdl ));
m_xBrwData->SetCursorMovedHdl( LINK( this, DataEditor, BrowserCursorMovedHdl ));
m_xBrwData->SetCellModifiedHdl( LINK( this, DataEditor, CellModified ));
UpdateData();
GrabFocus();
m_apBrwData->GrabFocus();
m_xBrwData->GrabFocus();
bool bReadOnly = true;
Reference< frame::XStorable > xStor( m_xChartDoc, uno::UNO_QUERY );
......@@ -83,27 +90,15 @@ DataEditor::DataEditor(
const sal_Int16 nStyle( aMiscOptions.GetToolboxStyle() );
// react on changes
aMiscOptions.AddListenerLink( LINK( this, DataEditor, MiscHdl ) );
m_aTbxData.SetOutStyle( nStyle );
// set good window width
Size aWinSize( GetOutputSizePixel());
Size aWinSizeWithBorder( GetSizePixel());
Point aWinPos( OutputToAbsoluteScreenPixel( GetPosPixel()));
sal_Int32 nMaxWidth = GetDesktopRectPixel().getWidth() -
(aWinSizeWithBorder.getWidth() - aWinSize.getWidth() + aWinPos.getX()) - 10; // leave some space
sal_Int32 nBrowserWidth = m_apBrwData->GetTotalWidth() + 12 + 16; // plus padding + 16?
sal_Int32 nWindowWidth = ::std::min( nMaxWidth, nBrowserWidth );
aWinSize.setWidth( nWindowWidth );
SetOutputSizePixel( aWinSize );
AdaptBrowseBoxSize();
m_pTbxData->SetOutStyle( nStyle );
// allow travelling to toolbar with F6
notifySystemWindow( this, & m_aTbxData, ::comphelper::mem_fun( & TaskPaneList::AddWindow ));
notifySystemWindow( this, m_pTbxData, ::comphelper::mem_fun( & TaskPaneList::AddWindow ));
}
DataEditor::~DataEditor()
{
notifySystemWindow( this, & m_aTbxData, ::comphelper::mem_fun( & TaskPaneList::RemoveWindow ));
notifySystemWindow( this, m_pTbxData, ::comphelper::mem_fun( & TaskPaneList::RemoveWindow ));
SvtMiscOptions aMiscOptions;
aMiscOptions.RemoveListenerLink( LINK( this, DataEditor, MiscHdl ) );
......@@ -114,30 +109,22 @@ DataEditor::~DataEditor()
// react on click (or keypress) on toolbar icon
IMPL_LINK_NOARG(DataEditor, ToolboxHdl)
{
switch( m_aTbxData.GetCurItemId() )
{
case TBI_DATA_INSERT_ROW:
m_apBrwData->InsertRow();
break;
case TBI_DATA_INSERT_COL:
m_apBrwData->InsertColumn();
break;
case TBI_DATA_INSERT_TEXT_COL:
m_apBrwData->InsertTextColumn();
break;
case TBI_DATA_DELETE_ROW:
m_apBrwData->RemoveRow();
break;
case TBI_DATA_DELETE_COL:
m_apBrwData->RemoveColumn();
break;
case TBI_DATA_SWAP_COL :
m_apBrwData->SwapColumn ();
break;
case TBI_DATA_SWAP_ROW :
m_apBrwData->SwapRow ();
break;
}
sal_uInt16 nId = m_pTbxData->GetCurItemId();
if (nId == TBI_DATA_INSERT_ROW)
m_xBrwData->InsertRow();
else if (nId == TBI_DATA_INSERT_COL)
m_xBrwData->InsertColumn();
else if (nId == TBI_DATA_INSERT_TEXT_COL)
m_xBrwData->InsertTextColumn();
else if (nId == TBI_DATA_DELETE_ROW)
m_xBrwData->RemoveRow();
else if (nId == TBI_DATA_DELETE_COL)
m_xBrwData->RemoveColumn();
else if (nId == TBI_DATA_SWAP_COL)
m_xBrwData->SwapColumn();
else if (nId == TBI_DATA_SWAP_ROW)
m_xBrwData->SwapRow();
return 0;
}
......@@ -148,16 +135,16 @@ IMPL_LINK_NOARG(DataEditor, BrowserCursorMovedHdl)
if( m_bReadOnly )
return 0;
bool bIsDataValid = m_apBrwData->IsEnableItem();
bool bIsDataValid = m_xBrwData->IsEnableItem();
m_aTbxData.EnableItem( TBI_DATA_INSERT_ROW, bIsDataValid && m_apBrwData->MayInsertRow() );
m_aTbxData.EnableItem( TBI_DATA_INSERT_COL, bIsDataValid && m_apBrwData->MayInsertColumn() );
m_aTbxData.EnableItem( TBI_DATA_INSERT_TEXT_COL, bIsDataValid && m_apBrwData->MayInsertColumn() );
m_aTbxData.EnableItem( TBI_DATA_DELETE_ROW, m_apBrwData->MayDeleteRow() );
m_aTbxData.EnableItem( TBI_DATA_DELETE_COL, m_apBrwData->MayDeleteColumn() );
m_pTbxData->EnableItem( TBI_DATA_INSERT_ROW, bIsDataValid && m_xBrwData->MayInsertRow() );
m_pTbxData->EnableItem( TBI_DATA_INSERT_COL, bIsDataValid && m_xBrwData->MayInsertColumn() );
m_pTbxData->EnableItem( TBI_DATA_INSERT_TEXT_COL, bIsDataValid && m_xBrwData->MayInsertColumn() );
m_pTbxData->EnableItem( TBI_DATA_DELETE_ROW, m_xBrwData->MayDeleteRow() );
m_pTbxData->EnableItem( TBI_DATA_DELETE_COL, m_xBrwData->MayDeleteColumn() );
m_aTbxData.EnableItem( TBI_DATA_SWAP_COL, bIsDataValid && m_apBrwData->MaySwapColumns() );
m_aTbxData.EnableItem( TBI_DATA_SWAP_ROW, bIsDataValid && m_apBrwData->MaySwapRows() );
m_pTbxData->EnableItem( TBI_DATA_SWAP_COL, bIsDataValid && m_xBrwData->MaySwapColumns() );
m_pTbxData->EnableItem( TBI_DATA_SWAP_ROW, bIsDataValid && m_xBrwData->MaySwapRows() );
return 0;
}
......@@ -168,16 +155,16 @@ void DataEditor::SetReadOnly( bool bReadOnly )
m_bReadOnly = bReadOnly;
if( m_bReadOnly )
{
m_aTbxData.EnableItem( TBI_DATA_INSERT_ROW, false );
m_aTbxData.EnableItem( TBI_DATA_INSERT_COL, false );
m_aTbxData.EnableItem( TBI_DATA_INSERT_TEXT_COL, false );
m_aTbxData.EnableItem( TBI_DATA_DELETE_ROW, false );
m_aTbxData.EnableItem( TBI_DATA_DELETE_COL, false );
m_aTbxData.EnableItem( TBI_DATA_SWAP_COL, false );
m_aTbxData.EnableItem( TBI_DATA_SWAP_ROW, false );
m_pTbxData->EnableItem( TBI_DATA_INSERT_ROW, false );
m_pTbxData->EnableItem( TBI_DATA_INSERT_COL, false );
m_pTbxData->EnableItem( TBI_DATA_INSERT_TEXT_COL, false );
m_pTbxData->EnableItem( TBI_DATA_DELETE_ROW, false );
m_pTbxData->EnableItem( TBI_DATA_DELETE_COL, false );
m_pTbxData->EnableItem( TBI_DATA_SWAP_COL, false );
m_pTbxData->EnableItem( TBI_DATA_SWAP_ROW, false );
}
m_apBrwData->SetReadOnly( m_bReadOnly );
m_xBrwData->SetReadOnly( m_bReadOnly );
}
IMPL_LINK_NOARG(DataEditor, MiscHdl)
......@@ -185,7 +172,7 @@ IMPL_LINK_NOARG(DataEditor, MiscHdl)
SvtMiscOptions aMiscOptions;
sal_Int16 nStyle( aMiscOptions.GetToolboxStyle() );
m_aTbxData.SetOutStyle( nStyle );
m_pTbxData->SetOutStyle( nStyle );
return 0L;
}
......@@ -197,24 +184,7 @@ IMPL_LINK_NOARG(DataEditor, CellModified)
void DataEditor::UpdateData()
{
m_apBrwData->SetDataFromModel( m_xChartDoc, m_xContext );
}
void DataEditor::AdaptBrowseBoxSize()
{
Size aSize( PixelToLogic( GetResizeOutputSizePixel(), MAP_APPFONT ));
Size aDataSize;
aDataSize.setWidth( aSize.getWidth() - 12 );
aDataSize.setHeight( aSize.getHeight() - 31 -24 );
m_apBrwData->SetSizePixel( LogicToPixel( aDataSize, MAP_APPFONT ));
}
void DataEditor::Resize()
{
Dialog::Resize();
AdaptBrowseBoxSize();
m_xBrwData->SetDataFromModel( m_xChartDoc, m_xContext );
}
sal_Bool DataEditor::Close()
......@@ -227,13 +197,7 @@ sal_Bool DataEditor::Close()
bool DataEditor::ApplyChangesToModel()
{
return m_apBrwData->EndEditing();
}
// sets the correct toolbar icons depending on the current mode (e.g. high contrast)
void DataEditor::ApplyImageList()
{
m_aTbxData.SetImageList( m_aToolboxImageList );
return m_xBrwData->EndEditing();
}
// add/remove a window (the toolbar) to/from the global list, so that F6
......
/* -*- 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 .
*/
#define DLG_DIAGRAM_DATA 744
#define FT_POS 1
#define TBX_DATA 2
#define CTL_DATA 1
// images for toolbox image list
//the numbers correspond to the icon names: icon-themes\(name of theme)\res\dataeditor_icon_xy
#define TBI_DATA_INSERT_ROW 1
#define TBI_DATA_INSERT_COL 2
#define TBI_DATA_DELETE_ROW 3
#define TBI_DATA_DELETE_COL 4
#define TBI_DATA_SWAP_COL 5
#define TBI_DATA_SWAP_ROW 6
#define TBI_DATA_INSERT_TEXT_COL 7
// image lists for toolbox
#define IL_DIAGRAM_DATA 1
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#include "dlg_DataEditor.hrc"
#include "HelpIds.hrc"
// Mask Color for standard images
#define IMAGE_BUTTON_STD_MASK_COLOR Color { Red = 0xff00; Green = 0x0000; Blue = 0xff00; }
#define ADDITIONAL_SPACE_ABOVE_TABLE 17
ModalDialog DLG_DIAGRAM_DATA
{
HelpID = HID_DIAGRAM_DATA ;
OutputSize = TRUE ;
Hide = TRUE ;
SVLook = TRUE ;
Pos = MAP_APPFONT ( 0 , 0 ) ;
Size = MAP_APPFONT ( 244 , 152 ) ;
Text [ en-US ] = "Data Table";
Moveable = TRUE ;
Closeable = TRUE ;
Sizeable = TRUE ;
Control CTL_DATA
{
HelpID = HID_SCH_CTL_DATA ;
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 24 + ADDITIONAL_SPACE_ABOVE_TABLE ) ;
Size = MAP_APPFONT ( 232 , 121 - ADDITIONAL_SPACE_ABOVE_TABLE ) ;
TabStop = TRUE ;
};
ToolBox TBX_DATA
{
HelpID = HID_SCH_TBX_DATA ;
SVLook = TRUE ;
TabStop = TRUE ;
Pos = MAP_APPFONT ( 4 , 2 ) ;
ItemList =
{
ToolBoxItem
{
HelpID = HID_SCH_TBI_DATA_INSERT_ROW ;
Identifier = TBI_DATA_INSERT_ROW ;
Text [ en-US ] = "Insert Row" ;
};
ToolBoxItem
{
HelpID = HID_SCH_TBI_DATA_INSERT_COL ;
Identifier = TBI_DATA_INSERT_COL ;
Text [ en-US ] = "Insert Series" ;
};
ToolBoxItem
{
HelpID = HID_SCH_TBI_DATA_INSERT_TEXT_COL ;
Identifier = TBI_DATA_INSERT_TEXT_COL ;
Text [ en-US ] = "Insert Text Column" ;
};
ToolBoxItem
{
HelpID = HID_SCH_TBI_DATA_DELETE_ROW ;
Identifier = TBI_DATA_DELETE_ROW ;
Text [ en-US ] = "Delete Row" ;
};
ToolBoxItem
{
HelpID = HID_SCH_TBI_DATA_DELETE_COL ;
Identifier = TBI_DATA_DELETE_COL ;
Text [ en-US ] = "Delete Series" ;
};
ToolBoxItem
{
Type = TOOLBOXITEM_SEPARATOR ;
};
ToolBoxItem
{
HelpID = HID_SCH_TBI_DATA_SWAP_COL ;
Identifier = TBI_DATA_SWAP_COL ;
Text [ en-US ] = "Move Series Right" ;
};
ToolBoxItem
{
HelpID = HID_SCH_TBI_DATA_SWAP_ROW ;
Identifier = TBI_DATA_SWAP_ROW ;
Text [ en-US ] = "Move Row Down" ;
};
ToolBoxItem
{
Type = TOOLBOXITEM_SEPARATOR ;
};
};
};
#define IMAGE_ID_LIST \
IdList = \
{ \
TBI_DATA_INSERT_ROW; \
TBI_DATA_INSERT_COL; \
TBI_DATA_INSERT_TEXT_COL; \
TBI_DATA_DELETE_ROW; \
TBI_DATA_DELETE_COL; \
TBI_DATA_SWAP_COL; \
TBI_DATA_SWAP_ROW; \
}; \
IdCount = { 7; }
ImageList IL_DIAGRAM_DATA
{
Prefix = "dataeditor_icon";
MaskColor = IMAGE_BUTTON_STD_MASK_COLOR;
IMAGE_ID_LIST;
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -20,7 +20,6 @@
#define CHART_HELPIDS_HRC
#define HID_SCH_WIN_DOCUMENT "CHART2_HID_SCH_WIN_DOCUMENT"
#define HID_SCH_CTL_DATA "CHART2_HID_SCH_CTL_DATA"
//for chart type dialog:
#define HID_SCH_CTL_TYPE "CHART2_HID_SCH_CTL_TYPE"
......@@ -28,15 +27,6 @@
#define HID_SCH_NUM_OF_LINES "CHART2_HID_SCH_NUM_OF_LINES"
//
#define HID_SCH_TBI_DATA_INSERT_ROW "CHART2_HID_SCH_TBI_DATA_INSERT_ROW"
#define HID_SCH_TBI_DATA_INSERT_COL "CHART2_HID_SCH_TBI_DATA_INSERT_COL"
#define HID_SCH_TBI_DATA_DELETE_ROW "CHART2_HID_SCH_TBI_DATA_DELETE_ROW"
#define HID_SCH_TBI_DATA_DELETE_COL "CHART2_HID_SCH_TBI_DATA_DELETE_COL"
#define HID_SCH_TBI_DATA_SWAP_COL "CHART2_HID_SCH_TBI_DATA_SWAP_COL"
#define HID_SCH_TBI_DATA_SWAP_ROW "CHART2_HID_SCH_TBI_DATA_SWAP_ROW"
#define HID_SCH_TBI_DATA_INSERT_TEXT_COL "CHART2_HID_SCH_TBI_DATA_INSERT_TEXT_COL"
#define HID_SCH_TBX_DATA "CHART2_HID_SCH_TBX_DATA"
#define HID_SCH_CHART_AUTO_FORMAT "CHART2_HID_SCH_CHART_AUTO_FORMAT"
#define HID_SCH_LB_BAR_GEOMETRY "CHART2_HID_SCH_LB_BAR_GEOMETRY"
......@@ -55,7 +45,6 @@
#define HID_SCH_LEGEND_SHOW "CHART2_HID_SCH_LEGEND_SHOW"
#define HID_SCH_DATA_SERIES_LABEL "CHART2_HID_SCH_DATA_SERIES_LABEL"
#define HID_DIAGRAM_DATA "CHART2_HID_DIAGRAM_DATA"
#define HID_INSERT_STATISTICS "CHART2_HID_INSERT_STATISTICS"
#endif
......
......@@ -20,6 +20,7 @@
#ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_INC_DLG_DATAEDITOR_HXX
#define INCLUDED_CHART2_SOURCE_CONTROLLER_INC_DLG_DATAEDITOR_HXX
#include <boost/scoped_ptr.hpp>
#include <svl/lstner.hxx>
#include <svtools/stdctrl.hxx>
#include <vcl/toolbox.hxx>
......@@ -27,8 +28,6 @@
#include <vcl/dialog.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <memory>
namespace com { namespace sun { namespace star {
namespace chart2 {
class XChartDocument;
......@@ -50,9 +49,6 @@ public:
::com::sun::star::uno::XComponentContext > & xContext );
virtual ~DataEditor();
// Window
virtual void Resize();
// Dialog
virtual sal_Bool Close();
......@@ -60,14 +56,21 @@ public:
bool ApplyChangesToModel();
private:
bool m_bReadOnly;
::std::auto_ptr< DataBrowser > m_apBrwData;
ToolBox m_aTbxData;
sal_uInt16 TBI_DATA_INSERT_ROW;
sal_uInt16 TBI_DATA_INSERT_COL;
sal_uInt16 TBI_DATA_INSERT_TEXT_COL;
sal_uInt16 TBI_DATA_DELETE_ROW;
sal_uInt16 TBI_DATA_DELETE_COL;
sal_uInt16 TBI_DATA_SWAP_COL;
sal_uInt16 TBI_DATA_SWAP_ROW;
bool m_bReadOnly;
boost::scoped_ptr<DataBrowser> m_xBrwData;
ToolBox* m_pTbxData;
::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > m_xChartDoc;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
m_xContext;
ImageList m_aToolboxImageList;
/// handles actions of the toolbox
DECL_LINK( ToolboxHdl, void* );
......@@ -83,7 +86,6 @@ private:
DECL_LINK( BrowserContentScrolled, void* );
void UpdateData();
void ApplyImageList();
/// moved and resizes the series name control etc. to fit the dimensions of the edit browsebox
// void ImplAdjustHeaderControls( bool bRefreshFromModel );
......@@ -103,8 +105,6 @@ private:
void notifySystemWindow( Window* pWindow,
Window* pToRegister,
::comphelper::mem_fun1_t< TaskPaneList, Window* > rMemFunc );
void AdaptBrowseBoxSize();
};
} // namespace chart
......
This diff is collapsed.
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