wxSplitterWindow issues Topic is solved

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
MrDoomMaster
Earned a small fee
Earned a small fee
Posts: 20
Joined: Tue Feb 21, 2006 9:45 pm

wxSplitterWindow issues

Post by MrDoomMaster » Wed Feb 22, 2006 6:21 pm

I have used DialogBlocks to create a wxFrame with a wxSplitterWindow in it. No sizers are used (because in the editor it shows the splitter extending across the entire client rect of the frame, which is what I want.

Along with the above frame, I have created ANOTHER wxFrame which has nothing but a list control in it. This will be the left window of my vertical splitter.

In the code, I load the wxSplitterWindow from the XRC file:

Code: Select all

mSplitter = XRCCTRL(*this, "ID_SPLITTERWINDOW", wxSplitterWindow);
I make a fruitful effort to:
1) Create an object of my 'left window"
2) Attach this wxFrame (left window) to my wxSplitterWindow.

After doing all of this, I get the following problems:

1) When I run the application, wxWidgets pops a dialog saying: "wxSplitterWindow node must have at least one window"
2) After pressing "OK' on the dialog, the application continues to run. I see what I assume is the splitter control attached to 0,0 in screenspace coordinates. This means it's stuck at the top left of the screen. My visible window, however, is not painting the client rect. When I size my frame, the top left offset wxSplitterWindow sizes along with my window.

Here is my code:

Code: Select all

mSplitter = XRCCTRL(*this, "ID_SPLITTERWINDOW", wxSplitterWindow);
mAnimationWnd = new AnimationList(mSplitter); // Left Window of splitter
mSplitter->Initialize(mAnimationWnd);
Note that I'm only attempting to load 1 window into my splitter for now. Once I get it working I'll add a second.

Thanks!

MrDoomMaster
Earned a small fee
Earned a small fee
Posts: 20
Joined: Tue Feb 21, 2006 9:45 pm

Post by MrDoomMaster » Wed Feb 22, 2006 6:29 pm

I guess a more obvious question would be, which type of resource can I create in DialogBlocks (window-type) that would work well as a splitter window? Currently, wxFrame seems to cause a top-level window to appear and doesn't really attach inside of the splitter window pane. It also creates an extra taskbar entry.

I wonder if I can just attach a wxListCtrl to the left pane?

DavidHart
Site Admin
Site Admin
Posts: 3881
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post by DavidHart » Wed Feb 22, 2006 6:42 pm

Hi,
I wonder if I can just attach a wxListCtrl to the left pane?
Probably, but you'd be better off using a wxPanel (one for each side of the splitterwindow), then adding the listctrl etc to this.

Regards,

David

MrDoomMaster
Earned a small fee
Earned a small fee
Posts: 20
Joined: Tue Feb 21, 2006 9:45 pm

Post by MrDoomMaster » Wed Feb 22, 2006 7:18 pm

DavidHart wrote:Hi,
I wonder if I can just attach a wxListCtrl to the left pane?
Probably, but you'd be better off using a wxPanel (one for each side of the splitterwindow), then adding the listctrl etc to this.

Regards,

David
Yours would have worked, but after a little experimenting I figured out an even easier way. DialogBlocks actually allows you to add the left and right sides to the splitter window, I didn't know this at first.

Thanks for your help!

Post Reply