2024-11-29 09:37:07 +00:00
|
|
|
#ifndef FILAMENT_GROUP_HOVER_HPP
|
|
|
|
#define FILAMENT_GROUP_HOVER_HPP
|
|
|
|
|
|
|
|
#include <wx/graphics.h>
|
|
|
|
#include <wx/hyperlink.h>
|
|
|
|
#include "wxExtensions.hpp"
|
|
|
|
#include "Widgets/PopupWindow.hpp"
|
2024-12-23 08:30:30 +00:00
|
|
|
#include "Widgets/CheckBox.hpp"
|
|
|
|
#include "Widgets/Label.hpp"
|
2024-11-29 09:37:07 +00:00
|
|
|
|
|
|
|
namespace Slic3r { namespace GUI {
|
|
|
|
|
|
|
|
bool is_pop_up_required();
|
|
|
|
FilamentMapMode get_prefered_map_mode();
|
|
|
|
|
|
|
|
class FilamentGroupPopup : public PopupWindow
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FilamentGroupPopup(wxWindow *parent);
|
|
|
|
void tryPopup(bool connect_status);
|
|
|
|
void tryClose();
|
|
|
|
|
|
|
|
FilamentMapMode GetSelectedMode() const { return m_mode; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
void StartTimer();
|
|
|
|
void ResetTimer();
|
|
|
|
|
2024-12-23 08:30:30 +00:00
|
|
|
void OnRadioBtn(int idx);
|
2024-11-29 09:37:07 +00:00
|
|
|
void OnLeaveWindow(wxMouseEvent &);
|
|
|
|
void OnEnterWindow(wxMouseEvent &);
|
|
|
|
void OnTimer(wxTimerEvent &event);
|
|
|
|
void OnRemindBtn(wxCommandEvent &event);
|
|
|
|
|
2024-12-23 08:30:30 +00:00
|
|
|
void Init();
|
2024-11-29 09:37:07 +00:00
|
|
|
void UpdateButtonStatus(int hover_idx = -1);
|
|
|
|
void DrawRoundedCorner(int radius);
|
|
|
|
|
|
|
|
private:
|
|
|
|
enum ButtonType { btForFlush, btForMatch, btManual, btCount };
|
|
|
|
|
|
|
|
const std::vector<FilamentMapMode> mode_list = {fmmAutoForFlush, fmmAutoForMatch, fmmManual};
|
|
|
|
|
|
|
|
FilamentMapMode m_mode;
|
2024-12-23 08:30:30 +00:00
|
|
|
bool m_connected{ false };
|
2024-11-29 09:37:07 +00:00
|
|
|
wxTimer *m_timer;
|
|
|
|
|
|
|
|
std::vector<wxBitmapButton *> radio_btns;
|
2024-12-23 08:30:30 +00:00
|
|
|
std::vector<Label *> button_labels;
|
|
|
|
std::vector<Label *> button_desps;
|
|
|
|
std::vector<Label *> detail_infos;
|
2024-11-29 09:37:07 +00:00
|
|
|
|
|
|
|
wxStaticText *wiki_link;
|
2024-12-23 08:30:30 +00:00
|
|
|
CheckBox* remind_checkbox;
|
2024-11-29 09:37:07 +00:00
|
|
|
};
|
|
|
|
}} // namespace Slic3r::GUI
|
|
|
|
#endif
|