15d39f272SZheng Fan /**************************************************************
25d39f272SZheng Fan *
35d39f272SZheng Fan * Licensed to the Apache Software Foundation (ASF) under one
45d39f272SZheng Fan * or more contributor license agreements. See the NOTICE file
55d39f272SZheng Fan * distributed with this work for additional information
65d39f272SZheng Fan * regarding copyright ownership. The ASF licenses this file
75d39f272SZheng Fan * to you under the Apache License, Version 2.0 (the
85d39f272SZheng Fan * "License"); you may not use this file except in compliance
95d39f272SZheng Fan * with the License. You may obtain a copy of the License at
105d39f272SZheng Fan *
115d39f272SZheng Fan * http://www.apache.org/licenses/LICENSE-2.0
125d39f272SZheng Fan *
135d39f272SZheng Fan * Unless required by applicable law or agreed to in writing,
145d39f272SZheng Fan * software distributed under the License is distributed on an
155d39f272SZheng Fan * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
165d39f272SZheng Fan * KIND, either express or implied. See the License for the
175d39f272SZheng Fan * specific language governing permissions and limitations
185d39f272SZheng Fan * under the License.
195d39f272SZheng Fan *
205d39f272SZheng Fan *************************************************************/
215d39f272SZheng Fan
225d39f272SZheng Fan #include "precompiled_svx.hxx"
235d39f272SZheng Fan
245d39f272SZheng Fan #include "ContextPanel.hxx"
255d39f272SZheng Fan
265d39f272SZheng Fan namespace svx { namespace sidebar {
275d39f272SZheng Fan
ContextPanel(::Window * pParent)285d39f272SZheng Fan ContextPanel::ContextPanel (::Window* pParent)
295d39f272SZheng Fan : Window(pParent, 0),
305d39f272SZheng Fan maApplicationName(this, 0),
315d39f272SZheng Fan maContextName(this, 0)
325d39f272SZheng Fan {
335d39f272SZheng Fan maApplicationName.SetPosSizePixel(5,5, 250,15);
345d39f272SZheng Fan maContextName.SetPosSizePixel(5,25, 250,15);
355d39f272SZheng Fan
365d39f272SZheng Fan maApplicationName.Show();
375d39f272SZheng Fan maContextName.Show();
385d39f272SZheng Fan Show();
395d39f272SZheng Fan }
405d39f272SZheng Fan
415d39f272SZheng Fan
425d39f272SZheng Fan
435d39f272SZheng Fan
~ContextPanel(void)445d39f272SZheng Fan ContextPanel::~ContextPanel (void)
455d39f272SZheng Fan {
465d39f272SZheng Fan }
475d39f272SZheng Fan
485d39f272SZheng Fan
495d39f272SZheng Fan
505d39f272SZheng Fan
GetPreferredHeight(sal_Int32)51*69ff20f4SPavel Janík sal_Int32 ContextPanel::GetPreferredHeight (sal_Int32 /* nWidth */)
525d39f272SZheng Fan {
535d39f272SZheng Fan const sal_Int32 nHeight (maContextName.GetPosPixel().Y() + maContextName.GetSizePixel().Height() + 5);
545d39f272SZheng Fan return nHeight;
555d39f272SZheng Fan }
565d39f272SZheng Fan
575d39f272SZheng Fan
585d39f272SZheng Fan
595d39f272SZheng Fan
HandleContextChange(const sfx2::sidebar::EnumContext aContext)605d39f272SZheng Fan void ContextPanel::HandleContextChange (const sfx2::sidebar::EnumContext aContext)
615d39f272SZheng Fan {
625d39f272SZheng Fan maApplicationName.SetText(aContext.GetApplicationName());
635d39f272SZheng Fan maContextName.SetText(aContext.GetContextName());
645d39f272SZheng Fan }
655d39f272SZheng Fan
665d39f272SZheng Fan
675d39f272SZheng Fan
685d39f272SZheng Fan
695d39f272SZheng Fan } } // end of namespace ::svx::sidebar
70