Kirix Support Forums

Sizing and Docking issue

Please post all general questions, comments, bug reports, and any other wxAUI feedback here.

Sizing and Docking issue

Postby aforumuser on Thu May 24, 2007 9:30 am

I am developing an application with four panels.Panes 1 and 2 are right aligned and Panes 3 & 4 are left aligned.The panes are in 3:1 ratio with Pane 2 below Pane1 and Pane 4 below Pane 3.
I am facing some issues in positioning the panes:
1. I am using the wxAUI in the pane layout.My understanding is that setting the min size in pane info should make the pane respect the min size. But the panes load on startup with a default size not respecting the min size I have specified.
Is there any way to get this working since this is a critical requirement for my application?
2.I don't want an user to resize the pane to a size below the min size. Right now this is possible. How do I disable it?
I am pasting the code below:
MyPanel :: MyPanel()
: wxPanel()
{
createUI();
}
void MyPanel :: createUI()
{
wxPanel* pane1 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(612, 424));
wxPanel* pane2 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(612, 192));

wxPanel* pane3 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(392, 346));
wxPanel* pane4 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(392, 286));

auiManager.SetManagedWindow(this);
auiManager.GetArtProvider()->SetMetric(wxAUI_DOCKART_GRADIENT_TYPE, wxAUI_GRADIENT_VERTICAL);

auiManager.AddPane( pane1, wxAuiPaneInfo().Name(wxT("pane1")).
Caption(wxT("pane1")).
MaximizeButton(true).
Left().Layer(1).Row(0).Position(0).
BestSize(wxSize(612, 424)).
MinSize(wxSize(612, 424)).
MaxSize(wxSize(612, 424)).
LeftDockable(true).
RightDockable(false).
TopDockable(false).
BottomDockable(false));
auiManager.AddPane(pane2,
wxAuiPaneInfo().
Name(wxT("pane2")).
Caption(wxT("pane2")).
Left().Layer(1).Row(0).Position(1).
BestSize(wxSize(612, 192)).
MinSize(wxSize(612, 192)).
MaxSize(wxSize(612, 192)).
LeftDockable(true).
RightDockable(false).
TopDockable(false).
BottomDockable(false));

auiManager.AddPane(pane3,
wxAuiPaneInfo().
Name(wxT("pane3")).
Caption(wxT("pane3")).
Right().Layer(4).Row(0).Position(0).
BestSize(wxSize(392, 346)).
MinSize(wxSize(392, 346)).
MaxSize(wxSize(392, 346)).
LeftDockable(false).
RightDockable(true).
TopDockable(false).
BottomDockable(false));
auiManager.AddPane(pane4,
wxAuiPaneInfo().
Name(wxT("pane4")).
Caption(wxT("pane4")).
Right().Layer(4).Row(0).Position(1).
BestSize(wxSize(392, 286)).
MinSize(wxSize(392, 286)).
MaxSize(wxSize(392, 286)).
LeftDockable(false).
RightDockable(true).
TopDockable(false).
BottomDockable(false));
//"commit" all changes made to wxAuiManager
m_uiManager.Update();
}

Kindly respond to my query asap
aforumuser
Registered User
 
Posts: 1
Joined: Thu May 24, 2007 9:01 am

Postby R.U.10 on Thu May 24, 2007 12:14 pm

Hello,

I think you should take a look on the wxAuiPaneInfo documentation on wxWidgets web site.


1.
wxAuiPaneInfo::MinSize

wxAuiPaneInfo& MinSize(const wxSize& size)

wxAuiPaneInfo& MinSize(int x, int y)

MinSize() sets the minimum size of the pane. Please note that this is only partially supported as of this writing.


2.
wxAuiPaneInfo::Resizable

wxAuiPaneInfo& Resizable(bool resizable = true)

Resizable() allows a pane to be resized if the parameter is true, and forces it to be a fixed size if the parameter is false. This is simply an antonym for Fixed().


Your code should look like something like that for the pane 1:
Code: Select all
auiManager.AddPane( pane1, wxAuiPaneInfo().Name(wxT("pane1").MinSize(wxSize(612, 424)).Resizable(false));
R.U.10
Registered User
 
Posts: 30
Joined: Mon May 21, 2007 9:26 am

Return to wxAUI Questions, Thoughts & Feedback