Example #1
0
// real construction (Init() must have been called before!)
bool wxWindowMGL::Create(wxWindow *parent,
                         wxWindowID id,
                         const wxPoint& pos,
                         const wxSize& size,
                         long style,
                         const wxString& name)
{
    if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
        return false;

    if ( parent )
        parent->AddChild(this);

    int x, y, w, h;
    x = pos.x, y = pos.y;
    if ( x == -1 )
        x = 0; // FIXME_MGL, something better, see GTK+
    if ( y == -1 )
        y = 0; // FIXME_MGL, something better, see GTK+
    AdjustForParentClientOrigin(x, y, 0);
    w = WidthDefault(size.x);
    h = HeightDefault(size.y);

    long mgl_style = 0;
    window_t *wnd_parent = parent ? parent->GetHandle() : NULL;

    if ( style & wxFULL_REPAINT_ON_RESIZE )
    {
        mgl_style |= MGL_WM_FULL_REPAINT_ON_RESIZE;
    }
    if ( style & wxSTAY_ON_TOP )
    {
        mgl_style |= MGL_WM_ALWAYS_ON_TOP;
    }
    if ( style & wxPOPUP_WINDOW )
    {
        mgl_style |= MGL_WM_ALWAYS_ON_TOP;
        // it is created hidden as other top level windows
        m_isShown = false;
        wnd_parent = NULL;
    }

    window_t *wnd = MGL_wmCreateWindow(g_winMng, wnd_parent, x, y, w, h);

    MGL_wmSetWindowFlags(wnd, mgl_style);
    MGL_wmShowWindow(wnd, m_isShown);

    SetMGLwindow_t(wnd);

    return true;
}
Example #2
0
 wxRootWindow() : wxWindow(NULL, wxID_ANY)
 {
     SetMGLwindow_t(MGL_wmGetRootWindow(g_winMng));
     SetBackgroundColour(wxTHEME_COLOUR(DESKTOP));
 }