Git Product home page Git Product logo

mhuikit's Introduction

***** UIKit for Gideros Studio ****
**********************************

The original work for this was done by Michael Hartlef. For the original code and license see this thread in the Gideros Forum:

http://www.giderosmobile.com/forum/discussion/578/uikit-plugin-example

UIKit for Gideros Studio is a plugin for iOS that allows usage of UIView, UIButton, UITextField, UIAlertView, UIWebView, UIScrollView, UILabel, UISwitch, UISlider, UIToolbar, UIPickerView.

Events are dispatched to Gideros Studio.

Known issues:

1. Not all methods and properties are implemented.


Gideros UIKit Plugin API

To use the plugin:

Copy uikit.mm to Xcode project "plugins" directory and then add to Xcode project.

In lua file:

require "ui"

Lua API

int hideStatusBar(bool show)
int addToRootView(view v)
int removeFromRootView(view v)
NSArray luaTableToArray(table t)

View : GEventDispatcherProxy
	new()
	void addView(view childView)
	void removeFromParent()
	void setPosition(int x, int y)
	void setSize(int width, int height)

Button : View
	new()
	void setTitle(string title)
	void setTitleColor(float r, float g, float b)
	void setBGColor(float r, float g, float b)
	void setFont(string fontname, float s)
	void setImage(string imagefile)
	void setBGImage(string imagefile)

	Generated event: "onButtonClick"

Label : View
	new()	
	void setText(string text)
	void setTextColor(float r, float g, float b)
	void setBGColor(float r, float g, float b)
	void setFont(string fontname, float s)

AlertView : GEventDispatcherProxy
	new(string title, string message, string button)
	void show()
	void addButton(string title)

	Generated event: "complete"

Switch : View
	new()	
	void setState(bool state)
	bool getState()

	Generated event: "onSwitchClick"

Slider : View
	new(float min, float max)	
	void setValue(float value)
	int getValue()
	void setThumbImage(string imagefile)

	Generated event: "onSliderChange"

TextField2 : View
	void create(string text)
	void setText(string text)
	string getText()	
	void setTextColor(float r, float g, float b)
	void setBGColor(float r, float g, float b)
	void showKeyboard()

	Generated events: "onTextFieldEdit", "onTextFieldReturn"

WebView : View
	new(string url)
	void loadLocalFile(string filename)

	Generated events: "onWebViewNavigation"

PickerView : View
	new(table items)
	virtual int getRowCount()	
	virtual void setRow(int row)	
	virtual int getPickedRow()	
	virtual string getPickedItem()	

	Generated event: "onPickerRows"

Toolbar : View
	new()	
	void addButton()
	void addTextButton(string caption)
	void add(view xview)
	//void setValue(float value)
	//void setThumbImage(string imagefile)

	Generated event: "onToolbarClick"

ScrollView : View
	new(float x, float y, float w, float h, float cw, float ch)	
	void add(view v)

	Generated event: onScrollViewClick

TableView : View
	new()
	void setData(NSArray data) -- use luaTableToArray()
	void setCellText(string text)
	setPosition(x, y)
	setSize(width, height)

	Generated events: "cellForRowAtIndexPath", "didSelectRowAtIndexPath"
	event table includes the additional field: "Row" (event.Row)

mhuikit's People

Contributors

mikehart66 avatar

Watchers

James Cloos avatar Can Candan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.