<commit_before>/************************************************************************
    filename:   FalMultiColumnList.cpp
    created:    Wed Jul 6 2005
    author:     <NAME> <<EMAIL>>
*************************************************************************/
/*************************************************************************
    Crazy Eddie's GUI System (http://www.cegui.org.uk)
    Copyright (C)2004 - 2005 <NAME> (<EMAIL>)
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*************************************************************************/
#include "FalMultiColumnList.h"
#include "falagard/CEGUIFalWidgetLookManager.h"
#include "falagard/CEGUIFalWidgetLookFeel.h"
#include "CEGUIWindowManager.h"
#include "elements/CEGUIScrollbar.h"
#include "elements/CEGUIListHeader.h"

// Start of CEGUI namespace section
namespace CEGUI
{
    const utf8 FalagardMultiColumnList::WidgetTypeName[] = "Falagard/MultiColumnList";


    FalagardMultiColumnList::FalagardMultiColumnList(const String& type, const String& name) :
        MultiColumnList(type, name)
    {
    }

    FalagardMultiColumnList::~FalagardMultiColumnList()
    {
    }

    Rect FalagardMultiColumnList::getListRenderArea(void) const
    {
        const WidgetLookFeel& wlf = WidgetLookManager::getSingleton().getWidgetLook(d_lookName);
        return wlf.getNamedArea("ItemRenderingArea").getArea().getPixelRect(*this);
    }

    ListHeader* FalagardMultiColumnList::createListHeader(const String& name) const
    {
        // return component created by look'n'feel assignment.
        return static_cast<ListHeader*>(WindowManager::getSingleton().getWindow(name));
    }

    Scrollbar* FalagardMultiColumnList::createVertScrollbar(const String& name) const
    {
        // return component created by look'n'feel assignment.
        return static_cast<Scrollbar*>(WindowManager::getSingleton().getWindow(name));<commit_msg>Additional rendering areas for MCL for various combinations of scrollbar<commit_after>/************************************************************************
    filename:   FalMultiColumnList.cpp
    created:    Wed Jul 6 2005
    author:     <NAME> <<EMAIL>>
*************************************************************************/
/*************************************************************************
    Crazy Eddie's GUI System (http://www.cegui.org.uk)
    Copyright (C)2004 - 2005 <NAME> (<EMAIL>)
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*************************************************************************/
#include "FalMultiColumnList.h"
#include "falagard/CEGUIFalWidgetLookManager.h"
#include "falagard/CEGUIFalWidgetLookFeel.h"
#include "CEGUIWindowManager.h"
#include "elements/CEGUIScrollbar.h"
#include "elements/CEGUIListHeader.h"

// Start of CEGUI namespace section
namespace CEGUI
{
    const utf8 FalagardMultiColumnList::WidgetTypeName[] = "Falagard/MultiColumnList";


    FalagardMultiColumnList::FalagardMultiColumnList(const String& type, const String& name) :
        MultiColumnList(type, name)
    {
    }

    FalagardMultiColumnList::~FalagardMultiColumnList()
    {
    }

    Rect FalagardMultiColumnList::getListRenderArea(void) const
    {
        // get WidgetLookFeel for the assigned look.
        const WidgetLookFeel& wlf = WidgetLookManager::getSingleton().getWidgetLook(d_lookName);
        bool v_visible = d_vertScrollbar->isVisible(true);
        bool h_visible = d_horzScrollbar->isVisible(true);

        // if either of the scrollbars are visible, we might want to use another item rendering area
        if (v_visible || h_visible)
        {
            String area_name("ItemRenderingArea");

            if (h_visible)
            {
                area_name += "H";
            }
            if (v_visible)
            {
                area_name += "V";
            }
            area_name += "Scroll";

            if (wlf.isNamedAreaDefined(area_name))
            {
                return wlf.getNamedArea(area_name).getArea().getPixelRect(*this);
            }
        }

        // default to plain ItemRenderingArea
        return wlf.getNamedArea("ItemRenderingArea").getArea().getPixelRect(*this);
    }

    ListHeader* FalagardMultiColumnList::createListHeader(const String& name) const
    {
        // return component created by look'n'feel assignment.
        return static_cast<ListHeader*>(WindowManager::getSingleton().getWindow(name));
    }

    Scrollbar* FalagardMultiColumnList::createVertScrollbar(const String& name) const
    {
        // return component created by look'n'feel assignment.
        return static_cast<Scrollbar*>(WindowManager::getSingleton().getWindow(name));
{'fraction_non_alphanumeric': 0.17181340341655715, 'fraction_numerical': 0.00985545335085414, 'mean_word_length': 3.7533177205308355, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3098309', 'n_tokens_mistral': 1655, 'n_tokens_neox': 1545, 'n_words': 467}