Exemplo n.º 1
0
        /// <summary>
        /// Initializes the internal signals
        /// </summary>
        protected virtual void InitSignals()
        {
            PositionChangedCallback = new CallbackActionVector2f((pos) => SendSignal(myPositionChangedEventKey, new SignalArgsVector2f(pos)));
            AddInternalSignal(tguiWidget_connectVector2f(CPointer, Util.ConvertStringForC_ASCII("PositionChanged"), PositionChangedCallback));

            SizeChangedCallback = new CallbackActionVector2f((size) => SendSignal(mySizeChangedEventKey, new SignalArgsVector2f(size)));
            AddInternalSignal(tguiWidget_connectVector2f(CPointer, Util.ConvertStringForC_ASCII("SizeChanged"), SizeChangedCallback));

            MouseEnteredCallback = new CallbackAction(() => SendSignal(myMouseEnteredEventKey));
            AddInternalSignal(tguiWidget_connect(CPointer, Util.ConvertStringForC_ASCII("MouseEntered"), MouseEnteredCallback));

            MouseLeftCallback = new CallbackAction(() => SendSignal(myMouseLeftEventKey));
            AddInternalSignal(tguiWidget_connect(CPointer, Util.ConvertStringForC_ASCII("MouseLeft"), MouseLeftCallback));

            FocusedCallback = new CallbackAction(() => SendSignal(myFocusedEventKey));
            AddInternalSignal(tguiWidget_connect(CPointer, Util.ConvertStringForC_ASCII("Focused"), FocusedCallback));

            UnfocusedCallback = new CallbackAction(() => SendSignal(myUnfocusedEventKey));
            AddInternalSignal(tguiWidget_connect(CPointer, Util.ConvertStringForC_ASCII("Unfocused"), UnfocusedCallback));

            AnimationFinishedCallback = new CallbackActionAnimation((type, visible) => SendSignal(myAnimationFinishedEventKey, new SignalArgsAnimation(type, visible)));
            AddInternalSignal(tguiWidget_connectAnimation(CPointer, Util.ConvertStringForC_ASCII("AnimationFinished"), AnimationFinishedCallback));
        }
Exemplo n.º 2
0
 static extern protected uint tguiWidget_connectAnimation(IntPtr cPointer, IntPtr signalName, [MarshalAs(UnmanagedType.FunctionPtr)] CallbackActionAnimation func);