0ad/source/tools/atlas/AtlasUI/CustomControls/Buttons/ToolButton.cpp
Ykkrosh 178ad741b9 DevIL: Improved quality of DXT5 alpha compression.
textureconv: Made -(no)mipmaps work. Defaulted to DXT5 for alpha
textures (since DXT3 almost never seems any good). Recompiled with new
DevIL code.
GUIRenderer: Removed complaints about 0-sized objects (e.g. hitpoint
bars).
Atlas: Added forgotten files.

This was SVN commit r3006.
2005-10-24 23:45:52 +00:00

38 lines
807 B
C++

#include "stdafx.h"
#include "ToolButton.h"
#include "ScenarioEditor/Tools/Common/Tools.h"
BEGIN_EVENT_TABLE(ToolButton, wxButton)
EVT_BUTTON(wxID_ANY, ToolButton::OnClick)
END_EVENT_TABLE()
void ToolButton::OnClick(wxCommandEvent& evt)
{
if (g_Current)
g_Current->SetSelectedAppearance(false);
// Toggle on/off
if (g_Current == this)
{
g_Current = NULL;
SetSelectedAppearance(false);
SetCurrentTool(_T(""));
}
else
{
g_Current = this;
SetSelectedAppearance(true);
SetCurrentTool(m_Tool);
}
}
void ToolButton::SetSelectedAppearance(bool selected)
{
if (selected)
SetBackgroundColour(wxColour(0xee, 0xcc, 0x55));
else
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
}
ToolButton* ToolButton::g_Current = NULL;