Beispiel #1
0
void wxWindowX11::SetFocus()
{
    Window xwindow = (Window) m_clientWindow;

    wxCHECK_RET( xwindow, wxT("invalid window") );

    wxCHECK_RET( AcceptsFocus(), wxT("set focus on window that doesn't accept the focus") );

#if 0
    if (GetName() == "scrollBar")
    {
        char *crash = NULL;
        *crash = 0;
    }
#endif

    if (wxWindowIsVisible(xwindow))
    {
        wxLogTrace( _T("focus"), _T("wxWindowX11::SetFocus: %s"), GetClassInfo()->GetClassName());
        //        XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToParent, CurrentTime );
        XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToNone, CurrentTime );
        m_needsInputFocus = FALSE;
    }
    else
    {
        m_needsInputFocus = TRUE;
    }
}
Beispiel #2
0
void wxWindowBeOS::SetFocus()
{
//    Window xwindow = (Window) m_clientWindow;

//    wxCHECK_RET( xwindow, wxT("invalid window") );

    // Don't assert; we might be trying to set the focus for a panel
    // with only static controls, so the panel returns false from AcceptsFocus.
    // The app should be not be expected to deal with this.
    if (!AcceptsFocus())
        return;

#if 0
    if (GetName() == "scrollBar")
    {
        char *crash = NULL;
        *crash = 0;
    }
#endif

//    if (wxWindowIsVisible(xwindow))
//    {
//        wxLogTrace( _T("focus"), _T("wxWindowBeOS::SetFocus: %s"), GetClassInfo()->GetClassName());
//        //        XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToParent, CurrentTime );
////        XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToNone, CurrentTime );
//        m_needsInputFocus = FALSE;
//    }
//    else
//    {
//        m_needsInputFocus = TRUE;
//    }
}
Beispiel #3
0
//------------------------------------------------------------------------------
void CIwUIEdFrame::OnMouse(wxMouseEvent& event)
{
    if (CIwTheHost.m_Link==NULL)
        return;

    int mode=128;

    if (!m_OnDrag)
    {
        if (event.LeftIsDown())
            mode|=1;

        if (event.MiddleIsDown())
            mode|=2;

        if (event.RightIsDown())
            mode|=4;

        if (event.ShiftDown())
            mode|=8;

        if (event.ControlDown())
            mode|=16;

        if (event.MetaDown())
            mode|=32;
    }

    int x = event.m_x;
    int y = event.m_y;


    int mouse[]={mode,x,y,0};
    //CIwTheHost.m_Link->SetData(CIwViewerUI::MOUSE_POS,(void*)mouse);

    if (mode!=128 || m_OldMode!=128)
    {
        if ( AcceptsFocus() )
            SetFocus();

        if (!mCapturingMouse)
        {
            CaptureMouse();
            mCapturingMouse = true;
        }
    }
    else
    {
        if (mCapturingMouse)
        {
            mCapturingMouse = false;
            if (HasCapture())
                ReleaseMouse();
        }
    }

    m_OldMode=mode;
}
Beispiel #4
0
WXDWORD wxControl::OS2GetStyle( long lStyle, WXDWORD* pdwExstyle ) const
{
    long dwStyle = wxWindow::OS2GetStyle( lStyle, pdwExstyle );

    if (AcceptsFocus())
    {
        dwStyle |= WS_TABSTOP;
    }
    return dwStyle;
} // end of wxControl::OS2GetStyle
Beispiel #5
0
WXDWORD wxControl::MSWGetStyle(long style, WXDWORD *exstyle) const
{
    long msStyle = wxWindow::MSWGetStyle(style, exstyle);

    if ( AcceptsFocus() )
    {
        msStyle |= WS_TABSTOP;
    }

    return msStyle;
}
Beispiel #6
0
bool wxTopLevelWindowMGL::Show(bool show)
{
    bool ret = wxTopLevelWindowBase::Show(show);

    // If this is the first time Show was called, send size event,
    // so that the frame can adjust itself (think auto layout or single child)
    if ( !m_sizeSet )
    {
        m_sizeSet = true;
        wxSizeEvent event(GetSize(), GetId());
        event.SetEventObject(this);
        GetEventHandler()->ProcessEvent(event);
    }

    if ( ret && show && AcceptsFocus() )
        SetFocus();
    // FIXME_MGL -- don't do this for popup windows?
    return ret;
}