mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-11 16:00:17 -07:00
Filament ComboBox editor updates
-Add show drop down feature to ObjectTable -Call finish editing when ComboBox is closed in ObjectList
This commit is contained in:
parent
d13bbb1890
commit
07a637d35a
2 changed files with 9 additions and 1 deletions
|
|
@ -5486,9 +5486,11 @@ void ObjectList::ItemValueChanged(wxDataViewEvent &event)
|
|||
// Here the last active column is forgotten, so when leaving the editing mode, the next mouse click will not enter the editing mode of the newly selected column.
|
||||
void ObjectList::OnEditingStarted(wxDataViewEvent &event)
|
||||
{
|
||||
// Orca: Automatically show drop down on editing start and finish editing when the combobox is closed
|
||||
if (event.GetColumn() == colFilament) {
|
||||
::ComboBox*c = static_cast<::ComboBox *>(event.GetDataViewColumn()->GetRenderer()->GetEditorCtrl());
|
||||
c->ToggleDropDown();
|
||||
c->Bind(wxEVT_COMBOBOX_CLOSEUP, [event](wxCommandEvent& evt){ event.GetDataViewColumn()->GetRenderer()->FinishEditing(); });
|
||||
}
|
||||
#ifdef __WXMSW__
|
||||
m_last_selected_column = -1;
|
||||
|
|
|
|||
|
|
@ -240,6 +240,9 @@ void GridCellFilamentsEditor::BeginEdit(int row, int col, wxGrid* grid)
|
|||
|
||||
Combo()->SetFocus();
|
||||
|
||||
// Orca: Show dropdown on editing start
|
||||
Combo()->ToggleDropDown();
|
||||
|
||||
#ifdef __WXOSX_COCOA__
|
||||
// This is a work around for the combobox being simply dismissed when a
|
||||
// choice is made in it under OS X. The bug is almost certainly due to a
|
||||
|
|
@ -432,6 +435,9 @@ void GridCellChoiceEditor::BeginEdit(int row, int col, wxGrid *grid)
|
|||
|
||||
Combo()->SetFocus();
|
||||
|
||||
// Orca: Show dropdown on editing start
|
||||
Combo()->ToggleDropDown();
|
||||
|
||||
#ifdef __WXOSX_COCOA__
|
||||
// This is a work around for the combobox being simply dismissed when a
|
||||
// choice is made in it under OS X. The bug is almost certainly due to a
|
||||
|
|
@ -528,7 +534,7 @@ void GridCellComboBoxRenderer::Draw(wxGrid &grid, wxGridCellAttr &attr, wxDC &dc
|
|||
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||
dc.SetBrush(wxBrush(attr.GetBackgroundColour()));
|
||||
dc.DrawRectangle(rect);
|
||||
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
|
||||
dc.DrawBitmap(bitmap->GetBitmapFor(dc.GetWindow()), wxPoint(rect.x + offset_x, rect.y + offset_y));
|
||||
text_rect.x += bitmap_width + grid_cell_border_width * 2;
|
||||
text_rect.width -= (bitmap_width + grid_cell_border_width * 2);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue