mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-22 08:11:11 -06:00
Porting object list manipulation from Perl to c++:
* Set count and scale to the objects on c++ side * Select/unselect object
This commit is contained in:
parent
dcf0b432cb
commit
5f82d01f19
5 changed files with 54 additions and 16 deletions
|
@ -1071,6 +1071,28 @@ void delete_all_objects_from_list()
|
|||
m_collpane_settings->Show(false);
|
||||
}
|
||||
|
||||
void set_object_count(int idx, int count)
|
||||
{
|
||||
m_objects_model->SetValue(wxString::Format("%d", count), idx, 1);
|
||||
m_objects_ctrl->Refresh();
|
||||
}
|
||||
|
||||
void set_object_scale(int idx, int scale)
|
||||
{
|
||||
m_objects_model->SetValue(wxString::Format("%d%%", scale), idx, 2);
|
||||
m_objects_ctrl->Refresh();
|
||||
}
|
||||
|
||||
void unselect_objects()
|
||||
{
|
||||
m_objects_ctrl->UnselectAll();
|
||||
}
|
||||
|
||||
void select_current_object(int idx)
|
||||
{
|
||||
m_objects_ctrl->Select(m_objects_model->GetItemById(idx));
|
||||
}
|
||||
|
||||
void add_expert_mode_part(wxWindow* parent, wxBoxSizer* sizer)
|
||||
{
|
||||
wxWindowUpdateLocker noUpdates(parent);
|
||||
|
|
|
@ -181,6 +181,14 @@ void add_object_to_list(const std::string &name, int instances_count=1, int scal
|
|||
void delete_object_from_list();
|
||||
// Delete all objects from the list
|
||||
void delete_all_objects_from_list();
|
||||
// Set count of object on c++ side
|
||||
void set_object_count(int idx, int count);
|
||||
// Set object scale on c++ side
|
||||
void set_object_scale(int idx, int scale);
|
||||
// Unselect all objects in the list on c++ side
|
||||
void unselect_objects();
|
||||
// Select current object in the list on c++ side
|
||||
void select_current_object(int idx);
|
||||
|
||||
void add_expert_mode_part(wxWindow* parent, wxBoxSizer* sizer);
|
||||
void add_frequently_changed_parameters(wxWindow* parent, wxBoxSizer* sizer, wxFlexGridSizer* preset_sizer);
|
||||
|
|
|
@ -505,22 +505,7 @@ bool MyObjectTreeModel::SetValue(const wxVariant &variant, const wxDataViewItem
|
|||
wxASSERT(item.IsOk());
|
||||
|
||||
MyObjectTreeModelNode *node = (MyObjectTreeModelNode*)item.GetID();
|
||||
switch (col)
|
||||
{
|
||||
case 0:
|
||||
node->m_name = variant.GetString();
|
||||
return true;
|
||||
case 1:
|
||||
node->m_copy = variant.GetString();
|
||||
return true;
|
||||
case 2:
|
||||
node->m_scale = variant.GetString();
|
||||
return true;
|
||||
|
||||
default:;
|
||||
// wxLogError("MyObjectTreeModel::SetValue: wrong column");
|
||||
}
|
||||
return false;
|
||||
return node->SetValue(variant, col);
|
||||
}
|
||||
|
||||
bool MyObjectTreeModel::SetValue(const wxVariant &variant, const int item_idx, unsigned int col)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue