mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-03-22 15:19:52 +01:00
misc compiler warning fixes (multiple compilers)
This commit is contained in:
parent
d9115fc3fe
commit
ca792f12b5
@ -32,7 +32,7 @@ void ConsoleModel::SetCurrentCommandIndex(size_t index)
|
||||
|
||||
ConsoleCommand ConsoleModel::GetCurrentCommand()
|
||||
{
|
||||
if(currentCommandIndex < 0 || currentCommandIndex >= previousCommands.size())
|
||||
if (currentCommandIndex >= previousCommands.size())
|
||||
{
|
||||
return ConsoleCommand("", 0, "");
|
||||
}
|
||||
|
@ -100,9 +100,9 @@ public:
|
||||
return;
|
||||
SetToolTip(x, y);
|
||||
}
|
||||
virtual void TextPosition()
|
||||
virtual void TextPosition(std::string ButtonText)
|
||||
{
|
||||
ui::Button::TextPosition();
|
||||
ui::Button::TextPosition(ButtonText);
|
||||
textPosition.X += 3;
|
||||
}
|
||||
void SetToolTips(std::string newToolTip1, std::string newToolTip2)
|
||||
|
@ -16,10 +16,10 @@ Button::Button(Point position, Point size, std::string buttonText, std::string t
|
||||
toggle(false),
|
||||
actionCallback(NULL)
|
||||
{
|
||||
TextPosition();
|
||||
TextPosition(ButtonText);
|
||||
}
|
||||
|
||||
void Button::TextPosition()
|
||||
void Button::TextPosition(std::string ButtonText)
|
||||
{
|
||||
buttonDisplayText = ButtonText;
|
||||
if(buttonDisplayText.length())
|
||||
@ -38,13 +38,13 @@ void Button::TextPosition()
|
||||
void Button::SetIcon(Icon icon)
|
||||
{
|
||||
Appearance.icon = icon;
|
||||
TextPosition();
|
||||
TextPosition(ButtonText);
|
||||
}
|
||||
|
||||
void Button::SetText(std::string buttonText)
|
||||
{
|
||||
ButtonText = buttonText;
|
||||
TextPosition();
|
||||
TextPosition(ButtonText);
|
||||
}
|
||||
|
||||
void Button::SetTogglable(bool togglable)
|
||||
@ -72,7 +72,7 @@ void Button::Draw(const Point& screenPos)
|
||||
{
|
||||
if(!drawn)
|
||||
{
|
||||
TextPosition();
|
||||
TextPosition(ButtonText);
|
||||
drawn = true;
|
||||
}
|
||||
Graphics * g = ui::Engine::Ref().g;
|
||||
|
@ -34,7 +34,7 @@ public:
|
||||
|
||||
virtual void Draw(const Point& screenPos);
|
||||
|
||||
virtual void TextPosition();
|
||||
virtual void TextPosition(std::string);
|
||||
inline bool GetState() { return state; }
|
||||
virtual void DoAction(); //action of button what ever it may be
|
||||
virtual void DoAltAction(); //action of button what ever it may be
|
||||
|
@ -202,10 +202,7 @@ void Textbox::pasteIntoSelection()
|
||||
|
||||
if (limit != std::string::npos)
|
||||
{
|
||||
if(limit-backingText.length() >= 0)
|
||||
newText = newText.substr(0, limit-backingText.length());
|
||||
else
|
||||
newText = "";
|
||||
newText = newText.substr(0, limit-backingText.length());
|
||||
}
|
||||
if (!multiline && Graphics::textwidth((char*)std::string(backingText+newText).c_str()) > regionWidth)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user