76#include <wx/dcmemory.h>
120 mIsAutoExpanded(false),
121 mIsManualExpanded(false),
129 mTopLevelParent(NULL)
132 wxDefaultPosition, wxSize(1, 1));
134 wxDefaultPosition, wxSize(1, 1));
263#ifdef EXPERIMENTAL_ROLL_UP_DIALOG
277 wxEvtHandler *inheritedEvtHandler)
283 window->PushEventHandler(
this);
298 mWindow->RemoveEventHandler(
this);
312 mHandlers.push_back(std::make_unique<ExpandingToolBarEvtHandler>
313 (
this, win, win->GetEventHandler()));
317 wxWindowList children = win->GetChildren();
318 for(
auto child : children)
354#ifdef EXPERIMENTAL_ROLL_UP_DIALOG
362 wxSize baseWindowSize = wxSize(width,
394 wxPoint globalMouse = ::wxGetMousePosition();
395 wxPoint localMouse = ScreenToClient(globalMouse);
397 bool result = (localMouse.x >= 0 && localMouse.y >= 0 &&
416 wxWindow *frame =
this;
417 while(!frame->IsTopLevel()) {
418 pos += frame->GetPosition();
419 frame = frame->GetParent();
496 wxSize
size = GetClientSize();
498 wxClientDC winDC(
this);
500 memDC.SelectObject(bitmap);
534 wxPoint hotSpot = ScreenToClient(wxGetMousePosition());
536 hotSpot -= (ClientToScreen(wxPoint(0, 0)) -
542 wxColour magicColor = wxColour(0, 255, 255);
550 wxTRANSPARENT_WINDOW);
561 mDragImage = std::make_unique<wxDragImage>(toolbarBitmap);
564 mDragImage->Move(ScreenToClient(wxGetMousePosition()));
572 wxPoint cursorPos =
mAreaParent->ScreenToClient(wxGetMousePosition());
574 int best_dist_sq = 99999;
580 int dist_sq = (x*x) + (y*y);
582 if (dist_sq < best_dist_sq) {
583 best_dist_sq = dist_sq;
600 dc.DestroyClippingRegion();
601 dc.SetLogicalFunction(wxINVERT);
602 wxRect r = prevTarget;
616 mDragImage->Move(ScreenToClient(wxGetMousePosition()));
619 mDragImage->Move(ScreenToClient(wxGetMousePosition()));
671 mOwnerToolBar(ownerToolbar)
675 wxColour magicColor = wxColour(0, 255, 255);
685 SetMinSize(mImageRoll[0].GetMinSize());
686 SetMaxSize(mImageRoll[1].GetMaxSize());
697 if (event.Entering())
699 else if (event.Leaving())
702 wxSize clientSize = GetClientSize();
704 if (event.m_x >= 0 && event.m_y >= 0 &&
705 event.m_x < clientSize.x && event.m_y < clientSize.y)
711 if (event.ButtonDown())
748 wxCAPTION|wxCLOSE_BOX),
769 wxSize childSize =
mChild->GetBestSize();
773 wxSize curContentSize = GetClientSize();
774 wxSize curFrameSize = GetSize();
775 wxSize newFrameSize = childSize + (curFrameSize - curContentSize);
777 SetSizeHints(newFrameSize, newFrameSize);
778 SetSize(newFrameSize);
793 const wxString&
name,
795 wxMiniFrame(parent,
id,
name, pos, wxSize(1, 1),
800 wxCAPTION|wxCLOSE_BOX),
821 wxSize childSize =
mChild->GetBestSize();
825 wxSize curContentSize = GetClientSize();
826 wxSize curFrameSize = GetSize();
827 wxSize newFrameSize = childSize + (curFrameSize - curContentSize);
829 SetSizeHints(newFrameSize, newFrameSize);
830 SetSize(newFrameSize);
874 childMin.x, childMin.y);
887 wxSize area = GetClientSize();
890 int leftoverSpace = 0;
891 int expandableCount = 0;
892 int toolbarCount = 0;
897 wxSize childMin = child->GetMinSize();
898 wxSize childMax = child->GetMaxSize();
900 minWidth += childMin.x;
903 if (childMax.x > childMin.x)
907 leftoverSpace = area.x - minWidth;
909 if (leftoverSpace <= 0) {
910 if (toolbarCount > 1)
921 wxPoint childPos = child->GetPosition();
922 wxSize childMin = child->GetMinSize();
923 wxSize childMax = child->GetMaxSize();
925 int width = childMin.x;
927 if (childMax.x > childMin.x)
929 (leftoverSpace * (j+1) / expandableCount) -
930 (leftoverSpace * (j) / expandableCount);
943 wxSize area = GetClientSize();
945 wxSize childMin = child->GetMinSize();
947 if (childIndex == 0) {
949 mChildArray[childIndex]->SetSize(0, 0, childMin.x, childMin.y);
953 wxPoint p =
mChildArray[childIndex]->GetPosition();
956 wxPrintf(
"ToolBar %d moved to row %d at (%d, %d), size (%d x %d)\n",
968 wxPoint prevPos =
mChildArray[childIndex-1]->GetPosition();
969 wxSize prevSize =
mChildArray[childIndex-1]->GetSize();
971 int prevX = prevPos.x + prevSize.x;
972 int availableWidth = area.x - prevX;
974 if (childMin.x <= availableWidth) {
978 childMin.x, childMin.y);
987 int maxRowHeight = 0;
988 for(i=0; i<childIndex; i++)
993 mChildArray[childIndex]->SetSize(0, prevPos.y + maxRowHeight,
994 childMin.x, childMin.y);
1005 wxPoint p =
mChildArray[childIndex]->GetPosition();
1008 wxPrintf(
"ToolBar %d moved to row %d at (%d, %d), size (%d x %d)\n",
1010 p.x, p.y, s.x, s.y);
1061 wxSize clientSize = GetClientSize();
1075 if (childPos.x + childSize.x > actualSize.x) {
1076 actualSize.x = childPos.x + childSize.x;
1079 if (childSize.x > minSize.x) {
1080 minSize.x = childSize.x;
1083 if (childPos.y + childSize.y > maxSize.y) {
1084 maxSize.y = childPos.y + childSize.y;
1085 minSize.y = maxSize.y;
1086 actualSize.y = maxSize.y;
1090 if (!horizontal && actualSize.x < clientSize.x)
1091 actualSize.x = clientSize.x;
1092 if (!vertical && actualSize.y < clientSize.y)
1093 actualSize.y = clientSize.y;
1115 wxSize currentSize = GetClientSize();
1140 else if (evt.Moving() || evt.Dragging())
1188 auto arrangement = std::make_unique<ToolBarArrangement>();
1195 arrangement->rectArray.push_back(
mChildArray[i]->GetRect());
1208 mChildArray[i]->SetSize(arrangement->rectArray[i]);
1214 arrangement.reset();
1227 if (numChildren == 0)
1230 for(i=0; i<numChildren; i++) {
1234 if (childRow != row) {
1239 mDropTargets.push_back(wxRect(childRect.x, childRect.y,
1240 0, childRect.height));
1246 mDropTargets.push_back(wxRect(childRect.x+childRect.width, childRect.y,
1247 0, childRect.height));
1265 for(j = newIndex+1; j < (int)
mChildArray.size(); j++)
1272 for(j = newIndex; j < (int)
mChildArray.size(); j++)
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
const TranslatableString name
std::vector< wxImage > ImageArray
An ImageRoll is an image that can be expanded to an arbitrary size; it is made up of both fixed piece...
static ImageArray SplitH(const wxImage &src, wxColour magicColor)
A wxPanel which displays an ImageRoll.
void SetLogicalFunction(int func)
wxImage & Image(int iIndex)
Holds a msgid for the translation catalog; may also bind format arguments.