2010-10-12 15:57:08 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01:00
|
|
|
/*
|
|
|
|
* 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 .
|
|
|
|
*/
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
#include "optHeaderTabListbox.hxx"
|
|
|
|
#include <vcl/svapp.hxx>
|
2014-01-02 23:52:37 +01:00
|
|
|
#include <vcl/settings.hxx>
|
2009-10-31 00:36:06 +01:00
|
|
|
#include <svtools/headbar.hxx>
|
2012-10-11 16:13:12 -04:00
|
|
|
#include <svtools/svlbitm.hxx>
|
2013-07-16 09:12:42 +01:00
|
|
|
#include <svtools/treelistentry.hxx>
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
namespace svx
|
|
|
|
{
|
|
|
|
// class OptLBoxString_Impl ----------------------------------------------
|
|
|
|
|
|
|
|
class OptLBoxString_Impl : public SvLBoxString
|
|
|
|
{
|
|
|
|
public:
|
2013-09-26 08:30:52 +02:00
|
|
|
OptLBoxString_Impl( SvTreeListEntry* pEntry, sal_uInt16 nFlags, const OUString& rTxt ) :
|
2009-10-31 00:36:06 +01:00
|
|
|
SvLBoxString( pEntry, nFlags, rTxt ) {}
|
|
|
|
|
2012-11-29 14:17:48 -05:00
|
|
|
virtual void Paint(
|
2014-03-27 18:12:18 +01:00
|
|
|
const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE;
|
2009-10-31 00:36:06 +01:00
|
|
|
};
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2012-11-29 14:17:48 -05:00
|
|
|
void OptLBoxString_Impl::Paint(
|
|
|
|
const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry)
|
2009-10-31 00:36:06 +01:00
|
|
|
{
|
2014-09-16 10:09:58 +02:00
|
|
|
vcl::Font aOldFont( rDev.GetFont() );
|
|
|
|
vcl::Font aFont( aOldFont );
|
2009-10-31 00:36:06 +01:00
|
|
|
//detect readonly state by asking for a valid Image
|
2015-04-07 16:18:28 +02:00
|
|
|
if(pEntry && !(!SvTreeListBox::GetCollapsedEntryBmp(pEntry)))
|
2009-10-31 00:36:06 +01:00
|
|
|
aFont.SetColor( Application::GetSettings().GetStyleSettings().GetDeactiveTextColor() );
|
|
|
|
rDev.SetFont( aFont );
|
|
|
|
rDev.DrawText( rPos, GetText() );
|
|
|
|
rDev.SetFont( aOldFont );
|
|
|
|
}
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2013-07-16 09:12:42 +01:00
|
|
|
OptHeaderTabListBox::OptHeaderTabListBox(SvSimpleTableContainer& rParent, WinBits nWinStyle)
|
|
|
|
: SvSimpleTable(rParent, nWinStyle)
|
2009-10-31 00:36:06 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2012-10-25 11:26:43 +01:00
|
|
|
void OptHeaderTabListBox::InitEntry( SvTreeListEntry* pEntry, const OUString& rTxt,
|
2009-10-31 00:36:06 +01:00
|
|
|
const Image& rImg1, const Image& rImg2,
|
|
|
|
SvLBoxButtonKind eButtonKind )
|
|
|
|
{
|
|
|
|
SvTabListBox::InitEntry( pEntry, rTxt, rImg1, rImg2, eButtonKind );
|
2011-01-14 12:41:27 +01:00
|
|
|
sal_uInt16 _nTabCount = TabCount();
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2011-01-14 12:41:27 +01:00
|
|
|
for ( sal_uInt16 nCol = 1; nCol < _nTabCount; ++nCol )
|
2009-10-31 00:36:06 +01:00
|
|
|
{
|
2012-04-15 17:50:21 +02:00
|
|
|
// initialize all columns with own class (column 0 == Bitmap)
|
2014-10-21 14:08:19 +02:00
|
|
|
SvLBoxString* pCol = static_cast<SvLBoxString*>(pEntry->GetItem( nCol ));
|
2009-10-31 00:36:06 +01:00
|
|
|
OptLBoxString_Impl* pStr = new OptLBoxString_Impl( pEntry, 0, pCol->GetText() );
|
|
|
|
pEntry->ReplaceItem( pStr, nCol );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace svx
|
2010-10-12 15:57:08 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|