1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "res_Titles.hxx"
22 #include "TitleDialogData.hxx"
23 #include <svtools/controldims.hrc>
28 TitleResources::TitleResources( VclBuilderContainer
& rBuilder
, bool bShowSecondaryAxesTitle
)
30 rBuilder
.get( m_pFT_Main
, "labelMainTitle" );
31 rBuilder
.get( m_pFT_Sub
, "labelSubTitle" );
32 rBuilder
.get( m_pEd_Main
, "maintitle" );
33 rBuilder
.get( m_pEd_Sub
, "subtitle" );
35 rBuilder
.get( m_pFT_XAxis
, "labelPrimaryXaxis" );
36 rBuilder
.get( m_pFT_YAxis
, "labelPrimaryYaxis" );
37 rBuilder
.get( m_pFT_ZAxis
, "labelPrimaryZaxis" );
38 rBuilder
.get( m_pEd_XAxis
, "primaryXaxis" );
39 rBuilder
.get( m_pEd_YAxis
, "primaryYaxis" );
40 rBuilder
.get( m_pEd_ZAxis
, "primaryZaxis" );
42 rBuilder
.get( m_pFT_SecondaryXAxis
, "labelSecondaryXAxis" );
43 rBuilder
.get( m_pFT_SecondaryYAxis
, "labelSecondaryYAxis" );
44 rBuilder
.get( m_pEd_SecondaryXAxis
, "secondaryXaxis" );
45 rBuilder
.get( m_pEd_SecondaryYAxis
, "secondaryYaxis" );
47 m_pFT_SecondaryXAxis
->Show( bShowSecondaryAxesTitle
);
48 m_pFT_SecondaryYAxis
->Show( bShowSecondaryAxesTitle
);
49 m_pEd_SecondaryXAxis
->Show( bShowSecondaryAxesTitle
);
50 m_pEd_SecondaryYAxis
->Show( bShowSecondaryAxesTitle
);
53 TitleResources::~TitleResources()
57 void TitleResources::SetUpdateDataHdl( const Link
<>& rLink
)
59 sal_uLong nTimeout
= 4*EDIT_UPDATEDATA_TIMEOUT
;
61 m_pEd_Main
->EnableUpdateData( nTimeout
);
62 m_pEd_Main
->SetUpdateDataHdl( rLink
);
64 m_pEd_Sub
->EnableUpdateData( nTimeout
);
65 m_pEd_Sub
->SetUpdateDataHdl( rLink
);
67 m_pEd_XAxis
->EnableUpdateData( nTimeout
);
68 m_pEd_XAxis
->SetUpdateDataHdl( rLink
);
70 m_pEd_YAxis
->EnableUpdateData( nTimeout
);
71 m_pEd_YAxis
->SetUpdateDataHdl( rLink
);
73 m_pEd_ZAxis
->EnableUpdateData( nTimeout
);
74 m_pEd_ZAxis
->SetUpdateDataHdl( rLink
);
76 m_pEd_SecondaryXAxis
->EnableUpdateData( nTimeout
);
77 m_pEd_SecondaryXAxis
->SetUpdateDataHdl( rLink
);
79 m_pEd_SecondaryYAxis
->EnableUpdateData( nTimeout
);
80 m_pEd_SecondaryYAxis
->SetUpdateDataHdl( rLink
);
83 bool TitleResources::IsModified()
85 return m_pEd_Main
->IsModified()
86 || m_pEd_Sub
->IsModified()
87 || m_pEd_XAxis
->IsModified()
88 || m_pEd_YAxis
->IsModified()
89 || m_pEd_ZAxis
->IsModified()
90 || m_pEd_SecondaryXAxis
->IsModified()
91 || m_pEd_SecondaryYAxis
->IsModified();
94 void TitleResources::ClearModifyFlag()
96 m_pEd_Main
->ClearModifyFlag();
97 m_pEd_Sub
->ClearModifyFlag();
98 m_pEd_XAxis
->ClearModifyFlag();
99 m_pEd_YAxis
->ClearModifyFlag();
100 m_pEd_ZAxis
->ClearModifyFlag();
101 m_pEd_SecondaryXAxis
->ClearModifyFlag();
102 m_pEd_SecondaryYAxis
->ClearModifyFlag();
105 void TitleResources::writeToResources( const TitleDialogData
& rInput
)
107 m_pFT_Main
->Enable( rInput
.aPossibilityList
[0] );
108 m_pFT_Sub
->Enable( rInput
.aPossibilityList
[1] );
109 m_pFT_XAxis
->Enable( rInput
.aPossibilityList
[2] );
110 m_pFT_YAxis
->Enable( rInput
.aPossibilityList
[3] );
111 m_pFT_ZAxis
->Enable( rInput
.aPossibilityList
[4] );
112 m_pFT_SecondaryXAxis
->Enable( rInput
.aPossibilityList
[5] );
113 m_pFT_SecondaryYAxis
->Enable( rInput
.aPossibilityList
[6] );
115 m_pEd_Main
->Enable( rInput
.aPossibilityList
[0] );
116 m_pEd_Sub
->Enable( rInput
.aPossibilityList
[1] );
117 m_pEd_XAxis
->Enable( rInput
.aPossibilityList
[2] );
118 m_pEd_YAxis
->Enable( rInput
.aPossibilityList
[3] );
119 m_pEd_ZAxis
->Enable( rInput
.aPossibilityList
[4] );
120 m_pEd_SecondaryXAxis
->Enable( rInput
.aPossibilityList
[5] );
121 m_pEd_SecondaryYAxis
->Enable( rInput
.aPossibilityList
[6] );
123 m_pEd_Main
->SetText(rInput
.aTextList
[0]);
124 m_pEd_Sub
->SetText(rInput
.aTextList
[1]);
125 m_pEd_XAxis
->SetText(rInput
.aTextList
[2]);
126 m_pEd_YAxis
->SetText(rInput
.aTextList
[3]);
127 m_pEd_ZAxis
->SetText(rInput
.aTextList
[4]);
128 m_pEd_SecondaryXAxis
->SetText(rInput
.aTextList
[5]);
129 m_pEd_SecondaryYAxis
->SetText(rInput
.aTextList
[6]);
132 void TitleResources::readFromResources( TitleDialogData
& rOutput
)
134 rOutput
.aExistenceList
[0] = !m_pEd_Main
->GetText().isEmpty();
135 rOutput
.aExistenceList
[1] = !m_pEd_Sub
->GetText().isEmpty();
136 rOutput
.aExistenceList
[2] = !m_pEd_XAxis
->GetText().isEmpty();
137 rOutput
.aExistenceList
[3] = !m_pEd_YAxis
->GetText().isEmpty();
138 rOutput
.aExistenceList
[4] = !m_pEd_ZAxis
->GetText().isEmpty();
139 rOutput
.aExistenceList
[5] = !m_pEd_SecondaryXAxis
->GetText().isEmpty();
140 rOutput
.aExistenceList
[6] = !m_pEd_SecondaryYAxis
->GetText().isEmpty();
142 rOutput
.aTextList
[0] = m_pEd_Main
->GetText();
143 rOutput
.aTextList
[1] = m_pEd_Sub
->GetText();
144 rOutput
.aTextList
[2] = m_pEd_XAxis
->GetText();
145 rOutput
.aTextList
[3] = m_pEd_YAxis
->GetText();
146 rOutput
.aTextList
[4] = m_pEd_ZAxis
->GetText();
147 rOutput
.aTextList
[5] = m_pEd_SecondaryXAxis
->GetText();
148 rOutput
.aTextList
[6] = m_pEd_SecondaryYAxis
->GetText();
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */