2013-08-09 08:01:20 +08:00
|
|
|
// Aseprite UI Library
|
2023-01-12 22:00:16 +08:00
|
|
|
// Copyright (C) 2019-2023 Igara Studio S.A.
|
2018-10-11 23:01:21 +08:00
|
|
|
// Copyright (C) 2001-2018 David Capello
|
2010-09-28 06:18:17 +08:00
|
|
|
//
|
2014-03-30 07:08:05 +08:00
|
|
|
// This file is released under the terms of the MIT license.
|
|
|
|
// Read LICENSE.txt for more information.
|
2007-09-19 07:57:02 +08:00
|
|
|
|
2013-08-06 08:20:19 +08:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2009-07-13 04:29:16 +08:00
|
|
|
#include "config.h"
|
2013-08-06 08:20:19 +08:00
|
|
|
#endif
|
2009-07-13 04:29:16 +08:00
|
|
|
|
2012-06-18 09:49:58 +08:00
|
|
|
#include "ui/button.h"
|
|
|
|
#include "ui/manager.h"
|
|
|
|
#include "ui/message.h"
|
2015-12-04 08:50:05 +08:00
|
|
|
#include "ui/size_hint_event.h"
|
2012-06-18 09:49:58 +08:00
|
|
|
#include "ui/theme.h"
|
|
|
|
#include "ui/widget.h"
|
2012-07-09 10:24:42 +08:00
|
|
|
#include "ui/window.h"
|
|
|
|
|
2014-09-03 11:01:30 +08:00
|
|
|
#include <cstring>
|
2012-07-09 10:24:42 +08:00
|
|
|
#include <queue>
|
2007-09-19 07:57:02 +08:00
|
|
|
|
2012-06-18 09:02:54 +08:00
|
|
|
namespace ui {
|
|
|
|
|
2014-04-21 06:53:27 +08:00
|
|
|
ButtonBase::ButtonBase(const std::string& text,
|
2018-10-11 23:01:21 +08:00
|
|
|
const WidgetType type,
|
|
|
|
const WidgetType behaviorType,
|
|
|
|
const WidgetType drawType)
|
2010-08-24 04:41:19 +08:00
|
|
|
: Widget(type)
|
2012-06-16 10:37:59 +08:00
|
|
|
, m_pressedStatus(false)
|
2011-03-07 03:15:05 +08:00
|
|
|
, m_behaviorType(behaviorType)
|
2014-08-18 07:38:55 +08:00
|
|
|
, m_handleSelect(true)
|
2007-09-19 07:57:02 +08:00
|
|
|
{
|
2015-06-24 01:00:00 +08:00
|
|
|
setAlign(CENTER | MIDDLE);
|
2012-06-16 10:37:59 +08:00
|
|
|
setText(text);
|
|
|
|
setFocusStop(true);
|
2010-08-24 04:41:19 +08:00
|
|
|
|
|
|
|
// Initialize theme
|
2017-03-18 03:13:47 +08:00
|
|
|
setType(drawType); // TODO Fix this nasty trick
|
2011-02-15 20:00:29 +08:00
|
|
|
initTheme();
|
2015-06-24 01:37:22 +08:00
|
|
|
setType(type);
|
2007-09-19 07:57:02 +08:00
|
|
|
}
|
|
|
|
|
2010-08-24 04:41:19 +08:00
|
|
|
ButtonBase::~ButtonBase()
|
2007-09-19 07:57:02 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
Refactor several "getNoun()" getters to "noun()"
This is a work-in-progress to create a consistent API and finally
separate the whole Aseprite base/gfx/ui libs into a reusable C++ library.
Classes:
app::IFileItem, app::AppMenuItem, app::skin::SkinPart,
gfx::Rect, gfx::Border, she::FileDialog,
ui::IButtonIcon, ui::Graphics, ui::Overlay, ui::Widget,
ui::ScrollableViewDelegate, and UI events
2015-12-05 01:39:04 +08:00
|
|
|
WidgetType ButtonBase::behaviorType() const
|
2007-09-19 07:57:02 +08:00
|
|
|
{
|
2011-03-07 03:15:05 +08:00
|
|
|
return m_behaviorType;
|
2007-09-19 07:57:02 +08:00
|
|
|
}
|
|
|
|
|
2023-01-12 22:00:16 +08:00
|
|
|
void ButtonBase::onClick()
|
2007-09-19 07:57:02 +08:00
|
|
|
{
|
2010-08-24 04:41:19 +08:00
|
|
|
// Fire Click() signal
|
2023-01-12 22:00:16 +08:00
|
|
|
Click();
|
2007-09-19 07:57:02 +08:00
|
|
|
}
|
|
|
|
|
2024-08-09 04:23:41 +08:00
|
|
|
void ButtonBase::onRightClick()
|
|
|
|
{
|
|
|
|
RightClick();
|
|
|
|
}
|
|
|
|
|
2011-04-03 00:14:07 +08:00
|
|
|
bool ButtonBase::onProcessMessage(Message* msg)
|
2007-09-19 07:57:02 +08:00
|
|
|
{
|
2013-07-29 08:17:07 +08:00
|
|
|
switch (msg->type()) {
|
2013-04-05 08:53:29 +08:00
|
|
|
case kFocusEnterMessage:
|
|
|
|
case kFocusLeaveMessage:
|
2012-06-16 10:37:59 +08:00
|
|
|
if (isEnabled()) {
|
2013-04-04 09:07:24 +08:00
|
|
|
if (m_behaviorType == kButtonWidget) {
|
2012-06-16 10:37:59 +08:00
|
|
|
// Deselect the widget (maybe the user press the key, but
|
|
|
|
// before release it, changes the focus).
|
|
|
|
if (isSelected())
|
|
|
|
setSelected(false);
|
2012-01-06 06:45:03 +08:00
|
|
|
}
|
|
|
|
|
2012-06-16 10:37:59 +08:00
|
|
|
// TODO theme specific stuff
|
2012-01-06 06:45:03 +08:00
|
|
|
invalidate();
|
2007-09-19 07:57:02 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2013-07-29 08:17:07 +08:00
|
|
|
case kKeyDownMessage: {
|
|
|
|
KeyMessage* keymsg = static_cast<KeyMessage*>(msg);
|
|
|
|
KeyScancode scancode = keymsg->scancode();
|
|
|
|
|
2017-06-13 23:04:40 +08:00
|
|
|
if (isEnabled() && isVisible()) {
|
2024-12-10 21:16:20 +08:00
|
|
|
const bool mnemonicPressed = isMnemonicPressedWithModifiers(keymsg);
|
2014-06-28 22:14:03 +08:00
|
|
|
|
2013-04-04 09:07:24 +08:00
|
|
|
// For kButtonWidget
|
|
|
|
if (m_behaviorType == kButtonWidget) {
|
2012-06-16 10:37:59 +08:00
|
|
|
// Has focus and press enter/space
|
|
|
|
if (hasFocus()) {
|
2013-07-29 08:17:07 +08:00
|
|
|
if ((scancode == kKeyEnter) || (scancode == kKeyEnterPad) || (scancode == kKeySpace)) {
|
2012-06-16 10:37:59 +08:00
|
|
|
setSelected(true);
|
2012-01-06 06:45:03 +08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
2014-06-28 22:14:03 +08:00
|
|
|
|
2019-11-05 21:46:47 +08:00
|
|
|
if ( // Check if the user pressed mnemonic
|
|
|
|
mnemonicPressed ||
|
|
|
|
// Magnetic widget catches ENTERs
|
|
|
|
(isFocusMagnet() && ((scancode == kKeyEnter) || (scancode == kKeyEnterPad)))) {
|
Refactor several "getNoun()" getters to "noun()"
This is a work-in-progress to create a consistent API and finally
separate the whole Aseprite base/gfx/ui libs into a reusable C++ library.
Classes:
app::IFileItem, app::AppMenuItem, app::skin::SkinPart,
gfx::Rect, gfx::Border, she::FileDialog,
ui::IButtonIcon, ui::Graphics, ui::Overlay, ui::Widget,
ui::ScrollableViewDelegate, and UI events
2015-12-05 01:39:04 +08:00
|
|
|
manager()->setFocus(this);
|
2012-01-06 06:45:03 +08:00
|
|
|
|
2012-04-16 02:21:24 +08:00
|
|
|
// Dispatch focus movement messages (because the buttons
|
|
|
|
// process them)
|
Refactor several "getNoun()" getters to "noun()"
This is a work-in-progress to create a consistent API and finally
separate the whole Aseprite base/gfx/ui libs into a reusable C++ library.
Classes:
app::IFileItem, app::AppMenuItem, app::skin::SkinPart,
gfx::Rect, gfx::Border, she::FileDialog,
ui::IButtonIcon, ui::Graphics, ui::Overlay, ui::Widget,
ui::ScrollableViewDelegate, and UI events
2015-12-05 01:39:04 +08:00
|
|
|
manager()->dispatchMessages();
|
2012-01-06 06:45:03 +08:00
|
|
|
|
2012-06-16 10:37:59 +08:00
|
|
|
setSelected(true);
|
2012-01-06 06:45:03 +08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
2013-04-04 09:07:24 +08:00
|
|
|
// For kCheckWidget or kRadioWidget
|
2012-01-06 06:45:03 +08:00
|
|
|
else {
|
2019-11-05 21:46:47 +08:00
|
|
|
// If the widget has the focus and the user press space or
|
|
|
|
// if the user press Alt+the underscored letter of the button
|
2014-06-28 22:14:03 +08:00
|
|
|
if ((hasFocus() && (scancode == kKeySpace)) || mnemonicPressed) {
|
2013-04-04 09:07:24 +08:00
|
|
|
if (m_behaviorType == kCheckWidget) {
|
2012-01-06 06:45:03 +08:00
|
|
|
// Swap the select status
|
2012-06-16 10:37:59 +08:00
|
|
|
setSelected(!isSelected());
|
2012-01-06 06:45:03 +08:00
|
|
|
invalidate();
|
|
|
|
}
|
2013-04-04 09:07:24 +08:00
|
|
|
else if (m_behaviorType == kRadioWidget) {
|
2012-06-16 10:37:59 +08:00
|
|
|
if (!isSelected()) {
|
|
|
|
setSelected(true);
|
2012-01-06 06:45:03 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
2007-09-19 07:57:02 +08:00
|
|
|
}
|
|
|
|
break;
|
2013-07-29 08:17:07 +08:00
|
|
|
}
|
2007-09-19 07:57:02 +08:00
|
|
|
|
2013-04-05 08:53:29 +08:00
|
|
|
case kKeyUpMessage:
|
2019-10-16 04:00:00 +08:00
|
|
|
if (isEnabled() && hasFocus()) {
|
|
|
|
switch (m_behaviorType) {
|
|
|
|
case kButtonWidget:
|
|
|
|
if (isSelected()) {
|
|
|
|
generateButtonSelectSignal();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2024-12-10 20:31:32 +08:00
|
|
|
case kCheckWidget: {
|
2024-11-12 04:43:21 +08:00
|
|
|
KeyMessage* keymsg = static_cast<KeyMessage*>(msg);
|
|
|
|
KeyScancode scancode = keymsg->scancode();
|
2024-12-10 21:16:20 +08:00
|
|
|
const bool mnemonicPressed = isMnemonicPressedWithModifiers(keymsg);
|
|
|
|
|
2024-11-12 04:43:21 +08:00
|
|
|
// Fire the onClick() event only if the user pressed space or
|
|
|
|
// Alt+the underscored letter of the checkbox label.
|
|
|
|
if (scancode == kKeySpace || mnemonicPressed) {
|
|
|
|
onClick();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
break;
|
2024-12-10 20:31:32 +08:00
|
|
|
}
|
2012-01-06 06:45:03 +08:00
|
|
|
}
|
2007-09-19 07:57:02 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2013-04-05 08:53:29 +08:00
|
|
|
case kMouseDownMessage:
|
2010-08-24 04:41:19 +08:00
|
|
|
switch (m_behaviorType) {
|
2013-04-04 09:07:24 +08:00
|
|
|
case kButtonWidget:
|
2012-06-16 10:37:59 +08:00
|
|
|
if (isEnabled()) {
|
|
|
|
setSelected(true);
|
2012-01-06 06:45:03 +08:00
|
|
|
|
2012-06-16 10:37:59 +08:00
|
|
|
m_pressedStatus = isSelected();
|
|
|
|
captureMouse();
|
2021-05-21 02:42:09 +08:00
|
|
|
|
|
|
|
onStartDrag();
|
2012-01-06 06:45:03 +08:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
|
2013-04-04 09:07:24 +08:00
|
|
|
case kCheckWidget:
|
2012-06-16 10:37:59 +08:00
|
|
|
if (isEnabled()) {
|
|
|
|
setSelected(!isSelected());
|
2012-01-06 06:45:03 +08:00
|
|
|
|
2012-06-16 10:37:59 +08:00
|
|
|
m_pressedStatus = isSelected();
|
|
|
|
captureMouse();
|
2021-05-21 02:42:09 +08:00
|
|
|
|
|
|
|
onStartDrag();
|
2012-01-06 06:45:03 +08:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
|
2013-04-04 09:07:24 +08:00
|
|
|
case kRadioWidget:
|
2012-06-16 10:37:59 +08:00
|
|
|
if (isEnabled()) {
|
|
|
|
if (!isSelected()) {
|
|
|
|
m_handleSelect = false;
|
|
|
|
setSelected(true);
|
|
|
|
m_handleSelect = true;
|
|
|
|
|
|
|
|
m_pressedStatus = isSelected();
|
|
|
|
captureMouse();
|
2021-05-21 02:42:09 +08:00
|
|
|
|
|
|
|
onStartDrag();
|
2012-01-06 06:45:03 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
2007-09-19 07:57:02 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2013-04-05 08:53:29 +08:00
|
|
|
case kMouseUpMessage:
|
2012-06-16 10:37:59 +08:00
|
|
|
if (hasCapture()) {
|
|
|
|
releaseMouse();
|
2012-01-06 06:45:03 +08:00
|
|
|
|
2023-07-10 21:54:37 +08:00
|
|
|
if (hasMouse()) {
|
2024-08-09 04:23:41 +08:00
|
|
|
MouseMessage* mouseMsg = static_cast<MouseMessage*>(msg);
|
|
|
|
|
2012-01-06 06:45:03 +08:00
|
|
|
switch (m_behaviorType) {
|
2013-04-04 09:07:24 +08:00
|
|
|
case kButtonWidget: {
|
2024-08-09 04:23:41 +08:00
|
|
|
if (mouseMsg->right())
|
|
|
|
onRightClick();
|
2024-12-17 01:52:19 +08:00
|
|
|
else
|
2024-08-09 04:23:41 +08:00
|
|
|
generateButtonSelectSignal();
|
2024-12-17 01:52:19 +08:00
|
|
|
} break;
|
|
|
|
|
2024-12-10 20:31:32 +08:00
|
|
|
case kCheckWidget: {
|
2012-01-06 06:45:03 +08:00
|
|
|
// Fire onClick() event
|
2023-01-12 22:00:16 +08:00
|
|
|
onClick();
|
2012-01-06 06:45:03 +08:00
|
|
|
|
|
|
|
invalidate();
|
|
|
|
} break;
|
|
|
|
|
2013-04-04 09:07:24 +08:00
|
|
|
case kRadioWidget: {
|
2012-06-16 10:37:59 +08:00
|
|
|
setSelected(false);
|
|
|
|
setSelected(true);
|
2012-01-06 06:45:03 +08:00
|
|
|
|
|
|
|
// Fire onClick() event
|
2023-01-12 22:00:16 +08:00
|
|
|
onClick();
|
2012-01-06 06:45:03 +08:00
|
|
|
} break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
2007-09-19 07:57:02 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2013-04-05 08:53:29 +08:00
|
|
|
case kMouseMoveMessage:
|
2012-06-16 10:37:59 +08:00
|
|
|
if (isEnabled() && hasCapture()) {
|
|
|
|
m_handleSelect = false;
|
2021-05-21 02:42:09 +08:00
|
|
|
onSelectWhenDragging();
|
2012-06-16 10:37:59 +08:00
|
|
|
m_handleSelect = true;
|
2007-09-19 07:57:02 +08:00
|
|
|
}
|
2010-04-25 23:03:25 +08:00
|
|
|
break;
|
2007-09-19 07:57:02 +08:00
|
|
|
|
2013-04-05 08:53:29 +08:00
|
|
|
case kMouseEnterMessage:
|
|
|
|
case kMouseLeaveMessage:
|
2010-04-25 23:03:25 +08:00
|
|
|
// TODO theme stuff
|
2012-06-16 10:37:59 +08:00
|
|
|
if (isEnabled())
|
2012-01-06 06:45:03 +08:00
|
|
|
invalidate();
|
2007-09-19 07:57:02 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2010-08-24 04:41:19 +08:00
|
|
|
return Widget::onProcessMessage(msg);
|
2007-09-19 07:57:02 +08:00
|
|
|
}
|
|
|
|
|
2010-08-24 04:41:19 +08:00
|
|
|
void ButtonBase::generateButtonSelectSignal()
|
|
|
|
{
|
|
|
|
// Deselect
|
2012-06-16 10:37:59 +08:00
|
|
|
setSelected(false);
|
2007-09-19 07:57:02 +08:00
|
|
|
|
2010-08-24 04:41:19 +08:00
|
|
|
// Fire onClick() event
|
2023-01-12 22:00:16 +08:00
|
|
|
onClick();
|
2007-09-19 07:57:02 +08:00
|
|
|
}
|
|
|
|
|
2021-05-21 02:42:09 +08:00
|
|
|
void ButtonBase::onStartDrag()
|
|
|
|
{
|
|
|
|
// Do nothing
|
|
|
|
}
|
|
|
|
|
|
|
|
void ButtonBase::onSelectWhenDragging()
|
|
|
|
{
|
2023-07-10 21:54:37 +08:00
|
|
|
const bool hasMouse = this->hasMouse();
|
2021-05-21 02:42:09 +08:00
|
|
|
|
|
|
|
// Switch state when the mouse go out
|
|
|
|
if ((hasMouse && isSelected() != m_pressedStatus) ||
|
|
|
|
(!hasMouse && isSelected() == m_pressedStatus)) {
|
|
|
|
if (hasMouse)
|
|
|
|
setSelected(m_pressedStatus);
|
|
|
|
else
|
|
|
|
setSelected(!m_pressedStatus);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-24 04:41:19 +08:00
|
|
|
// ======================================================================
|
|
|
|
// Button class
|
|
|
|
// ======================================================================
|
|
|
|
|
2014-04-21 06:53:27 +08:00
|
|
|
Button::Button(const std::string& text)
|
2013-04-04 09:07:24 +08:00
|
|
|
: ButtonBase(text, kButtonWidget, kButtonWidget, kButtonWidget)
|
2007-09-19 07:57:02 +08:00
|
|
|
{
|
2015-06-24 01:00:00 +08:00
|
|
|
setAlign(CENTER | MIDDLE);
|
2010-08-24 04:41:19 +08:00
|
|
|
}
|
2007-09-19 07:57:02 +08:00
|
|
|
|
2010-08-24 04:41:19 +08:00
|
|
|
// ======================================================================
|
|
|
|
// CheckBox class
|
|
|
|
// ======================================================================
|
2007-09-19 07:57:02 +08:00
|
|
|
|
2018-10-11 23:01:21 +08:00
|
|
|
CheckBox::CheckBox(const std::string& text, const WidgetType drawType)
|
2013-04-04 09:07:24 +08:00
|
|
|
: ButtonBase(text, kCheckWidget, kCheckWidget, drawType)
|
2010-08-24 04:41:19 +08:00
|
|
|
{
|
2015-06-24 01:00:00 +08:00
|
|
|
setAlign(LEFT | MIDDLE);
|
2010-08-24 04:41:19 +08:00
|
|
|
}
|
2007-09-19 07:57:02 +08:00
|
|
|
|
2010-08-24 04:41:19 +08:00
|
|
|
// ======================================================================
|
|
|
|
// RadioButton class
|
|
|
|
// ======================================================================
|
2007-09-19 07:57:02 +08:00
|
|
|
|
2018-10-11 23:01:21 +08:00
|
|
|
RadioButton::RadioButton(const std::string& text, const int radioGroup, const WidgetType drawType)
|
2013-04-04 09:07:24 +08:00
|
|
|
: ButtonBase(text, kRadioWidget, kRadioWidget, drawType)
|
2010-08-24 04:41:19 +08:00
|
|
|
{
|
2015-06-24 01:00:00 +08:00
|
|
|
setAlign(LEFT | MIDDLE);
|
2010-08-24 04:41:19 +08:00
|
|
|
setRadioGroup(radioGroup);
|
|
|
|
}
|
2007-09-19 07:57:02 +08:00
|
|
|
|
2010-08-24 04:41:19 +08:00
|
|
|
void RadioButton::setRadioGroup(int radioGroup)
|
|
|
|
{
|
|
|
|
m_radioGroup = radioGroup;
|
|
|
|
|
|
|
|
// TODO: Update old and new groups
|
|
|
|
}
|
|
|
|
|
|
|
|
int RadioButton::getRadioGroup() const
|
|
|
|
{
|
|
|
|
return m_radioGroup;
|
|
|
|
}
|
|
|
|
|
|
|
|
void RadioButton::deselectRadioGroup()
|
|
|
|
{
|
Refactor several "getNoun()" getters to "noun()"
This is a work-in-progress to create a consistent API and finally
separate the whole Aseprite base/gfx/ui libs into a reusable C++ library.
Classes:
app::IFileItem, app::AppMenuItem, app::skin::SkinPart,
gfx::Rect, gfx::Border, she::FileDialog,
ui::IButtonIcon, ui::Graphics, ui::Overlay, ui::Widget,
ui::ScrollableViewDelegate, and UI events
2015-12-05 01:39:04 +08:00
|
|
|
Widget* widget = window();
|
2010-08-24 04:41:19 +08:00
|
|
|
if (!widget)
|
|
|
|
return;
|
|
|
|
|
|
|
|
std::queue<Widget*> allChildrens;
|
|
|
|
allChildrens.push(widget);
|
|
|
|
|
|
|
|
while (!allChildrens.empty()) {
|
|
|
|
widget = allChildrens.front();
|
|
|
|
allChildrens.pop();
|
|
|
|
|
|
|
|
if (RadioButton* radioButton = dynamic_cast<RadioButton*>(widget)) {
|
|
|
|
if (radioButton->getRadioGroup() == m_radioGroup)
|
2012-01-06 06:45:03 +08:00
|
|
|
radioButton->setSelected(false);
|
2010-08-24 04:41:19 +08:00
|
|
|
}
|
|
|
|
|
2015-12-04 06:46:13 +08:00
|
|
|
for (auto child : widget->children()) {
|
|
|
|
allChildrens.push(child);
|
2007-09-19 07:57:02 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-09 02:53:10 +08:00
|
|
|
void RadioButton::onSelect(bool selected)
|
2007-09-19 07:57:02 +08:00
|
|
|
{
|
2016-09-09 02:53:10 +08:00
|
|
|
ButtonBase::onSelect(selected);
|
|
|
|
if (!selected)
|
|
|
|
return;
|
2007-09-19 07:57:02 +08:00
|
|
|
|
2012-06-16 10:37:59 +08:00
|
|
|
if (!m_handleSelect)
|
|
|
|
return;
|
2007-09-19 07:57:02 +08:00
|
|
|
|
Refactor several "getNoun()" getters to "noun()"
This is a work-in-progress to create a consistent API and finally
separate the whole Aseprite base/gfx/ui libs into a reusable C++ library.
Classes:
app::IFileItem, app::AppMenuItem, app::skin::SkinPart,
gfx::Rect, gfx::Border, she::FileDialog,
ui::IButtonIcon, ui::Graphics, ui::Overlay, ui::Widget,
ui::ScrollableViewDelegate, and UI events
2015-12-05 01:39:04 +08:00
|
|
|
if (behaviorType() == kRadioWidget) {
|
2012-06-16 10:37:59 +08:00
|
|
|
deselectRadioGroup();
|
2010-08-24 04:41:19 +08:00
|
|
|
|
2012-06-16 10:37:59 +08:00
|
|
|
m_handleSelect = false;
|
|
|
|
setSelected(true);
|
|
|
|
m_handleSelect = true;
|
|
|
|
}
|
2007-09-19 07:57:02 +08:00
|
|
|
}
|
2012-06-18 09:02:54 +08:00
|
|
|
|
|
|
|
} // namespace ui
|