Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef _CHART2_TP_SCALES_HXX
20 : #define _CHART2_TP_SCALES_HXX
21 :
22 : // header for SfxTabPage
23 : #include <sfx2/tabdlg.hxx>
24 : // header for class FormattedField
25 : #include <svtools/fmtfield.hxx>
26 : // header for FixedText
27 : #include <vcl/fixed.hxx>
28 : // header for CheckBox
29 : #include <vcl/button.hxx>
30 : // header for MetricField
31 : #include <vcl/field.hxx>
32 : // header for class ListBox
33 : #include <vcl/lstbox.hxx>
34 :
35 : //.............................................................................
36 : namespace chart
37 : {
38 : //.............................................................................
39 :
40 0 : class ScaleTabPage : public SfxTabPage
41 : {
42 : public:
43 : ScaleTabPage( Window* pParent, const SfxItemSet& rInAttrs );
44 :
45 : static SfxTabPage* Create( Window* pParent, const SfxItemSet& rInAttrs );
46 : virtual sal_Bool FillItemSet( SfxItemSet& rOutAttrs );
47 : virtual void Reset( const SfxItemSet& rInAttrs );
48 : using TabPage::DeactivatePage;
49 : virtual int DeactivatePage( SfxItemSet* pItemSet = NULL );
50 :
51 : void SetNumFormatter( SvNumberFormatter* pFormatter );
52 : void SetNumFormat();
53 :
54 : void ShowAxisOrigin( bool bShowOrigin );
55 :
56 : virtual void StateChanged( StateChangedType nType );
57 :
58 : private:
59 : FixedLine aFlScale;
60 :
61 : CheckBox aCbxReverse;
62 :
63 : CheckBox aCbxLogarithm;
64 :
65 : FixedText m_aTxt_AxisType;
66 : ListBox m_aLB_AxisType;
67 :
68 : FixedText aTxtMin;
69 : FormattedField aFmtFldMin;
70 : CheckBox aCbxAutoMin;
71 :
72 : FixedText aTxtMax;
73 : FormattedField aFmtFldMax;
74 : CheckBox aCbxAutoMax;
75 :
76 : FixedText m_aTxt_TimeResolution;
77 : ListBox m_aLB_TimeResolution;
78 : CheckBox m_aCbx_AutoTimeResolution;
79 :
80 : FixedText aTxtMain;
81 : FormattedField aFmtFldStepMain;
82 : MetricField m_aMt_MainDateStep;
83 : ListBox m_aLB_MainTimeUnit;
84 : CheckBox aCbxAutoStepMain;
85 :
86 : FixedText aTxtHelpCount;
87 : FixedText aTxtHelp;
88 : MetricField aMtStepHelp;
89 : ListBox m_aLB_HelpTimeUnit;
90 : CheckBox aCbxAutoStepHelp;
91 :
92 : FixedText aTxtOrigin;
93 : FormattedField aFmtFldOrigin;
94 : CheckBox aCbxAutoOrigin;
95 :
96 : double fMin;
97 : double fMax;
98 : double fStepMain;
99 : sal_Int32 nStepHelp;
100 : double fOrigin;
101 : sal_Int32 m_nTimeResolution;
102 : sal_Int32 m_nMainTimeUnit;
103 : sal_Int32 m_nHelpTimeUnit;
104 : int m_nAxisType;
105 : bool m_bAllowDateAxis;
106 : SvNumberFormatter* pNumFormatter;
107 :
108 : bool m_bShowAxisOrigin;
109 :
110 : void AdjustControlPositions();
111 : void EnableControls();
112 : void PlaceIntervalControlsAccordingToAxisType();
113 :
114 : DECL_LINK( SelectAxisTypeHdl, void* );
115 : DECL_LINK( EnableValueHdl, CheckBox* );
116 : DECL_LINK( FmtFieldModifiedHdl, FormattedField* );
117 :
118 : /** shows a warning window due to an invalid input.
119 :
120 : @param nResIdMessage
121 : The resource identifier that represents the localized warning text.
122 : If this is 0, no warning is shown and false is returned.
123 :
124 : @param pControl
125 : If non-NULL, contains a pointer to the control in which the
126 : errornous value was in. This method gives this control the focus
127 : and selects its content.
128 :
129 : @return false, if nResIdMessage was 0, true otherwise
130 : */
131 : bool ShowWarning( sal_uInt16 nResIdMessage, Control* pControl = NULL );
132 :
133 : void HideAllControls();
134 : };
135 :
136 : //.............................................................................
137 : } //namespace chart
138 : //.............................................................................
139 :
140 : #endif
141 :
142 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|