mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 17:12:07 +00:00
* Fix calls to depreciated wxPen constructor * Fix use of wxTimerEvent * Fix unrecognized character escape sequence * Fix signed/unsigned mismatch At least as much as possible without significantly altering parts of the application * Clean unreferenced variables * fix mistyped namespace selector * Update deprecated calls * Fix preprocessor statement * Remove empty switch statements * Change int vector used as bool to bool vector * Remove empty control statements and related unused code * Change multi character constant to string constant * Fix discarded return value json::parse was being called on the object, rather than statically like it should be. Also, the value was not being captured. * Rename ICON_SIZE def used by MultiMachine By having the definition in the header, it causes issues when other files define ICON_SIZE. By renaming it to MM_ICON_SIZE, this lessens the issue. It would probably be ideal to have the definitions in the respective .cpp that use them, but it would make it less convenient to update the values if needed in the future. * Remove unused includes * Fix linux/macOS compilation * Hide unused-function errors on non-Windows systems * Disable signed/unsigned comparison mismatch error * Remove/Disable more unused variables Still TODO: check double for loop in Print.cpp * Remove unused variable that was missed * Remove unused variables in libraries in the src folder * Apply temporary fix for subobject linkage error * Remove/Disable last set of unused variables reported by GCC * remove redundant for loop * fix misspelled ifdef check * Update message on dialog * Fix hard-coded platform specific modifier keys * Remove duplicate for loop * Disable -Wmisleading-indentation warning * disable -Wswitch warning * Remove unused local typedefs * Fix -Wunused-value * Fix pragma error on Windows from subobject linkage fix * Fix -Waddress * Fix null conversions (-Wconversion-null) --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
117 lines
3.7 KiB
C++
117 lines
3.7 KiB
C++
#ifndef slic3r_MultiMachineMangerPage_hpp_
|
|
#define slic3r_MultiMachineMangerPage_hpp_
|
|
|
|
#include "GUI_Utils.hpp"
|
|
#include "MultiMachine.hpp"
|
|
|
|
namespace Slic3r {
|
|
namespace GUI {
|
|
|
|
#define DEVICE_LEFT_PADDING_LEFT 15
|
|
#define DEVICE_LEFT_DEV_NAME 180
|
|
#define DEVICE_LEFT_PRO_NAME 180
|
|
#define DEVICE_LEFT_PRO_INFO 320
|
|
|
|
class MultiMachineItem : public DeviceItem
|
|
{
|
|
|
|
public:
|
|
MultiMachineItem(wxWindow* parent, MachineObject* obj);
|
|
~MultiMachineItem() {};
|
|
|
|
void OnEnterWindow(wxMouseEvent& evt);
|
|
void OnLeaveWindow(wxMouseEvent& evt);
|
|
void OnLeftDown(wxMouseEvent& evt);
|
|
void OnMove(wxMouseEvent& evt);
|
|
|
|
void paintEvent(wxPaintEvent& evt);
|
|
void render(wxDC& dc);
|
|
void DrawTextWithEllipsis(wxDC& dc, const wxString& text, int maxWidth, int left, int top = 0);
|
|
void doRender(wxDC& dc);
|
|
void post_event(wxCommandEvent&& event);
|
|
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
|
|
|
public:
|
|
bool m_hover{ false };
|
|
ScalableBitmap m_bitmap_check_disable;
|
|
ScalableBitmap m_bitmap_check_off;
|
|
ScalableBitmap m_bitmap_check_on;
|
|
wxString get_left_time(int mc_left_time);
|
|
};
|
|
|
|
class MultiMachineManagerPage : public wxPanel
|
|
{
|
|
public:
|
|
MultiMachineManagerPage(wxWindow* parent);
|
|
~MultiMachineManagerPage() {};
|
|
|
|
void update_page();
|
|
void refresh_user_device(bool clear = false);
|
|
|
|
void sync_state(MachineObject* obj_);
|
|
bool Show(bool show);
|
|
|
|
std::vector<ObjState> extractRange(const std::vector<ObjState>& source, int start, int end);
|
|
|
|
void start_timer();
|
|
void update_page_number();
|
|
void on_timer();
|
|
void clear_page();
|
|
|
|
void page_num_enter_evt();
|
|
|
|
void msw_rescale();
|
|
|
|
private:
|
|
std::vector<ObjState> m_state_objs;
|
|
std::vector<MultiMachineItem*> m_device_items;
|
|
SortItem m_sort;
|
|
bool device_dev_name_big{ true };
|
|
bool device_state_big{ true };
|
|
|
|
|
|
Button* m_button_edit{nullptr};
|
|
wxBoxSizer* page_sizer{ nullptr };
|
|
wxPanel* m_main_panel{ nullptr };
|
|
wxBoxSizer* m_main_sizer{nullptr};
|
|
wxBoxSizer* m_sizer_machine_list{nullptr};
|
|
wxScrolledWindow* m_machine_list{ nullptr };
|
|
wxStaticText* m_selected_num{ nullptr };
|
|
|
|
// table head
|
|
wxPanel* m_table_head_panel{ nullptr };
|
|
wxBoxSizer* m_table_head_sizer{ nullptr };
|
|
Button* m_printer_name{ nullptr };
|
|
Button* m_task_name{ nullptr };
|
|
Button* m_status{ nullptr };
|
|
Button* m_action{ nullptr };
|
|
Button* m_stop_all_botton{nullptr};
|
|
|
|
// tip when no device
|
|
wxStaticText* m_tip_text{ nullptr };
|
|
Button* m_button_add{ nullptr };
|
|
|
|
// Flipping pages
|
|
int m_current_page{ 0 };
|
|
int m_total_page{ 0 };
|
|
int m_total_count{ 0 };
|
|
int m_count_page_item{ 10 };
|
|
|
|
bool prev{ false };
|
|
bool next{ false };
|
|
Button* btn_last_page{ nullptr };
|
|
Button* btn_next_page{ nullptr };
|
|
wxStaticText* st_page_number{ nullptr };
|
|
wxBoxSizer* m_flipping_page_sizer{ nullptr };
|
|
wxBoxSizer* m_page_sizer{ nullptr };
|
|
wxPanel* m_flipping_panel{ nullptr };
|
|
wxTimer* m_flipping_timer{ nullptr };
|
|
TextInput* m_page_num_input{ nullptr };
|
|
Button* m_page_num_enter{ nullptr };
|
|
};
|
|
|
|
} // namespace GUI
|
|
} // namespace Slic3r
|
|
|
|
#endif
|