Problem(s) with wxDockIt - can anyone help?

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
cr_itm
Earned a small fee
Earned a small fee
Posts: 15
Joined: Fri May 06, 2005 4:48 pm

Problem(s) with wxDockIt - can anyone help?

Post by cr_itm » Fri May 13, 2005 4:20 pm

Hello,

I hope someone could get some experience with wxDockIt to help me. I tried some things with it, created dockable sub-windows - just testet the whole lib a bit. This is what builds a frame with two dockable sub-windows with a wxLayoutManager that handles the docking:

Code: Select all

m_pText1 = new wxTextCtrl(this, -1, "First Textbox", wxPoint(10.0, 10.0));
m_pText2 = new wxTextCtrl(this, -1, "This is the second text control.", wxPoint(10.0, 30.0));


// Create the Layout Manager of wxDockIt
m_pLM = new wxLayoutManager(this);

m_pDockWindow01 = new wxDockWindow(this, wxID_ANY, "Dock Window 1",
				   wxPoint(250, 500), wxSize(196, 196), "dock1");

m_pDockWindow02 = new wxDockWindow(this, wxID_ANY, "Dock Window 2",
				   wxPoint(650, 500), wxSize(196, 196), "dock2");


// Set the two text controls as clients for the docking windows
m_pDockWindow01->SetClient(m_pText1);
m_pDockWindow02->SetClient(m_pText2);

// ...and tell the Layout Manager that we have two docking windows
m_pLM->AddDefaultHosts();
m_pLM->AddDockWindow(m_pDockWindow01);
m_pLM->AddDockWindow(m_pDockWindow02);

// finally showing the two small windows (in this state, they are not docked)
m_pDockWindow01->Show();
m_pDockWindow02->Show();
This is what it looks like:

Image

Now to the problem(s). It's mainly a very strange behaviour, and I strongly hope that it is my fault (I may have forgot important lines of code or something) and the reason for it is hopefully not the beta status of the wxDockIt lib.

Now, this is when I move the first small docking window to the left border of the main frame:

Image

Well, you can see what happened: the docking window is in the right location, but -> the dark gray background disappeared, and there is a light gray background with a strange small cube in the top-left corner. What is that small cube for and where did it come from??

Ok, I noticed that I can drag and drop the small cube, so I dragged it to the right. And hey, the dark gray background came back:

Image

But hey, what does that mean, there is a dark and a light gray area, and it seems that the light gray area on the right side is like a panel that I can change in size. Curios.

Now I managed to get rid of the the small cube, and in it's place a dragable-line came in. But not with changing the code, I just dragged the second dockable window to the bottom of the main frame. And *surprise* the small cube has gone. Strange.

Image

Ah a last thing: Did I mention, when I drag the a dockable window to the right of the main frame, it does not dock like on the left side, but then it fills out the whole main frame? I wonder why.


So please, if there is anyone who has some experience with wxDockIt or anyone who thinks he got an explanation, please help me. I just don't get it.


Thanks a lot!

cr_itm
Earned a small fee
Earned a small fee
Posts: 15
Joined: Fri May 06, 2005 4:48 pm

Post by cr_itm » Fri May 13, 2005 9:03 pm

I just figured it out by myself :-) I hope this is not spam, I just want to contribute a solution, if anyone encounters the same problem.

I only had to add these lines of code:

Code: Select all

wxPane* pPane = new wxPane(this, 0, "client_pane");
m_pLM->SetLayout(wxDWF_SPLITTER_BORDERS, pPane);
pPane->ShowCloseButton(false);
As I understand, a wxPane is a free client space for wxDockIt. I create one in the first line, use the SetLayout method in the middle line and than disabled the close button of the pane in the last line.

Now all weird docking problems are magically gone ;-) and all works as intended.

Post Reply