wxSplitterWindow Preventing Unsplit

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
vasimr22
Earned a small fee
Earned a small fee
Posts: 11
Joined: Tue Dec 18, 2012 2:41 am

wxSplitterWindow Preventing Unsplit

Post by vasimr22 » Sun Mar 24, 2013 4:27 am

Hello,

I am attempting to create a 4-view splitter window for a 3D application, and am running into an issue with unsplit. The plan is to allow the user to drag the three sashes to resize the windows allowing them three of them to be simultaneously dragged to zero size without deleting them. Additionally, I need to add the ability to "foreground" a single panel (possibly by just setting the sash positions to 0.0 or 1.0 - depending on the window). I have been able to prevent unsplit by double clicking on the sash via setting a minimum panel size, however, when the sash is dragged to within minimum panel size, the application hangs. Any suggestions as to how I can accomplish what I am trying to do?

Thanks

catalin
Moderator
Moderator
Posts: 1521
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: wxSplitterWindow Preventing Unsplit

Post by catalin » Sun Mar 24, 2013 4:50 pm

vasimr22 wrote:I have been able to prevent unsplit by double clicking on the sash via setting a minimum panel size, however, when the sash is dragged to within minimum panel size, the application hangs.
That's all you need to do. As you can see in the 'splitter' sample, after setting a min pane size > 0, double-click unsplit is disabled and the splitter will no longer disappear when it reaches the minimum pane limit.
Whatever hang you're seeing must be because of your code. ..unless it's because of a bug that was fixed since the version you're using.
So the suggestion would be: try to reproduce it in the 'splitter' sample; if you can't, it's you code you need to check.

User avatar
bishop.gis
Earned a small fee
Earned a small fee
Posts: 20
Joined: Fri May 25, 2012 6:47 pm

Re: wxSplitterWindow Preventing Unsplit

Post by bishop.gis » Sun Mar 24, 2013 5:35 pm

I use event capturing to prevent unsplit

Code: Select all

BEGIN_EVENT_TABLE(wxGISAddCommandDlg, wxDialog)
	EVT_SPLITTER_DCLICK(wxID_ANY, wxGISAddCommandDlg::OnDoubleClickSash)
END_EVENT_TABLE()

void wxGISAddCommandDlg::OnDoubleClickSash(wxSplitterEvent& event)
{
	event.Veto();
}

vasimr22
Earned a small fee
Earned a small fee
Posts: 11
Joined: Tue Dec 18, 2012 2:41 am

Re: wxSplitterWindow Preventing Unsplit

Post by vasimr22 » Mon Mar 25, 2013 12:32 am

Thanks for the input. I think the issue was actually with the sizers being used with the splitter window (they were causing the hanging when the size goes to zero).
I ended up just using sashes instead (after looking back at the sample programs) which seem to work exactly as I wanted them to.

Post Reply