# Area

(UI 0.9.9)

## 简介

An Area represents a canvas which can be used to draw, and respond to mouse and key events.

## 类摘要

class UI\Area extends UI\Control {
/* 常量 */
const int Ctrl;
const int Alt;
const int Shift;
const int Super;
const int Down;
const int Up;
/* 方法 */
protected function onDraw(
UI\Draw\Pen `$pen`,
UI\Size `$areaSize`,
UI\Point `$clipPoint`,
UI\Size `$clipSize`
)
protected function onKey(string `$key`, int `$ext`, int `$flags`)
protected function onMouse(UI\Point `$areaPoint`, UI\Size `$areaSize`, int `$flags`)
public function redraw()
public function scrollTo(UI\Point `$point`, UI\Size `$size`)
public function setSize(UI\Size `$size`)
/* 继承的方法 */
public function UI\Control::destroy()
public function UI\Control::disable()
public function UI\Control::enable()
public function UI\Control::getParent(): UI\Control
public function UI\Control::getTopLevel(): int
public function UI\Control::hide()
public function UI\Control::isEnabled(): bool
public function UI\Control::isVisible(): bool
public function UI\Control::setParent(UI\Control `$parent`)
public function UI\Control::show()
}

## 预定义常量

`UI\Area::Ctrl`
  Shall be set in the modifiers passed to key and mouse events when the `CTRL` key is active
`UI\Area::Alt`
  Shall be set in the modifiers passed to key and mouse events when the `ALT` key is active
`UI\Area::Shift`
  Shall be set in the modifiers passed to key and mouse events when the `SHIFT` key is active
`UI\Area::Super`

`UI\Area::Down`

  Shall be set in the modifiers passed to key and mouse events

`UI\Area::Up`

  Shall be set in the modifiers passed to key and mouse events

## 目录

- UI\Area::onDraw — Draw Callback
- UI\Area::onKey — Key Callback
- UI\Area::onMouse — Mouse Callback
- UI\Area::redraw — Redraw Area
- UI\Area::scrollTo — Area Scroll
- UI\Area::setSize — Set Size

`↑` and `↓` to navigate • `Enter` to select • `Esc` to close • `/` to open