xamarin / urho

Code to integrate with the Urho3D engine
Other
463 stars 122 forks source link

SubscribeToClick? #148

Open Zamir7 opened 8 years ago

Zamir7 commented 8 years ago

I don't find how Subscribe To mouse Click on UiElement (ex.Window). there is SubscribeToDragBegin, but without "SubscribeToClick"

EgorBo commented 8 years ago

@Zamir7 this.UI.SubscribeToUIMouseClick

1vanK commented 8 years ago

https://github.com/urho3d/Urho3D/commit/8e8ee798a77c9376e679374e82a927870c8d4405

new event E_CLICK for UIElements

Zamir7 commented 8 years ago
class row : Window { 
    internal int ID;
    public row(UIElement into) {
        into.AddChild(this);
        SetStyleAuto(null);
    }

    public override void OnDoubleClick(IntVector2 position, IntVector2 screenPosition, int button, int buttons, int qualifiers, Cursor cursor) {
        base.OnDoubleClick(position, screenPosition, button, buttons, qualifiers, cursor);
        new msg("dblclk", "aaa");
    }
    public override void OnWheel(int delta, int buttons, int qualifiers) {
        base.OnWheel(delta, buttons, qualifiers);
        new msg(delta.ToString(), "aaa");
    }
    public override void OnClickBegin(IntVector2 position, IntVector2 screenPosition, int button, int buttons, int qualifiers, Cursor cursor) {
        base.OnClickBegin(position, screenPosition, button, buttons, qualifiers, cursor);
        new msg(position.X.ToString(), "aaa");
    }
}

don't work too, maybe i do any wrong?