Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Gideros UIKit Plugin API — Gideros Forum

Gideros UIKit Plugin API

MagnusviriMagnusviri Member
edited March 2012 in Plugins
I'm not sure where to put this so I started a new discussion. In an attempt to understand the UIKit plugin and how plugins in general work I complied what appears to me to be the current API (of sorts). Maybe we can put something like this somewhere (wiki?) so that it is current and accurate.
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"
 
-- perhaps do this?
stage:addEventListener(Event.ENTER_FRAME, function(event)
		collectgarbage()
	end)
 
 
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)

Comments

Sign In or Register to comment.