FIX: use dialog instead of popup window

jira: [STUDIO-10692]
Change-Id: I85e8da120946fc6ff845c9b88d4f1594e313652b
This commit is contained in:
xin.zhang 2025-03-05 16:04:39 +08:00 committed by lane.wei
parent 26609a130a
commit 7115c1ca17
3 changed files with 3 additions and 14 deletions

View File

@ -4812,7 +4812,7 @@ void StatusPanel::on_nozzle_fan_switch(wxCommandEvent &event)
} }
m_fan_control_popup->SetPosition(pos); m_fan_control_popup->SetPosition(pos);
m_fan_control_popup->Popup(); m_fan_control_popup->ShowModal();

View File

@ -588,7 +588,7 @@ Description:FanControlPopupNew
**************************************************/ **************************************************/
static void nop_deleter_fan_control_popup(FanControlPopupNew *) {} static void nop_deleter_fan_control_popup(FanControlPopupNew *) {}
FanControlPopupNew::FanControlPopupNew(wxWindow* parent, MachineObject* obj, const AirDuctData& data) FanControlPopupNew::FanControlPopupNew(wxWindow* parent, MachineObject* obj, const AirDuctData& data)
: PopupWindow(parent, wxBORDER_NONE) : wxDialog(parent, wxID_ANY, wxEmptyString)
{ {
SetBackgroundColour(*wxWHITE); SetBackgroundColour(*wxWHITE);
init_names(); init_names();
@ -848,10 +848,6 @@ void FanControlPopupNew::on_left_down(wxMouseEvent& evt)
evt.Skip(); evt.Skip();
} }
void FanControlPopupNew::OnDismiss()
{
}
void FanControlPopupNew::post_event(int fan_type, wxString speed) void FanControlPopupNew::post_event(int fan_type, wxString speed)
{ {
// id, speed // id, speed
@ -863,11 +859,6 @@ void FanControlPopupNew::post_event(int fan_type, wxString speed)
event.Skip(); event.Skip();
} }
bool FanControlPopupNew::ProcessLeftDown(wxMouseEvent& event)
{
return PopupWindow::ProcessLeftDown(event);
}
void FanControlPopupNew::on_show(wxShowEvent& evt) void FanControlPopupNew::on_show(wxShowEvent& evt)
{ {
wxGetApp().UpdateDarkUIWin(this); wxGetApp().UpdateDarkUIWin(this);

View File

@ -174,7 +174,7 @@ public:
}; };
class FanControlPopupNew : public PopupWindow class FanControlPopupNew : public wxDialog
{ {
public: public:
FanControlPopupNew(wxWindow* parent, MachineObject* obj, const AirDuctData& data); FanControlPopupNew(wxWindow* parent, MachineObject* obj, const AirDuctData& data);
@ -248,8 +248,6 @@ public:
void post_event(int fan_type, wxString speed); void post_event(int fan_type, wxString speed);
void on_show(wxShowEvent& evt); void on_show(wxShowEvent& evt);
void command_control_air_duct(int mode_id); void command_control_air_duct(int mode_id);
virtual void OnDismiss() wxOVERRIDE;
virtual bool ProcessLeftDown(wxMouseEvent& event) wxOVERRIDE;
}; };
wxDECLARE_EVENT(EVT_FAN_SWITCH_ON, wxCommandEvent); wxDECLARE_EVENT(EVT_FAN_SWITCH_ON, wxCommandEvent);
wxDECLARE_EVENT(EVT_FAN_SWITCH_OFF, wxCommandEvent); wxDECLARE_EVENT(EVT_FAN_SWITCH_OFF, wxCommandEvent);