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()
|
ConsoleCommand ConsoleModel::GetCurrentCommand()
|
||||||
{
|
{
|
||||||
if(currentCommandIndex < 0 || currentCommandIndex >= previousCommands.size())
|
if (currentCommandIndex >= previousCommands.size())
|
||||||
{
|
{
|
||||||
return ConsoleCommand("", 0, "");
|
return ConsoleCommand("", 0, "");
|
||||||
}
|
}
|
||||||
|
@ -100,9 +100,9 @@ public:
|
|||||||
return;
|
return;
|
||||||
SetToolTip(x, y);
|
SetToolTip(x, y);
|
||||||
}
|
}
|
||||||
virtual void TextPosition()
|
virtual void TextPosition(std::string ButtonText)
|
||||||
{
|
{
|
||||||
ui::Button::TextPosition();
|
ui::Button::TextPosition(ButtonText);
|
||||||
textPosition.X += 3;
|
textPosition.X += 3;
|
||||||
}
|
}
|
||||||
void SetToolTips(std::string newToolTip1, std::string newToolTip2)
|
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),
|
toggle(false),
|
||||||
actionCallback(NULL)
|
actionCallback(NULL)
|
||||||
{
|
{
|
||||||
TextPosition();
|
TextPosition(ButtonText);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button::TextPosition()
|
void Button::TextPosition(std::string ButtonText)
|
||||||
{
|
{
|
||||||
buttonDisplayText = ButtonText;
|
buttonDisplayText = ButtonText;
|
||||||
if(buttonDisplayText.length())
|
if(buttonDisplayText.length())
|
||||||
@ -38,13 +38,13 @@ void Button::TextPosition()
|
|||||||
void Button::SetIcon(Icon icon)
|
void Button::SetIcon(Icon icon)
|
||||||
{
|
{
|
||||||
Appearance.icon = icon;
|
Appearance.icon = icon;
|
||||||
TextPosition();
|
TextPosition(ButtonText);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button::SetText(std::string buttonText)
|
void Button::SetText(std::string buttonText)
|
||||||
{
|
{
|
||||||
ButtonText = buttonText;
|
ButtonText = buttonText;
|
||||||
TextPosition();
|
TextPosition(ButtonText);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button::SetTogglable(bool togglable)
|
void Button::SetTogglable(bool togglable)
|
||||||
@ -72,7 +72,7 @@ void Button::Draw(const Point& screenPos)
|
|||||||
{
|
{
|
||||||
if(!drawn)
|
if(!drawn)
|
||||||
{
|
{
|
||||||
TextPosition();
|
TextPosition(ButtonText);
|
||||||
drawn = true;
|
drawn = true;
|
||||||
}
|
}
|
||||||
Graphics * g = ui::Engine::Ref().g;
|
Graphics * g = ui::Engine::Ref().g;
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
|
|
||||||
virtual void Draw(const Point& screenPos);
|
virtual void Draw(const Point& screenPos);
|
||||||
|
|
||||||
virtual void TextPosition();
|
virtual void TextPosition(std::string);
|
||||||
inline bool GetState() { return state; }
|
inline bool GetState() { return state; }
|
||||||
virtual void DoAction(); //action of button what ever it may be
|
virtual void DoAction(); //action of button what ever it may be
|
||||||
virtual void DoAltAction(); //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 != std::string::npos)
|
||||||
{
|
{
|
||||||
if(limit-backingText.length() >= 0)
|
newText = newText.substr(0, limit-backingText.length());
|
||||||
newText = newText.substr(0, limit-backingText.length());
|
|
||||||
else
|
|
||||||
newText = "";
|
|
||||||
}
|
}
|
||||||
if (!multiline && Graphics::textwidth((char*)std::string(backingText+newText).c_str()) > regionWidth)
|
if (!multiline && Graphics::textwidth((char*)std::string(backingText+newText).c_str()) > regionWidth)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user