
Ȉ MonaSq/monagui Cu t@X


monagui Ƃ́AMonaOS Ɏꂽ C++ p GUI CułB

MonaSq ł́ASquirrel XNvgォ monagui CuĂяo
bp[Cu MonaSq/monagui pӂĂ܂B

MonaSq/monagui ́AMonaSq ̃fXg[V̂߂ɍ܂B
SĂ monagui R|[lg킯ł͂܂B
܂Ał͂słB



Graphics NX\bhꗗ

	function drawPixel(x, y, color)
	function drawImage(image, x, y)
	function drawLine(x0, y0, x1, y1)
	function drawRect(x, y, width, height)
	function drawCircle(x0, y0, r)
	function drawString(str, x, y)
	function fillCircle(x0, y0, r)
	function fillRect(x, y, width, height)
	function translate(x, y)
	function getFontStyle()
	function setClip(cx, cy, cw, ch)
	function setColor(r, g, b)
	function setColor(color)
	function setFontStyle(style)



Image NX\bhꗗ

	constructor()
	constructor(filename)
	constructor(width, height)

	function getHandle()
	function getWidth()
	function getHeight()
	function getPixel(x, y)
	function setPixel(x, y, color)



FrameNX\bhꗗ

	constructor()
	constructor(title)

	function setHandler(eventId, calee, func)
	function removeHandler(eventId)

	function getTitle()
	function setTitle(title)

	function setTimer(duration)
	function run()
	function stop()

	function add( component )
	function remove( component )
	function getComponent()
	function getComponentAt(x, y)

	function repaint()
	function setBounds(x, y, width, height)
	function update()
	function update(x, y, width, height)
	function getEnabled()
	function getFocused()
	function getVisible()
	function getX()
	function getY()
	function getWidth()
	function getHeight()
	function getBackground()
	function getForeground()
	function getFontStyle()
	function setEnabled(enabled)
	function setFocused(focused)
	function setVisible(visible)
	function setLocation(x, y)
	function setBackground(backColor)
	function setForeground(foreColor)
	function setFontStyle(style)



ButtonNX\bhꗗ

	constructor()
	constructor(label)

	function setHandler(eventId, calee, func)
	function removeHandler(eventId)

	function setLabel(label)
	function getLabel()
	function getPushed()

	function repaint()
	function setBounds(x, y, width, height)
	function update()
	function update(x, y, width, height)
	function getEnabled()
	function getFocused()
	function getVisible()
	function getX()
	function getY()
	function getWidth()
	function getHeight()
	function getBackground()
	function getForeground()
	function getFontStyle()
	function setEnabled(enabled)
	function setFocused(focused)
	function setVisible(visible)
	function setLocation(x, y)
	function setBackground(backColor)
	function setForeground(foreColor)
	function setFontStyle(style)



TextFieldNX\bhꗗ

	constructor()

	function setHandler(eventId, calee, func)
	function removeHandler(eventId)

	function setText(text)
	function getText()

	function repaint()
	function setBounds(x, y, width, height)
	function update()
	function update(x, y, width, height)
	function getEnabled()
	function getFocused()
	function getVisible()
	function getX()
	function getY()
	function getWidth()
	function getHeight()
	function getBackground()
	function getForeground()
	function getFontStyle()
	function setEnabled(enabled)
	function setFocused(focused)
	function setVisible(visible)
	function setLocation(x, y)
	function setBackground(backColor)
	function setForeground(foreColor)
	function setFontStyle(style)



ListBoxNX\bhꗗ

	constructor()

	function setHandler(eventId, calee, func)
	function removeHandler(eventId)

	function getSelectedIndex()
	function getSelectedItem()
	function select(index)
	function add(item)
	function remove(index)

	function repaint()
	function setBounds(x, y, width, height)
	function update()
	function update(x, y, width, height)
	function getEnabled()
	function getFocused()
	function getVisible()
	function getX()
	function getY()
	function getWidth()
	function getHeight()
	function getBackground()
	function getForeground()
	function getFontStyle()
	function setEnabled(enabled)
	function setFocused(focused)
	function setVisible(visible)
	function setLocation(x, y)
	function setBackground(backColor)
	function setForeground(foreColor)
	function setFontStyle(style)



CheckboxNX\bhꗗ

	constructor()

	function setHandler(eventId, calee, func)
	function removeHandler(eventId)

	function getLabel()
	function setLabel(label)
	function getChecked()
	function setChecked(checked)
	function getCheckboxGroup()
	function setCheckboxGroup(group)

	function repaint()
	function setBounds(x, y, width, height)
	function update()
	function update(x, y, width, height)
	function getEnabled()
	function getFocused()
	function getVisible()
	function getX()
	function getY()
	function getWidth()
	function getHeight()
	function getBackground()
	function getForeground()
	function getFontStyle()
	function setEnabled(enabled)
	function setFocused(focused)
	function setVisible(visible)
	function setLocation(x, y)
	function setBackground(backColor)
	function setForeground(foreColor)
	function setFontStyle(style)



ContainerNX\bhꗗ

	constructor()
	constructor(title)

	function setHandler(eventId, calee, func)
	function removeHandler(eventId)

	function add( component )
	function remove( component )
	function getComponent()
	function getComponentAt(x, y)

	function repaint()
	function setBounds(x, y, width, height)
	function update()
	function update(x, y, width, height)
	function getEnabled()
	function getFocused()
	function getVisible()
	function getX()
	function getY()
	function getWidth()
	function getHeight()
	function getBackground()
	function getForeground()
	function getFontStyle()
	function setEnabled(enabled)
	function setFocused(focused)
	function setVisible(visible)
	function setLocation(x, y)
	function setBackground(backColor)
	function setForeground(foreColor)
	function setFontStyle(style)




Cxgnh̓o^

Cxgnh́Amonagui ŔCxg
邽߂̊֐ŁAKvɉĒ`܂B

Cxgnh́ACxg̎ނɂĈقȂ܂B
Ⴆ΁AL[Cxg monagui.KEY_PRESSED nh
nAȉ̂悤ɒ`ł܂i֐͂ȂłǂjB

	function onKeyPressed(keycode, modifiers) {
		print("key:" + keycode + " / modifiers:" + modifiers + "\n" );
	}

̂悤 Frame.setHandler() Ɋ֐nƂŁA
L[CxgnhEChEɓo^܂B

	local frame = Frame();				// EChEIuWFNg쐬
	frame.setBounds(10, 10, 120, 120);	// EChȆ傫ݒ
	frame.setHandler( monagui.KEY_PRESSED, this, onKeyPressed );
										// Cxgnho^
	frame.run();						// EChEs



Cxgnh̖߂l

Cxgnh͖߂lsvłA
KvȂ true  false ԂƂł܂B

false Ԃꍇ́AԂȂ̂ƓłB

true Ԃꍇ́ACxgSɏIƂӖ܂B
X[p[NX͂ȏセ̃Cxg܂B
Ⴆ΁Amonagui.PAINT Cxgɑ΂ănh true ԂƁA
monagui ͂̃R|[lg`悵ȂȂ܂B
̃CxgSɒuꍇ true ԂĂB



Cxg萔

monagui.PAINT
	F`v
	nhFfunction handler( g )
	Fg R|[lg֕`\ Graphics NXIuWFNg

monagui.KEY_PRESSED
	FL[ꂽ
	nhFfunction handler( keycode, modifiers, src )
	Fkeycode L[R[h
	Fmodifiers CL[
	Fsrc CxgR|[lg

monagui.KEY_RELEASED
	FL[ꂽ
	nhFfunction handler( keycode, modifiers, src )
	Fkeycode L[R[h
	Fmodifiers CL[
	Fsrc CxgR|[lg

monagui.MOUSE_PRESSED
	F}EX{^ꂽ
	nhFfunction handler( x, y, button, src )
	Fx wW
	Fy xW
	Fbutton {^imonagui.BUTTON_LEFT, monagui.BUTTON_RIGHT, monagui.BUTTON_MIDDLEj
	Fsrc CxgR|[lg

monagui.MOUSE_RELEASED
	F}EX{^ꂽ
	nhFfunction handler( x, y, button, src )
	Fx wW
	Fy xW
	Fbutton {^imonagui.BUTTON_LEFT, monagui.BUTTON_RIGHT, monagui.BUTTON_MIDDLEj
	Fsrc CxgR|[lg

monagui.MOUSE_DRAGGED
	FhbOꂽ
	nhFfunction handler( x, y, button, src )
	Fx wW
	Fy xW
	Fbutton {^imonagui.BUTTON_LEFT, monagui.BUTTON_RIGHT, monagui.BUTTON_MIDDLEj
	Fsrc CxgR|[lg

monagui.MOUSE_MOVED
	F}EX|C^ړ
	nhFfunction handler( x, y, src )
	Fx wW
	Fy xW
	Fsrc CxgR|[lg

monagui.FOCUS_IN
	FANeBuɂȂ
	nhFfunction handler(src)
	Fsrc CxgR|[lg

monagui.FOCUS_OUT
	FANeBuɂȂ
	nhFfunction handler(src)
	Fsrc CxgR|[lg

monagui.TIMER
	F^C}[CxgiFrame.setTimer() QƁj
	nhFfunction handler(src)
	Fsrc CxgR|[lg

monagui.TEXT_CHANGED
	FeLXgtB[h̃eLXgύXꂽ
	nhFfunction handler(src)
	Fsrc CxgR|[lg

monagui.ITEM_SELECTED
	FXgi̍ڂIꂽ
	nhFfunction handler(src)
	Fsrc CxgR|[lg

monagui.BLOCK_INCLEMENT
	F
	nhFfunction handler(src)
	Fsrc CxgR|[lg

monagui.BLOCK_DECLEMENT
	F
	nhFfunction handler(src)
	Fsrc CxgR|[lg

monagui.CUSTOM_EVENT
	FJX^Cxg
	nhFfunction handler(header, arg1, arg2, arg3, from, str, src)
	Fheader
	Farg1
	Farg2
	Farg3
	Ffrom
	Fstr
	Fsrc CxgR|[lg




}EX{^萔

	monagui.BUTTON_LEFT =	1
	monagui.BUTTON_RIGHT =	2
	monagui.BUTTON_MIDDLE =	3



J[萔

Frame.setColor() ̈ƂĎwł܂B

	monagui.black     = 0xff000000
	monagui.maroon    = 0xff800000
	monagui.green     = 0xff008000
	monagui.olive     = 0xff808000
	monagui.navy      = 0xff000080
	monagui.purple    = 0xff800080
	monagui.teal      = 0xff008080
	monagui.lightGray = 0xffC0C0C0
	monagui.gray      = 0xff808080
	monagui.red       = 0xffff0000
	monagui.lime      = 0xff00ff00
	monagui.yellow    = 0xffffff00
	monagui.blue      = 0xff0000ff
	monagui.magenta   = 0xffff00ff
	monagui.cyan      = 0xff00ffff
	monagui.white     = 0xffffffff



