HomeForumSourceResearchGuide
Sign in to contribute to source. how it works
Type definition file ui.XYMouseObject by barry
expand copy to clipboardexpand
/*
{"description" : "This interface is implemented by graphical objects that want to be notified of detailed mouse events with x/y coordinates and a button type (see MouseButtons)."}
*/

uses MouseButtons
uses Cursor

data CursorSetEvent {
	byte type
	Cursor cursor
}

interface XYMouseObject extends ClickableObject {

	/* {"@description" : "This windowing event is intended for the windowing system only, and is fired when the object requests a specific cursor to be used."} */
	event setCursor(CursorSetEvent cse)

	/* {"@description" : "This function is called by the windowing system when a mouse button is pressed down over this object."} */
	void mouseDown(int x, int y, int button){}
	/* {"@description" : "This function is called by the windowing system when a mouse button is released over this object."} */
	void mouseUp(int x, int y, int button){}
	/* {"@description" : "This function is called by the windowing system when the mouse pointer is moved over this object."} */
	void mouseMove(int x, int y){}
	
	/* {"@description" : "This function is called by the windowing system when a file is dropped onto this object."} */
	void dropFile(int x, int y, char path[]){}
	
	/* {"@description" : "This function is called by the windowing system when the mouse pointer enters the bounding box of this object."} */
	CursorSetEvent mouseOver(int x, int y){return new CursorSetEvent()}
	/* {"@description" : "This function is called by the windowing system when the mouse pointer exits the bounding box of this object."} */
	void mouseOut(){}
	/* {"@description" : "This function is called by the windowing system when the mouse wheel is moved, and indicates how much movement is suggested by the mouse wheel input in left, right, up, and down directions."} */
	void mouseWheel(int xAdd, int xSub, int yAdd, int ySub){}
	}
Revision history
To propose a new revision to this entity, use dana source put -ut your/new/version.dn -n ui.XYMouseObject -m "reason for update" -u yourUsername
Version 1 (this version) by barry
Notes for this version: Standard Library Initialisation