mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 08:17:51 -06:00
Added functions for deleting (sub)objects from model and list at the same time
This commit is contained in:
parent
ad8f270796
commit
05e2d33d3f
4 changed files with 63 additions and 1 deletions
|
@ -5,7 +5,9 @@
|
|||
#include <wx/dataview.h>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include "Event.hpp"
|
||||
#include "wxExtensions.hpp"
|
||||
|
||||
class wxBoxSizer;
|
||||
class PrusaObjectDataViewModel;
|
||||
|
@ -20,6 +22,13 @@ namespace GUI {
|
|||
|
||||
wxDECLARE_EVENT(EVT_OBJ_LIST_OBJECT_SELECT, SimpleEvent);
|
||||
|
||||
struct ItemForDelete
|
||||
{
|
||||
ItemType type;
|
||||
int obj_idx;
|
||||
int sub_obj_idx;
|
||||
};
|
||||
|
||||
class ObjectList : public wxDataViewCtrl
|
||||
{
|
||||
wxBoxSizer *m_sizer {nullptr};
|
||||
|
@ -92,6 +101,7 @@ public:
|
|||
void load_subobject(int type);
|
||||
void load_part(ModelObject* model_object, wxArrayString& part_names, int type);
|
||||
void load_generic_subobject(const std::string& type_name, const int type);
|
||||
void del_object(const int obj_idx);
|
||||
void del_subobject_item(wxDataViewItem& item);
|
||||
void del_settings_from_config();
|
||||
void del_instances_from_object(const int obj_idx);
|
||||
|
@ -117,6 +127,8 @@ public:
|
|||
void delete_object_from_list(const size_t obj_idx);
|
||||
void delete_volume_from_list(const size_t obj_idx, const size_t vol_idx);
|
||||
void delete_instance_from_list(const size_t obj_idx, const size_t inst_idx);
|
||||
void delete_from_model_and_list(const ItemType type, const int obj_idx, const int sub_obj_idx);
|
||||
void delete_from_model_and_list(const std::vector<ItemForDelete> * items_for_delete);
|
||||
// Delete all objects from the list
|
||||
void delete_all_objects_from_list();
|
||||
// Increase instances count
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue