OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
TabCtrl Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Widgets/TabCtrl.hpp>

Inheritance diagram for TabCtrl:
Collaboration diagram for TabCtrl:

Public Member Functions

 TabCtrl (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0)
 ~TabCtrl ()
virtual bool SetFont (wxFont const &font) override
int AppendItem (const wxString &item, int image=-1, int selImage=-1, void *clientData=nullptr)
int AppendItem (const wxString &item, const wxBitmap &bitmap, void *clientData=nullptr)
bool DeleteItem (int item)
void DeleteAllItems ()
unsigned int GetCount () const
int GetSelection () const
void SelectItem (int item)
void Unselect ()
virtual void Rescale ()
wxString GetItemText (unsigned int item) const
void SetItemText (unsigned int item, wxString const &value)
void SetItemBitmap (unsigned int item, const wxBitmap &bitmap)
void SetItemIndicator (unsigned int item, bool on)
bool GetItemBold (unsigned int item) const
void SetItemBold (unsigned int item, bool bold)
void * GetItemData (unsigned int item) const
void SetItemData (unsigned int item, void *clientData)
void AssignImageList (wxImageList *imageList)
void SetItemTextColour (unsigned int item, const StateColor &col)
int GetFirstVisibleItem () const
int GetNextVisible (int item) const
bool IsVisible (unsigned int item) const
int GetFullSize () const
bool Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0)
void SetCornerRadius (double radius)
void SetBorderWidth (int width)
void SetTopMargin (int margin)
void SetBorderColor (StateColor const &color)
void SetBorderColorNormal (wxColor const &color)
void SetBorderStyle (wxPenStyle style)
void SetBackgroundColor (StateColor const &color)
void SetBackgroundColorNormal (wxColor const &color)
void SetBackgroundColor2 (StateColor const &color)
void ShowBadge (bool show)

Static Public Member Functions

static wxColor GetParentBackgroundColor (wxWindow *parent)

Protected Member Functions

void eraseEvent (wxEraseEvent &evt)
void sizeEvent (wxSizeEvent &evt)
void paintEvent (wxPaintEvent &evt)
void render (wxDC &dc)

Protected Attributes

double radius
int border_width = 1
int top_margin = 0
wxPenStyle border_style = wxPENSTYLE_SOLID
StateHandler state_handler
StateColor border_color
StateColor background_color
StateColor background_color2
ScalableBitmap badge

Private Member Functions

virtual void DoSetSize (int x, int y, int width, int height, int sizeFlags=wxSIZE_AUTO) override
void relayout ()
void buttonClicked (wxCommandEvent &event)
void keyDown (wxKeyEvent &event)
void doRender (wxDC &dc) override
bool sendTabCtrlEvent (bool changing=false)

Private Attributes

std::vector< Button * > btns
wxImageList * images = nullptr
wxBoxSizer * sizer = nullptr
int sel = -1
wxFont bold

Detailed Description

Constructor & Destructor Documentation

◆ TabCtrl()

TabCtrl::TabCtrl ( wxWindow * parent,
wxWindowID id,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize,
long style = 0 )
40 : StaticBox(parent, id, pos, size, style)
41{
42#if 0
43 radius = 5;
44#else
45 radius = 1;
46#endif
47 border_width = 1;
48 SetBorderColor(0xcecece);
49 sizer = new wxBoxSizer(wxHORIZONTAL);
50 sizer->AddSpacer(10);
51 auto hsizer = new wxBoxSizer(wxVERTICAL);
52 hsizer->Add(sizer, 0, wxEXPAND | wxBOTTOM, border_width * 4);
53 SetSizer(hsizer);
54 Bind(wxEVT_COMMAND_BUTTON_CLICKED, &TabCtrl::buttonClicked, this);
55 // wxString reason;
56 // IsTransparentBackgroundSupported(&reason);
57}
#define style
Definition WipeTowerDialog.cpp:101
int border_width
Definition StaticBox.hpp:68
double radius
Definition StaticBox.hpp:67
StaticBox()
Definition StaticBox.cpp:33
void SetBorderColor(StateColor const &color)
Definition StaticBox.cpp:87
wxBoxSizer * sizer
Definition TabCtrl.hpp:23
void buttonClicked(wxCommandEvent &event)
Definition TabCtrl.cpp:315

References StaticBox::StaticBox(), StaticBox::border_width, buttonClicked(), StaticBox::radius, StaticBox::SetBorderColor(), sizer, and style.

Here is the call graph for this function:

◆ ~TabCtrl()

TabCtrl::~TabCtrl ( )
59{ delete images; }
wxImageList * images
Definition TabCtrl.hpp:22

References images.

Member Function Documentation

◆ AppendItem() [1/2]

int TabCtrl::AppendItem ( const wxString & item,
const wxBitmap & bitmap,
void * clientData = nullptr )
123{
124 const int index = AppendItem(item, -1, -1, clientData);
125 SetItemBitmap(index, bitmap);
126 return index;
127}
int AppendItem(const wxString &item, int image=-1, int selImage=-1, void *clientData=nullptr)
Definition TabCtrl.cpp:103
void SetItemBitmap(unsigned int item, const wxBitmap &bitmap)
Definition TabCtrl.cpp:180

References AppendItem(), and SetItemBitmap().

Here is the call graph for this function:

◆ AppendItem() [2/2]

int TabCtrl::AppendItem ( const wxString & item,
int image = -1,
int selImage = -1,
void * clientData = nullptr )
104{
105 Button* btn = new Button();
106 btn->Create(this, item, "", wxBORDER_NONE);
107 btn->SetFont(GetFont());
108 btn->SetTextColor(
109 StateColor(std::make_pair(0x6B6B6C, (int) StateColor::NotChecked), std::make_pair(wxColour("#262E30"), (int) StateColor::Normal)));
110 btn->SetBackgroundColor(StateColor());
111 btn->SetCornerRadius(0);
113 btns.push_back(btn);
114 if (btns.size() > 1)
115 sizer->GetItem(sizer->GetItemCount() - 1)->SetMinSize({0, 0});
116 sizer->Add(btn, 0, wxALIGN_CENTER_VERTICAL);
117 sizer->AddStretchSpacer(1);
118 relayout();
119 return btns.size() - 1;
120}
#define TAB_BUTTON_PADDING
Definition TabCtrl.cpp:37
void SetTextColor(StateColor const &color)
Definition Button.cpp:137
bool Create(wxWindow *parent, wxString text, wxString icon="", long style=0, int iconSize=0, wxWindowID btn_id=wxID_ANY)
Definition Button.cpp:56
void SetPaddingSize(const wxSize &size)
Definition Button.cpp:124
bool SetFont(const wxFont &font) override
Definition Button.cpp:81
@ NotChecked
Definition StateColor.hpp:23
@ Normal
Definition StateColor.hpp:16
void SetCornerRadius(double radius)
Definition StaticBox.cpp:62
void SetBackgroundColor(StateColor const &color)
Definition StaticBox.cpp:102
std::vector< Button * > btns
Definition TabCtrl.hpp:21
void relayout()
Definition TabCtrl.cpp:267

References btns, Button::Create(), StateColor::Normal, StateColor::NotChecked, relayout(), StaticBox::SetBackgroundColor(), StaticBox::SetCornerRadius(), Button::SetFont(), Button::SetPaddingSize(), Button::SetTextColor(), sizer, and TAB_BUTTON_PADDING.

Referenced by AppendItem(), and Slic3r::GUI::PublishSettingsDialog::category_index_for().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AssignImageList()

void TabCtrl::AssignImageList ( wxImageList * imageList)
226{
227 if (images == imageList)
228 return;
229 delete images;
230 images = imageList;
231}

References images.

◆ buttonClicked()

void TabCtrl::buttonClicked ( wxCommandEvent & event)
private
316{
317 SetFocus();
318 auto btn = event.GetEventObject();
319 auto iter = std::find(btns.begin(), btns.end(), btn);
320 SelectItem(iter == btns.end() ? -1 : iter - btns.begin());
321}
void SelectItem(int item)
Definition TabCtrl.cpp:63

References btns, and SelectItem().

Referenced by TabCtrl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Create()

bool StaticBox::Create ( wxWindow * parent,
wxWindowID id = wxID_ANY,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize,
long style = 0 )
inherited
52{
53 if (style & wxBORDER_NONE)
54 border_width = 0;
55 wxWindow::Create(parent, id, pos, size, style);
57 state_handler.update_binds();
58 SetBackgroundColour(GetParentBackgroundColor(parent));
59 return true;
60}
StateColor border_color
Definition StaticBox.hpp:72
static wxColor GetParentBackgroundColor(wxWindow *parent)
Definition StaticBox.cpp:122
StateHandler state_handler
Definition StaticBox.hpp:71
StateColor background_color
Definition StaticBox.hpp:73
StateColor background_color2
Definition StaticBox.hpp:74

References background_color, background_color2, border_color, border_width, GetParentBackgroundColor(), state_handler, and style.

Referenced by FanSwitchButton::FanSwitchButton(), ImageSwitchButton::ImageSwitchButton(), ModeSwitchButton::ModeSwitchButton(), StaticBox(), Button::Create(), SpinInput::Create(), TabButton::Create(), TempInput::Create(), and TextInput::Create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeleteAllItems()

void TabCtrl::DeleteAllItems ( )
159{
160 sizer->Clear(true);
161 sizer->AddSpacer(10);
162 btns.clear();
163 if (sel >= 0) {
164 sel = -1;
166 }
167}
bool sendTabCtrlEvent(bool changing=false)
Definition TabCtrl.cpp:374
int sel
Definition TabCtrl.hpp:25

References btns, sel, sendTabCtrlEvent(), and sizer.

Here is the call graph for this function:

◆ DeleteItem()

bool TabCtrl::DeleteItem ( int item)
130{
131 if (item < 0 || item >= btns.size()) {
132 return false;
133 }
134 const bool selection_changed = sel >= item;
135
136 if (selection_changed) {
137 sendTabCtrlEvent(true);
138 }
139
140 Button* btn = btns[item];
141 btn->Destroy();
142 btns.erase(btns.begin() + item);
143 sizer->Remove(item * 2);
144 if (btns.size() > 1)
145 sizer->GetItem(sizer->GetItemCount() - 1)->SetMinSize({0, 0});
146
147 if (selection_changed) {
148 sel--; // `relayout()` uses `sel` so we need to update this before calling `relayout()`
149 }
150 relayout();
151 if (selection_changed) {
153 }
154
155 return true;
156}

References btns, relayout(), sel, sendTabCtrlEvent(), and sizer.

Here is the call graph for this function:

◆ doRender()

void TabCtrl::doRender ( wxDC & dc)
overrideprivatevirtual

Reimplemented from StaticBox.

340{
341 wxSize size = GetSize();
342 int states = state_handler.states();
343 if (sel < 0) {
344 return;
345 }
346
347 auto x1 = btns[sel]->GetPosition().x;
348 auto x2 = x1 + btns[sel]->GetSize().x;
349 const int BS2 = (1 + border_width) / 2;
350#if 0
351 const int BS = border_width / 2;
353 dc.SetPen(wxPen(border_color.colorForStates(states), border_width));
354 dc.SetBrush(*wxTRANSPARENT_BRUSH);
355 dc.DrawLine(0, size.y - BS2, x1 - radius + BS2, size.y - BS2);
356 dc.DrawArc(x1 - radius, size.y, x1, size.y - radius, x1 - radius, size.y - radius);
357 dc.DrawLine(x1, size.y - radius, x1, radius);
358 dc.DrawArc(x1 + radius, 0, x1, radius, x1 + radius, radius);
359 dc.DrawLine(x1 + radius, BS, x2 - radius, BS);
360 dc.DrawArc(x2, radius, x2 - radius, 0, x2 - radius, radius);
361 dc.DrawLine(x2, radius, x2, size.y - radius);
362 dc.DrawArc(x2, size.y - radius, x2 + radius, size.y, x2 + radius, size.y - radius);
363 dc.DrawLine(x2 + radius - BS2, size.y - BS2, size.x, size.y - BS2);
364#else
365 dc.SetPen(wxPen(border_color.colorForStates(states), border_width));
366 dc.DrawLine(0, size.y - BS2, size.x, size.y - BS2);
367 wxColour c("#009688"); // ORCA selected tab underline stroke color
368 dc.SetPen(wxPen(c, 1));
369 dc.SetBrush(c);
370 dc.DrawRoundedRectangle(x1 - radius, size.y - BS2 - border_width * 3, x2 + radius * 2 - x1, border_width * 3, radius);
371#endif
372}
#define TAB_BUTTON_SPACE
Definition TabCtrl.cpp:34

References StaticBox::border_color, StaticBox::border_width, btns, StaticBox::radius, sel, StaticBox::state_handler, and TAB_BUTTON_SPACE.

◆ DoSetSize()

void TabCtrl::DoSetSize ( int x,
int y,
int width,
int height,
int sizeFlags = wxSIZE_AUTO )
overrideprivatevirtual
247{
248 auto size = GetSize();
249 wxWindow::DoSetSize(x, y, width, height, sizeFlags);
250 if (size == GetSize())
251 return;
252 relayout();
253}

References relayout().

Here is the call graph for this function:

◆ eraseEvent()

void StaticBox::eraseEvent ( wxEraseEvent & evt)
protectedinherited
153{
154 // for transparent background, but not work
155#ifdef __WXMSW__
156 wxDC *dc = evt.GetDC();
157 wxSize size = GetSize();
158 wxClientDC dc2(GetParent());
159 dc->Blit({0, 0}, size, &dc2, GetPosition());
160#endif
161}

◆ GetCount()

unsigned int TabCtrl::GetCount ( ) const
169{ return btns.size(); }

References btns.

◆ GetFirstVisibleItem()

int TabCtrl::GetFirstVisibleItem ( ) const
240{ return btns.size() == 0 ? -1 : 0; }

References btns.

◆ GetFullSize()

int TabCtrl::GetFullSize ( ) const
307{
308 // Mirrors relayout(): a 10px leading spacer plus every button's min width.
309 int width = 10;
310 for (const Button* btn : btns)
311 width += btn->GetMinSize().x;
312 return width;
313}
coord_t width(const BoundingBox &box)
Definition Arrange.cpp:1184

References btns.

◆ GetItemBold()

bool TabCtrl::GetItemBold ( unsigned int item) const
197{
198 if (item >= btns.size())
199 return false;
200 return btns[item]->GetFont() == bold;
201}
wxFont bold
Definition TabCtrl.hpp:26

References bold, and btns.

◆ GetItemData()

void * TabCtrl::GetItemData ( unsigned int item) const
212{
213 if (item >= btns.size())
214 return nullptr;
215 return btns[item]->GetClientData();
216}

References btns.

◆ GetItemText()

wxString TabCtrl::GetItemText ( unsigned int item) const
171{ return item < btns.size() ? btns[item]->GetLabel() : wxString{}; }

References btns.

◆ GetNextVisible()

int TabCtrl::GetNextVisible ( int item) const
242{ return ++item < btns.size() ? item : -1; }

References btns.

◆ GetParentBackgroundColor()

wxColor StaticBox::GetParentBackgroundColor ( wxWindow * parent)
staticinherited
123{
124 if (auto box = dynamic_cast<StaticBox*>(parent)) {
125 if (box->background_color.count() > 0) {
126 if (box->background_color2.count() == 0)
127 return box->background_color.defaultColor();
128 auto s = box->background_color.defaultColor();
129 auto e = box->background_color2.defaultColor();
130 int r = (s.Red() + e.Red()) / 2;
131 int g = (s.Green() + e.Green()) / 2;
132 int b = (s.Blue() + e.Blue()) / 2;
133 return wxColor(r, g, b);
134 }
135 }
136 if (parent)
137 return parent->GetBackgroundColour();
138 return *wxWHITE;
139}

References StaticBox().

Referenced by Label::Label(), ModeSwitchButton::ModeSwitchButton(), ScalableButton::ScalableButton(), SwitchButton::SwitchButton(), Create(), and SwitchButton::Rescale().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSelection()

int TabCtrl::GetSelection ( ) const
61{ return sel; }

References sel.

Referenced by keyDown().

Here is the caller graph for this function:

◆ IsVisible()

bool TabCtrl::IsVisible ( unsigned int item) const
244{ return true; }

◆ keyDown()

void TabCtrl::keyDown ( wxKeyEvent & event)
private
324{
325 switch (event.GetKeyCode()) {
326 case WXK_UP:
327 case WXK_DOWN:
328 case WXK_LEFT:
329 case WXK_RIGHT:
330 if ((event.GetKeyCode() == WXK_UP || event.GetKeyCode() == WXK_LEFT) && GetSelection() > 0) {
332 } else if ((event.GetKeyCode() == WXK_DOWN || event.GetKeyCode() == WXK_RIGHT) && GetSelection() + 1 < btns.size()) {
334 }
335 break;
336 }
337}
int GetSelection() const
Definition TabCtrl.cpp:61

References btns, GetSelection(), and SelectItem().

Referenced by wxDEFINE_EVENT().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ paintEvent()

void StaticBox::paintEvent ( wxPaintEvent & evt)
protectedinherited
170{
171 // depending on your system you may need to look at double-buffered dcs
172 wxPaintDC dc(this);
173 render(dc);
174}
void render(wxDC &dc)
Definition StaticBox.cpp:181

References render().

Here is the call graph for this function:

◆ relayout()

void TabCtrl::relayout ( )
private
268{
269 int offset = 10;
270 int item = sel + 1;
271 int first = 0;
272 for (int i = 0; i < item; ++i)
273 offset += btns[i]->GetMinSize().x;
274 if (item < btns.size())
275 offset += btns[item]->GetMinSize().x;
276 int width = GetSize().x;
277 for (int i = 0; i < btns.size(); ++i) {
278 auto size = btns[i]->GetMinSize().x;
279 if (i < sel && offset > width) {
280 sizer->Show(i * 2 + 1, false);
281 sizer->Show(i * 2 + 2, false);
282 offset -= size;
283 first = i + 1;
284 } else if (i <= item) {
285 sizer->Show(i * 2 + 1, true);
286 sizer->Show(i * 2 + 2, true);
287 } else if (offset <= width) {
288 sizer->Show(i * 2 + 1, true);
289 sizer->Show(i * 2 + 2, true);
290 offset += size;
291 item = i;
292 } else {
293 sizer->Show(i * 2 + 1, false);
294 sizer->Show(i * 2 + 2, false);
295 }
296 sizer->GetItem(i * 2 + 2)->SetMinSize({0, 0});
297 }
298 if (item >= btns.size())
299 --item;
300 // Keep spacing 2 ~ 10 TAB_BUTTON_SPACE
301 int b = GetSize().x - offset - 10 - (item + 1 - first) * 16;
302 sizer->GetItem(item * 2 + 2)->SetMinSize({b > 0 ? b : 0, 0});
303 Layout();
304}
Slic3r::Polygons offset(const Slic3r::Polygon &polygon, const float delta, JoinType joinType, double miterLimit)
Definition ClipperUtils.cpp:582

References btns, sel, and sizer.

Referenced by AppendItem(), DeleteItem(), DoSetSize(), Rescale(), SelectItem(), SetItemBitmap(), and SetItemIndicator().

Here is the caller graph for this function:

◆ render()

void StaticBox::render ( wxDC & dc)
protectedinherited
182{
183#ifdef __WXMSW__
184 if (radius == 0) {
185 doRender(dc);
186 return;
187 }
188
189 wxSize size = GetSize();
190 if (size.x <= 0 || size.y <= 0)
191 return;
192 wxMemoryDC memdc(&dc);
193 if (!memdc.IsOk()) {
194 doRender(dc);
195 return;
196 }
197 wxBitmap bmp(size.x, size.y);
198 memdc.SelectObject(bmp);
199 //memdc.Blit({0, 0}, size, &dc, {0, 0});
200 memdc.SetBackground(wxBrush(GetBackgroundColour()));
201 memdc.Clear();
202 {
203 wxGCDC dc2(memdc);
204 doRender(dc2);
205 }
206
207 memdc.SelectObject(wxNullBitmap);
208 dc.DrawBitmap(bmp, 0, 0);
209#else
210 doRender(dc);
211#endif
212}
virtual void doRender(wxDC &dc)
Definition StaticBox.cpp:214

References doRender(), and radius.

Referenced by paintEvent(), Button::render(), FanSwitchButton::render(), ImageSwitchButton::render(), SpinInput::render(), TabButton::render(), TempInput::render(), and TextInput::render().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Rescale()

void TabCtrl::Rescale ( )
virtual
88{
89 for (auto& b : btns)
90 b->Rescale();
91 relayout();
92}

References btns, and relayout().

Referenced by Slic3r::GUI::PublishSettingsDialog::on_dpi_changed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SelectItem()

void TabCtrl::SelectItem ( int item)
64{
65 if (item == sel || !sendTabCtrlEvent(true))
66 return;
67 if (sel >= 0) {
68 wxCommandEvent e(wxEVT_CHECKBOX);
69 auto b = btns[sel];
70 e.SetEventObject(b);
71 b->GetEventHandler()->ProcessEvent(e);
72 }
73 sel = item;
74 if (sel >= 0) {
75 wxCommandEvent e(wxEVT_CHECKBOX);
76 auto b = btns[sel];
77 e.SetEventObject(b);
78 b->GetEventHandler()->ProcessEvent(e);
79 }
81 relayout();
82 Refresh();
83}

References btns, relayout(), sel, and sendTabCtrlEvent().

Referenced by buttonClicked(), keyDown(), Slic3r::GUI::PublishSettingsDialog::setup_variant_switch(), and Unselect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendTabCtrlEvent()

bool TabCtrl::sendTabCtrlEvent ( bool changing = false)
private
375{
376 wxCommandEvent event(changing ? wxEVT_TAB_SEL_CHANGING : wxEVT_TAB_SEL_CHANGED, GetId());
377 event.SetEventObject(this);
378 event.SetInt(sel);
379 GetEventHandler()->ProcessEvent(event);
380 return true;
381}

References sel.

Referenced by DeleteAllItems(), DeleteItem(), and SelectItem().

Here is the caller graph for this function:

◆ SetBackgroundColor()

◆ SetBackgroundColor2()

void StaticBox::SetBackgroundColor2 ( StateColor const & color)
inherited
116{
117 background_color2 = color;
118 state_handler.update_binds();
119 Refresh();
120}

References background_color2, and state_handler.

◆ SetBackgroundColorNormal()

void StaticBox::SetBackgroundColorNormal ( wxColor const & color)
inherited
110{
111 background_color.setColorForStates(color, 0);
112 Refresh();
113}

References background_color.

Referenced by Slic3r::GUI::ShortcutCaptureDialog::ShortcutCaptureDialog(), and Slic3r::GUI::HotEndTable::CreateNozzleBox().

Here is the caller graph for this function:

◆ SetBorderColor()

◆ SetBorderColorNormal()

void StaticBox::SetBorderColorNormal ( wxColor const & color)
inherited
97{
98 border_color.setColorForStates(color, 0);
99 Refresh();
100}

References border_color.

Referenced by Slic3r::GUI::ShortcutCaptureDialog::ShortcutCaptureDialog(), and Slic3r::GUI::HotEndTable::CreateNozzleBox().

Here is the caller graph for this function:

◆ SetBorderStyle()

void StaticBox::SetBorderStyle ( wxPenStyle style)
inherited
76{
78 Refresh();
79}
wxPenStyle border_style
Definition StaticBox.hpp:70

References border_style, and style.

◆ SetBorderWidth()

void StaticBox::SetBorderWidth ( int width)
inherited
82{
84 Refresh();
85}

References border_width.

Referenced by MultiSwitchButton::MultiSwitchButton(), Slic3r::GUI::KBShortcutsDialog::create_page(), and Button::SetStyle().

Here is the caller graph for this function:

◆ SetCornerRadius()

◆ SetFont()

bool TabCtrl::SetFont ( wxFont const & font)
overridevirtual
95{
96 StaticBox::SetFont(font);
97 bold = font.Bold();
98 for (size_t i = 0; i < btns.size(); ++i)
99 btns[i]->SetFont(i == sel ? bold : font);
100 return true;
101}
virtual bool SetFont(wxFont const &font) override
Definition TabCtrl.cpp:94

References bold, btns, sel, and SetFont().

Referenced by Slic3r::GUI::PublishSettingsDialog::section_group_for(), and SetFont().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetItemBitmap()

void TabCtrl::SetItemBitmap ( unsigned int item,
const wxBitmap & bitmap )
181{
182 if (item >= btns.size())
183 return;
184 btns[item]->SetIcon(bitmap);
185 relayout();
186}

References btns, and relayout().

Referenced by AppendItem().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetItemBold()

void TabCtrl::SetItemBold ( unsigned int item,
bool bold )
204{
205 if (item >= btns.size())
206 return;
207 btns[item]->SetFont(bold ? this->bold : GetFont());
208 btns[item]->Rescale();
209}

References bold, and btns.

◆ SetItemData()

void TabCtrl::SetItemData ( unsigned int item,
void * clientData )
219{
220 if (item >= btns.size())
221 return;
222 btns[item]->SetClientData(clientData);
223}

References btns.

◆ SetItemIndicator()

void TabCtrl::SetItemIndicator ( unsigned int item,
bool on )
189{
190 if (item >= btns.size())
191 return;
192 btns[item]->SetIndicator(on);
193 relayout();
194}

References btns, and relayout().

Referenced by Slic3r::GUI::PublishSettingsDialog::refresh_tab_indicators().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetItemText()

void TabCtrl::SetItemText ( unsigned int item,
wxString const & value )
174{
175 if (item >= btns.size())
176 return;
177 btns[item]->SetLabel(value);
178}

References btns.

◆ SetItemTextColour()

void TabCtrl::SetItemTextColour ( unsigned int item,
const StateColor & col )
234{
235 if (item >= btns.size())
236 return;
237 btns[item]->SetTextColor(col);
238}

References btns.

◆ SetTopMargin()

void StaticBox::SetTopMargin ( int margin)
inherited
70{
71 this->top_margin = margin;
72 Refresh();
73}
int top_margin
Definition StaticBox.hpp:69

References top_margin.

Referenced by Slic3r::GUI::ExtruderGroup::ExtruderGroup().

Here is the caller graph for this function:

◆ ShowBadge()

void StaticBox::ShowBadge ( bool show)
inherited
142{
143 if (show && badge.name() != "badge") {
144 badge = ScalableBitmap(this, "badge", 18);
145 Refresh();
146 } else if (!show && !badge.name().empty()) {
147 badge = ScalableBitmap {};
148 Refresh();
149 }
150}
ScalableBitmap badge
Definition StaticBox.hpp:75

References badge.

Referenced by Slic3r::GUI::ExtruderGroup::ExtruderGroup().

Here is the caller graph for this function:

◆ sizeEvent()

void StaticBox::sizeEvent ( wxSizeEvent & evt)
protectedinherited
164{
165 Refresh();
166 evt.Skip();
167}

◆ Unselect()

void TabCtrl::Unselect ( )
85{ SelectItem(-1); }

References SelectItem().

Referenced by Slic3r::GUI::PublishSettingsDialog::show_inner_page(), and Slic3r::GUI::PublishSettingsDialog::show_mixed_page().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ background_color

◆ background_color2

StateColor StaticBox::background_color2
protectedinherited

◆ badge

ScalableBitmap StaticBox::badge
protectedinherited

Referenced by doRender(), and ShowBadge().

◆ bold

wxFont TabCtrl::bold
private

Referenced by GetItemBold(), SetFont(), and SetItemBold().

◆ border_color

◆ border_style

wxPenStyle StaticBox::border_style = wxPENSTYLE_SOLID
protectedinherited

Referenced by doRender(), and SetBorderStyle().

◆ border_width

◆ btns

◆ images

wxImageList* TabCtrl::images = nullptr
private

Referenced by ~TabCtrl(), and AssignImageList().

◆ radius

◆ sel

◆ sizer

wxBoxSizer* TabCtrl::sizer = nullptr
private

◆ state_handler

◆ top_margin

int StaticBox::top_margin = 0
protectedinherited

Referenced by doRender(), and SetTopMargin().


The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Widgets/TabCtrl.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Widgets/TabCtrl.cpp