mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
Changed mode of the OblectList to Multiple selection
This commit is contained in:
parent
05c016764f
commit
30f3ec3d16
4 changed files with 16 additions and 3 deletions
|
@ -741,6 +741,7 @@ public:
|
||||||
|
|
||||||
#if ENABLE_EXTENDED_SELECTION
|
#if ENABLE_EXTENDED_SELECTION
|
||||||
const Selection& get_selection() const { return m_selection; }
|
const Selection& get_selection() const { return m_selection; }
|
||||||
|
Selection& get_selection() { return m_selection; }
|
||||||
#endif // ENABLE_EXTENDED_SELECTION
|
#endif // ENABLE_EXTENDED_SELECTION
|
||||||
|
|
||||||
// Set the bed shape to a single closed 2D polygon(array of two element arrays),
|
// Set the bed shape to a single closed 2D polygon(array of two element arrays),
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace GUI
|
||||||
{
|
{
|
||||||
|
|
||||||
ObjectList::ObjectList(wxWindow* parent) :
|
ObjectList::ObjectList(wxWindow* parent) :
|
||||||
wxDataViewCtrl(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize)
|
wxDataViewCtrl(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_MULTIPLE)
|
||||||
{
|
{
|
||||||
// Fill CATEGORY_ICON
|
// Fill CATEGORY_ICON
|
||||||
{
|
{
|
||||||
|
@ -328,7 +328,9 @@ void ObjectList::on_begin_drag(wxDataViewEvent &event)
|
||||||
wxDataViewItem item(event.GetItem());
|
wxDataViewItem item(event.GetItem());
|
||||||
|
|
||||||
// only allow drags for item, not containers
|
// only allow drags for item, not containers
|
||||||
if (m_objects_model->GetParent(item) == wxDataViewItem(0) || m_objects_model->IsSettingsItem(item)) {
|
if (multiple_selection() ||
|
||||||
|
m_objects_model->GetParent(item) == wxDataViewItem(0) ||
|
||||||
|
m_objects_model->IsSettingsItem(item) ) {
|
||||||
event.Veto();
|
event.Veto();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1139,5 +1141,12 @@ void ObjectList::init_objects()
|
||||||
m_objects = wxGetApp().model_objects();
|
m_objects = wxGetApp().model_objects();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ObjectList::multiple_selection() const
|
||||||
|
{
|
||||||
|
wxDataViewItemArray sels;
|
||||||
|
GetSelections(sels);
|
||||||
|
return sels.size() > 1;
|
||||||
|
}
|
||||||
|
|
||||||
} //namespace GUI
|
} //namespace GUI
|
||||||
} //namespace Slic3r
|
} //namespace Slic3r
|
|
@ -121,6 +121,8 @@ public:
|
||||||
void remove();
|
void remove();
|
||||||
|
|
||||||
void init_objects();
|
void init_objects();
|
||||||
|
|
||||||
|
bool multiple_selection() const ;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -176,7 +176,8 @@ void ObjectManipulation::update_settings_list()
|
||||||
auto config = wxGetApp().obj_list()->m_config;
|
auto config = wxGetApp().obj_list()->m_config;
|
||||||
|
|
||||||
const auto item = objects_ctrl->GetSelection();
|
const auto item = objects_ctrl->GetSelection();
|
||||||
if (config && objects_model->IsSettingsItem(item))
|
if (!objects_ctrl->multiple_selection() &&
|
||||||
|
config && objects_model->IsSettingsItem(item))
|
||||||
{
|
{
|
||||||
auto extra_column = [config](wxWindow* parent, const Line& line)
|
auto extra_column = [config](wxWindow* parent, const Line& line)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue