Window

(PHP 7, UI 0.9.9)

简介

Represents a UI Window

类摘要

UI\Window extends UI\Control {
/* 属性 */
protected $controls ;
/* Constructor */
public __construct ( string $title , Size $size [, boolean $menu = false ] )
/* 方法 */
public add ( UI\Control $control )
public error ( string $title , string $msg )
public UI\Size getSize ( void )
public string getTitle ( void )
public bool hasBorders ( void )
public bool hasMargin ( void )
public bool isFullScreen ( void )
public msg ( string $title , string $msg )
protected int onClosing ( void )
public string open ( void )
public string save ( void )
public setBorders ( boolean $borders )
public setFullScreen ( boolean $full )
public setMargin ( boolean $margin )
public setSize ( UI\Size $size )
public setTitle ( string $title )
/* 继承的方法 */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

属性

controls

Contains controls, should not be manipulated directly

Table of Contents

User Contributed Notes

everton3x at gmail dot com 03-Feb-2017 09:58
This is a example to wizard layout in UI library:

<?php

/*
 * Wizard sample layout builded with PHP UI
 */

use UI\Window;
use
UI\Size;
use
UI\Controls\Button;
use
UI\Controls\Grid;
use
UI\Controls\Box;
use
UI\Controls\Form;
use
UI\Controls\Entry;
use
UI\Controls\Label;

/*
 * The window
 */
$window = new Window('Wizard Sample Layout', new Size(640, 480), TRUE);
$window->setMargin(true);

/*
 * Wizard content (sample)
 */
$content = new Form();
$content->setPadded(true);
$content->append('User:', new Entry());
$content->append('Password:', new Entry(Entry::Password));

/*
 * Layout to title, content and buttons
 */
$grid = new Grid();
$grid->setPadded(false);

/*
 * Title
 */
$grid->append(new Label('Wizard Sample'), 0, 0, 6, 1, true, Grid::Fill, false, Grid::Fill);

/*
 * Append content
 */
$grid->append($content, 0, 1, 6, 1, false, Grid::Fill, true, Grid::Fill);

/*
 * Left buttons
 */
$left_box = new Box(Box::Horizontal);
$left_box->append(new Button('&About'));
$left_box->append(new Button('&Help'));

/*
 * Right buttons
 */
$right_box = new Box(Box::Horizontal);
$right_box->append(new Button('&Back'));
$right_box->append(new Button('&Forward'));
$right_box->append(new Button('&Close'));

/**
 * Append buttons
 */
$grid->append($left_box, 0, 2, 1, 1, true, Grid::Start, false, Grid::Fill);
$grid->append($right_box, 5, 2, 1, 1, true, Grid::End, false, Grid::Fill);

/*
 * Append layout and show.
 */
$window->add($grid);

$window->show();

UI\run();

?>