From cbbeb55989c075d365ae6554b5b858244dfead02 Mon Sep 17 00:00:00 2001 From: Ocraftyone Date: Mon, 13 Nov 2023 13:54:13 -0500 Subject: [PATCH] update a few todos --- src/slic3r/GUI/DragCanvas.cpp | 2 +- src/slic3r/GUI/GUI_ObjectTable.cpp | 8 ++++---- src/slic3r/GUI/OG_CustomCtrl.cpp | 2 +- src/slic3r/GUI/PresetComboBoxes.cpp | 2 -- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/slic3r/GUI/DragCanvas.cpp b/src/slic3r/GUI/DragCanvas.cpp index b64085d575..60e1da3bcd 100644 --- a/src/slic3r/GUI/DragCanvas.cpp +++ b/src/slic3r/GUI/DragCanvas.cpp @@ -46,7 +46,7 @@ void DragCanvas::set_shape_list(const std::vector& colors, const st m_dragshape_list.clear(); for (int i = 0; i < order.size(); i++) { - wxBitmap bmp = get_extruder_color_icon(colors[order[i] - 1], std::to_string(order[i]), SHAPE_SIZE, SHAPE_SIZE)->GetBitmapFor(m_parent); //OcraftyoneTODO: quick and dirty conversion + wxBitmap bmp = get_extruder_color_icon(colors[order[i] - 1], std::to_string(order[i]), SHAPE_SIZE, SHAPE_SIZE)->GetBitmapFor(m_parent); DragShape* shape = new DragShape(bmp, order[i]); m_dragshape_list.push_back(shape); } diff --git a/src/slic3r/GUI/GUI_ObjectTable.cpp b/src/slic3r/GUI/GUI_ObjectTable.cpp index 7c82a13b5f..515c14d6cd 100644 --- a/src/slic3r/GUI/GUI_ObjectTable.cpp +++ b/src/slic3r/GUI/GUI_ObjectTable.cpp @@ -77,9 +77,9 @@ void GridCellIconRenderer::Draw(wxGrid& grid, table->m_icon_row_height = grid.GetRowSize(row); table->m_icon_col_width = grid.GetColSize(col); //} - wxBitmapBundle& bitmap = table->get_undo_bitmap(); - int bitmap_width = bitmap.GetBitmapFor(dc.GetWindow()).GetWidth(); - int bitmap_height = bitmap.GetBitmapFor(dc.GetWindow()).GetHeight(); + wxBitmap bitmap = table->get_undo_bitmap().GetBitmapFor(dc.GetWindow()); + int bitmap_width = bitmap.GetWidth(); + int bitmap_height = bitmap.GetHeight(); int offset_x = (table->m_icon_col_width - bitmap_width)/2; int offset_y = (table->m_icon_row_height - bitmap_height)/2; @@ -91,7 +91,7 @@ void GridCellIconRenderer::Draw(wxGrid& grid, lock_pos.y += top; dc.DrawBitmap(bitmap, lock_pos); #else - dc.DrawBitmap(bitmap.GetBitmapFor(dc.GetWindow()), wxPoint(rect.x + offset_x, rect.y + offset_y));//OcraftyoneTODO: determine if this way of getting bitmap works well + dc.DrawBitmap(bitmap, wxPoint(rect.x + offset_x, rect.y + offset_y)); #endif //dc.SetPen(*wxGREEN_PEN); diff --git a/src/slic3r/GUI/OG_CustomCtrl.cpp b/src/slic3r/GUI/OG_CustomCtrl.cpp index 941a77d7e6..713c2c633c 100644 --- a/src/slic3r/GUI/OG_CustomCtrl.cpp +++ b/src/slic3r/GUI/OG_CustomCtrl.cpp @@ -748,7 +748,7 @@ void OG_CustomCtrl::CtrlLine::render(wxDC& dc, wxCoord h_pos, wxCoord v_pos) if (field && field->undo_bitmap()) //if (field) // BBS: new layout - draw_act_bmps(dc, wxPoint(h_pos, v_pos), field->undo_to_sys_bitmap()->get_bitmap(), field->undo_bitmap()->get_bitmap(), field->blink()); //OcraftyoneTODO: conversion rather than rewrite + draw_act_bmps(dc, wxPoint(h_pos, v_pos), field->undo_to_sys_bitmap()->get_bitmap(), field->undo_bitmap()->get_bitmap(), field->blink()); return; } diff --git a/src/slic3r/GUI/PresetComboBoxes.cpp b/src/slic3r/GUI/PresetComboBoxes.cpp index 80ec5f16f7..f58b759d84 100644 --- a/src/slic3r/GUI/PresetComboBoxes.cpp +++ b/src/slic3r/GUI/PresetComboBoxes.cpp @@ -397,9 +397,7 @@ void PresetComboBox::add_ams_filaments(std::string selected, bool alias_name) const_cast(*iter).is_visible = true; auto color = tray.opt_string("filament_colour", 0u); auto name = tray.opt_string("tray_name", 0u); -// wxBitmap bmp(get_extruder_color_icon(color, name, 24, 16)->GetBitmapFor(m_parent)); //OcraftyoneTODO: conversion rather than updating correctly int item_id = Append(get_preset_name(*iter), *get_extruder_color_icon(color, name, 24, 16), &m_first_ams_filament + entry.first); - //validate_selection(id->value == selected); // can not select } m_last_ams_filament = GetCount(); }