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

Convert chart axis scale tab page to widget UI.

Obs:
-Several widget positioning methods turned useless and were deleted
-Corner case related to axis origin untested (couldn't find where it is used)

Change-Id: I6a563c89ddcfbff62494ce7726f3e7d6089e6b57
Reviewed-on: https://gerrit.libreoffice.org/6730Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 7b069f4b
......@@ -59,7 +59,6 @@ $(eval $(call gb_SrsTarget_add_files,chart2/res,\
chart2/source/controller/dialogs/tp_PointGeometry.src \
chart2/source/controller/dialogs/tp_PolarOptions.src \
chart2/source/controller/dialogs/tp_RangeChooser.src \
chart2/source/controller/dialogs/tp_Scale.src \
chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.src \
))
......
......@@ -38,6 +38,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\
chart2/uiconfig/ui/titlerotationtabpage \
chart2/uiconfig/ui/tp_axisLabel \
chart2/uiconfig/ui/tp_SeriesToAxis \
chart2/uiconfig/ui/tp_Scale \
chart2/uiconfig/ui/tp_Trendline \
))
......
/* -*- 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 "ResourceIds.hrc"
#define FL_SCALE 1
#define TXT_MIN 1
#define TXT_MAX 2
#define TXT_STEP_MAIN 3
#define TXT_STEP_HELP_COUNT 4
#define TXT_ORIGIN 5
#define TXT_TIME_RESOLUTION 6
#define TXT_AXIS_TYPE 7
#define TXT_STEP_HELP 8
#define CBX_AUTO_MIN 1
#define CBX_AUTO_MAX 2
#define CBX_AUTO_STEP_MAIN 3
#define CBX_AUTO_STEP_HELP 4
#define CBX_AUTO_ORIGIN 5
#define CBX_LOGARITHM 6
#define CBX_REVERSE 7
#define CBX_AUTO_TIME_RESOLUTION 8
#define EDT_STEP_MAIN 1
#define EDT_MAX 2
#define EDT_MIN 3
#define EDT_ORIGIN 4
#define MT_STEPHELP 10
#define MT_MAIN_DATE_STEP 11
#define LB_AXIS_TYPE 1
#define LB_MAIN_TIME_UNIT 2
#define LB_HELP_TIME_UNIT 3
#define LB_TIME_RESOLUTION 4
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -54,42 +54,39 @@ public:
virtual void StateChanged( StateChangedType nType );
private:
FixedLine aFlScale;
CheckBox* m_pCbxReverse;
CheckBox* m_pCbxLogarithm;
CheckBox aCbxReverse;
VclBox* m_pBxType;
ListBox* m_pLB_AxisType;
CheckBox aCbxLogarithm;
VclGrid* m_pBxMinMax;
FormattedField* m_pFmtFldMin;
CheckBox* m_pCbxAutoMin;
FixedText m_aTxt_AxisType;
ListBox m_aLB_AxisType;
FormattedField* m_pFmtFldMax;
CheckBox* m_pCbxAutoMax;
FixedText aTxtMin;
FormattedField aFmtFldMin;
CheckBox aCbxAutoMin;
VclBox* m_pBxResolution;
ListBox* m_pLB_TimeResolution;
CheckBox* m_pCbx_AutoTimeResolution;
FixedText aTxtMax;
FormattedField aFmtFldMax;
CheckBox aCbxAutoMax;
VclBox* m_pBxMain;
FormattedField* m_pFmtFldStepMain;
MetricField* m_pMt_MainDateStep;
ListBox* m_pLB_MainTimeUnit;
CheckBox* m_pCbxAutoStepMain;
FixedText m_aTxt_TimeResolution;
ListBox m_aLB_TimeResolution;
CheckBox m_aCbx_AutoTimeResolution;
VclBox* m_pBxMinor;
FixedText* m_pTxtHelpCount;
FixedText* m_pTxtHelp;
MetricField* m_pMtStepHelp;
ListBox* m_pLB_HelpTimeUnit;
CheckBox* m_pCbxAutoStepHelp;
FixedText aTxtMain;
FormattedField aFmtFldStepMain;
MetricField m_aMt_MainDateStep;
ListBox m_aLB_MainTimeUnit;
CheckBox aCbxAutoStepMain;
FixedText aTxtHelpCount;
FixedText aTxtHelp;
MetricField aMtStepHelp;
ListBox m_aLB_HelpTimeUnit;
CheckBox aCbxAutoStepHelp;
FixedText aTxtOrigin;
FormattedField aFmtFldOrigin;
CheckBox aCbxAutoOrigin;
FormattedField* m_pFmtFldOrigin;
CheckBox* m_pCbxAutoOrigin;
VclBox* m_pBxOrigin;
double fMin;
double fMax;
......@@ -105,9 +102,7 @@ private:
bool m_bShowAxisOrigin;
void AdjustControlPositions();
void EnableControls();
void PlaceIntervalControlsAccordingToAxisType();
DECL_LINK( SelectAxisTypeHdl, void* );
DECL_LINK( EnableValueHdl, CheckBox* );
......
/* -*- 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 <sfx2/tabpage.hrc>
#include "HelpIds.hrc"
#include "tp_Scale.hrc"
#define YLine1 3
#define Y1 (YLine1+13)
#define Y2 (Y1+16)
#define Y3 (Y2+16)
#define Y4 (Y3+16)
#define Y5 (Y4+16)
#define Y6 (Y5+16)
#define Y7 (Y6+16)
#define Y8 (Y7+16)
#define LABELWIDTH 88
#define AUTOCHECKWIDTH 41
#define EDITWIDTH 50
#define X1 6
#define X2 11
#define X3 (X2+LABELWIDTH+4)
#define X4 (X3+EDITWIDTH+5)
#define X5 (X4+AUTOCHECKWIDTH+5)
#define STR_LIST_TIME_UNIT \
StringList [ en-US ] = \
{ \
"Days" ; \
"Months" ; \
"Years" ; \
};
TabPage TP_SCALE
{
HelpID = "chart2:TabPage:TP_SCALE";
Hide = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
FixedLine FL_SCALE
{
Pos = MAP_APPFONT ( X1 , YLine1 ) ;
Size = MAP_APPFONT ( 248 , 8 ) ;
Text [ en-US ] = "Scale" ;
};
CheckBox CBX_REVERSE
{
HelpID = "chart2:CheckBox:TP_SCALE:CBX_REVERSE:ValueAxis";
Pos = MAP_APPFONT ( X2 , Y1 ) ;
Size = MAP_APPFONT ( 244 , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~Reverse direction" ;
};
//---------------------------
CheckBox CBX_LOGARITHM
{
HelpID = "chart2:CheckBox:TP_SCALE:CBX_LOGARITHM";
Pos = MAP_APPFONT ( X2 , Y2 ) ;
Size = MAP_APPFONT ( 244 , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~Logarithmic scale" ;
};
//---------------------------
FixedText TXT_AXIS_TYPE
{
Pos = MAP_APPFONT ( X2 , Y2 ) ;
Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
Text [ en-US ] = "T~ype" ;
};
ListBox LB_AXIS_TYPE
{
HelpID = "chart2:ListBox:TP_SCALE:LB_AXIS_TYPE";
Border = TRUE ;
AutoHScroll = TRUE ;
Pos = MAP_APPFONT ( X3 , Y2-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
Group = TRUE ;
DropDown=TRUE;
DDExtraWidth = TRUE ;
StringList [ en-US ] =
{
"Automatic" ;
"Text" ;
"Date" ;
};
};
//---------------------------
FixedText TXT_MIN
{
Pos = MAP_APPFONT ( X2 , Y3 ) ;
Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
Text [ en-US ] = "~Minimum" ;
};
SpinField EDT_MIN
{
HelpID = "chart2:SpinField:TP_SCALE:EDT_MIN";
Border = TRUE ;
SVLook = TRUE ;
Pos = MAP_APPFONT ( X3 , Y3-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
};
CheckBox CBX_AUTO_MIN
{
HelpID = "chart2:CheckBox:TP_SCALE:CBX_AUTO_MIN";
Pos = MAP_APPFONT ( X4 , Y3+1 ) ;
Size = MAP_APPFONT ( AUTOCHECKWIDTH , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~Automatic" ;
};
FixedText TXT_MAX
{
Pos = MAP_APPFONT ( X2 , Y4 ) ;
Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
Text [ en-US ] = "Ma~ximum" ;
};
SpinField EDT_MAX
{
HelpID = "chart2:SpinField:TP_SCALE:EDT_MAX";
Border = TRUE ;
SVLook = TRUE ;
Pos = MAP_APPFONT ( X3 , Y4-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
};
CheckBox CBX_AUTO_MAX
{
HelpID = "chart2:CheckBox:TP_SCALE:CBX_AUTO_MAX";
Pos = MAP_APPFONT ( X4 , Y4+1 ) ;
Size = MAP_APPFONT ( AUTOCHECKWIDTH , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "A~utomatic" ;
};
//---------------------------
FixedText TXT_TIME_RESOLUTION
{
Pos = MAP_APPFONT ( X2 , Y5 ) ;
Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
Text [ en-US ] = "R~esolution" ;
};
ListBox LB_TIME_RESOLUTION
{
HelpID = "chart2:ListBox:TP_SCALE:LB_TIME_RESOLUTION";
Border = TRUE ;
AutoHScroll = TRUE ;
Pos = MAP_APPFONT ( X3 , Y5-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
Group = TRUE ;
DropDown=TRUE;
DDExtraWidth = TRUE ;
STR_LIST_TIME_UNIT
};
CheckBox CBX_AUTO_TIME_RESOLUTION
{
HelpID = "chart2:CheckBox:TP_SCALE:CBX_AUTO_TIME_RESOLUTION";
Pos = MAP_APPFONT ( X4 , Y5+1 ) ;
Size = MAP_APPFONT ( AUTOCHECKWIDTH , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Automat~ic" ;
};
//---------------------------
FixedText TXT_STEP_MAIN
{
Pos = MAP_APPFONT ( X2 , Y5 ) ;
Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
Text [ en-US ] = "Ma~jor interval" ;
};
SpinField EDT_STEP_MAIN
{
HelpID = "chart2:SpinField:TP_SCALE:EDT_STEP_MAIN";
Border = TRUE ;
Pos = MAP_APPFONT ( X3 , Y5-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
};
MetricField MT_MAIN_DATE_STEP
{
HelpID = "chart2:MetricField:TP_SCALE:MT_MAIN_DATE_STEP";
Border = TRUE ;
Pos = MAP_APPFONT ( X3 , Y6-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = 1 ;
Maximum = 100000 ;
StrictFormat = TRUE ;
Unit = FUNIT_CUSTOM ;
First = 1 ;
Last = 100000 ;
SpinSize = 1 ;
};
ListBox LB_MAIN_TIME_UNIT
{
HelpID = "chart2:ListBox:TP_SCALE:LB_MAIN_TIME_UNIT";
Border = TRUE ;
AutoHScroll = TRUE ;
Pos = MAP_APPFONT ( X5 , Y6-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
Group = TRUE ;
DropDown=TRUE;
DDExtraWidth = TRUE ;
STR_LIST_TIME_UNIT
};
CheckBox CBX_AUTO_STEP_MAIN
{
HelpID = "chart2:CheckBox:TP_SCALE:CBX_AUTO_STEP_MAIN";
Pos = MAP_APPFONT ( X4 , Y5+1 ) ;
Size = MAP_APPFONT ( AUTOCHECKWIDTH , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Au~tomatic" ;
};
//---------------------------
FixedText TXT_STEP_HELP_COUNT
{
Pos = MAP_APPFONT ( X2 , Y6 ) ;
Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
Text [ en-US ] = "Minor inter~val count" ;
};
FixedText TXT_STEP_HELP
{
Pos = MAP_APPFONT ( X2 , Y7 ) ;
Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
Text [ en-US ] = "Minor inter~val" ;
};
MetricField MT_STEPHELP
{
HelpID = "chart2:MetricField:TP_SCALE:MT_STEPHELP";
Border = TRUE ;
Pos = MAP_APPFONT ( X3 , Y6-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = 1 ;
Maximum = 100 ;
StrictFormat = TRUE ;
Unit = FUNIT_CUSTOM ;
First = 1 ;
Last = 100 ;
SpinSize = 1 ;
};
ListBox LB_HELP_TIME_UNIT
{
HelpID = "chart2:ListBox:TP_SCALE:LB_HELP_TIME_UNIT";
Border = TRUE ;
AutoHScroll = TRUE ;
Pos = MAP_APPFONT ( X5 , Y7-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
Group = TRUE ;
DropDown=TRUE;
DDExtraWidth = TRUE ;
STR_LIST_TIME_UNIT
};
CheckBox CBX_AUTO_STEP_HELP
{
HelpID = "chart2:CheckBox:TP_SCALE:CBX_AUTO_STEP_HELP";
Pos = MAP_APPFONT ( X4 , Y6+1 ) ;
Size = MAP_APPFONT ( AUTOCHECKWIDTH , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Aut~omatic" ;
};
FixedText TXT_ORIGIN
{
Pos = MAP_APPFONT ( X2 , Y7 ) ;
Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
Text [ en-US ] = "Re~ference value" ;
};
SpinField EDT_ORIGIN
{
HelpID = "chart2:SpinField:TP_SCALE:EDT_ORIGIN";
Border = TRUE ;
SVLook = TRUE ;
Pos = MAP_APPFONT ( X3 , Y7-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
};
CheckBox CBX_AUTO_ORIGIN
{
HelpID = "chart2:CheckBox:TP_SCALE:CBX_AUTO_ORIGIN";
Pos = MAP_APPFONT ( X4 , Y7+1 ) ;
Size = MAP_APPFONT ( AUTOCHECKWIDTH , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Automat~ic" ;
};
//---------------------------
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
......@@ -269,6 +269,9 @@
<glade-widget-class title="MultiLine Edit" name="svtlo-MultiLineEditSyntaxHighlight"
generic-name="MultiLineEdit" parent="GtkTextView"
icon-name="widget-gtk-textview"/>
<glade-widget-class title="SvtFormattedField" name="svtlo-FormattedField"
generic-name="Formatted Field" parent="GtkSpinButton"
icon-name="widget-gtk-textentry"/>
<glade-widget-class title="Address MultiLine Edit" name="swuilo-AddressMultiLineEdit"
generic-name="AddressMultiLineEdit" parent="GtkTextView"
icon-name="widget-gtk-textview"/>
......
......@@ -23,6 +23,7 @@
#include <comphelper/string.hxx>
#include <unotools/localedatawrapper.hxx>
#include <vcl/svapp.hxx>
#include <vcl/builder.hxx>
#include <svl/zformat.hxx>
#include <svtools/fmtfield.hxx>
#include <i18nlangtag/languagetag.hxx>
......@@ -343,6 +344,11 @@ FormattedField::FormattedField(Window* pParent, const ResId& rResId, SvNumberFor
m_nFormatKey = nFormatKey;
}
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeFormattedField(Window *pParent, VclBuilder::stringmap &)
{
WinBits nWinBits = WB_BORDER;
return new FormattedField(pParent, nWinBits);
}
FormattedField::~FormattedField()
{
......
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