Removed unused GUI1 label widget
This commit is contained in:
parent
67e2927044
commit
078f61c412
5 changed files with 0 additions and 130 deletions
|
@ -3450,13 +3450,6 @@
|
|||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Debug|Win32'">$(IntDir)Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Release|Win32'">$(IntDir)Widgets\</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\widgets\label.cpp">
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='ReleaseDEBUG|Win32'">$(IntDir)Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Debug|Win32'">$(IntDir)Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Release|Win32'">$(IntDir)Widgets\</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\widgets\menu.cpp">
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='ReleaseDEBUG|Win32'">$(IntDir)Widgets\</ObjectFileName>
|
||||
|
@ -4094,7 +4087,6 @@
|
|||
<ClInclude Include="..\..\src\whiteboard\utility.hpp" />
|
||||
<ClInclude Include="..\..\src\whiteboard\visitor.hpp" />
|
||||
<ClInclude Include="..\..\src\widgets\button.hpp" />
|
||||
<ClInclude Include="..\..\src\widgets\label.hpp" />
|
||||
<ClInclude Include="..\..\src\widgets\menu.hpp" />
|
||||
<ClInclude Include="..\..\src\widgets\scrollarea.hpp" />
|
||||
<ClInclude Include="..\..\src\widgets\scrollbar.hpp" />
|
||||
|
|
|
@ -962,9 +962,6 @@
|
|||
<ClCompile Include="..\..\src\widgets\button.cpp">
|
||||
<Filter>Widgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\widgets\label.cpp">
|
||||
<Filter>Widgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\widgets\menu.cpp">
|
||||
<Filter>Widgets</Filter>
|
||||
</ClCompile>
|
||||
|
@ -2443,9 +2440,6 @@
|
|||
<ClInclude Include="..\..\src\widgets\button.hpp">
|
||||
<Filter>Widgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\widgets\label.hpp">
|
||||
<Filter>Widgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\widgets\menu.hpp">
|
||||
<Filter>Widgets</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
@ -54,7 +54,6 @@ tooltips.cpp
|
|||
utils/make_enum.cpp
|
||||
video.cpp
|
||||
widgets/button.cpp
|
||||
widgets/label.cpp
|
||||
widgets/menu.cpp
|
||||
widgets/menu_style.cpp
|
||||
widgets/scrollarea.cpp
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2004 - 2018 by Philippe Plantier <ayin@anathas.org>
|
||||
Part of the Battle for Wesnoth Project http://www.wesnoth.org
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY.
|
||||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#define GETTEXT_DOMAIN "wesnoth-lib"
|
||||
|
||||
#include "font/text.hpp"
|
||||
#include "widgets/label.hpp"
|
||||
#include "font/marked-up_text.hpp"
|
||||
#include "video.hpp"
|
||||
|
||||
namespace gui {
|
||||
|
||||
label::label(CVideo& video, const std::string& text, int size, const color_t& color, const bool auto_join) : widget(video, auto_join), text_(text), size_(size), color_(color)
|
||||
{
|
||||
update_label_size();
|
||||
}
|
||||
|
||||
const std::string& label::set_text(const std::string& text)
|
||||
{
|
||||
if (text_ == text)
|
||||
return text_;
|
||||
|
||||
text_ = text;
|
||||
update_label_size();
|
||||
set_dirty();
|
||||
return text_;
|
||||
}
|
||||
|
||||
const std::string& label::get_text() const
|
||||
{
|
||||
return text_;
|
||||
}
|
||||
|
||||
const color_t& label::set_color(const color_t& color)
|
||||
{
|
||||
color_ = color;
|
||||
set_dirty();
|
||||
return get_color();
|
||||
}
|
||||
|
||||
const color_t& label::get_color() const
|
||||
{
|
||||
return (enabled()) ? color_ : font::DISABLED_COLOR;
|
||||
}
|
||||
|
||||
void label::draw_contents()
|
||||
{
|
||||
const SDL_Rect& loc = location();
|
||||
if (!text_.empty() && loc.w > 0 && loc.h > 0)
|
||||
font::draw_text(&video(), loc, size_, get_color(), text_, loc.x, loc.y);
|
||||
}
|
||||
|
||||
void label::update_label_size()
|
||||
{
|
||||
SDL_Rect area = font::text_area(text_, size_);
|
||||
set_measurements(area.w, area.h);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2004 - 2018 by Philippe Plantier <ayin@anathas.org>
|
||||
Part of the Battle for Wesnoth Project http://www.wesnoth.org
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY.
|
||||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "font/constants.hpp"
|
||||
#include "font/standard_colors.hpp"
|
||||
#include "widget.hpp"
|
||||
#include <string>
|
||||
|
||||
namespace gui {
|
||||
|
||||
class label : public widget
|
||||
{
|
||||
public:
|
||||
label(CVideo& video, const std::string& text, int size=font::SIZE_NORMAL,
|
||||
const color_t& color=font::NORMAL_COLOR, const bool auto_join=true);
|
||||
const std::string& set_text(const std::string& text);
|
||||
const std::string& get_text() const;
|
||||
|
||||
const color_t& set_color(const color_t& color);
|
||||
const color_t& get_color() const;
|
||||
|
||||
virtual void draw_contents();
|
||||
private:
|
||||
void update_label_size();
|
||||
std::string text_;
|
||||
int size_;
|
||||
color_t color_;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue