mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-31 00:32:48 +00:00
JM_DESTROY message cannot be used in derived classes of Widget.
This commit is contained in:
parent
c3ef673421
commit
b1a53bfdd2
@ -58,6 +58,19 @@ PopupWindow::PopupWindow(const char* text, bool close_on_buttonpressed)
|
|||||||
jwidget_noborders(this);
|
jwidget_noborders(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PopupWindow::~PopupWindow()
|
||||||
|
{
|
||||||
|
if (m_filtering) {
|
||||||
|
m_filtering = false;
|
||||||
|
jmanager_remove_msg_filter(JM_MOTION, this);
|
||||||
|
jmanager_remove_msg_filter(JM_BUTTONPRESSED, this);
|
||||||
|
jmanager_remove_msg_filter(JM_KEYPRESSED, this);
|
||||||
|
}
|
||||||
|
if (m_hot_region != NULL) {
|
||||||
|
jregion_free(m_hot_region);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param region The new hot-region. This pointer is holded by the @a widget.
|
* @param region The new hot-region. This pointer is holded by the @a widget.
|
||||||
* So you cannot destroy it after calling this routine.
|
* So you cannot destroy it after calling this routine.
|
||||||
@ -91,18 +104,6 @@ bool PopupWindow::msg_proc(JMessage msg)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case JM_DESTROY:
|
|
||||||
if (m_filtering) {
|
|
||||||
m_filtering = false;
|
|
||||||
jmanager_remove_msg_filter(JM_MOTION, this);
|
|
||||||
jmanager_remove_msg_filter(JM_BUTTONPRESSED, this);
|
|
||||||
jmanager_remove_msg_filter(JM_KEYPRESSED, this);
|
|
||||||
}
|
|
||||||
if (m_hot_region != NULL) {
|
|
||||||
jregion_free(m_hot_region);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case JM_REQSIZE: {
|
case JM_REQSIZE: {
|
||||||
int w = 0, h = 0;
|
int w = 0, h = 0;
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ class PopupWindow : public Frame
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
PopupWindow(const char* text, bool close_on_buttonpressed);
|
PopupWindow(const char* text, bool close_on_buttonpressed);
|
||||||
|
~PopupWindow();
|
||||||
|
|
||||||
void setHotRegion(JRegion region);
|
void setHotRegion(JRegion region);
|
||||||
|
|
||||||
|
@ -164,6 +164,19 @@ TipWindow::TipWindow(const char *text, bool close_on_buttonpressed)
|
|||||||
jwidget_init_theme(this);
|
jwidget_init_theme(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TipWindow::~TipWindow()
|
||||||
|
{
|
||||||
|
if (m_filtering) {
|
||||||
|
m_filtering = false;
|
||||||
|
jmanager_remove_msg_filter(JM_MOTION, this);
|
||||||
|
jmanager_remove_msg_filter(JM_BUTTONPRESSED, this);
|
||||||
|
jmanager_remove_msg_filter(JM_KEYPRESSED, this);
|
||||||
|
}
|
||||||
|
if (m_hot_region != NULL) {
|
||||||
|
jregion_free(m_hot_region);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param region The new hot-region. This pointer is holded by the @a widget.
|
* @param region The new hot-region. This pointer is holded by the @a widget.
|
||||||
* So you can't destroy it after calling this routine.
|
* So you can't destroy it after calling this routine.
|
||||||
@ -197,18 +210,6 @@ bool TipWindow::msg_proc(JMessage msg)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case JM_DESTROY:
|
|
||||||
if (m_filtering) {
|
|
||||||
m_filtering = false;
|
|
||||||
jmanager_remove_msg_filter(JM_MOTION, this);
|
|
||||||
jmanager_remove_msg_filter(JM_BUTTONPRESSED, this);
|
|
||||||
jmanager_remove_msg_filter(JM_KEYPRESSED, this);
|
|
||||||
}
|
|
||||||
if (m_hot_region != NULL) {
|
|
||||||
jregion_free(m_hot_region);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case JM_REQSIZE: {
|
case JM_REQSIZE: {
|
||||||
int w = 0, h = 0;
|
int w = 0, h = 0;
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@ class TipWindow : public Frame
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
TipWindow(const char *text, bool close_on_buttonpressed = false);
|
TipWindow(const char *text, bool close_on_buttonpressed = false);
|
||||||
|
~TipWindow();
|
||||||
|
|
||||||
void set_hotregion(JRegion region);
|
void set_hotregion(JRegion region);
|
||||||
|
|
||||||
|
@ -78,6 +78,11 @@ Frame::Frame(bool desktop, const char* text)
|
|||||||
jwidget_init_theme(this);
|
jwidget_init_theme(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Frame::~Frame()
|
||||||
|
{
|
||||||
|
_jmanager_close_window(getManager(), this, false);
|
||||||
|
}
|
||||||
|
|
||||||
Widget* Frame::get_killer()
|
Widget* Frame::get_killer()
|
||||||
{
|
{
|
||||||
return m_killer;
|
return m_killer;
|
||||||
@ -237,10 +242,6 @@ bool Frame::msg_proc(JMessage msg)
|
|||||||
{
|
{
|
||||||
switch (msg->type) {
|
switch (msg->type) {
|
||||||
|
|
||||||
case JM_DESTROY:
|
|
||||||
_jmanager_close_window(getManager(), this, false);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case JM_REQSIZE:
|
case JM_REQSIZE:
|
||||||
this->window_request_size(&msg->reqsize.w, &msg->reqsize.h);
|
this->window_request_size(&msg->reqsize.w, &msg->reqsize.h);
|
||||||
return true;
|
return true;
|
||||||
|
@ -52,6 +52,7 @@ class Frame : public Widget
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
Frame(bool is_desktop, const char* text);
|
Frame(bool is_desktop, const char* text);
|
||||||
|
~Frame();
|
||||||
|
|
||||||
Widget* get_killer();
|
Widget* get_killer();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user