Remove the And/Or menu field when you remove a row
This commit is contained in:
@@ -2046,12 +2046,39 @@ FindPanel::RemoveAttrRow()
|
|||||||
if (view != NULL)
|
if (view != NULL)
|
||||||
view->MakeFocus();
|
view->MakeFocus();
|
||||||
|
|
||||||
if (fAttrGrid->CountRows() != 1)
|
if (fAttrGrid->CountRows() > 1) {
|
||||||
|
// remove the And/Or menu field of the previous row
|
||||||
|
BLayoutItem* item = fAttrGrid->ItemAt(3, row - 1);
|
||||||
|
if (item == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
view = item->View();
|
||||||
|
if (view == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
view->RemoveSelf();
|
||||||
|
delete view;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// only one row remains
|
||||||
|
|
||||||
|
// disable the remove button
|
||||||
|
BButton* button = dynamic_cast<BButton*>(FindView("remove button"));
|
||||||
|
if (button != NULL)
|
||||||
|
button->SetEnabled(false);
|
||||||
|
|
||||||
|
// remove the And/Or menu field
|
||||||
|
BLayoutItem* item = fAttrGrid->RemoveItem(3);
|
||||||
|
if (item == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BButton* button = dynamic_cast<BButton*>(FindView("remove button"));
|
view = item->View();
|
||||||
if (button)
|
if (view == NULL)
|
||||||
button->SetEnabled(false);
|
return;
|
||||||
|
|
||||||
|
view->RemoveSelf();
|
||||||
|
delete view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user