mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-15 09:32:09 +00:00
1. Add filament group pop up when slice 2. Add more filament modes in filament dialog 3. Add capsule button jira:NONE Signed-off-by: xun.zhang <xun.zhang@bambulab.com> Change-Id: I8bc3a2e08696e406b89e550a0335a1a36728ee65 (cherry picked from commit f1702a5c3604f685a3b35ea0e83d29bdbbd90f70)
66 lines
1.7 KiB
C++
66 lines
1.7 KiB
C++
#ifndef slic3r_DragDropPanel_hpp_
|
|
#define slic3r_DragDropPanel_hpp_
|
|
|
|
#include "GUI.hpp"
|
|
#include "GUI_Utils.hpp"
|
|
|
|
#include <wx/simplebook.h>
|
|
#include <wx/dialog.h>
|
|
#include <wx/timer.h>
|
|
#include <vector>
|
|
|
|
|
|
namespace Slic3r { namespace GUI {
|
|
|
|
wxColor Hex2Color(const std::string& str);
|
|
|
|
class ColorPanel;
|
|
class DragDropPanel : public wxPanel
|
|
{
|
|
public:
|
|
DragDropPanel(wxWindow *parent, const wxString &label, bool is_auto);
|
|
|
|
void AddColorBlock(const wxColour &color, int filament_id, bool update_ui = true);
|
|
void RemoveColorBlock(ColorPanel *panel, bool update_ui = true);
|
|
void DoDragDrop(ColorPanel *panel, const wxColour &color, int filament_id);
|
|
|
|
std::vector<int> GetAllFilaments() const;
|
|
|
|
void set_is_draging(bool is_draging) { m_is_draging = is_draging; }
|
|
bool is_draging() const { return m_is_draging; }
|
|
|
|
std::vector<ColorPanel *> get_filament_blocks() const { return m_filament_blocks; }
|
|
|
|
private:
|
|
wxBoxSizer *m_sizer;
|
|
wxGridSizer *m_grid_item_sizer;
|
|
bool m_is_auto;
|
|
|
|
std::vector<ColorPanel *> m_filament_blocks;
|
|
private:
|
|
bool m_is_draging = false;
|
|
};
|
|
|
|
/////////////// ColorPanel start ////////////////////////
|
|
// The UI panel of drag item
|
|
class ColorPanel : public wxPanel
|
|
{
|
|
public:
|
|
ColorPanel(DragDropPanel *parent, const wxColour &color, int filament_id);
|
|
|
|
wxColour GetColor() const { return m_color; }
|
|
int GetFilamentId() const { return m_filament_id; }
|
|
|
|
private:
|
|
void OnLeftDown(wxMouseEvent &event);
|
|
void OnLeftUp(wxMouseEvent &event);
|
|
void OnPaint(wxPaintEvent &event);
|
|
|
|
DragDropPanel *m_parent;
|
|
wxColor m_color;
|
|
int m_filament_id;
|
|
};
|
|
}} // namespace Slic3r::GUI
|
|
|
|
#endif /* slic3r_DragDropPanel_hpp_ */
|