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 INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_SCALE_HXX
20 : #define INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_SCALE_HXX
21 :
22 : #include <sfx2/tabdlg.hxx>
23 : #include <svtools/fmtfield.hxx>
24 : #include <vcl/fixed.hxx>
25 : #include <vcl/button.hxx>
26 : #include <vcl/field.hxx>
27 : #include <vcl/lstbox.hxx>
28 :
29 : namespace chart
30 : {
31 :
32 0 : class ScaleTabPage : public SfxTabPage
33 : {
34 : public:
35 : ScaleTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
36 :
37 : static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rInAttrs );
38 : virtual bool FillItemSet( SfxItemSet* rOutAttrs ) SAL_OVERRIDE;
39 : virtual void Reset( const SfxItemSet* rInAttrs ) SAL_OVERRIDE;
40 : using TabPage::DeactivatePage;
41 : virtual int DeactivatePage( SfxItemSet* pItemSet = NULL ) SAL_OVERRIDE;
42 :
43 : void SetNumFormatter( SvNumberFormatter* pFormatter );
44 : void SetNumFormat();
45 :
46 : void ShowAxisOrigin( bool bShowOrigin );
47 :
48 : virtual void StateChanged( StateChangedType nType ) SAL_OVERRIDE;
49 :
50 : private:
51 : CheckBox* m_pCbxReverse;
52 : CheckBox* m_pCbxLogarithm;
53 :
54 : VclBox* m_pBxType;
55 : ListBox* m_pLB_AxisType;
56 :
57 : VclGrid* m_pBxMinMax;
58 : FormattedField* m_pFmtFldMin;
59 : CheckBox* m_pCbxAutoMin;
60 :
61 : FormattedField* m_pFmtFldMax;
62 : CheckBox* m_pCbxAutoMax;
63 :
64 : VclBox* m_pBxResolution;
65 : ListBox* m_pLB_TimeResolution;
66 : CheckBox* m_pCbx_AutoTimeResolution;
67 :
68 : FixedText* m_pTxtMain;
69 : FormattedField* m_pFmtFldStepMain;
70 : MetricField* m_pMt_MainDateStep;
71 : ListBox* m_pLB_MainTimeUnit;
72 : CheckBox* m_pCbxAutoStepMain;
73 :
74 : FixedText* m_pTxtHelpCount;
75 : FixedText* m_pTxtHelp;
76 : MetricField* m_pMtStepHelp;
77 : ListBox* m_pLB_HelpTimeUnit;
78 : CheckBox* m_pCbxAutoStepHelp;
79 :
80 : FormattedField* m_pFmtFldOrigin;
81 : CheckBox* m_pCbxAutoOrigin;
82 : VclBox* m_pBxOrigin;
83 :
84 : double fMin;
85 : double fMax;
86 : double fStepMain;
87 : sal_Int32 nStepHelp;
88 : double fOrigin;
89 : sal_Int32 m_nTimeResolution;
90 : sal_Int32 m_nMainTimeUnit;
91 : sal_Int32 m_nHelpTimeUnit;
92 : int m_nAxisType;
93 : bool m_bAllowDateAxis;
94 : SvNumberFormatter* pNumFormatter;
95 :
96 : bool m_bShowAxisOrigin;
97 :
98 : void EnableControls();
99 :
100 : DECL_LINK( SelectAxisTypeHdl, void* );
101 : DECL_LINK( EnableValueHdl, CheckBox* );
102 : DECL_LINK( FmtFieldModifiedHdl, FormattedField* );
103 :
104 : /** shows a warning window due to an invalid input.
105 :
106 : @param nResIdMessage
107 : The resource identifier that represents the localized warning text.
108 : If this is 0, no warning is shown and false is returned.
109 :
110 : @param pControl
111 : If non-NULL, contains a pointer to the control in which the
112 : errornous value was in. This method gives this control the focus
113 : and selects its content.
114 :
115 : @return false, if nResIdMessage was 0, true otherwise
116 : */
117 : bool ShowWarning( sal_uInt16 nResIdMessage, Control* pControl = NULL );
118 :
119 : void HideAllControls();
120 : };
121 :
122 : } //namespace chart
123 :
124 : #endif
125 :
126 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|