<commit_before>package openfl.display;


import lime.ui.MouseCursor;
import openfl._internal.swf.SWFLite;
import openfl._internal.symbols.ButtonSymbol;
import openfl.display.DisplayObject;
import openfl.display.InteractiveObject;
import openfl.geom.Matrix;
import openfl.geom.Rectangle;
import openfl.events.MouseEvent;
import openfl.media.SoundTransform;
import openfl.Vector;

#if !openfl_debug
@:fileXml('tags="haxe,release"')
@:noDebug
#end

@:access(openfl._internal.symbols.SWFSymbol)
@:access(openfl.display.MovieClip)
@:access(openfl.geom.Matrix)
@:access(openfl.geom.Rectangle)


class SimpleButton extends InteractiveObject {
	
	
	private static var __initSWF:SWFLite;
	private static var __initSymbol:ButtonSymbol;
	
	public var downState (get, set):DisplayObject;
	public var enabled:Bool;
	public var hitTestState (get, set):DisplayObject;
	public var overState (get, set):DisplayObject;
	public var soundTransform (get, set):SoundTransform;
	public var trackAsMenu:Bool;
	public var upState (get, set):DisplayObject;
	public var useHandCursor:Bool;
	
	private var __currentState (default, set):DisplayObject;
	private var __downState:DisplayObject;
	private var __hitTestState:DisplayObject;
	private var __ignoreEvent:Bool;
	private var __overState:DisplayObject;
	private var __previousStates:Vector<DisplayObject>;
	private var __soundTransform:SoundTransform;
	private var __symbol:ButtonSymbol;
	private var __upState:DisplayObject;
	
	
	#if openfljs
	private static function __init__ () {
		
		untyped Object.defineProperties (SimpleButton.prototype, {
			"downState": { get: untyped __js__ ("function () { return this.get_downState (); }"), set: untyped __js__ ("function (v) { return this.set_downState (v); }") },
			"hitTestState": { get: untyped __js__ ("function () { return this.get_hitTestState (); }"), set: untyped __js__ ("function (v) { return this.set_hitTestState (v); }") },
			"overState": { get: untyped __js__ ("function () { return this.get_overState (); }"), set: untyped __js__ ("function (v) { return this.set_overState (v); }") },
			"soundTransform": { get: untyped __js__ ("function () { return this.get_soundTransform (); }"), set: untyped __js__ ("function (v) { return this.set_soundTransform (v); }") },
			"upState": { get: untyped __js__ ("function () { return this.get_upState (); }"), set: untyped __js__ ("function (v) { return this.set_upState (v); }") },
		});
		
	}
	#end
	
	
	public function new (upState:DisplayObject = null, overState:DisplayObject = null, downState:DisplayObject = null, hitTestState:DisplayObject = null) {
		
		super ();
		
		enabled = true;
		trackAsMenu = false;
		useHandCursor = true;
		
		__upState = (upState != null) ? upState : new DisplayObject ();
		__overState = overState;
		__downState = downState;
		__hitTestState = (hitTestState != null) ? hitTestState : new DisplayObject ();
		
		addEventListener (MouseEvent.MOUSE_DOWN, __this_onMouseDown);
		addEventListener (MouseEvent.MOUSE_OUT, __this_onMouseOut);
		addEventListener (MouseEvent.MOUSE_OVER, __this_onMouseOver);
		addEventListener (MouseEvent.MOUSE_UP, __this_onMouseUp);
		
		__tabEnabled = true;
		__currentState = __upState;
		
		if (__initSymbol != null) {
			
			var swf = __initSWF;
			__symbol = __initSymbol;
			
			__initSWF = null;
			__initSymbol = null;
			
			__fromSymbol (swf, __symbol);
			
		}
		
	}
	
	
	private function __fromSymbol (swf:SWFLite, symbol:ButtonSymbol):Void {
		
		__symbol = symbol;
		
		if (symbol.downState != null) {<commit_msg>Fix initial hit test state with Shape<commit_after>package openfl.display;


import lime.ui.MouseCursor;
import openfl._internal.swf.SWFLite;
import openfl._internal.symbols.ButtonSymbol;
import openfl.display.DisplayObject;
import openfl.display.InteractiveObject;
import openfl.geom.Matrix;
import openfl.geom.Rectangle;
import openfl.events.MouseEvent;
import openfl.media.SoundTransform;
import openfl.Vector;

#if !openfl_debug
@:fileXml('tags="haxe,release"')
@:noDebug
#end

@:access(openfl._internal.symbols.SWFSymbol)
@:access(openfl.display.MovieClip)
@:access(openfl.geom.Matrix)
@:access(openfl.geom.Rectangle)


class SimpleButton extends InteractiveObject {
	
	
	private static var __initSWF:SWFLite;
	private static var __initSymbol:ButtonSymbol;
	
	public var downState (get, set):DisplayObject;
	public var enabled:Bool;
	public var hitTestState (get, set):DisplayObject;
	public var overState (get, set):DisplayObject;
	public var soundTransform (get, set):SoundTransform;
	public var trackAsMenu:Bool;
	public var upState (get, set):DisplayObject;
	public var useHandCursor:Bool;
	
	private var __currentState (default, set):DisplayObject;
	private var __downState:DisplayObject;
	private var __hitTestState:DisplayObject;
	private var __ignoreEvent:Bool;
	private var __overState:DisplayObject;
	private var __previousStates:Vector<DisplayObject>;
	private var __soundTransform:SoundTransform;
	private var __symbol:ButtonSymbol;
	private var __upState:DisplayObject;
	
	
	#if openfljs
	private static function __init__ () {
		
		untyped Object.defineProperties (SimpleButton.prototype, {
			"downState": { get: untyped __js__ ("function () { return this.get_downState (); }"), set: untyped __js__ ("function (v) { return this.set_downState (v); }") },
			"hitTestState": { get: untyped __js__ ("function () { return this.get_hitTestState (); }"), set: untyped __js__ ("function (v) { return this.set_hitTestState (v); }") },
			"overState": { get: untyped __js__ ("function () { return this.get_overState (); }"), set: untyped __js__ ("function (v) { return this.set_overState (v); }") },
			"soundTransform": { get: untyped __js__ ("function () { return this.get_soundTransform (); }"), set: untyped __js__ ("function (v) { return this.set_soundTransform (v); }") },
			"upState": { get: untyped __js__ ("function () { return this.get_upState (); }"), set: untyped __js__ ("function (v) { return this.set_upState (v); }") },
		});
		
	}
	#end
	
	
	public function new (upState:DisplayObject = null, overState:DisplayObject = null, downState:DisplayObject = null, hitTestState:DisplayObject = null) {
		
		super ();
		
		enabled = true;
		trackAsMenu = false;
		useHandCursor = true;
		
		__upState = (upState != null) ? upState : new DisplayObject ();
		__overState = overState;
		__downState = downState;
		this.hitTestState = (hitTestState != null) ? hitTestState : new DisplayObject ();
		
		addEventListener (MouseEvent.MOUSE_DOWN, __this_onMouseDown);
		addEventListener (MouseEvent.MOUSE_OUT, __this_onMouseOut);
		addEventListener (MouseEvent.MOUSE_OVER, __this_onMouseOver);
		addEventListener (MouseEvent.MOUSE_UP, __this_onMouseUp);
		
		__tabEnabled = true;
		__currentState = __upState;
		
		if (__initSymbol != null) {
			
			var swf = __initSWF;
			__symbol = __initSymbol;
			
			__initSWF = null;
			__initSymbol = null;
			
			__fromSymbol (swf, __symbol);
			
		}
		
	}
	
	
	private function __fromSymbol (swf:SWFLite, symbol:ButtonSymbol):Void {
		
		__symbol = symbol;
		
		if (symbol.downState != null) {
{'fraction_non_alphanumeric': 0.11872081505589359, 'fraction_numerical': 0.0, 'mean_word_length': 5.210896309314587, 'pattern_counts': {'":': 10, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1061610', 'n_tokens_mistral': 2441, 'n_tokens_neox': 2239, 'n_words': 538}