Ticket #3038: t3038_rename_vertical_scrollbar_add_sprites_wip_v1.patch

File t3038_rename_vertical_scrollbar_add_sprites_wip_v1.patch, 44.7 KB (added by elexis, 4 years ago)

Renames "scrollbar" to "scrollbar_vertical", introduces "scrollbar_horizontal" in few but not all places, contains like 15% of the changes needed.

  • binaries/data/mods/mod/gui/common/modern/setup.xml

     
    99    -->
    1010    <scrollbar name="ModernScrollBar"
    1111            width = "15"
    1212            minimum_bar_size = "15"
    1313            maximum_bar_size = "15"
    14             show_edge_buttons = "false"
     14            show_edge_buttons = "true"
    1515            sprite_back_vertical = "ModernScrollBack"
    1616            sprite_bar_vertical = "ModernScrollBar"
     17            sprite_button_top = "ModernScrollBarUp"
     18            sprite_button_top_over = "ModernScrollBarUpOver"
     19            sprite_button_top_pressed = "ModernScrollBarUpPressed"
     20            sprite_button_top_disabled = "ModernScrollBarUpDisabled"
     21            sprite_button_bottom = "ModernScrollBarDown"
     22            sprite_button_bottom_over = "ModernScrollBarDownOver"
     23            sprite_button_bottom_disabled = "ModernScrollBarDownDisabed"
     24            sprite_button_bottom_pressed = "ModernScrollBarDownPressed"
    1725    />
    1826    <!--
    1927    ==========================================
    2028    - TOOLTIPS -
    2129    ==========================================
  • binaries/data/mods/mod/gui/common/modern/sprites.xml

     
    2121        <image texture = "global/modern/scrollback.png"
    2222            real_texture_placement = "0 0 15 128"
    2323            size = "0 0 100% 100%"
    2424        />
    2525    </sprite>
     26
    2627    <sprite name = "ModernScrollBar">
    2728        <image texture = "global/modern/scrollbar.png"
    2829            real_texture_placement = "0 0 15 15"
    2930            size = "0 0 100% 100%"
    3031        />
    3132    </sprite>
     33
     34    <sprite name = "ModernScrollBarUp">
     35        <image texture = "global/modern/arrow-up.png"
     36            size = "0 0 100% 15"
     37        />
     38    </sprite>
     39
     40    <sprite name = "ModernScrollBarUpOver">
     41        <effect add_color="blue" />
     42        <image texture = "global/modern/arrow-up.png"
     43            size = "0 0 100% 15"
     44        />
     45    </sprite>
     46
     47    <sprite name = "ModernScrollBarUpPressed">
     48        <effect add_color="red" />
     49        <image texture = "global/modern/arrow-up.png"
     50            size = "0 0 100% 15"
     51        />
     52    </sprite>
     53
     54    <sprite name = "ModernScrollBarUpDisabled">
     55        <effect add_color="gray" />
     56        <image texture = "global/modern/arrow-up.png"
     57            size = "0 0 100% 15"
     58        />
     59    </sprite>
     60
     61    <sprite name = "ModernScrollBarDown">
     62        <image texture = "global/modern/arrow-down.png"
     63            size = "0 100%-15 100% 100%"
     64        />
     65    </sprite>
     66
     67    <sprite name = "ModernScrollBarDownOver">
     68        <effect add_color="blue" />
     69        <image texture = "global/modern/arrow-down.png"
     70            size = "0 100%-15 100% 100%"
     71        />
     72    </sprite>
     73
     74    <sprite name = "ModernScrollBarDownPressed">
     75        <effect add_color="red" />
     76        <image texture = "global/modern/arrow-down.png"
     77            size = "0 100%-15 100% 100%"
     78        />
     79    </sprite>
     80
     81    <sprite name = "ModernScrollBarDownDisabled">
     82        <effect add_color="gray" />
     83        <image texture = "global/modern/arrow-down.png"
     84            size = "0 100%-15 100% 100%"
     85        />
     86    </sprite>
     87
    3288    <!--
    3389    ==========================================
    3490    - Window -
    3591    ==========================================
    3692    -->
  • binaries/data/mods/mod/gui/common/modern/styles.xml

     
    3737        text_valign = "top"
    3838    />
    3939    <style name = "ModernList"
    4040        buffer_zone = "5"
    4141        font = "sans-bold-stroke-14"
    42         scrollbar = "true"
     42        scrollbar_vertical = "true"
    4343        scrollbar_style = "ModernScrollBar"
    4444        sprite = "ModernDarkBoxGoldNoTop"
    4545        sprite_selectarea = "ModernDarkBoxWhite"
    4646        sprite_heading = "ModernDarkBoxGoldNoBottom"
    4747        textcolor = "white"
     
    6666        dropdown_size="224"
    6767        sprite_list="BlackBorderOnGray"
    6868        sprite_selectarea="ModernDarkBoxWhite"
    6969        textcolor_selected="white"
    7070
    71         scrollbar="true"
     71        scrollbar_vertical="true"
    7272        scrollbar_style="ModernScrollBar"
    7373
    7474        sound_opened="audio/interface/ui/ui_button_click.ogg"
    7575        sound_closed="audio/interface/ui/ui_button_click.ogg"
    7676        sound_selected="audio/interface/ui/ui_button_click.ogg"
     
    114114    <style name="ModernText"
    115115        font="sans-14"
    116116        textcolor="white"
    117117        text_align="left"
    118118        text_valign="top"
    119         scrollbar="true"
     119        scrollbar_vertical="true"
    120120        scrollbar_style="ModernScrollBar"
    121121    />
    122122    <style name="ModernInput"
    123123        sprite="ModernDarkBoxWhite"
    124124        sprite_selectarea="color:150 0 0"
  • binaries/data/mods/mod/gui/gui.rnc

    ex_settings =  
    6767  attribute mask_char { xsd:string { minLength = "1" maxLength = "1" } }?&
    6868  attribute max_length { xsd:nonNegativeInteger }?&
    6969  attribute maxwidth { xsd:decimal }? &
    7070  attribute multiline { bool }?&
    7171  attribute offset { pos }?&
    72   attribute scrollbar { bool }?&
     72  attribute scrollbar_vertical { bool }?&
    7373  attribute scrollbar_style { text }?&
    7474  attribute scroll_bottom { bool }?&
    7575  attribute sortable { bool }?&
    7676  attribute sound_closed { text }?&
    7777  attribute sound_disabled { text }?&
  • binaries/data/mods/mod/gui/gui.rng

     
    278278        <attribute name="offset">
    279279          <ref name="pos"/>
    280280        </attribute>
    281281      </optional>
    282282      <optional>
    283         <attribute name="scrollbar">
     283        <attribute name="scrollbar_vertical">
    284284          <ref name="bool"/>
    285285        </attribute>
    286286      </optional>
    287287      <optional>
    288288        <attribute name="scrollbar_style"/>
     
    291291        <attribute name="scroll_bottom">
    292292          <ref name="bool"/>
    293293        </attribute>
    294294      </optional>
    295295      <optional>
    296         <attribute name="sortable"/>
     296        <attribute name="sortable">
     297          <ref name="bool"/>
     298        </attribute>
    297299      </optional>
    298300      <optional>
    299301        <attribute name="sound_closed"/>
    300302      </optional>
    301303      <optional>
  • binaries/data/mods/mod/gui/modmod/styles.xml

     
    22
    33<styles>
    44    <style name="ModmodScrollbar"
    55        buffer_zone="5"
    66        font="sans-13"
    7         scrollbar="true"
     7        scrollbar_vertical="true"
    88        scrollbar_style="ModernScrollBar"
    99        scroll_bottom="true"
    1010        textcolor="white"
    1111        textcolor_selected="gold"
    1212        text_align="left"
  • binaries/data/mods/public/gui/common/common_styles.xml

     
    271271        dropdown_size="310"
    272272        sprite_list="BackgroundListBox"
    273273        sprite_selectarea="BackgroundSelectArea"
    274274        textcolor_selected="white"
    275275
    276         scrollbar="true"
     276        scrollbar_vertical="true"
    277277        scrollbar_style="wheatScrollBar"
    278278
    279279        sound_opened="audio/interface/ui/ui_button_click.ogg"
    280280        sound_closed="audio/interface/ui/ui_button_click.ogg"
    281281        sound_selected="audio/interface/ui/ui_button_click.ogg"
    282282    />
    283283
    284284    <style  name="StoneList"
    285285        buffer_zone="5"
    286286        font="sans-bold-stroke-14"
    287         scrollbar="true"
     287        scrollbar_vertical="true"
    288288        scrollbar_style="wheatScrollBar"
    289289        sprite="BackgroundIndentFillDark"
    290290        sprite_selectarea="BackgroundSelectArea"
    291291        sprite_over="BackgroundIndentFillDark"
    292292        textcolor="white"
  • binaries/data/mods/public/gui/credits/styles.xml

     
    22
    33<styles>
    44
    55    <style name="textPanel"
    66        buffer_zone="8"
    7         scrollbar="true"
     7        scrollbar_vertical="true"
    88        scrollbar_style="ModernScrollBar"
    99        font="sans-bold-stroke-14"
    1010        textcolor="white"
    1111        text_align="center"
    1212        text_valign="center"
  • binaries/data/mods/public/gui/gamesetup/gamesetup.xml

     
    8282                <object size="1 36 100%-1 100%">
    8383                    <repeat count="8">
    8484                        <object name="playerBox[n]" size="0 0 100% 32" hidden="true">
    8585                            <object name="playerColor[n]" type="image" size="0 0 100% 100%"/>
    8686                            <object name="playerName[n]" type="text" style="ModernLabelText" size="0 2 22% 30"/>
    87                             <object name="playerColorPicker[n]" type="dropdown" style="ModernDropDown" size="22%+5 2 22%+33 30" sprite="" scrollbar="false" button_width="22" font="sans-stroke-14" tooltip_style="onscreenToolTip">
     87                            <object name="playerColorPicker[n]" type="dropdown" style="ModernDropDown" size="22%+5 2 22%+33 30" sprite="" scrollbar_vertical="false" button_width="22" font="sans-stroke-14" tooltip_style="onscreenToolTip">
    8888                                <translatableAttribute id="tooltip">Pick a color.</translatableAttribute>
    8989                            </object>
    9090                            <object name="playerAssignment[n]" type="dropdown" style="ModernDropDown" size="22%+37 2 50%+35 30" tooltip_style="onscreenToolTip">
    9191                                <translatableAttribute id="tooltip">Select player.</translatableAttribute>
    9292                            </object>
  • binaries/data/mods/public/gui/gamesetup/styles.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22
    33<styles>
    44
    5 <!--    <style name="indentedPanel"
    6         buffer_zone="5"
    7         font="sans-14"
    8         sprite="wheatIndentFillLight"
    9         textcolor="black"
    10         textcolor_selected="white"
    11         text_align="left"
    12         text_valign="center"
    13     />-->
    14    
    155    <style name="MapDescription"
    166        buffer_zone="8"
    177        font="sans-12"
    18         scrollbar="true"
     8        scrollbar_vertical="true"
    199        scrollbar_style="ModernScrollBar"
    2010        scroll_bottom="true"
    2111        textcolor="white"
    2212        text_align="left"
    2313        text_valign="top"
    2414    />
    2515
    26 
    2716    <style name="ChatPanel"
    2817        buffer_zone="5"
    2918        font="sans-13"
    30         scrollbar="true"
     19        scrollbar_vertical="true"
    3120        scrollbar_style="ModernScrollBar"
    3221        scroll_bottom="true"
    3322        textcolor="white"
    3423        textcolor_selected="gold"
    3524        text_align="left"
  • binaries/data/mods/public/gui/lobby/styles.xml

     
    22
    33<styles>
    44    <style name="ChatPanel"
    55        buffer_zone="5"
    66        font="sans-13"
    7         scrollbar="true"
     7        scrollbar_vertical="true"
    88        scrollbar_style="ModernScrollBar"
    99        scroll_bottom="true"
    1010        textcolor="white"
    1111        textcolor_selected="gold"
    1212        text_align="left"
     
    1414    />
    1515
    1616    <style name="MapPlayerList"
    1717        buffer_zone="8"
    1818        font="sans-14"
    19         scrollbar="true"
     19        scrollbar_vertical="true"
    2020        scrollbar_style="ModernScrollBar"
    2121        scroll_bottom="true"
    2222        textcolor="white"
    2323        text_align="left"
    2424        text_valign="top"
  • binaries/data/mods/public/gui/manual/styles.xml

     
    33<styles>
    44
    55    <style name="textPanel"
    66        buffer_zone="8"
    77        font="sans-bold-16"
    8         scrollbar="true"
     8        scrollbar_vertical="true"
    99        scrollbar_style="ModernScrollBar"
    1010        textcolor="white"
    1111        textcolor_selected="black"
    1212        text_align="left"
    1313        text_valign="center"
  • binaries/data/mods/public/gui/pregame/mainmenu.xml

     
    523523
    524524                <!-- PRE-RELEASE WARNING -->
    525525                <object
    526526                    font="sans-14"
    527527                    type="text"
     528                    scrollbar_vertical="true"
     529                    scrollbar_style="ModernScrollBar"
    528530                    textcolor="white"
    529                     size="8 8 100%-8 100%-36"
    530                                         ghost="true"
     531                    size="8 8 100%-8 150"
    531532                >
    532533                    <!-- IMPORTANT: remember to update session/top_panel/label.xml in sync with this: -->
    533534                    <attribute id="caption">
    534                         <keep>[font="sans-bold-16"]</keep>
    535                         <translate>Alpha XX: Timosthenes</translate>
    536                         <keep>[/font]\n\n</keep>
    537                         <translate>WARNING: This is an early development version of the game. Many features have not been added yet.</translate>
     535                        <translate>WARNING: This is an early development version of the game. Many features have not been added yet. This is an early development version of the game. Many features have not been added yet. This is an early development version of the game. Many features have not been added yet. This is an early development version of the game. Many features have not been added yet. </translate>
    538536                    </attribute>
    539537                </object>
    540538
    541539                <!-- GET INVOLVED -->
    542540                <object type="button"
  • binaries/data/mods/public/gui/replaymenu/styles.xml

     
    22
    33<styles>
    44    <style name="MapPlayerList"
    55        buffer_zone="8"
    66        font="sans-14"
    7         scrollbar="true"
     7        scrollbar_vertical="true"
    88        scrollbar_style="ModernScrollBar"
    99        scroll_bottom="true"
    1010        textcolor="white"
    1111        text_align="left"
    1212        text_valign="top"
  • binaries/data/mods/public/gui/structree/structree.xml

     
    6060            text_valign="top"
    6161            size="104 52 100%-8 100%"
    6262        />
    6363
    6464        <!-- Structure Tree display -->
    65         <object size="0 54+64 100%-124 100%-54" name="display_tree">
     65        <object
     66            name="display_tree"
     67            type="container"
     68            scrollbar_vertical="true"
     69            scrollbar_horizontal="true"
     70            size="0 54+64 100%-124 100%-54"
     71        >
    6672            <repeat count="4" var="n">
    6773                <object name="phase[n]_phase" type="image"/>
    6874                <object name="phase[n]_bar">
    6975                    <repeat count="4" var="k">
    7076                        <object name="phase[n]_bar[k]" type="image" sprite="ProdBar">
  • binaries/data/mods/public/gui/structree/styles.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22
    33<styles>
    44    <style name="TreeDisplay"
    55        sprite="ModernDarkBoxGold"
    6         scrollbar="true"
     6        scrollbar_vertical="true"
    77        scrollbar_style="ModernScrollBar"
    88    />
    99
    1010    <style name="StructNameSpecific"
    1111        textcolor="white"
  • source/gui/CDropDown.cpp

    CDropDown::CDropDown()  
    4848    // Add these in CList! And implement TODO
    4949    //AddSetting(GUIST_CColor,              "textcolor_over");
    5050    //AddSetting(GUIST_CColor,              "textcolor_pressed");
    5151    //AddSetting(GUIST_CColor,              "textcolor_disabled");
    5252
    53     // Scrollbar is forced to be true.
    54     GUI<bool>::SetSetting(this, "scrollbar", true);
     53    // Set default
     54    GUI<bool>::SetSetting(this, "scrollbar_vertical", true);
    5555}
    5656
    5757CDropDown::~CDropDown()
    5858{
    5959}
    void CDropDown::HandleMessage(SGUIMessag  
    9595        CPos mouse = GetMousePos();
    9696
    9797        if (!GetListRect().PointInside(mouse))
    9898            break;
    9999
    100         bool scrollbar;
     100        bool scrollbar_vertical;
    101101        CGUIList* pList;
    102         GUI<bool>::GetSetting(this, "scrollbar", scrollbar);
     102        GUI<bool>::GetSetting(this, "scrollbar_vertical", scrollbar_vertical);
    103103        GUI<CGUIList>::GetSettingPointer(this, "list", pList);
    104104        float scroll = 0.f;
    105         if (scrollbar)
     105        if (scrollbar_vertical)
    106106            scroll = GetScrollBar(0).GetPos();
    107107
    108108        CRect rect = GetListRect();
    109109        mouse.y += scroll;
    110110        int set = -1;
    void CDropDown::Draw()  
    485485
    486486        CPos pos(m_CachedActualSize.left, m_CachedActualSize.top);
    487487        DrawText(selected, color, pos, bz+0.1f, cliparea);
    488488    }
    489489
    490     bool* scrollbar = NULL;
     490    bool* scrollbar_vertical = NULL;
    491491    bool old;
    492     GUI<bool>::GetSettingPointer(this, "scrollbar", scrollbar);
     492    GUI<bool>::GetSettingPointer(this, "scrollbar_vertical", scrollbar_vertical);
    493493
    494     old = *scrollbar;
     494    old = *scrollbar_vertical;
    495495
    496496    if (m_Open)
    497497    {
    498498        if (m_HideScrollBar)
    499             *scrollbar = false;
     499            *scrollbar_vertical = false;
    500500
    501501        DrawList(m_ElementHighlight, "sprite_list", "sprite_selectarea", "textcolor");
    502502
    503503        if (m_HideScrollBar)
    504             *scrollbar = old;
     504            *scrollbar_vertical = old;
    505505    }
    506506}
    507507
    508508// When a dropdown list is opened, it needs to be visible above all the other
    509509// controls on the page. The only way I can think of to do this is to increase
  • source/gui/CGUI.cpp

    IGUIObject* CGUI::ConstructObject(const  
    315315    }
    316316}
    317317
    318318void CGUI::Initialize()
    319319{
    320     // Add base types!
    321320    //  You can also add types outside the GUI to extend the flexibility of the GUI.
    322321    //  Pyrogenesis though will have all the object types inserted from here.
    323322    AddObjectType("empty",          &CGUIDummyObject::ConstructObject);
    324323    AddObjectType("button",         &CButton::ConstructObject);
    325324    AddObjectType("image",          &CImage::ConstructObject);
    void CGUI::Xeromyces_ReadObject(XMBEleme  
    979978    // Our object we are going to create
    980979    IGUIObject* object = NULL;
    981980
    982981    XMBAttributeList attributes = Element.GetAttributes();
    983982
    984     // Well first of all we need to determine the type
    985983    CStr type(attributes.GetNamedItem(pFile->GetAttributeID("type")));
    986984    if (type.empty())
    987985        type = "empty";
    988986
    989987    // Construct object from specified type
    void CGUI::Xeromyces_ReadImage(XMBElemen  
    16271625        {
    16281626            debug_warn(L"Invalid data - DTD shouldn't allow this");
    16291627        }
    16301628    }
    16311629
    1632     //
    1633     //  Input
    1634     //
    1635 
    16361630    parent.AddImage(Image);
    16371631}
    16381632
    16391633void CGUI::Xeromyces_ReadEffects(XMBElement Element, CXeromyces* pFile, SGUIImageEffects& effects)
    16401634{
    void CGUI::Xeromyces_ReadScrollBarStyle(  
    17481742            if (!GUI<float>::ParseString(attr_value.FromUTF8(), f))
    17491743                LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name, attr_value);
    17501744            else
    17511745                scrollbar.m_MaximumBarSize = f;
    17521746        }
     1747        // Vertical scrollbar style
    17531748        else if (attr_name == "sprite_button_top")
    17541749            scrollbar.m_SpriteButtonTop = attr_value;
    17551750        else if (attr_name == "sprite_button_top_pressed")
    17561751            scrollbar.m_SpriteButtonTopPressed = attr_value;
    17571752        else if (attr_name == "sprite_button_top_disabled")
    void CGUI::Xeromyces_ReadScrollBarStyle(  
    17721767            scrollbar.m_SpriteBarVertical = attr_value;
    17731768        else if (attr_name == "sprite_bar_vertical_over")
    17741769            scrollbar.m_SpriteBarVerticalOver = attr_value;
    17751770        else if (attr_name == "sprite_bar_vertical_pressed")
    17761771            scrollbar.m_SpriteBarVerticalPressed = attr_value;
    1777     }
    17781772
    1779     //
    1780     //  Add to CGUI
    1781     //
     1773        // Horizontal scrollbar style
     1774        else if (attr_name == "sprite_button_left")
     1775            scrollbar.m_SpriteButtonTop = attr_value;
     1776        else if (attr_name == "sprite_button_left_pressed")
     1777            scrollbar.m_SpriteButtonTopPressed = attr_value;
     1778        else if (attr_name == "sprite_button_left_disabled")
     1779            scrollbar.m_SpriteButtonTopDisabled = attr_value;
     1780        else if (attr_name == "sprite_button_left_over")
     1781            scrollbar.m_SpriteButtonTopOver = attr_value;
     1782        else if (attr_name == "sprite_button_right")
     1783            scrollbar.m_SpriteButtonBottom = attr_value;
     1784        else if (attr_name == "sprite_button_right_pressed")
     1785            scrollbar.m_SpriteButtonBottomPressed = attr_value;
     1786        else if (attr_name == "sprite_button_right_disabled")
     1787            scrollbar.m_SpriteButtonBottomDisabled = attr_value;
     1788        else if (attr_name == "sprite_button_right_over")
     1789            scrollbar.m_SpriteButtonBottomOver = attr_value;
     1790        else if (attr_name == "sprite_back_horizontal")
     1791            scrollbar.m_SpriteBackVertical = attr_value;
     1792        else if (attr_name == "sprite_bar_horizontal")
     1793            scrollbar.m_SpriteBarVertical = attr_value;
     1794        else if (attr_name == "sprite_bar_horizontal_over")
     1795            scrollbar.m_SpriteBarVerticalOver = attr_value;
     1796        else if (attr_name == "sprite_bar_horizontal_pressed")
     1797            scrollbar.m_SpriteBarVerticalPressed = attr_value;
     1798    }
    17821799
    17831800    m_ScrollBarStyles[name] = scrollbar;
    17841801}
    17851802
    17861803void CGUI::Xeromyces_ReadIcon(XMBElement Element, CXeromyces* pFile)
  • source/gui/CGUIScrollBarVertical.cpp

    void CGUIScrollBarVertical::SetPosFromMo  
    5050
    5151void CGUIScrollBarVertical::Draw()
    5252{
    5353    if (!GetStyle())
    5454    {
    55         LOGWARNING("Attempt to draw scrollbar without a style.");
     55        LOGWARNING("Attempt to draw a vertical scrollbar without a style.");
    5656        return;
    5757    }
    5858
    5959    if (GetGUI() && IsVisible())
    6060    {
  • source/gui/CGUIScrollBarVertical.h

     
    1 /* Copyright (C) 2015 Wildfire Games.
     1/* Copyright (C) 2016 Wildfire Games.
    22 * This file is part of 0 A.D.
    33 *
    44 * 0 A.D. is free software: you can redistribute it and/or modify
    55 * it under the terms of the GNU General Public License as published by
    66 * the Free Software Foundation, either version 2 of the License, or
     
    1414 * You should have received a copy of the GNU General Public License
    1515 * along with 0 A.D.  If not, see <http://www.gnu.org/licenses/>.
    1616 */
    1717
    1818/*
    19 A GUI ScrollBar
    20 
    21 --Overview--
    22 
    2319    A GUI Scrollbar, this class doesn't present all functionality
    2420    to the scrollbar, it just controls the drawing and a wrapper
    2521    for interaction with it.
    26 
    27 --Usage--
    28 
    29     Used in everywhere scrollbars are needed, like in a combobox for instance.
    30 
    31 --More info--
    32 
    33     Check GUI.h
    34 
    3522*/
    3623
    3724#ifndef INCLUDED_CGUISCROLLBARVERTICAL
    3825#define INCLUDED_CGUISCROLLBARVERTICAL
    3926
    class CGUIScrollBarVertical : public IGU  
    5037public:
    5138    CGUIScrollBarVertical();
    5239    virtual ~CGUIScrollBarVertical();
    5340
    5441public:
    55     /**
    56      * Draw the scroll-bar
    57      */
     42
    5843    virtual void Draw();
    5944
    6045    /**
    6146     * If an object that contains a scrollbar has got messages, send
    6247     * them to the scroll-bar and it will see if the message regarded
    public:  
    6954    /**
    7055     * Set m_Pos with g_mouse_x/y input, i.e. when dragging.
    7156     */
    7257    virtual void SetPosFromMousePos(const CPos& mouse);
    7358
    74     /**
    75      * @see IGUIScrollBar#HoveringButtonMinus
    76      */
    7759    virtual bool HoveringButtonMinus(const CPos& mouse);
    78 
    79     /**
    80      * @see IGUIScrollBar#HoveringButtonPlus
    81      */
    8260    virtual bool HoveringButtonPlus(const CPos& mouse);
    8361
    84     /**
    85      * Set Right Aligned
    86      * @param align Alignment
    87      */
    8862    void SetRightAligned(const bool& align) { m_RightAligned = align; }
    8963
    9064    /**
    9165     * Get the rectangle of the actual BAR.
    92      * @return Rectangle, CRect
    9366     */
    9467    virtual CRect GetBarRect() const;
    9568
    9669    /**
    9770     * Get the rectangle of the outline of the scrollbar, every component of the
    9871     * scroll-bar should be inside this area.
    99      * @return Rectangle, CRect
    10072     */
    10173    virtual CRect GetOuterRect() const;
    10274
    10375protected:
    10476    /**
  • source/gui/CInput.cpp

    CInput::CInput()  
    5252    AddSetting(GUIST_CStrW,                 "font");
    5353    AddSetting(GUIST_CStrW,                 "mask_char");
    5454    AddSetting(GUIST_bool,                  "mask");
    5555    AddSetting(GUIST_int,                   "max_length");
    5656    AddSetting(GUIST_bool,                  "multiline");
    57     AddSetting(GUIST_bool,                  "scrollbar");
     57    AddSetting(GUIST_bool,                  "scrollbar_vertical");
    5858    AddSetting(GUIST_CStr,                  "scrollbar_style");
    5959    AddSetting(GUIST_CGUISpriteInstance,    "sprite");
    6060    AddSetting(GUIST_CGUISpriteInstance,    "sprite_selectarea");
    6161    AddSetting(GUIST_CColor,                "textcolor");
    6262    AddSetting(GUIST_CColor,                "textcolor_selected");
    void CInput::HandleMessage(SGUIMessage&  
    783783
    784784    switch (Message.type)
    785785    {
    786786    case GUIM_SETTINGS_UPDATED:
    787787    {
    788         bool scrollbar;
    789         GUI<bool>::GetSetting(this, "scrollbar", scrollbar);
     788        bool scrollbar_vertical;
     789        GUI<bool>::GetSetting(this, "scrollbar_vertical", scrollbar_vertical);
    790790
    791791        // Update scroll-bar
    792792        // TODO Gee: (2004-09-01) Is this really updated each time it should?
    793         if (scrollbar &&
     793        if (scrollbar_vertical &&
    794794            (Message.value == CStr("size") ||
    795795             Message.value == CStr("z") ||
    796796             Message.value == CStr("absolute")))
    797797        {
    798798            GetScrollBar(0).SetX(m_CachedActualSize.right);
    void CInput::HandleMessage(SGUIMessage&  
    819819        if (Message.value == CStr("size") ||
    820820            Message.value == CStr("z") ||
    821821            Message.value == CStr("font") ||
    822822            Message.value == CStr("absolute") ||
    823823            Message.value == CStr("caption") ||
    824             Message.value == CStr("scrollbar") ||
     824            Message.value == CStr("scrollbar_vertical") ||
    825825            Message.value == CStr("scrollbar_style"))
    826826        {
    827827            UpdateText();
    828828        }
    829829
    void CInput::HandleMessage(SGUIMessage&  
    842842        break;
    843843    }
    844844
    845845    case GUIM_MOUSE_PRESS_LEFT:
    846846    {
    847         bool scrollbar, multiline;
    848         GUI<bool>::GetSetting(this, "scrollbar", scrollbar);
     847        bool scrollbar_vertical, multiline;
     848        GUI<bool>::GetSetting(this, "scrollbar_vertical", scrollbar_vertical);
    849849        GUI<bool>::GetSetting(this, "multiline", multiline);
    850850
    851851        // Check if we're selecting the scrollbar
    852852        if (GetScrollBar(0).GetStyle() && multiline)
    853853        {
    void CInput::UpdateCachedSize()  
    10671067    // If an ancestor's size changed, this will let us intercept the change and
    10681068    // update our scrollbar positions
    10691069
    10701070    IGUIObject::UpdateCachedSize();
    10711071
    1072     bool scrollbar;
    1073     GUI<bool>::GetSetting(this, "scrollbar", scrollbar);
    1074     if (scrollbar)
     1072    bool scrollbar_vertical;
     1073    GUI<bool>::GetSetting(this, "scrollbar_vertical", scrollbar_vertical);
     1074    if (scrollbar_vertical)
    10751075    {
    10761076        GetScrollBar(0).SetX(m_CachedActualSize.right);
    10771077        GetScrollBar(0).SetY(m_CachedActualSize.top);
    10781078        GetScrollBar(0).SetZ(GetBufferedZ());
    10791079        GetScrollBar(0).SetLength(m_CachedActualSize.bottom - m_CachedActualSize.top);
    void CInput::Draw()  
    10991099        // should always be visible
    11001100        m_CursorVisState = true;
    11011101    }
    11021102
    11031103    // First call draw on ScrollBarOwner
    1104     bool scrollbar;
     1104    bool scrollbar_vertical;
    11051105    float buffer_zone;
    11061106    bool multiline;
    11071107    bool mask;
    1108     GUI<bool>::GetSetting(this, "scrollbar", scrollbar);
     1108    GUI<bool>::GetSetting(this, "scrollbar_vertical", scrollbar_vertical);
    11091109    GUI<float>::GetSetting(this, "buffer_zone", buffer_zone);
    11101110    GUI<bool>::GetSetting(this, "multiline", multiline);
    11111111    GUI<bool>::GetSetting(this, "mask", mask);
    11121112
    1113     if (scrollbar && multiline)
     1113    if (scrollbar_vertical && multiline)
    11141114        IGUIScrollBarOwner::Draw();
    11151115
    11161116    if (!GetGUI())
    11171117        return;
    11181118
    void CInput::Draw()  
    11471147    GUI<int>::GetSetting(this, "cell_id", cell_id);
    11481148
    11491149    GetGUI()->DrawSprite(*sprite, cell_id, bz, m_CachedActualSize);
    11501150
    11511151    float scroll = 0.f;
    1152     if (scrollbar && multiline)
     1152    if (scrollbar_vertical && multiline)
    11531153        scroll = GetScrollBar(0).GetPos();
    11541154
    11551155    CFontMetrics font(font_name);
    11561156
    11571157    // We'll have to setup clipping manually, since we're doing the rendering manually.
    11581158    CRect cliparea(m_CachedActualSize);
    11591159
    11601160    // First we'll figure out the clipping area, which is the cached actual size
    11611161    //  substracted by an optional scrollbar
    1162     if (scrollbar)
     1162    if (scrollbar_vertical)
    11631163    {
    11641164        scroll = GetScrollBar(0).GetPos();
    11651165
    11661166        // substract scrollbar from cliparea
    11671167        if (cliparea.right > GetScrollBar(0).GetOuterRect().left &&
    void CInput::UpdateText(int from, int to  
    18321832    }
    18331833
    18341834    // add the final row (even if empty)
    18351835    m_CharacterPositions.insert(current_line, row);
    18361836
    1837     bool scrollbar;
    1838     GUI<bool>::GetSetting(this, "scrollbar", scrollbar);
     1837    bool scrollbar_vertical;
     1838    GUI<bool>::GetSetting(this, "scrollbar_vertical", scrollbar_vertical);
    18391839    // Update scollbar
    1840     if (scrollbar)
     1840    if (scrollbar_vertical)
    18411841    {
    18421842        GetScrollBar(0).SetScrollRange(m_CharacterPositions.size() * font.GetLineSpacing() + buffer_zone*2.f);
    18431843        GetScrollBar(0).SetScrollSpace(m_CachedActualSize.GetHeight());
    18441844    }
    18451845}
    int CInput::GetMouseHoveringTextPosition  
    18621862    CPos mouse = GetMousePos();
    18631863
    18641864    if (multiline)
    18651865    {
    18661866        CStrW font_name_w;
    1867         bool scrollbar;
     1867        bool scrollbar_vertical;
    18681868        GUI<CStrW>::GetSetting(this, "font", font_name_w);
    1869         GUI<bool>::GetSetting(this, "scrollbar", scrollbar);
     1869        GUI<bool>::GetSetting(this, "scrollbar_vertical", scrollbar_vertical);
    18701870        CStrIntern font_name(font_name_w.ToUTF8());
    18711871
    18721872        float scroll = 0.f;
    1873         if (scrollbar)
     1873        if (scrollbar_vertical)
    18741874            scroll = GetScrollBarPos(0);
    18751875
    18761876        // Now get the height of the font.
    18771877                        // TODO: Get the real font
    18781878        CFontMetrics font(font_name);
    bool CInput::SelectingText() const  
    19851985           m_iBufferPos_Tail != m_iBufferPos;
    19861986}
    19871987
    19881988float CInput::GetTextAreaWidth()
    19891989{
    1990     bool scrollbar;
     1990    bool scrollbar_vertical;
    19911991    float buffer_zone;
    1992     GUI<bool>::GetSetting(this, "scrollbar", scrollbar);
     1992    GUI<bool>::GetSetting(this, "scrollbar_vertical", scrollbar_vertical);
    19931993    GUI<float>::GetSetting(this, "buffer_zone", buffer_zone);
    19941994
    1995     if (scrollbar && GetScrollBar(0).GetStyle())
     1995    if (scrollbar_vertical && GetScrollBar(0).GetStyle())
    19961996        return m_CachedActualSize.GetWidth() - buffer_zone*2.f - GetScrollBar(0).GetStyle()->m_Width;
    19971997    else
    19981998        return m_CachedActualSize.GetWidth() - buffer_zone*2.f;
    19991999}
    20002000
    void CInput::UpdateAutoScroll()  
    20072007
    20082008    // Autoscrolling up and down
    20092009    if (multiline)
    20102010    {
    20112011        CStrW font_name_w;
    2012         bool scrollbar;
     2012        bool scrollbar_vertical;
    20132013        GUI<CStrW>::GetSetting(this, "font", font_name_w);
    2014         GUI<bool>::GetSetting(this, "scrollbar", scrollbar);
     2014        GUI<bool>::GetSetting(this, "scrollbar_vertical", scrollbar_vertical);
    20152015        CStrIntern font_name(font_name_w.ToUTF8());
    20162016
    20172017        float scroll = 0.f;
    2018         if (!scrollbar)
     2018        if (!scrollbar_vertical)
    20192019            return;
    20202020
    20212021        scroll = GetScrollBar(0).GetPos();
    20222022
    20232023        // Now get the height of the font.
  • source/gui/CList.cpp

    CList::CList()  
    3131{
    3232    // Add sprite_disabled! TODO
    3333
    3434    AddSetting(GUIST_float,                 "buffer_zone");
    3535    AddSetting(GUIST_CStrW,                 "font");
    36     AddSetting(GUIST_bool,                  "scrollbar");
     36    AddSetting(GUIST_bool,                  "scrollbar_vertical");
    3737    AddSetting(GUIST_CStr,                  "scrollbar_style");
    3838    AddSetting(GUIST_CStrW,                 "sound_disabled");
    3939    AddSetting(GUIST_CStrW,                 "sound_selected");
    4040    AddSetting(GUIST_CGUISpriteInstance,    "sprite");
    4141    AddSetting(GUIST_CGUISpriteInstance,    "sprite_selectarea");
    CList::CList()  
    4848    AddSetting(GUIST_CStr,                  "tooltip_style");
    4949    // Each list item has both a name (in 'list') and an associated data string (in 'list_data')
    5050    AddSetting(GUIST_CGUIList,              "list");
    5151    AddSetting(GUIST_CGUIList,              "list_data"); // TODO: this should be a list of raw strings, not of CGUIStrings
    5252
    53     GUI<bool>::SetSetting(this, "scrollbar", false);
     53    GUI<bool>::SetSetting(this, "scrollbar_vertical", false);
    5454
    5555    // Nothing is selected as default.
    5656    GUI<int>::SetSetting(this, "selected", -1);
    5757
    5858    // Add scroll-bar
    void CList::SetupText()  
    8989    if (GUI<CStrW>::GetSetting(this, "font", font) != PSRETURN_OK || font.empty())
    9090        // Use the default if none is specified
    9191        // TODO Gee: (2004-08-14) Don't define standard like this. Do it with the default style.
    9292        font = L"default";
    9393
    94     bool scrollbar;
    95     GUI<bool>::GetSetting(this, "scrollbar", scrollbar);
     94    bool scrollbar_vertical;
     95    GUI<bool>::GetSetting(this, "scrollbar_vertical", scrollbar_vertical);
    9696
    9797    float width = GetListRect().GetWidth();
    9898    // remove scrollbar if applicable
    99     if (scrollbar && GetScrollBar(0).GetStyle())
     99    if (scrollbar_vertical && GetScrollBar(0).GetStyle())
    100100        width -= GetScrollBar(0).GetStyle()->m_Width;
    101101
    102102    float buffer_zone = 0.f;
    103103    GUI<float>::GetSetting(this, "buffer_zone", buffer_zone);
    104104
    void CList::SetupText()  
    118118        AddText(text);
    119119    }
    120120
    121121    m_ItemsYPositions[pList->m_Items.size()] = buffered_y;
    122122
    123     // Setup scrollbar
    124     if (scrollbar)
     123    if (scrollbar_vertical)
    125124    {
    126125        GetScrollBar(0).SetScrollRange(m_ItemsYPositions.back());
    127126        GetScrollBar(0).SetScrollSpace(GetListRect().GetHeight());
    128127
    129128        CRect rect = GetListRect();
    void CList::HandleMessage(SGUIMessage& M  
    153152
    154153            // TODO only works if lower-case, shouldn't it be made case sensitive instead?
    155154            ScriptEvent("selectionchange");
    156155        }
    157156
    158         if (Message.value == "scrollbar")
     157        if (Message.value == "scrollbar_vertical")
    159158            SetupText();
    160159
    161         // Update scrollbar
    162160        if (Message.value == "scrollbar_style")
    163161        {
    164162            CStr scrollbar_style;
    165163            GUI<CStr>::GetSetting(this, Message.value, scrollbar_style);
    166164
    void CList::HandleMessage(SGUIMessage& M  
    181179            if (g_SoundManager && GUI<CStrW>::GetSetting(this, "sound_disabled", soundPath) == PSRETURN_OK && !soundPath.empty())
    182180                g_SoundManager->PlayAsUI(soundPath.c_str(), false);
    183181            break;
    184182        }
    185183
    186         bool scrollbar;
     184        bool scrollbar_vertical;
    187185        CGUIList* pList;
    188         GUI<bool>::GetSetting(this, "scrollbar", scrollbar);
     186        GUI<bool>::GetSetting(this, "scrollbar_vertical", scrollbar_vertical);
    189187        GUI<CGUIList>::GetSettingPointer(this, "list", pList);
    190188        float scroll = 0.f;
    191         if (scrollbar)
     189        if (scrollbar_vertical)
    192190            scroll = GetScrollBar(0).GetPos();
    193191
    194192        CRect rect = GetListRect();
    195193        CPos mouse = GetMousePos();
    196194        mouse.y += scroll;
    void CList::HandleMessage(SGUIMessage& M  
    198196        for (int i = 0; i < (int)pList->m_Items.size(); ++i)
    199197        {
    200198            if (mouse.y >= rect.top + m_ItemsYPositions[i] &&
    201199                mouse.y < rect.top + m_ItemsYPositions[i+1] &&
    202200                // mouse is not over scroll-bar
    203                 (!scrollbar || !GetScrollBar(0).IsVisible() ||
     201                (!scrollbar_vertical || !GetScrollBar(0).IsVisible() ||
    204202                    mouse.x < GetScrollBar(0).GetOuterRect().left ||
    205203                    mouse.x > GetScrollBar(0).GetOuterRect().right))
    206204            {
    207205                set = i;
    208206            }
    void CList::Draw()  
    303301void CList::DrawList(const int& selected, const CStr& _sprite, const CStr& _sprite_selected, const CStr& _textcolor)
    304302{
    305303    float bz = GetBufferedZ();
    306304
    307305    // First call draw on ScrollBarOwner
    308     bool scrollbar;
    309     GUI<bool>::GetSetting(this, "scrollbar", scrollbar);
     306    bool scrollbar_vertical;
     307    GUI<bool>::GetSetting(this, "scrollbar_vertical", scrollbar_vertical);
    310308
    311     if (scrollbar)
     309    if (scrollbar_vertical)
    312310        IGUIScrollBarOwner::Draw();
    313311
    314312    if (GetGUI())
    315313    {
    316314        CRect rect = GetListRect();
    void CList::DrawList(const int& selected  
    326324        GUI<CGUIList>::GetSettingPointer(this, "list", pList);
    327325
    328326        GetGUI()->DrawSprite(*sprite, cell_id, bz, rect);
    329327
    330328        float scroll = 0.f;
    331         if (scrollbar)
     329        if (scrollbar_vertical)
    332330            scroll = GetScrollBar(0).GetPos();
    333331
    334332        if (selected >= 0 && selected+1 < (int)m_ItemsYPositions.size())
    335333        {
    336334            // Get rectangle of selection:
    void CList::DrawList(const int& selected  
    343341                if (rect_sel.bottom > rect.bottom)
    344342                    rect_sel.bottom = rect.bottom;
    345343                if (rect_sel.top < rect.top)
    346344                    rect_sel.top = rect.top;
    347345
    348                 if (scrollbar)
     346                if (scrollbar_vertical)
    349347                {
    350348                    // Remove any overlapping area of the scrollbar.
    351349                    if (rect_sel.right > GetScrollBar(0).GetOuterRect().left &&
    352350                        rect_sel.right <= GetScrollBar(0).GetOuterRect().right)
    353351                        rect_sel.right = GetScrollBar(0).GetOuterRect().left;
    void CList::DrawList(const int& selected  
    371369                continue;
    372370
    373371            // Clipping area (we'll have to substract the scrollbar)
    374372            CRect cliparea = GetListRect();
    375373
    376             if (scrollbar)
     374            if (scrollbar_vertical)
    377375            {
    378376                if (cliparea.right > GetScrollBar(0).GetOuterRect().left &&
    379377                    cliparea.right <= GetScrollBar(0).GetOuterRect().right)
    380378                    cliparea.right = GetScrollBar(0).GetOuterRect().left;
    381379
    void CList::SelectLastElement()  
    478476}
    479477
    480478void CList::UpdateAutoScroll()
    481479{
    482480    int selected;
    483     bool scrollbar;
     481    bool scrollbar_vertical;
    484482    float scroll;
    485483    GUI<int>::GetSetting(this, "selected", selected);
    486     GUI<bool>::GetSetting(this, "scrollbar", scrollbar);
     484    GUI<bool>::GetSetting(this, "scrollbar_vertical", scrollbar_vertical);
    487485
    488486    CRect rect = GetListRect();
    489487
    490488    // No scrollbar, no scrolling (at least it's not made to work properly).
    491     if (!scrollbar)
     489    if (!scrollbar_vertical)
    492490        return;
    493491
    494492    scroll = GetScrollBar(0).GetPos();
    495493
    496494    // Check upper boundary
  • source/gui/COList.cpp

    void COList::SetupText()  
    6363    if (GUI<CStrW>::GetSetting(this, "font", font) != PSRETURN_OK || font.empty())
    6464        // Use the default if none is specified
    6565        // TODO Gee: (2004-08-14) Don't define standard like this. Do it with the default style.
    6666        font = L"default";
    6767
    68     bool scrollbar;
    69     GUI<bool>::GetSetting(this, "scrollbar", scrollbar);
     68    bool scrollbar_vertical;
     69    GUI<bool>::GetSetting(this, "scrollbar_vertical", scrollbar_vertical);
    7070
    7171    float width = GetListRect().GetWidth();
    7272    // remove scrollbar if applicable
    73     if (scrollbar && GetScrollBar(0).GetStyle())
     73    if (scrollbar_vertical && GetScrollBar(0).GetStyle())
    7474        width -= GetScrollBar(0).GetStyle()->m_Width;
    7575
    7676    m_TotalAvalibleColumnWidth = width;
    7777
    7878    float buffer_zone = 0.f;
    void COList::SetupText()  
    121121        }
    122122    }
    123123
    124124    m_ItemsYPositions[pList->m_Items.size()] = buffered_y;
    125125
    126     if (scrollbar)
     126    if (scrollbar_vertical)
    127127    {
    128128        GetScrollBar(0).SetScrollRange(m_ItemsYPositions.back());
    129129        GetScrollBar(0).SetScrollSpace(GetListRect().GetHeight());
    130130
    131131        CRect rect = GetListRect();
    bool COList::HandleAdditionalChildren(co  
    297297
    298298void COList::DrawList(const int& selected, const CStr& _sprite, const CStr& _sprite_selected, const CStr& _textcolor)
    299299{
    300300    float bz = GetBufferedZ();
    301301
    302     bool scrollbar;
    303     GUI<bool>::GetSetting(this, "scrollbar", scrollbar);
     302    bool scrollbar_vertical;
     303    GUI<bool>::GetSetting(this, "scrollbar_vertical", scrollbar_vertical);
    304304
    305     if (scrollbar)
     305    if (scrollbar_vertical)
    306306        IGUIScrollBarOwner::Draw();
    307307
    308308    if (!GetGUI())
    309309        return;
    310310
    void COList::DrawList(const int& selecte  
    321321    GUI<CGUIList>::GetSettingPointer(this, "list_name", pList);
    322322
    323323    GetGUI()->DrawSprite(*sprite, cell_id, bz, rect);
    324324
    325325    float scroll = 0.f;
    326     if (scrollbar)
     326    if (scrollbar_vertical)
    327327        scroll = GetScrollBar(0).GetPos();
    328328
    329329    // Draw item selection
    330330    if (selected != -1)
    331331    {
    void COList::DrawList(const int& selecte  
    341341            if (rect_sel.bottom > rect.bottom)
    342342                rect_sel.bottom = rect.bottom;
    343343            if (rect_sel.top < rect.top)
    344344                rect_sel.top = rect.top;
    345345
    346             if (scrollbar)
     346            if (scrollbar_vertical)
    347347            {
    348348                // Remove any overlapping area of the scrollbar.
    349349                if (rect_sel.right > GetScrollBar(0).GetOuterRect().left &&
    350350                    rect_sel.right <= GetScrollBar(0).GetOuterRect().right)
    351351                    rect_sel.right = GetScrollBar(0).GetOuterRect().left;
    void COList::DrawList(const int& selecte  
    415415        const float rowHeight = m_ItemsYPositions[i+1] - m_ItemsYPositions[i];
    416416
    417417        // Clipping area (we'll have to substract the scrollbar)
    418418        CRect cliparea = GetListRect();
    419419
    420         if (scrollbar)
     420        if (scrollbar_vertical)
    421421        {
    422422            if (cliparea.right > GetScrollBar(0).GetOuterRect().left &&
    423423                cliparea.right <= GetScrollBar(0).GetOuterRect().right)
    424424                cliparea.right = GetScrollBar(0).GetOuterRect().left;
    425425
  • source/gui/CText.cpp

    CText::CText()  
    2929    AddSetting(GUIST_float,                 "buffer_zone");
    3030    AddSetting(GUIST_CGUIString,            "caption");
    3131    AddSetting(GUIST_int,                   "cell_id");
    3232    AddSetting(GUIST_bool,                  "clip");
    3333    AddSetting(GUIST_CStrW,                 "font");
    34     AddSetting(GUIST_bool,                  "scrollbar");
     34    AddSetting(GUIST_bool,                  "scrollbar_vertical");
    3535    AddSetting(GUIST_CStr,                  "scrollbar_style");
    3636    AddSetting(GUIST_bool,                  "scroll_bottom");
    3737    AddSetting(GUIST_CGUISpriteInstance,    "sprite");
    3838    AddSetting(GUIST_EAlign,                "text_align");
    3939    AddSetting(GUIST_EVAlign,               "text_valign");
    CText::CText()  
    4444    // Private settings
    4545    AddSetting(GUIST_CStrW,                 "_icon_tooltip");
    4646    AddSetting(GUIST_CStr,                  "_icon_tooltip_style");
    4747
    4848    //GUI<bool>::SetSetting(this, "ghost", true);
    49     GUI<bool>::SetSetting(this, "scrollbar", false);
     49    GUI<bool>::SetSetting(this, "scrollbar_vertical", false);
    5050    GUI<bool>::SetSetting(this, "clip", true);
    5151
    5252    // Add scroll-bar
    5353    CGUIScrollBarVertical* bar = new CGUIScrollBarVertical();
    5454    bar->SetRightAligned(true);
    void CText::SetupText()  
    7474        // Use the default if none is specified
    7575        // TODO Gee: (2004-08-14) Don't define standard like this. Do it with the default style.
    7676        font = L"default";
    7777
    7878    CGUIString caption;
    79     bool scrollbar;
     79    bool scrollbar_vertical;
    8080    GUI<CGUIString>::GetSetting(this, "caption", caption);
    81     GUI<bool>::GetSetting(this, "scrollbar", scrollbar);
     81    GUI<bool>::GetSetting(this, "scrollbar_vertical", scrollbar_vertical);
    8282
    8383    float width = m_CachedActualSize.GetWidth();
    8484    // remove scrollbar if applicable
    85     if (scrollbar && GetScrollBar(0).GetStyle())
     85    if (scrollbar_vertical && GetScrollBar(0).GetStyle())
    8686        width -= GetScrollBar(0).GetStyle()->m_Width;
    8787
    8888
    8989    float buffer_zone = 0.f;
    9090    GUI<float>::GetSetting(this, "buffer_zone", buffer_zone);
    9191    *m_GeneratedTexts[0] = GetGUI()->GenerateText(caption, font, width, buffer_zone, this);
    9292
    93     if (!scrollbar)
     93    if (!scrollbar_vertical)
    9494        CalculateTextPosition(m_CachedActualSize, m_TextPos, *m_GeneratedTexts[0]);
    9595
    96     // Setup scrollbar
    97     if (scrollbar)
     96    if (scrollbar_vertical)
    9897    {
    9998        bool scrollbottom = false;
    10099        GUI<bool>::GetSetting(this, "scroll_bottom", scrollbottom);
    101100
    102101        // If we are currently scrolled to the bottom of the text,
    void CText::HandleMessage(SGUIMessage& M  
    126125    //IGUITextOwner::HandleMessage(Message); <== placed it after the switch instead!
    127126
    128127    switch (Message.type)
    129128    {
    130129    case GUIM_SETTINGS_UPDATED:
    131         if (Message.value == "scrollbar")
     130        if (Message.value == "scrollbar_vertical") //TODO: correct?
    132131            SetupText();
    133132
    134         // Update scrollbar
    135133        if (Message.value == "scrollbar_style")
    136134        {
    137135            CStr scrollbar_style;
    138136            GUI<CStr>::GetSetting(this, Message.value, scrollbar_style);
    139137
    void CText::HandleMessage(SGUIMessage& M  
    185183void CText::Draw()
    186184{
    187185    float bz = GetBufferedZ();
    188186
    189187    // First call draw on ScrollBarOwner
    190     bool scrollbar;
    191     GUI<bool>::GetSetting(this, "scrollbar", scrollbar);
     188    bool scrollbar_vertical;
     189    GUI<bool>::GetSetting(this, "scrollbar_vertical", scrollbar_vertical);
    192190
    193     if (scrollbar)
    194         // Draw scrollbar
     191    if (scrollbar_vertical)
    195192        IGUIScrollBarOwner::Draw();
    196193
    197194    if (!GetGUI())
    198195        return;
    199196
    void CText::Draw()  
    205202    GUI<bool>::GetSetting(this, "clip", clip);
    206203
    207204    GetGUI()->DrawSprite(*sprite, cell_id, bz, m_CachedActualSize);
    208205
    209206    float scroll = 0.f;
    210     if (scrollbar)
     207    if (scrollbar_vertical)
    211208        scroll = GetScrollBar(0).GetPos();
    212209
    213210    // Clipping area (we'll have to subtract the scrollbar)
    214211    CRect cliparea;
    215212    if (clip)
    216213    {
    217214        cliparea = m_CachedActualSize;
    218215
    219         if (scrollbar)
     216        if (scrollbar_vertical)
    220217        {
    221218            // subtract scrollbar from cliparea
    222219            if (cliparea.right > GetScrollBar(0).GetOuterRect().left &&
    223220                cliparea.right <= GetScrollBar(0).GetOuterRect().right)
    224221                cliparea.right = GetScrollBar(0).GetOuterRect().left;
    void CText::Draw()  
    230227    }
    231228
    232229    CColor color;
    233230    GUI<CColor>::GetSetting(this, "textcolor", color);
    234231
    235     if (scrollbar)
     232    if (scrollbar_vertical)
    236233        DrawText(0, color, m_CachedActualSize.TopLeft() - CPos(0.f, scroll), bz+0.1f, cliparea);
    237234    else
    238235        DrawText(0, color, m_TextPos, bz+0.1f, cliparea);
    239236}
    240237
  • source/gui/IGUIScrollBar.h

    struct SGUIScrollBarStyle  
    125125    //@{
    126126
    127127    CGUISpriteInstance m_SpriteButtonLeft;
    128128    CGUISpriteInstance m_SpriteButtonLeftPressed;
    129129    CGUISpriteInstance m_SpriteButtonLeftDisabled;
     130    CGUISpriteInstance m_SpriteButtonLeftOver;
    130131
    131132    CGUISpriteInstance m_SpriteButtonRight;
    132133    CGUISpriteInstance m_SpriteButtonRightPressed;
    133134    CGUISpriteInstance m_SpriteButtonRightDisabled;
     135    CGUISpriteInstance m_SpriteButtonRightOver;
    134136
    135     CGUISpriteInstance m_SpriteBackHorizontal;
    136137    CGUISpriteInstance m_SpriteBarHorizontal;
     138    CGUISpriteInstance m_SpriteBarHorizontalOver;
     139    CGUISpriteInstance m_SpriteBarHorizontalPressed;
    137140
     141    CGUISpriteInstance m_SpriteBackHorizontal;
    138142    //@}
    139143};
    140144
    141145
    142146/**