Exemple #1
0
void wxTopLevelWindowMac::OSXSetIconizeState(bool iconize)
{
    if ( iconize != m_iconized )
    {
        m_iconized = iconize;
        (void)SendIconizeEvent(iconize);
    }
}
Exemple #2
0
void wxTopLevelWindowGTK::SetIconizeState(bool iconize)
{
    if ( iconize != m_isIconized )
    {
        m_isIconized = iconize;
        (void)SendIconizeEvent(iconize);
    }
}
Exemple #3
0
bool wxFrame::HandleSize(int WXUNUSED(x), int WXUNUSED(y), WXUINT id)
{
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
    switch ( id )
    {
        case SIZE_RESTORED:
        case SIZE_MAXIMIZED:
            // only do it it if we were iconized before, otherwise resizing the
            // parent frame has a curious side effect of bringing it under it's
            // children
            if ( !m_iconized )
                break;

            // restore all child frames too
            IconizeChildFrames(false);

            (void)SendIconizeEvent(false);
            break;

        case SIZE_MINIMIZED:
            // iconize all child frames too
            IconizeChildFrames(true);
            break;
    }
#else
    wxUnusedVar(id);
#endif // !__WXWINCE__

    if ( !m_iconized )
    {
#if wxUSE_STATUSBAR
        PositionStatusBar();
#endif // wxUSE_STATUSBAR

#if wxUSE_TOOLBAR
        PositionToolBar();
#endif // wxUSE_TOOLBAR

#if defined(WINCE_WITH_COMMANDBAR)
        // Position the menu command bar
        if (GetMenuBar() && GetMenuBar()->GetCommandBar())
        {
            RECT rect;
            ::GetWindowRect((HWND) GetMenuBar()->GetCommandBar(), &rect);
            wxSize clientSz = GetClientSize();

            if ( !::MoveWindow((HWND) GetMenuBar()->GetCommandBar(), 0, 0, clientSz.x, rect.bottom - rect.top, true ) )
            {
                wxLogLastError(wxT("MoveWindow"));
            }

        }
#endif // WINCE_WITH_COMMANDBAR
    }

    // call the base class version to generate the appropriate events
    return false;
}
Exemple #4
0
bool wxFrame::HandleSize(int WXUNUSED(x), int WXUNUSED(y), WXUINT id)
{
    switch ( id )
    {
        case SIZE_RESTORED:
        case SIZE_MAXIMIZED:
            // only do it it if we were iconized before, otherwise resizing the
            // parent frame has a curious side effect of bringing it under it's
            // children
            if ( !m_iconized )
                break;

            // restore all child frames too
            IconizeChildFrames(false);

            (void)SendIconizeEvent(false);
            break;

        case SIZE_MINIMIZED:
            // iconize all child frames too
            IconizeChildFrames(true);
            break;
    }

    if ( !m_iconized )
    {
#if wxUSE_STATUSBAR
        PositionStatusBar();
#endif // wxUSE_STATUSBAR

#if wxUSE_TOOLBAR
        PositionToolBar();
#endif // wxUSE_TOOLBAR

    }

    // call the base class version to generate the appropriate events
    return false;
}
Exemple #5
0
bool wxFrame::HandleSize( int nX, int nY, WXUINT nId )
{
    bool bProcessed = false;

    switch (nId)
    {
        case kSizeNormal:
            //
            // Only do it it if we were iconized before, otherwise resizing the
            // parent frame has a curious side effect of bringing it under it's
            // children
            if (!m_bIconized )
                break;

            //
            // restore all child frames too
            //
            IconizeChildFrames(false);
            (void)SendIconizeEvent(false);

            //
            // fall through
            //

        case kSizeMax:
            m_bIconized = false;
            break;

        case kSizeMin:
            //
            // Iconize all child frames too
            //
            IconizeChildFrames(true);
            (void)SendIconizeEvent();
            m_bIconized = true;
            break;
    }

    if (!m_bIconized)
    {
        //
        // forward WM_SIZE to status bar control
        //
#if wxUSE_NATIVE_STATUSBAR
        if (m_frameStatusBar && m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95)))
        {
            wxSizeEvent             vEvent( wxSize( nX
                                                   ,nY
                                                  )
                                           ,m_frameStatusBar->GetId()
                                          );

            vEvent.SetEventObject(m_frameStatusBar);
            m_frameStatusBar->OnSize(vEvent);
        }
#endif // wxUSE_NATIVE_STATUSBAR

        PositionStatusBar();
#if  wxUSE_TOOLBAR
        PositionToolBar();
#endif // wxUSE_TOOLBAR

        bProcessed = wxWindow::HandleSize( nX
                                          ,nY
                                          ,nId
                                         );
    }
    return bProcessed;
} // end of wxFrame::HandleSize