Hello Justin,
I assume you refer to the Win32 Platform Package. In this case the size of the window is predetermined by the value set in ScreenSize attribute. It is fixed and not intended to be changed at the runtime since usually the design of the application imposes the size of the window. Anyway, to support the UI with dynamic size would require multiple modifications of the Platform Package code. For the recent version 12, these would be:
1. In the WindowProc() function look for the WM_SIZE Windows message handler. Delete the original code found there. The function is found in the module gfx_system_windows.c.
2. In the WM_SIZE message handler, recreate the DIB (Windows bitmap acting as frame buffer memory) with the new window size. (use the functions CreateDIB() and DestroyDIB()).
3. In the WM_SIZE message handler, recreate the Viewport. (use the functions EwInitViewport() and EwDoneViewport()).
4. In the WM_SIZE message handler, adjust the root object dimension. For this purpose invoke the method OnSetBounds() of the root object providing to it the new dimension.
5. In the WM_SIZE message handler, update the global variable ViewerSize.
Following could be the code (without having verified that it works):
case WM_SIZE :
{
XObject rootObject = EwGetAppRootObject();
int width = LOWORD( aLParam );
int height = HIWORD( aLParam );
XPoint size = { width, height };
XRect rect = { 0, 0, width, height };
/* Each time the window is resized -> free the old framebuffer */
if ( Viewport ) EwDoneViewport( Viewport );
if ( Framebuffer ) DestroyDib( Framebuffer );
/* Create new framebuffer */
if (( Framebuffer = CreateDib( width, height )) == 0 )
{
... failed -> end application ...
}
/* Also create the viewport as bridge between the Windows DIB and the
Graphics Engine bitmap */
if (( Viewport = EwInitViewport( size, rect, 0, 255, Framebuffer,
0, 0, ViewportProc )) == 0 )
{
... failed -> end application ...
}
/* Remember the new size in the global variable */
ViewportSize = size;
/* update the size of the root object */
CoreRectView__OnSetBounds( rootObject, rect );
CoreGroup__InvalidateArea( rootObject, rect );
EwProcessSignals();
EwUpdateViewer();
}
break;
Now the UI application should be resizable. For example, when the size changes, the position and the size of components existing in your application can be updated. When you have a Filled Rectangle view in the background of the Application component, just configures its Layout property to be as shown below. This will have the effect of the rectangle automatically adapting the new size and so filling the entire screen:
Well, I hope it helps you further.
Best regards
Paul Banach