mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
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.
38 lines
807 B
C++
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;
|