We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Originally posted by huangzhengyi February 10, 2022 设置按钮的normal(红)、hot(绿) 2种状态颜色
<Button name="btn_test" width="200" height="200" normalcolor="#ffff0000" hotcolor="#ff00ff00"/>
加入按钮点击处理函数
m_pButton->AttachClick([this](ui::EventArgs* args) { SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0); return true; });
会出现,当我们点击按钮窗口最小化了,但是我们重新点击任务栏的窗口显示窗口,发现按钮还是绿色,只有鼠标放在窗口或者按钮上才会重绘这个窗口
void Window::Invalidate(const UiRect& rcItem) { ::InvalidateRect(m_hWnd, &rcItem, FALSE); // Invalidating a layered window will not trigger a WM_PAINT message, // thus we have to post WM_PAINT by ourselves. if (m_bIsLayeredWindow) { ::PostMessage(m_hWnd, WM_PAINT, (LPARAM)&rcItem, (WPARAM)FALSE); } } void Window::Paint() { if (::IsIconic(m_hWnd) || !m_pRoot) { PAINTSTRUCT ps = { 0 }; ::BeginPaint(m_hWnd, &ps); ::EndPaint(m_hWnd, &ps); return; } ....
发现,是通过post发送的paint消息,怀疑是当我点击按钮之后,窗口隐藏了之后才收到paint导致的
The text was updated successfully, but these errors were encountered:
((Button*)msg->pSender)->SetState(kControlStateNormal); ui::UiRect _rcWnd; ::SendMessage(m_hWnd, WM_PAINT, (LPARAM)&_rcWnd, (WPARAM)FALSE); ShowWindow(false);
在按钮隐藏前,先刷新一遍
Sorry, something went wrong.
No branches or pull requests
Discussed in #381
Originally posted by huangzhengyi February 10, 2022
设置按钮的normal(红)、hot(绿) 2种状态颜色
加入按钮点击处理函数
会出现,当我们点击按钮窗口最小化了,但是我们重新点击任务栏的窗口显示窗口,发现按钮还是绿色,只有鼠标放在窗口或者按钮上才会重绘这个窗口
发现,是通过post发送的paint消息,怀疑是当我点击按钮之后,窗口隐藏了之后才收到paint导致的
The text was updated successfully, but these errors were encountered: