| 757 | {} |
| 758 | |
| 759 | void ModifySize |
| 760 | (ToolBar *ct, |
| 761 | const wxRect &rectIn, |
| 762 | ToolBarConfiguration::Position prevPosition, |
| 763 | ToolBarConfiguration::Position position, |
| 764 | wxSize &sz) |
| 765 | override |
| 766 | { |
| 767 | // Maybe insert the NEW bar if it hasn't already been done |
| 768 | // and is in the right place. |
| 769 | |
| 770 | // Does the location fall within this bar? |
| 771 | if (rectIn.Contains(point)) |
| 772 | { |
| 773 | sz = tb->GetDockedSize(); |
| 774 | // Choose a position always, if there is a bar to displace. |
| 775 | // Else, only if the fit is possible. |
| 776 | if (ct || (sz.x <= rectIn.width && sz.y <= rectIn.height)) { |
| 777 | // May choose current or previous. |
| 778 | if (ct && |
| 779 | (sz.y < rectIn.height || |
| 780 | point.y < (rectIn.GetTop() + rectIn.GetBottom()) / 2)) |
| 781 | // "Wedge" the bar into a crack alone, not adopting others, |
| 782 | // if either a short bar displaces a tall one, or else |
| 783 | // the displacing bar is at least at tall, but the pointer is |
| 784 | // in the upper half of the box. |
| 785 | usedPrev = true, result = prevPosition, result.adopt = false; |
| 786 | else |
| 787 | result = position; |
| 788 | } |
| 789 | // Now wait until the other callback below to discover x and y |
| 790 | } |
| 791 | } |
| 792 | |
| 793 | void Visit |
| 794 | (ToolBar *, wxPoint pointIn) |
no test coverage detected