splitter in notebook
Matt Connolly
matt at soundevolution.com.au
Wed Jun 27 23:58:20 PDT 2007
I had a similar problem.
It seems to me that any wxWindow added to a Frame (or top level
window) automagically sizes to fill the frame, but any (sub)windows
(this terminology still confuses me) added to a window that's in a
frame don't get resized.
I thought wxSizer's might have done the trick, but I wanted to centre
something in the window (vertically and horizontally), and wxBoxSizer
does one or the other, not both.
I ended up adding a size event handler and writing my own code to
resize the views within my window (within my frame):
EVT_SIZE( MyWindow::HandleResize )
...
void MyWindow::HandleResize( wxSizeEvent& event )
{
...
}
You can probably achieve what you want with a "wxBoxSizer".
Best,
Matt
On 28/06/2007, at 3:30 PM, Lloyd wrote:
> Sure I would move to wxAUI I later. Here my problem is different. I
> would like to know the fundamental reason behind it. The problem is
> this. If my notebook page is a class derived from wxWindow it resizes
> appropriately to use the maximum space available (when
> wxDefaultSize is
> used). Now I am adding a splitter window as its member variable and
> makes the splitter window object in the constructor itself. here the
> splitter takes only 20x20 pixels but the window takes the maximum
> space
> available. I just checked it by setting the background colour. So my
> question is
> why splitter window is not taking the maximum size available?
>
> Thank you very much,
> Lloyd
>
>
> On Thu, 2007-06-28 at 13:09 +0800, Mohd Radzi Ibrahim wrote:
>> Why not try wxAUI?
>>
>>
>> ----- Original Message -----
>> From: "Lloyd" <lloyd at cdactvm.in>
>> To: <wx-users at lists.wxwidgets.org>
>> Sent: Wednesday, June 27, 2007 10:16 PM
>> Subject: splitter in notebook
>>
>>
>>> Hi,
>>> I have a notebook with so many pages. One of the page contains a
>>> splitter. How should I implement it?
>>>
>>> 1) Derive a class from wxSplitterWindow, add two windows as its
>>> members,
>>> split the window in its constructor itself.
>>>
>>> 2) Derive a class from wxPanel, add two windows and a splitter as
>>> members, and perform the splitting in the constructor itself.
>>>
>>> I tried these two ways. But they did not work well. In the first
>>> case
>>> the window is split, but the sash is on the top (its a horizontal
>>> splitter). In the second case too the window splits, but the
>>> window size
>>> is (20x20 pixels it seems) very small and is on the top left
>>> corner of
>>> the notebook page.
>>>
>>> I think both of these methods are wrong, please guide me how to
>>> implement this...
>>>
>>> Thank you very much,
>>> Lloyd
>>>
>>>
>>> ______________________________________
>>> Scanned and protected by Email scanner
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
>>> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
>> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>
>
> ______________________________________
> Scanned and protected by Email scanner
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2174 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wx-users/attachments/20070628/3eaaac37/smime.bin
More information about the wx-users
mailing list