76#include <wx/dcmemory.h>
119 mIsAutoExpanded(false),
120 mIsManualExpanded(false),
128 mTopLevelParent(NULL)
131 wxDefaultPosition, wxSize(1, 1));
133 wxDefaultPosition, wxSize(1, 1));
262#ifdef EXPERIMENTAL_ROLL_UP_DIALOG
276 wxEvtHandler *inheritedEvtHandler)
282 window->PushEventHandler(
this);
297 mWindow->RemoveEventHandler(
this);
311 mHandlers.push_back(std::make_unique<ExpandingToolBarEvtHandler>
312 (
this, win, win->GetEventHandler()));
316 wxWindowList children = win->GetChildren();
317 for(
auto child : children)
353#ifdef EXPERIMENTAL_ROLL_UP_DIALOG
361 wxSize baseWindowSize = wxSize(width,
393 wxPoint globalMouse = ::wxGetMousePosition();
394 wxPoint localMouse = ScreenToClient(globalMouse);
396 bool result = (localMouse.x >= 0 && localMouse.y >= 0 &&
415 wxWindow *frame =
this;
416 while(!frame->IsTopLevel()) {
417 pos += frame->GetPosition();
418 frame = frame->GetParent();
495 wxSize
size = GetClientSize();
497 wxClientDC winDC(
this);
499 memDC.SelectObject(bitmap);
533 wxPoint hotSpot = ScreenToClient(wxGetMousePosition());
535 hotSpot -= (ClientToScreen(wxPoint(0, 0)) -
541 wxColour magicColor = wxColour(0, 255, 255);
549 wxTRANSPARENT_WINDOW);
559 mDragImage = std::make_unique<wxDragImage>(toolbarBitmap);
562 mDragImage->Move(ScreenToClient(wxGetMousePosition()));
570 wxPoint cursorPos =
mAreaParent->ScreenToClient(wxGetMousePosition());
572 int best_dist_sq = 99999;
578 int dist_sq = (x*x) + (y*y);
580 if (dist_sq < best_dist_sq) {
581 best_dist_sq = dist_sq;
598 dc.DestroyClippingRegion();
599 dc.SetLogicalFunction(wxINVERT);
600 wxRect r = prevTarget;
614 mDragImage->Move(ScreenToClient(wxGetMousePosition()));
617 mDragImage->Move(ScreenToClient(wxGetMousePosition()));
669 mOwnerToolBar(ownerToolbar)
673 wxColour magicColor = wxColour(0, 255, 255);
683 SetMinSize(mImageRoll[0].GetMinSize());
684 SetMaxSize(mImageRoll[1].GetMaxSize());
695 if (event.Entering())
697 else if (event.Leaving())
700 wxSize clientSize = GetClientSize();
702 if (event.m_x >= 0 && event.m_y >= 0 &&
703 event.m_x < clientSize.x && event.m_y < clientSize.y)
709 if (event.ButtonDown())
746 wxCAPTION|wxCLOSE_BOX),
767 wxSize childSize =
mChild->GetBestSize();
771 wxSize curContentSize = GetClientSize();
772 wxSize curFrameSize = GetSize();
773 wxSize newFrameSize = childSize + (curFrameSize - curContentSize);
775 SetSizeHints(newFrameSize, newFrameSize);
776 SetSize(newFrameSize);
791 const wxString&
name,
793 wxMiniFrame(parent,
id,
name, pos, wxSize(1, 1),
798 wxCAPTION|wxCLOSE_BOX),
819 wxSize childSize =
mChild->GetBestSize();
823 wxSize curContentSize = GetClientSize();
824 wxSize curFrameSize = GetSize();
825 wxSize newFrameSize = childSize + (curFrameSize - curContentSize);
827 SetSizeHints(newFrameSize, newFrameSize);
828 SetSize(newFrameSize);
872 childMin.x, childMin.y);
885 wxSize area = GetClientSize();
888 int leftoverSpace = 0;
889 int expandableCount = 0;
890 int toolbarCount = 0;
895 wxSize childMin = child->GetMinSize();
896 wxSize childMax = child->GetMaxSize();
898 minWidth += childMin.x;
901 if (childMax.x > childMin.x)
905 leftoverSpace = area.x - minWidth;
907 if (leftoverSpace <= 0) {
908 if (toolbarCount > 1)
919 wxPoint childPos = child->GetPosition();
920 wxSize childMin = child->GetMinSize();
921 wxSize childMax = child->GetMaxSize();
923 int width = childMin.x;
925 if (childMax.x > childMin.x)
927 (leftoverSpace * (j+1) / expandableCount) -
928 (leftoverSpace * (j) / expandableCount);
941 wxSize area = GetClientSize();
943 wxSize childMin = child->GetMinSize();
945 if (childIndex == 0) {
947 mChildArray[childIndex]->SetSize(0, 0, childMin.x, childMin.y);
951 wxPoint p =
mChildArray[childIndex]->GetPosition();
954 wxPrintf(
"ToolBar %d moved to row %d at (%d, %d), size (%d x %d)\n",
966 wxPoint prevPos =
mChildArray[childIndex-1]->GetPosition();
967 wxSize prevSize =
mChildArray[childIndex-1]->GetSize();
969 int prevX = prevPos.x + prevSize.x;
970 int availableWidth = area.x - prevX;
972 if (childMin.x <= availableWidth) {
976 childMin.x, childMin.y);
985 int maxRowHeight = 0;
986 for(i=0; i<childIndex; i++)
991 mChildArray[childIndex]->SetSize(0, prevPos.y + maxRowHeight,
992 childMin.x, childMin.y);
1003 wxPoint p =
mChildArray[childIndex]->GetPosition();
1006 wxPrintf(
"ToolBar %d moved to row %d at (%d, %d), size (%d x %d)\n",
1008 p.x, p.y, s.x, s.y);
1059 wxSize clientSize = GetClientSize();
1073 if (childPos.x + childSize.x > actualSize.x) {
1074 actualSize.x = childPos.x + childSize.x;
1077 if (childSize.x > minSize.x) {
1078 minSize.x = childSize.x;
1081 if (childPos.y + childSize.y > maxSize.y) {
1082 maxSize.y = childPos.y + childSize.y;
1083 minSize.y = maxSize.y;
1084 actualSize.y = maxSize.y;
1088 if (!horizontal && actualSize.x < clientSize.x)
1089 actualSize.x = clientSize.x;
1090 if (!vertical && actualSize.y < clientSize.y)
1091 actualSize.y = clientSize.y;
1113 wxSize currentSize = GetClientSize();
1138 else if (evt.Moving() || evt.Dragging())
1186 auto arrangement = std::make_unique<ToolBarArrangement>();
1193 arrangement->rectArray.push_back(
mChildArray[i]->GetRect());
1206 mChildArray[i]->SetSize(arrangement->rectArray[i]);
1212 arrangement.reset();
1225 if (numChildren == 0)
1228 for(i=0; i<numChildren; i++) {
1232 if (childRow != row) {
1237 mDropTargets.push_back(wxRect(childRect.x, childRect.y,
1238 0, childRect.height));
1244 mDropTargets.push_back(wxRect(childRect.x+childRect.width, childRect.y,
1245 0, childRect.height));
1263 for(j = newIndex+1; j < (int)
mChildArray.size(); j++)
1270 for(j = newIndex; j < (int)
mChildArray.size(); j++)
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
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)
wxImage & Image(int iIndex)
Holds a msgid for the translation catalog; may also bind format arguments.