Files
OrcaSlicer/src/slic3r/GUI/Widgets/AxisCtrlButton.hpp
T
HanifKoh 1a5f91d727 Add Missing Includes Across src/slic3r/GUI (#16048)
* Add Missing Includes Across src/slic3r/GUI

Every GUI source and header now directly includes the headers declaring what it uses, rather than relying on the precompiled header or transitive includes. Generated with clang-tidy misc-include-cleaner, plus one hand edit making CalibrationPanel.hpp self-contained.

* Drop the OS-Specific Includes Added Outside Their Platform Guards

GLib, GTK, D-Bus and POSIX headers are only used inside platform #if blocks, which already include them. Added unconditionally at the top of the file they broke the Windows build.

* Add the clang-tidy Configuration That Generated These Includes

Only misc-include-cleaner's missing-include check, with the headers it must never suggest: per-platform, internal and OS-specific ones that would break other platforms or are not meant to be included directly.

* Match Windows Paths in the clang-tidy Ignore List

Header paths use backslashes on Windows, so every / in a pattern is now [/\\]. The Windows SDK headers are ignored alongside the other OS-specific ones, and the list is one pattern per line. Suggested by @raistlin7447 from a Windows clang-cl run.
2026-10-02 14:56:56 +08:00

84 lines
1.8 KiB
C++

#ifndef slic3r_GUI_AxisCtrlButton_hpp_
#define slic3r_GUI_AxisCtrlButton_hpp_
#include <wx/gdicmn.h>
#include "slic3r/GUI/Widgets/StateColor.hpp"
#include <wx/event.h>
#include <wx/dc.h>
#include <wx/stattext.h>
#include <wx/vlbox.h>
#include <wx/combo.h>
#include "../wxExtensions.hpp"
#include "StateHandler.hpp"
class AxisCtrlButton : public wxWindow
{
wxSize minSize;
double stretch;
double r_outer;
double r_inner;
double r_home;
double r_blank;
double gap;
wxPoint center;
StateHandler state_handler;
StateColor text_color;
StateColor border_color;
StateColor background_color;
StateColor inner_background_color;
ScalableBitmap m_icon;
bool pressedDown = false;
unsigned char last_pos;
unsigned char current_pos;
enum CurrentPos {
OUTER_UP = 0,
OUTER_LEFT = 1,
OUTER_DOWN = 2,
OUTER_RIGHT = 3,
INNER_UP = 4,
INNER_LEFT = 5,
INNER_DOWN = 6,
INNER_RIGHT = 7,
INNER_HOME = 8,
UNDEFINED = 9
};
public:
AxisCtrlButton(wxWindow *parent, ScalableBitmap &icon, long style = 0);
void SetMinSize(const wxSize& size) override;
void SetTextColor(StateColor const& color);
void SetBorderColor(StateColor const& color);
void SetBackgroundColor(StateColor const& color);
void SetInnerBackgroundColor(StateColor const& color);
void SetBitmap(ScalableBitmap &bmp);
void Rescale();
private:
void updateParams();
void paintEvent(wxPaintEvent& evt);
void render(wxDC& dc);
void mouseDown(wxMouseEvent& event);
void mouseReleased(wxMouseEvent& event);
void mouseMoving(wxMouseEvent& event);
void sendButtonEvent();
DECLARE_EVENT_TABLE()
};
#endif // !slic3r_GUI_Button_hpp_