OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::OG_CustomCtrl::CtrlLine Struct Reference
Collaboration diagram for Slic3r::GUI::OG_CustomCtrl::CtrlLine:

Public Member Functions

 CtrlLine (wxCoord height, OG_CustomCtrl *ctrl, const Line &og_line, bool draw_just_act_buttons=false, bool draw_mode_bitmap=true)
 ~CtrlLine ()
int get_max_win_width ()
void correct_items_positions ()
void msw_rescale ()
void update_visibility (ConfigOptionMode mode)
void render_separator (wxDC &dc, wxCoord v_pos)
void render (wxDC &dc, wxCoord h_pos, wxCoord v_pos)
wxCoord draw_text (wxDC &dc, wxPoint pos, const wxString &text, const wxColour *color, int width, bool is_url=false, bool is_main=false)
wxPoint draw_blinking_bmp (wxDC &dc, wxPoint pos, bool is_blinking)
wxPoint draw_act_bmps (wxDC &dc, wxPoint pos, const wxBitmap &bmp_undo_to_sys, const wxBitmap &bmp_undo, bool is_blinking, size_t rect_id=0, bool is_main=false)
wxCoord draw_edit_bmp (wxDC &dc, wxPoint pos, const wxBitmap &bmp_edit)
bool launch_browser () const
bool is_separator () const

Public Attributes

wxCoord width { wxDefaultCoord }
wxCoord height { wxDefaultCoord }
OG_CustomCtrl * ctrl { nullptr }
const Line & og_line
bool draw_just_act_buttons { false }
bool draw_mode_bitmap { true }
bool is_visible { true }
bool is_focused { false }
std::vector< wxRect > rects_undo_icon
std::vector< wxRect > rects_undo_to_sys_icon
std::vector< wxRect > rects_edit_icon
wxRect rect_label

Detailed Description

Constructor & Destructor Documentation

◆ CtrlLine()

Slic3r::GUI::OG_CustomCtrl::CtrlLine::CtrlLine ( wxCoord height,
OG_CustomCtrl * ctrl,
const Line & og_line,
bool draw_just_act_buttons = false,
bool draw_mode_bitmap = true )
667 :
668 height(height),
669 ctrl(ctrl),
673{
674
675 for (size_t i = 0; i < og_line.get_options().size(); i++) {
676 rects_undo_icon.emplace_back(wxRect());
677 rects_undo_to_sys_icon.emplace_back(wxRect());
678 }
679}
bool draw_mode_bitmap
Definition OG_CustomCtrl.hpp:67
wxCoord height
Definition OG_CustomCtrl.hpp:62
std::vector< wxRect > rects_undo_icon
Definition OG_CustomCtrl.hpp:93
bool draw_just_act_buttons
Definition OG_CustomCtrl.hpp:66
const Line & og_line
Definition OG_CustomCtrl.hpp:64
std::vector< wxRect > rects_undo_to_sys_icon
Definition OG_CustomCtrl.hpp:94
OG_CustomCtrl * ctrl
Definition OG_CustomCtrl.hpp:63

References Slic3r::GUI::OG_CustomCtrl::OG_CustomCtrl(), ctrl, draw_just_act_buttons, draw_mode_bitmap, height, og_line, rects_undo_icon, and rects_undo_to_sys_icon.

Here is the call graph for this function:

◆ ~CtrlLine()

Slic3r::GUI::OG_CustomCtrl::CtrlLine::~CtrlLine ( )
inline
76{ ctrl = nullptr; }

References ctrl.

Member Function Documentation

◆ correct_items_positions()

void Slic3r::GUI::OG_CustomCtrl::CtrlLine::correct_items_positions ( )
697{
699 return;
700
701 if (og_line.near_label_widget_win)
702 ctrl->correct_window_position(og_line.near_label_widget_win, og_line);
703 if (og_line.widget_sizer)
704 ctrl->correct_widgets_position(og_line.widget_sizer, og_line);
705 if (og_line.extra_widget_sizer)
706 ctrl->correct_widgets_position(og_line.extra_widget_sizer, og_line);
707
708 const std::vector<Option>& option_set = og_line.get_options();
709 for (auto opt : option_set) {
710 Field* field = ctrl->opt_group->get_field(opt.opt_id);
711 if (!field)
712 continue;
713 if (field->getSizer())
714 ctrl->correct_widgets_position(field->getSizer(), og_line, field);
715 else if (field->getWindow())
716 ctrl->correct_window_position(field->getWindow(), og_line, field);
717 }
718}
bool is_visible
Definition OG_CustomCtrl.hpp:68

References ctrl, draw_just_act_buttons, Slic3r::GUI::Field::getSizer(), Slic3r::GUI::Field::getWindow(), is_visible, and og_line.

Referenced by msw_rescale(), and update_visibility().

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

◆ draw_act_bmps()

wxPoint Slic3r::GUI::OG_CustomCtrl::CtrlLine::draw_act_bmps ( wxDC & dc,
wxPoint pos,
const wxBitmap & bmp_undo_to_sys,
const wxBitmap & bmp_undo,
bool is_blinking,
size_t rect_id = 0,
bool is_main = false )
1037{
1038#ifndef DISABLE_BLINKING
1039 pos = draw_blinking_bmp(dc, pos, is_blinking);
1040#else
1041 if (ctrl->opt_group->split_multi_line && !is_main) { // BBS
1042 const std::vector<Option> &option_set = og_line.get_options();
1043 if (option_set.size() > 1)
1044 pos.y += lround(((height - ctrl->m_v_gap + ctrl->m_v_gap2) / option_set.size() - get_bitmap_size(bmp_undo).GetHeight()) / 2);
1045 else
1046 pos.y += lround((height - get_bitmap_size(bmp_undo).GetHeight()) / 2);
1047 } else {
1048 pos.y += lround((height - get_bitmap_size(bmp_undo).GetHeight()) / 2);
1049 }
1050#endif
1051 wxCoord h_pos = pos.x - ctrl->m_h_gap; // Orca: adjust position to the left
1052 wxCoord v_pos = pos.y;
1053
1054#ifndef DISABLE_UNDO_SYS
1055 //BBS: GUI refactor
1056 dc.DrawBitmap(bmp_undo_to_sys, h_pos, v_pos);
1057
1058 int bmp_dim = get_bitmap_size(bmp_undo_to_sys).GetWidth();
1059 rects_undo_to_sys_icon[rect_id] = wxRect(h_pos, v_pos, bmp_dim, bmp_dim);
1060
1061 h_pos += bmp_dim + ctrl->m_h_gap;
1062#endif
1063 dc.DrawBitmap(og_line.undo_to_sys ? bmp_undo_to_sys : bmp_undo, h_pos, v_pos);
1064
1065 int bmp_dim2 = get_bitmap_size(bmp_undo).GetWidth();
1066 (og_line.undo_to_sys ? rects_undo_to_sys_icon[rect_id] : rects_undo_icon[rect_id]) = wxRect(h_pos, v_pos, bmp_dim2, bmp_dim2);
1067
1068 h_pos += bmp_dim2 + ctrl->m_h_gap;
1069
1070 return wxPoint(h_pos, v_pos);
1071}
static wxSize get_bitmap_size(const wxBitmap &bmp)
Definition OG_CustomCtrl.cpp:48
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:16
wxPoint draw_blinking_bmp(wxDC &dc, wxPoint pos, bool is_blinking)
Definition OG_CustomCtrl.cpp:1022

References ctrl, draw_blinking_bmp(), Slic3r::GUI::get_bitmap_size(), height, og_line, rects_undo_icon, and rects_undo_to_sys_icon.

Referenced by render().

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

◆ draw_blinking_bmp()

wxPoint Slic3r::GUI::OG_CustomCtrl::CtrlLine::draw_blinking_bmp ( wxDC & dc,
wxPoint pos,
bool is_blinking )
1023{
1024 wxBitmap bmp_blinking = create_scaled_bitmap(is_blinking ? "blank_16" : "empty", ctrl);
1025 wxCoord h_pos = pos.x;
1026 wxCoord v_pos = pos.y + lround((height - get_bitmap_size(bmp_blinking).GetHeight()) / 2);
1027
1028 dc.DrawBitmap(bmp_blinking, h_pos, v_pos);
1029
1030 int bmp_dim = get_bitmap_size(bmp_blinking).GetWidth();
1031
1032 h_pos += bmp_dim + ctrl->m_h_gap;
1033 return wxPoint(h_pos, v_pos);
1034}
wxBitmap create_scaled_bitmap(const std::string &bmp_name_in, wxWindow *win, const int px_cnt, const bool grayscale, const std::string &new_color, const bool menu_bitmap, const bool resize, const bool bitmap2, const std::vector< std::string > &array_new_color)
Definition wxExtensions.cpp:448

References create_scaled_bitmap(), ctrl, Slic3r::GUI::get_bitmap_size(), and height.

Referenced by draw_act_bmps(), and render().

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

◆ draw_edit_bmp()

wxCoord Slic3r::GUI::OG_CustomCtrl::CtrlLine::draw_edit_bmp ( wxDC & dc,
wxPoint pos,
const wxBitmap & bmp_edit )
1074{
1075 const wxCoord h_pos = pos.x + ctrl->m_h_gap;
1076 const wxCoord v_pos = pos.y;
1077 const int bmp_w = bmp_edit.GetWidth();
1078 rects_edit_icon.emplace_back(wxRect(h_pos, v_pos, bmp_w, bmp_w));
1079
1080 dc.DrawBitmap(bmp_edit, h_pos, v_pos);
1081
1082 return h_pos + bmp_w + ctrl->m_h_gap;
1083}
std::vector< wxRect > rects_edit_icon
Definition OG_CustomCtrl.hpp:95

References ctrl, and rects_edit_icon.

Referenced by render().

Here is the caller graph for this function:

◆ draw_text()

wxCoord Slic3r::GUI::OG_CustomCtrl::CtrlLine::draw_text ( wxDC & dc,
wxPoint pos,
const wxString & text,
const wxColour * color,
int width,
bool is_url = false,
bool is_main = false )
977{
978 wxString multiline_text;
979 auto size = Label::split_lines(dc, width, text, multiline_text);
980
981 if (!text.IsEmpty()) {
982 const wxString& out_text = multiline_text.IsEmpty() ? text : multiline_text;
983
984 if (ctrl->opt_group->split_multi_line && !is_main) { // BBS
985 const std::vector<Option> &option_set = og_line.get_options();
986 pos.y = pos.y + lround(((height - ctrl->m_v_gap + ctrl->m_v_gap2) / option_set.size() - size.y) / 2);
987 } else {
988 pos.y = pos.y + lround((height - size.y) / 2);
989 }
990 if (width > 0 && is_main)
991 rect_label = wxRect(pos, wxSize(size.x, size.y));
992
993 wxColour old_clr = dc.GetTextForeground();
994 wxFont old_font = dc.GetFont();
995 wxColor clr_url = StateColor::darkModeColorFor("#009688");
996 if (is_focused && is_url) {
997 // temporary workaround for the OSX because of strange Bold font behavior on BigSerf
998#ifdef __APPLE__
999 dc.SetFont(old_font.Underlined());
1000#else
1001 dc.SetFont(old_font.Bold().Underlined());
1002#endif
1003 color = &clr_url;
1004 }
1005 dc.SetTextForeground(color ? *color :
1006#ifdef _WIN32
1007 wxGetApp().get_label_clr_default());
1008#else
1009 wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
1010#endif /* _WIN32 */
1011 dc.DrawText(out_text, pos);
1012 dc.SetTextForeground(old_clr);
1013 dc.SetFont(old_font);
1014
1015 if (width < 1)
1016 width = size.x;
1017 }
1018
1019 return pos.x + width + ctrl->m_h_gap;
1020}
static wxSize split_lines(wxDC &dc, int width, const wxString &text, wxString &multiline_text, int max_count=0)
Definition Label.cpp:293
static wxColour darkModeColorFor(wxColour const &color)
Definition StateColor.cpp:219
wxCoord width
Definition OG_CustomCtrl.hpp:61
wxRect rect_label
Definition OG_CustomCtrl.hpp:96
bool is_focused
Definition OG_CustomCtrl.hpp:69

References ctrl, StateColor::darkModeColorFor(), height, is_focused, og_line, rect_label, Label::split_lines(), and width.

Referenced by render().

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

◆ get_max_win_width()

int Slic3r::GUI::OG_CustomCtrl::CtrlLine::get_max_win_width ( )
682{
683 int max_win_width = 0;
685 const std::vector<Option>& option_set = og_line.get_options();
686 for (auto opt : option_set) {
687 Field* field = ctrl->opt_group->get_field(opt.opt_id);
688 if (field && field->getWindow())
689 max_win_width = field->getWindow()->GetSize().GetWidth();
690 }
691 }
692
693 return max_win_width;
694}

References ctrl, draw_just_act_buttons, Slic3r::GUI::Field::getWindow(), and og_line.

Here is the call graph for this function:

◆ is_separator()

bool Slic3r::GUI::OG_CustomCtrl::CtrlLine::is_separator ( ) const
inline
91{ return og_line.is_separator(); }

References og_line.

Referenced by render().

Here is the caller graph for this function:

◆ launch_browser()

bool Slic3r::GUI::OG_CustomCtrl::CtrlLine::launch_browser ( ) const
1086{
1087 if (!is_focused || og_line.label_path.empty())
1088 return false;
1089
1090 return OptionsGroup::launch_browser(og_line.label_path);
1091}
static bool launch_browser(const std::string &path_end)
Definition OptionsGroup.cpp:1419

References is_focused, Slic3r::GUI::OptionsGroup::launch_browser(), and og_line.

Here is the call graph for this function:

◆ msw_rescale()

void Slic3r::GUI::OG_CustomCtrl::CtrlLine::msw_rescale ( )
721{
722 // if we have a single option with no label, no sidetext
724 height = get_bitmap_size(create_scaled_bitmap("empty")).GetHeight();
725
726 if (ctrl->opt_group->label_width != 0 && !og_line.label.IsEmpty()) {
727 wxSize label_sz = ctrl->GetTextExtent(og_line.label);
728 if (ctrl->opt_group->split_multi_line) { // BBS
729 const std::vector<Option> &option_set = og_line.get_options();
730 if (option_set.size() > 1)
731 height = (label_sz.y + ctrl->m_v_gap2) * option_set.size() + ctrl->m_v_gap - ctrl->m_v_gap2;
732 else
733 height = label_sz.y * (label_sz.GetWidth() > int(ctrl->opt_group->label_width * ctrl->m_em_unit) ? 2 : 1) + ctrl->m_v_gap;
734 } else {
735 height = label_sz.y * (label_sz.GetWidth() > int(ctrl->opt_group->label_width * ctrl->m_em_unit) ? 2 : 1) + ctrl->m_v_gap;
736 }
737 }
738
740}
void correct_items_positions()
Definition OG_CustomCtrl.cpp:696

References correct_items_positions(), create_scaled_bitmap(), ctrl, draw_just_act_buttons, Slic3r::GUI::get_bitmap_size(), height, and og_line.

Here is the call graph for this function:

◆ render()

void Slic3r::GUI::OG_CustomCtrl::CtrlLine::render ( wxDC & dc,
wxCoord h_pos,
wxCoord v_pos )

To correct translation by context have to use wxGETTEXT_IN_CONTEXT macro from wxWidget 3.1.1

istead of (opt != option_set.back())

805{
806 if (is_separator()) {
807 render_separator(dc, v_pos);
808 return;
809 }
810
811 Field* field = og_line.get_options().empty() ? nullptr :
812 ctrl->opt_group->get_field(og_line.get_options().front().opt_id);
813
814 bool suppress_hyperlinks = false;
816 //BBS: GUI refactor
817 if (field && field->undo_bitmap()) {
818 // if (field)
819 // BBS: new layout
820 const wxPoint pos = draw_act_bmps(dc, wxPoint(h_pos, v_pos), field->undo_to_sys_bitmap()->bmp(),
821 field->undo_bitmap()->bmp(), field->blink());
822 if (field->has_edit_ui())
823 draw_edit_bmp(dc, pos, *field->edit_bitmap());
824 }
825 return;
826 }
827
828 const std::vector<Option>& option_set = og_line.get_options();
829
830 // ORCA draw multi_extruder icon to spacing before field lines so labels keep aligned
831 bool is_multi_extruder = false;
832 if (ctrl->opt_group->draw_multi_extruder)
833 for (const Option& opt : option_set)
834 is_multi_extruder |= opt.opt_id.find_last_of('#') != std::string::npos;
835 if (is_multi_extruder) {
836 if (!ctrl->m_bmp_multi_extruder.bmp().IsOk())
837 ctrl->m_bmp_multi_extruder = ScalableBitmap(ctrl, "multi_extruder");
838 const wxBitmap& bmp = ctrl->m_bmp_multi_extruder.bmp();
839 const wxSize bmp_sz = get_bitmap_size(bmp); // Logical size. GetWidth() returns physical pixels on macOS retina which pushes icon outside of control
840 const wxCoord icon_x = std::max(0, h_pos - bmp_sz.GetWidth() - ctrl->m_h_gap);
841 const wxCoord icon_y = v_pos + lround((height - bmp_sz.GetHeight()) / 2);
842 dc.DrawBitmap(bmp, icon_x, icon_y, true);
843 }
844
845 if (og_line.near_label_widget_win)
846 h_pos += og_line.near_label_widget_win->GetSize().x + ctrl->m_h_gap;
847
848 wxString label = og_line.label;
849 wxColour blink_color = StateColor::darkModeColorFor("#009688");
850 bool is_url_string = false;
851 if (ctrl->opt_group->label_width != 0 && !label.IsEmpty()) {
852 const wxColour* text_clr = field ? field->label_color() : og_line.label_color();
853 for (const Option& opt : option_set) {
854 Field* field = ctrl->opt_group->get_field(opt.opt_id);
855 if (field && field->blink()) {
856 text_clr = &blink_color;
857 break;
858 }
859 }
860 is_url_string = !suppress_hyperlinks && !og_line.label_path.empty();
861 // BBS
862 h_pos = draw_text(dc, wxPoint(h_pos, v_pos), label /* + ":" */, text_clr, h_pos + ctrl->opt_group->label_width * ctrl->m_em_unit - h_pos, is_url_string, true);
863 }
864
865 // If there's a widget, build it and set result to the correct position.
866#ifndef DISABLE_BLINKING
867 if (og_line.widget != nullptr) {
868 draw_blinking_bmp(dc, wxPoint(h_pos, v_pos), og_line.blink);
869 return;
870 }
871#endif
872
873 // If we're here, we have more than one option or a single option with sidetext
874 // so we need a horizontal sizer to arrange these things
875
876 auto add_field_width = [&h_pos, this] (Field* field) {
877 if (field) {
878 if (field->getSizer())
879 {
880 auto children = field->getSizer()->GetChildren();
881 for (auto child : children)
882 if (child->IsWindow())
883 h_pos += child->GetWindow()->GetSize().x + ctrl->m_h_gap;
884 }
885 else if (field->getWindow()) {
886 h_pos += field->getWindow()->GetSize().x + ctrl->m_h_gap;
887 }
888 }
889 };
890
891 auto draw_buttons = [&h_pos, &dc, &v_pos, this](Field* field, size_t bmp_rect_id = 0) {
892 if (field && field->undo_to_sys_bitmap()) {
893 h_pos = draw_act_bmps(dc, wxPoint(h_pos, v_pos), field->undo_to_sys_bitmap()->bmp(), field->undo_bitmap()->bmp(), field->blink(), bmp_rect_id).x;
894 }
895#ifndef DISABLE_BLINKING
896 else if (field && !field->undo_to_sys_bitmap() && field->blink())
897 draw_blinking_bmp(dc, wxPoint(h_pos, v_pos), field->blink());
898#endif
899 };
900
901 wxCoord h_pos2 = h_pos;
902 // If we have a single option with no sidetext just add it directly to the grid sizer
903 if (option_set.size() == 1 && option_set.front().opt.sidetext.size() == 0 &&
904 option_set.front().side_widget == nullptr && og_line.get_extra_widgets().size() == 0)
905 {
906 // BBS: new layout
907 if (ctrl->opt_group->option_label_at_right)
908 draw_buttons(field);
909 add_field_width(field);
910 wxCoord h_pos3 = h_pos;
911 if (!ctrl->opt_group->option_label_at_right)
912 draw_buttons(field);
913 // update width for full_width fields
914 if (option_set.front().opt.full_width && field && field->getWindow())
915 field->getWindow()->SetSize(ctrl->GetSize().x - h_pos2 + h_pos3 - h_pos - ctrl->m_em_unit * 3, -1);
916 return;
917 }
918
919 size_t bmp_rect_id = 0;
920 bool is_multioption_line = option_set.size() > 1;
921 for (const Option& opt : option_set) {
922 field = ctrl->opt_group->get_field(opt.opt_id);
923 ConfigOptionDef option = opt.opt;
924 if (ctrl->opt_group->option_label_at_right)
925 draw_buttons(field, bmp_rect_id++);
926 if (ctrl->opt_group->option_label_at_right) // BBS
927 add_field_width(field);
928 // add label if any
929 if (is_multioption_line && !option.label.empty()) {
931 label = (option.label == L_CONTEXT("Top", "Layers") || option.label == L_CONTEXT("Bottom", "Layers")) ?
932 _L_CONTEXT(option.label, "Layers") : _(option.label);
933 //if (!ctrl->opt_group->option_label_at_right) // BBS
934 //label += ":";
935
936 if (is_url_string)
937 is_url_string = false;
938 else if(opt == option_set.front())
939 is_url_string = !suppress_hyperlinks && !og_line.label_path.empty();
940 wxColor c = StateColor::darkModeColorFor("#6B6B6B");
941 h_pos = draw_text(dc, wxPoint(h_pos, v_pos), label, field ? (field->blink() ? &blink_color : &c) : nullptr, ctrl->opt_group->sublabel_width * ctrl->m_em_unit, is_url_string);
942 h_pos += 8;
943 }
944
945 // BBS: new layout
946 // add field
947 if (option_set.size() == 1 && option_set.front().opt.full_width)
948 break;
949 if (!ctrl->opt_group->option_label_at_right) // BBS
950 add_field_width(field);
951 // add sidetext if any
952 // BBS: new layout
953 wxCoord offset = 0;
954 if (!field->combine_side_text() && (!option.sidetext.empty() || ctrl->opt_group->sidetext_width > 0)) {
955 wxCoord h_pos2 = h_pos + dc.GetTextExtent(_(option.sidetext)).x;
956 h_pos = draw_text(dc, wxPoint(h_pos, v_pos), _(option.sidetext), nullptr, ctrl->opt_group->sidetext_width * ctrl->m_em_unit);
957 offset = h_pos - h_pos2;
958 }
959 // BBS: new layout
960 if (!ctrl->opt_group->option_label_at_right) {
961 offset -= ctrl->m_h_gap; h_pos -= offset;
962 draw_buttons(field, bmp_rect_id++);
963 h_pos += offset;
964 }
965
966 if (opt.opt_id != option_set.back().opt_id)
967 h_pos += lround(0.6 * ctrl->m_em_unit);
968
969 if (ctrl->opt_group->split_multi_line) { // BBS
970 v_pos += (height - ctrl->m_v_gap + ctrl->m_v_gap2) / option_set.size();
971 h_pos = h_pos2;
972 }
973 }
974}
#define _(s)
Definition 3mf.cpp:306
#define L_CONTEXT(s, context)
Definition DesignOffer.hpp:17
Slic3r::Polygons offset(const Slic3r::Polygon &polygon, const float delta, JoinType joinType, double miterLimit)
Definition ClipperUtils.cpp:582
#define _L_CONTEXT(s, ctx)
Definition I18N.hpp:15
bool is_separator() const
Definition OG_CustomCtrl.hpp:91
wxPoint draw_act_bmps(wxDC &dc, wxPoint pos, const wxBitmap &bmp_undo_to_sys, const wxBitmap &bmp_undo, bool is_blinking, size_t rect_id=0, bool is_main=false)
Definition OG_CustomCtrl.cpp:1036
wxCoord draw_edit_bmp(wxDC &dc, wxPoint pos, const wxBitmap &bmp_edit)
Definition OG_CustomCtrl.cpp:1073
void render_separator(wxDC &dc, wxCoord v_pos)
Definition OG_CustomCtrl.cpp:792
wxCoord draw_text(wxDC &dc, wxPoint pos, const wxString &text, const wxColour *color, int width, bool is_url=false, bool is_main=false)
Definition OG_CustomCtrl.cpp:976

References _, _L_CONTEXT, Slic3r::GUI::UndoValueUIManager::blink(), ScalableBitmap::bmp(), Slic3r::GUI::Field::combine_side_text(), ctrl, StateColor::darkModeColorFor(), draw_act_bmps(), draw_blinking_bmp(), draw_edit_bmp(), draw_just_act_buttons, draw_text(), Slic3r::GUI::UndoValueUIManager::edit_bitmap(), Slic3r::GUI::get_bitmap_size(), Slic3r::GUI::Field::getSizer(), Slic3r::GUI::Field::getWindow(), Slic3r::GUI::UndoValueUIManager::has_edit_ui(), height, is_separator(), L_CONTEXT, Slic3r::ConfigOptionDef::label, Slic3r::GUI::UndoValueUIManager::label_color(), Slic3r::offset(), og_line, render_separator(), Slic3r::ConfigOptionDef::sidetext, Slic3r::GUI::UndoValueUIManager::undo_bitmap(), and Slic3r::GUI::UndoValueUIManager::undo_to_sys_bitmap().

Here is the call graph for this function:

◆ render_separator()

void Slic3r::GUI::OG_CustomCtrl::CtrlLine::render_separator ( wxDC & dc,
wxCoord v_pos )
793{
794 wxPoint begin(ctrl->m_h_gap, v_pos);
795 wxPoint end(ctrl->GetSize().GetWidth() - ctrl->m_h_gap, v_pos);
796
797 wxPen old_pen = dc.GetPen();
798 // pen.SetColour(*wxLIGHT_GREY);
799 dc.SetPen(*wxTRANSPARENT_PEN);
800 dc.DrawLine(begin, end);
801 dc.SetPen(old_pen);
802}
T * begin(Slic3r::Mat< N, M, T > &mat)
Definition Point.hpp:838
T * end(Slic3r::Mat< N, M, T > &mat)
Definition Point.hpp:841

References ctrl.

Referenced by render().

Here is the caller graph for this function:

◆ update_visibility()

void Slic3r::GUI::OG_CustomCtrl::CtrlLine::update_visibility ( ConfigOptionMode mode)
743{
744 if (og_line.is_separator())
745 return;
746 const std::vector<Option>& option_set = og_line.get_options();
747
748 // Widget-only lines (no options appended) are always visible unless explicitly hidden.
749 if (option_set.empty()) {
750 is_visible = og_line.toggle_visible;
751 if (og_line.near_label_widget_win)
752 og_line.near_label_widget_win->Show(is_visible);
753 if (og_line.widget_sizer)
754 og_line.widget_sizer->ShowItems(is_visible);
755 if (og_line.extra_widget_sizer)
756 og_line.extra_widget_sizer->ShowItems(is_visible);
758 return;
759 }
760
761 const ConfigOptionMode& line_mode = option_set.front().opt.mode;
762 is_visible = og_line.toggle_visible && line_mode <= mode;
763
765 return;
766
767 if (og_line.near_label_widget_win)
768 og_line.near_label_widget_win->Show(is_visible);
769 if (og_line.widget_sizer)
770 og_line.widget_sizer->ShowItems(is_visible);
771 if (og_line.extra_widget_sizer)
772 og_line.extra_widget_sizer->ShowItems(is_visible);
773
774 for (auto opt : option_set) {
775 Field* field = ctrl->opt_group->get_field(opt.opt_id);
776 if (!field)
777 continue;
778
779 if (field->getSizer()) {
780 auto children = field->getSizer()->GetChildren();
781 for (auto child : children)
782 if (child->IsWindow())
783 child->GetWindow()->Show(is_visible);
784 }
785 else if (field->getWindow())
786 field->getWindow()->Show(is_visible);
787 }
788
790}
ConfigOptionMode
Definition Config.hpp:221

References correct_items_positions(), ctrl, draw_just_act_buttons, Slic3r::GUI::Field::getSizer(), Slic3r::GUI::Field::getWindow(), is_visible, and og_line.

Here is the call graph for this function:

Member Data Documentation

◆ ctrl

◆ draw_just_act_buttons

bool Slic3r::GUI::OG_CustomCtrl::CtrlLine::draw_just_act_buttons { false }

◆ draw_mode_bitmap

bool Slic3r::GUI::OG_CustomCtrl::CtrlLine::draw_mode_bitmap { true }
67{ true };

Referenced by CtrlLine().

◆ height

wxCoord Slic3r::GUI::OG_CustomCtrl::CtrlLine::height { wxDefaultCoord }
62{ wxDefaultCoord };

Referenced by CtrlLine(), draw_act_bmps(), draw_blinking_bmp(), draw_text(), msw_rescale(), and render().

◆ is_focused

bool Slic3r::GUI::OG_CustomCtrl::CtrlLine::is_focused { false }
69{ false };

Referenced by draw_text(), and launch_browser().

◆ is_visible

bool Slic3r::GUI::OG_CustomCtrl::CtrlLine::is_visible { true }
68{ true };

Referenced by correct_items_positions(), and update_visibility().

◆ og_line

◆ rect_label

wxRect Slic3r::GUI::OG_CustomCtrl::CtrlLine::rect_label

◆ rects_edit_icon

std::vector<wxRect> Slic3r::GUI::OG_CustomCtrl::CtrlLine::rects_edit_icon

Referenced by draw_edit_bmp().

◆ rects_undo_icon

std::vector<wxRect> Slic3r::GUI::OG_CustomCtrl::CtrlLine::rects_undo_icon

Referenced by CtrlLine(), and draw_act_bmps().

◆ rects_undo_to_sys_icon

std::vector<wxRect> Slic3r::GUI::OG_CustomCtrl::CtrlLine::rects_undo_to_sys_icon

Referenced by CtrlLine(), and draw_act_bmps().

◆ width

wxCoord Slic3r::GUI::OG_CustomCtrl::CtrlLine::width { wxDefaultCoord }
61{ wxDefaultCoord };

Referenced by draw_text().


The documentation for this struct was generated from the following files: