Пример #1
0
static void DlgSetSize( gui_window *parent, gui_create_info *dlg_info, int rows,
                        int cols, gui_coord *charuse )
{
    gui_rect            max_size;
    gui_rect            rect;
    gui_system_metrics  metrics;
    gui_coord           half;
    gui_ord             char_ui_adjust;

    GetHalfAndAdjust( charuse, &half, &char_ui_adjust );
    GUIGetSystemMetrics( &metrics );
    GUIGetScale( &max_size );
    dlg_info->rect.width = (cols+3) * charuse->x + metrics.dialog_top_left_size.x +
                      metrics.dialog_bottom_right_size.x;
    dlg_info->rect.height= rows * charuse->y + metrics.dialog_top_left_size.y +
                      metrics.dialog_bottom_right_size.y + char_ui_adjust;
    if( dlg_info->rect.width  > max_size.width ) {
        dlg_info->rect.width  = max_size.width;
    }
    if( dlg_info->rect.height > max_size.height ) {
        dlg_info->rect.height = max_size.height;
    }
    dlg_info->rect.x = max_size.x + ( max_size.width - dlg_info->rect.width ) / 2;
    dlg_info->rect.y = max_size.y + ( max_size.height - dlg_info->rect.height ) / 2;
    if( parent != NULL ) {
        GUIGetClientRect( parent, &rect );
        dlg_info->rect.x -= rect.x;
        dlg_info->rect.y -= rect.y;
    }
}
Пример #2
0
int DUIGetMonitorType( void )
{
    if( GUIIsGUI() ) {
        return( 1 );
    } else {
        gui_system_metrics  metrics;
        GUIGetSystemMetrics( &metrics );
        return( metrics.colour != 0 );
    }
}
Пример #3
0
void    InitWClass( gui_rect *screen ) {
/**************************************/

    WSystemMetrics::_screenCoords.x( screen->x );
    WSystemMetrics::_screenCoords.y( screen->y );
    WSystemMetrics::_screenCoords.w( screen->width );
    WSystemMetrics::_screenCoords.h( screen->height );
    WSystemMetrics::_initDefRect.x( screen->x );
    WSystemMetrics::_initDefRect.y( screen->y );
    WSystemMetrics::_initDefRect.w( ( 3 * screen->width ) / 4 );
    WSystemMetrics::_initDefRect.h( ( 2 * screen->height ) / 3 );
    WSystemMetrics::_defRect = WSystemMetrics::_initDefRect;
    GUIGetSystemMetrics( &WSystemMetrics::_metrics );
    GUIGetScreen( &WSystemMetrics::_screen );
}