Get to a compilable state

Everything seems to be working (including the plater). I am not seeing any graphical issues
This commit is contained in:
Ocraftyone
2023-11-08 06:33:32 -05:00
parent dc062f1a1a
commit 03754b5213
18 changed files with 149 additions and 147 deletions
+18 -18
View File
@@ -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);
//}
wxBitmap& bitmap = table->get_undo_bitmap();
int bitmap_width = bitmap.GetWidth();
int bitmap_height = bitmap.GetHeight();
wxBitmapBundle& bitmap = table->get_undo_bitmap();
int bitmap_width = bitmap.GetBitmapFor(dc.GetWindow()).GetWidth();
int bitmap_height = bitmap.GetBitmapFor(dc.GetWindow()).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, wxPoint(rect.x + offset_x, rect.y + offset_y));
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
#endif
//dc.SetPen(*wxGREEN_PEN);
@@ -125,7 +125,7 @@ GridCellIconRenderer *GridCellIconRenderer::Clone() const
GridCellFilamentsEditor::GridCellFilamentsEditor(const wxArrayString& choices,
bool allowOthers,
std::vector<wxBitmap*>* bitmaps)
std::vector<wxBitmapBundle*>* bitmaps)
: wxGridCellChoiceEditor(choices, allowOthers), m_icons(bitmaps)
{
}
@@ -133,7 +133,7 @@ GridCellFilamentsEditor::GridCellFilamentsEditor(const wxArrayString& choices,
GridCellFilamentsEditor::GridCellFilamentsEditor(size_t count,
const wxString choices[],
bool allowOthers,
std::vector<wxBitmap*>* bitmaps)
std::vector<wxBitmapBundle*>* bitmaps)
: wxGridCellChoiceEditor(count, choices, allowOthers), m_icons(bitmaps)
{
}
@@ -159,13 +159,13 @@ void GridCellFilamentsEditor::Create(wxWindow* parent,
if ( !m_allowOthers )
style |= wxCB_READONLY;
::ComboBox *bitmap_combo = new ComboBox(parent, id, wxEmptyString,
wxDefaultPosition, wxSize(((*m_icons)[0])->GetWidth() + 10, -1), 0, nullptr, CB_NO_DROP_ICON | CB_NO_TEXT | wxCB_READONLY);
wxDefaultPosition, wxSize(((*m_icons)[0])->GetDefaultSize().GetWidth() + 10, -1), 0, nullptr, CB_NO_DROP_ICON | CB_NO_TEXT | wxCB_READONLY); //OcraftyoneTODO: is this a good way of getting the size?
if (m_icons) {
int array_count = m_choices.GetCount();
int icon_count = m_icons->size();
for (int i = 0; i < array_count; i++)
{
wxBitmap* bitmap = (i < icon_count) ? (*m_icons)[i] : (*m_icons)[0];
wxBitmapBundle* bitmap = (i < icon_count) ? (*m_icons)[i] : (*m_icons)[0];
bitmap_combo->Append(m_choices[i], *bitmap);
}
}
@@ -335,9 +335,9 @@ void GridCellFilamentsRenderer::Draw(wxGrid &grid, wxGridCellAttr &attr, wxDC &d
ObjectGridTable::ObjectGridRow *grid_row = table->get_grid_row(row - 1);
ConfigOptionInt & cur_option = dynamic_cast<ConfigOptionInt &>((*grid_row)[(ObjectGridTable::GridColType) col]);
wxBitmap *bitmap = table->get_color_bitmap((cur_option.value >= 1) ? cur_option.value - 1 : cur_option.value);
int bitmap_width = bitmap->GetWidth();
int bitmap_height = bitmap->GetHeight();
wxBitmapBundle *bitmap = table->get_color_bitmap((cur_option.value >= 1) ? cur_option.value - 1 : cur_option.value);
int bitmap_width = bitmap->GetBitmapFor(dc.GetWindow()).GetWidth();
int bitmap_height = bitmap->GetBitmapFor(dc.GetWindow()).GetHeight();
int offset_x = grid_cell_border_width;
int offset_y = (rect.height > bitmap_height) ? (rect.height - bitmap_height) / 2 : grid_cell_border_height;
@@ -345,7 +345,7 @@ void GridCellFilamentsRenderer::Draw(wxGrid &grid, wxGridCellAttr &attr, wxDC &d
dc.SetBrush(wxBrush(attr.GetBackgroundColour()));
dc.DrawRectangle(rect);
if ( grid_row->model_volume_type != ModelVolumeType::NEGATIVE_VOLUME) {
dc.DrawBitmap(*bitmap, wxPoint(rect.x + offset_x, rect.y + offset_y));
dc.DrawBitmap(bitmap->GetBitmapFor(dc.GetWindow()), wxPoint(rect.x + offset_x, rect.y + offset_y));//TODO: determine if this way of getting bitmap works well
}
text_rect.x += bitmap_width + grid_cell_border_width * 2;
@@ -518,16 +518,16 @@ void GridCellComboBoxRenderer::Draw(wxGrid &grid, wxGridCellAttr &attr, wxDC &dc
ObjectGridTable::ObjectGridRow *grid_row = table->get_grid_row(row - 1);
ConfigOptionInt & cur_option = dynamic_cast<ConfigOptionInt &>((*grid_row)[(ObjectGridTable::GridColType) col]);
wxBitmap *bitmap = table->get_color_bitmap((cur_option.value >= 1) ? cur_option.value - 1 : cur_option.value);
int bitmap_width = bitmap->GetWidth();
int bitmap_height = bitmap->GetHeight();
wxBitmapBundle *bitmap = table->get_color_bitmap((cur_option.value >= 1) ? cur_option.value - 1 : cur_option.value);
int bitmap_width = bitmap->GetBitmapFor(dc.GetWindow()).GetWidth();
int bitmap_height = bitmap->GetBitmapFor(dc.GetWindow()).GetHeight();
int offset_x = grid_cell_border_width;
int offset_y = (rect.height > bitmap_height) ? (rect.height - bitmap_height) / 2 : grid_cell_border_height;
dc.SetPen(*wxTRANSPARENT_PEN);
dc.SetBrush(wxBrush(attr.GetBackgroundColour()));
dc.DrawRectangle(rect);
dc.DrawBitmap(*bitmap, wxPoint(rect.x + offset_x, rect.y + offset_y));
dc.DrawBitmap(bitmap->GetBitmapFor(dc.GetWindow()), wxPoint(rect.x + offset_x, rect.y + offset_y)); //TODO: determine if this way of getting bitmap works well
text_rect.x += bitmap_width + grid_cell_border_width * 2;
text_rect.width -= (bitmap_width + grid_cell_border_width * 2);
}
@@ -2641,12 +2641,12 @@ void ObjectGridTable::OnCellValueChanged(int row, int col)
}
}
wxBitmap& ObjectGridTable::get_undo_bitmap(bool selected)
wxBitmapBundle& ObjectGridTable::get_undo_bitmap(bool selected)
{
return m_panel->m_undo_bitmap;
}
wxBitmap* ObjectGridTable::get_color_bitmap(int color_index)
wxBitmapBundle* ObjectGridTable::get_color_bitmap(int color_index)
{
if (color_index < m_panel->m_color_bitmaps.size())
return m_panel->m_color_bitmaps[color_index];