void
TGUIStimulusView::AttachVisualStimulus( const char* inFile )
{
    TGUIView::InvalidateRect( viewTRect );
    delete bitmap;
    bitmap = NULL;
    mediaPlayer->Close();
    useMediaPlayer = false;

    if( inFile == NULL || *inFile == '\0' )
        return;

    TPresError  err = presNoError;
    bitmap = new Graphics::TBitmap();
    try
    {
        bitmap->LoadFromFile( inFile );
        bitmap->Transparent = false;
        Resized();
    }
    catch( const EFOpenError& )
    {
        err = presFileOpeningError;
    }
    catch( const EInvalidGraphic& )
    {
        err = presFileOpeningError;
    }

    if( err != presNoError )
    {
        delete bitmap;
        bitmap = NULL;
        err = presNoError;
        try
        {
            mediaPlayer->FileName = inFile;
            mediaPlayer->Open();
            useMediaPlayer = true;
            Resized();
        }
        catch( const EMCIDeviceError& )
        {
            err = presFileOpeningError;
        }
    }

    if( err != presNoError )
        gPresErrors.AddError( err, inFile );
}
Пример #2
0
EXPORT_C void CTBaseWin::SetExtL(const TPoint &aPos, const TSize &aSize)
	{
	User::LeaveIfError(BaseWin()->SetExtentErr(aPos,aSize));
	iPos=aPos;
	iSize=aSize;
	Resized(iSize);
	}
Пример #3
0
TPresError
TGUITargetView::InitGoal()
{
    goalBuffer = new Graphics::TBitmap;
    Resized();
    return presNoError;
}
TPresError
TGUIReinforcementView::InitAnimation( /*char    *inFileName*/ )
{
    animationBitmap = NULL;
    for( std::vector<Graphics::TBitmap*>::iterator i = animFrames.begin();
                                        i != animFrames.end(); i++ )
        delete *i;
    animFrames.clear();
    numAnimationFrames = 0;

    // Build a list of animation frames.
    std::ostringstream  resName;
    resName << cRiAnimPrefix << numAnimationFrames + 1;
    HBITMAP bmpHandle = ::LoadBitmap( HInstance, resName.str().c_str() );

    while( bmpHandle != NULL )
    {
        Graphics::TBitmap   *bitmap = new Graphics::TBitmap;
        bitmap->Handle = bmpHandle;
        bitmap->Transparent = true;
        bitmap->TransparentMode = tmAuto;
        animFrames.push_back( bitmap );
        numAnimationFrames++;

        resName.str( "" );
        resName << cRiAnimPrefix << numAnimationFrames + 1;
        bmpHandle = ::LoadBitmap( HInstance, resName.str().c_str() );
    }

    Resized();

    return presNoError;
}
Пример #5
0
void CListWindow::SetSize()
{
    iSize.iHeight=ListCount()*(iFont->HeightInPixels()+1)+iTitleHeight+2;
    iSize.iWidth=iFont->TextWidthInPixels(*Client()->Title())+30;
    for(TInt index=0; index<ListCount(); index++)
    {
        TInt wid=iFont->TextWidthInPixels(GetText(index));
        if (wid>iSize.iWidth)
            iSize.iWidth=wid;
    }
    iSize.iWidth+=4;
    iWin.SetSize(iSize);
    Resized(iSize);
}
Пример #6
0
void
compzillaWindow::Configured (bool isNotify,
                             PRInt32 x, PRInt32 y,
                             PRInt32 width, PRInt32 height,
                             PRInt32 border,
                             compzillaWindow *aboveWin,
                             bool override_redirect)
{
    mAttr.override_redirect = override_redirect;

    if (isNotify) {
        Resized (x, y, width, height, border);
        SendPendingResize ();
    }

    if (!isNotify || override_redirect) {
        // abovewin doesn't work given that abovewin has a list of content
        // nodes...  but really, we shouldn't have to worry about this, as you
        // *can't* reliably specify a window to raise/lower above/below, since
        // clients can't depend on the fact that other topevel windows are
        // siblings of each other.
        nsCOMPtr<compzillaIWindow> above = aboveWin;

        for (PRUint32 i = mObservers.Count() - 1; i != PRUint32(-1); --i) {
            nsCOMPtr<compzillaIWindowObserver> observer = mObservers.ObjectAt(i);

            // FIXME: Respect the return value
            observer->Configure (mAttr.map_state == IsViewable,
                                 override_redirect,
                                 x, y,
                                 width, height,
                                 border,
                                 above);
        }
    }
}
Пример #7
0
void Expander::Handle_child_resize()
{
	Resized();
}
Пример #8
0
void
TGUITargetView::SetLabel( const char* inLabel )
{
    label = inLabel;
    Resized();
}
Пример #9
0
static void
init_canvas( FL_OBJECT * ob )
{
    FLI_CANVAS_SPEC *sp = ob->spec;
    static int nc;      /* number of canvases */
    char name[ 32 ];

    if ( ! sp->window || ! fl_winisvalid( sp->window ) )
    {
        /* Find the real parent of the canvas */

        sp->parent = fl_get_real_object_window( ob );
        sp->window = None;

        if ( sp->parent == None )
        {
            M_err( "init_canvas", "Internal Error" );
            exit( 0 );
        }

        if ( sp->init && sp->init( ob ) < 0 )
        {
            M_err( "init_canvas", "Unable to initialize canvas %s", ob->label );
            return;
        }

        /* Create the window */

        sp->window = XCreateWindow( flx->display, sp->parent,
                                    ob->x, ob->y, ob->w, ob->h, 0,
                                    sp->depth, InputOutput,
                                    sp->visual, sp->mask, &sp->xswa );

        if ( sp->user_mask )
            XChangeWindowAttributes( flx->display, sp->window,
                                     sp->user_mask, &sp->user_xswa );

#if FL_DEBUG >= ML_ERR
        M_warn( "init_canvas", "Depth = %d colormap = 0x%lx, WinID = %ld",
                sp->depth, sp->colormap, sp->window );
#endif

        /* Take over event handling */

        fli_set_preemptive_callback( sp->window, canvas_event_intercept, ob );

        if ( sp->activate && sp->activate( ob ) < 0 )
        {
            M_err( "init_canvas", "Can't initialize canvas %s", ob->label );
            return;
        }

        /* Record the name of the window */
        
        if ( *ob->label )
            XStoreName( flx->display, sp->window, ob->label );
        else
        {
            sprintf( name, "flcanvas%d", nc++ );
            XStoreName( flx->display, sp->window, name );
        }

        BegWMColormap( sp );

        XMapWindow( flx->display, sp->window );

        /* Save size */

        sp->x = ob->x;
        sp->y = ob->y;
        sp->w = ob->w;
        sp->h = ob->h;
    }

    /* Check if moved or resized */

    if ( Moved( ob, sp ) || Resized( ob, sp ) )
    {
        M_warn( "init_canvas", "Canvas: WinMoved\n" );
        XMoveResizeWindow( flx->display, sp->window, ob->x, ob->y,
                           ob->w, ob->h );
    }

    sp->x = ob->x;
    sp->y = ob->y;
    sp->w = ob->w;
    sp->h = ob->h;

    if ( ob->col1 != FL_NoColor )
        XClearWindow( flx->display, sp->window );

    sp->dec_type = fli_boxtype2frametype( ob->boxtype );
    fl_draw_frame( sp->dec_type, ob->x, ob->y, ob->w, ob->h, ob->col2, ob->bw );
}
Пример #10
0
	void resizeEvent(QResizeEvent * e)
	{
		QwtPlot::resizeEvent(e);
		emit Resized();
	}
Пример #11
0
 void ResizerWidget::EmitCurrentSize()
 {
    emit(Resized(size()));
 }
Пример #12
0
 void ResizerWidget::resizeEvent(QResizeEvent* evt)
 {
    QWidget::resizeEvent(evt);
    emit(Resized(evt->size()));
 }
Пример #13
0
void RenderWidget::resizeGL(int width, int height)
{
    QGLWidget::resizeGL(width, height);
    Resized(width, height);
}
void FramebufferManagerGLES::Init() {
	FramebufferManagerCommon::Init();
	// Workaround for upscaling shaders where we force x1 resolution without saving it
	Resized();
	CompileDraw2DProgram();
}