예제 #1
0
void Splitter::Unsplit(SerializerElement & element,
    std::function<SerializerElement(gd::String path, gd::String name)> cb)
{
	for(auto & child : element.GetAllChildren())
	{
		auto & childElement = child.second;
		if ((childElement->HasAttribute("referenceTo") && childElement->HasAttribute("name")) ||
			(childElement->HasChild("referenceTo") && childElement->HasChild("name")))
		{
			SerializerElement newElement = cb(childElement->GetStringAttribute("referenceTo"),
				childElement->GetStringAttribute("name"));
			*childElement = newElement;
		}

		Unsplit(*childElement, cb);
	}
}
예제 #2
0
// Called when the sash is double-clicked. The default behaviour is to remove
// the sash if the minimum pane size is zero.
void wxSplitterWindow::OnDoubleClickSash(int x, int y)
{
    wxCHECK_RET(m_windowTwo, wxT("splitter: no window to remove"));

    // new code should handle events instead of using the virtual functions
    wxSplitterEvent event(wxEVT_SPLITTER_DOUBLECLICKED, this);
    event.m_data.pt.x = x;
    event.m_data.pt.y = y;
    if ( DoSendEvent(event) )
    {
        if ( GetMinimumPaneSize() == 0 || m_permitUnsplitAlways )
        {
            wxWindow* win = m_windowTwo;
            if ( Unsplit(win) )
            {
                wxSplitterEvent unsplitEvent(wxEVT_SPLITTER_UNSPLIT, this);
                unsplitEvent.m_data.win = win;
                (void)DoSendEvent(unsplitEvent);
            }
        }
    }
    //else: blocked by user
}