如何处理 WXWIDGETS 中父窗口的鼠标事件
how to handle mouse events of parent window in wxwidgets
>我有一个父窗口,上面有一个子窗口,如何处理从子窗口到父窗口的鼠标事件。
这是我的代码:
//parent class
IMPLEMENT_DYNAMIC_CLASS(MWParent, wxPanel)
BEGIN_EVENT_TABLE(MWParent, wxPanel)
EVT_LEFT_DCLICK(MWParent::OnMouseLeftDClick)
EVT_RIGHT_DOWN(MWParent::OnMouseRightclick)
END_EVENT_TABLE()
MWParent::MWParent()
{
}
MWParent::~MWParent()
{
}
MWParent::MWParent( wxWindow *win , long id ):wxPanel( win , id ){
MWChild *obj = new MWChild(this);
}
//child class
IMPLEMENT_DYNAMIC_CLASS(MWChild, wxPanel)
BEGIN_EVENT_TABLE(MWChild, wxPanel)
END_EVENT_TABLE()
MWChild::MWChild()
{
}
MWChild::~MWChild()
{
}
MWChild::MWChild( wxWindow *win , long id ):wxPanel( win , id ){
}
使用 Bind() 将子事件连接到任何其他窗口(可能是父窗口)中的处理程序。
有关详细信息,请参阅事件处理概述。
相关文章:
- SDL2 调整窗口大小后如何缩放鼠标坐标?
- 我在窗口中有一个fltk Fl_Choice下拉菜单,但只能通过鼠标使用
- Qt将鼠标移动事件转移到新窗口
- 在鼠标按下时移动 SDL2 窗口的功能闪烁窗口并且移动速度不够快
- 我可以在 SDL 窗口外跟踪我的鼠标 pos 吗?
- 当鼠标移出窗口时,SFML 窗口会自行关闭
- 鼠标离开 GLFW窗口后触发 GLFW 鼠标回调?
- 获取窗口中的鼠标位置
- 鼠标输入和键输入有什么区别(在前台获取窗口)
- 发送到另一个窗口的鼠标移动消息不执行任何操作
- 如何使用Win32 API阻止来自透明窗口的鼠标输入?
- GLFW 不会检测到 GLFW 窗口外的鼠标移动
- 如何在Mac OSX上的窗口客户端内获取真实的鼠标位置?
- QQuickView窗口在调整鼠标大小时冻结
- 防止触摸输入移动的鼠标光标在窗口上
- 将WM_CHANGEUISTATE发送到窗口应用程序后,当用鼠标访问菜单时,助记符不会显示在系统菜单上
- ncurses检测鼠标何时离开窗口
- 将鼠标事件发送到虚拟现实OpenGL场景中的QtQuick窗口
- 在调整大小窗口时,如何使用鼠标单击来获取图像的坐标
- 如何检测鼠标何时在窗口外移动