From: "Iulian-Nicu Serbanoiu" on
If you are using the EVT_SIZE event you should call also the default
handler for this event. This can be done by calling Skip(true);

MyFrame::OnSize(wxSizeEvent& event)
{
// your code before the default event

event.Skip(true);

// your code after the default event
}

HTH,

Iulian

On 17 Aug 2006 22:30:51 -0700, abirbasak(a)gmail.com <abirbasak(a)gmail.com> wrote:
> I had used EVT_SIZE for the wxFrame, which doing nothing, and layout
> mechanism was not working. Removing the event works fine. However I
> want to do something OnSize for the frame. Will I call frame->OnSize()
> first on the event handler first, before my custom code?
> Thanks for reply.
> abir
> > Regards,
> >
> > Iulian

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: abirbasak on

"Iulian-Nicu Serbanoiu" wrote:
> If you are using the EVT_SIZE event you should call also the default
> handler for this event. This can be done by calling Skip(true);
>
> MyFrame::OnSize(wxSizeEvent& event)
> {
> // your code before the default event
>
> event.Skip(true);
>
> // your code after the default event
> }
Thanks. This one is working.
But one more problem. Now I am adding a wxPanel to my wxFrame, and set
it to the sizer. I want to add wxSashLayoutWindow insize the panel. Now
This one is not working as expected.
here is the code inside wxFrame ctor
wxPanel* clientPanel = new wxPanel(this);
clientPanel->SetBackgroundColour(*wxBLUE);
wxBoxSizer* clientSizer = new wxBoxSizer(wxHORIZONTAL);
clientSizer->Add(clientPanel,wxSizerFlags(1).Expand());

wxSashLayoutWindow* _bottomSplitterWindow = new
wxSashLayoutWindow(clientPanel);
_bottomSplitterWindow->SetDefaultSize(wxSize(1000,200));
_bottomSplitterWindow->SetOrientation(wxLAYOUT_HORIZONTAL);
_bottomSplitterWindow->SetAlignment(wxLAYOUT_BOTTOM);
_bottomSplitterWindow->SetBackgroundColour(*wxGREEN);
_bottomSplitterWindow->SetSashVisible(wxSASH_TOP,true);
this->SetSizer(clientSizer);

clientPanel is expanded to the whole wxFrame, except statusbar, menubar
& toolbar as expected. But bottomSplitterWindow is not at the bottom of
the clientPanel, with a height of 200. (It appears at the top left
corner of the clientPanel) .
How to do it? I am new to wxWidgets , and not finding a way to do it.
sorry for disturbing.
abir

>
> HTH,
>
> Iulian
>
> On 17 Aug 2006 22:30:51 -0700, abirbasak(a)gmail.com <abirbasak(a)gmail.com> wrote:
> > I had used EVT_SIZE for the wxFrame, which doing nothing, and layout
> > mechanism was not working. Removing the event works fine. However I
> > want to do something OnSize for the frame. Will I call frame->OnSize()
> > first on the event handler first, before my custom code?
> > Thanks for reply.
> > abir
> > > Regards,
> > >
> > > Iulian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Robin Dunn on
Iulian-Nicu Serbanoiu wrote:
> If you are using the EVT_SIZE event you should call also the default
> handler for this event. This can be done by calling Skip(true);
>
> MyFrame::OnSize(wxSizeEvent& event)
> {
> // your code before the default event
>
> event.Skip(true);
>
> // your code after the default event
> }
>

This is not true. Calling Skip only sets a flag that causes the event
system to continue looking for a handler *after* the current handler
returns. It does *not* cause the default handler to be called
immediately (during the call to Skip.)


--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

First  |  Prev  | 
Pages: 1 2
Prev: Unresolved externals
Next: Odd link error