Exemplo n.º 1
0
        private void SendScreenSizeChangedEvent()
        {
            Memory    eventData = new Memory(4);
            const int MAWidgetEventData_eventType = 0;

            eventData.WriteInt32(MAWidgetEventData_eventType, MoSync.Constants.EVENT_TYPE_SCREEN_CHANGED);

            machine.GetRuntime().PostEvent(new Event(eventData));
        }
Exemplo n.º 2
0
        /**
         * The BackKeyPress event handler.
         * Currently it contains the functionality for the back event when a StackScreen is a child of a TabScreen.
         * When this handler does not cover the functionality required it should be updated.
         * @param from Object the object that triggers the event.
         * @param args System.ComponentModel.CancelEventArgs the event arguments.
         */
        public void BackKeyPressHandler(object from, System.ComponentModel.CancelEventArgs args)
        {
            NativeUIModule nativeUIModule = machine.GetRuntime().GetModule <NativeUIModule>();

            //EVENT_TYPE_KEY_RELEASED event data
            Memory    eventData                     = new Memory(8);
            const int MAEventData_eventType         = 0;
            const int MAEventData_backButtonKeyCode = 4;

            eventData.WriteInt32(MAEventData_eventType, MoSync.Constants.EVENT_TYPE_KEY_PRESSED);
            eventData.WriteInt32(MAEventData_backButtonKeyCode, MoSync.Constants.MAK_BACK);
            //Posting a CustomEvent
            machine.GetRuntime().PostEvent(new Event(eventData));

            args.Cancel = nativeUIModule.HandleBackButtonPressed();
        }
Exemplo n.º 3
0
        private void Application_Launching(object sender, LaunchingEventArgs e)
        {
            //RootFrame.Navigated += delegate(object _sender, NavigationEventArgs _e)
            RootFrame.Loaded += delegate(object _sender, RoutedEventArgs _e)
            {
                if (machine == null)
                {
#if !REBUILD
                    machine = MoSync.Machine.CreateInterpretedMachine("program", "resources");
#else
                    machine = MoSync.Machine.CreateNativeMachine(new CoreNativeProgram(), "resources");
#endif
                    InitExtensions(machine.GetCore(), machine.GetRuntime());
                    machine.Run();
                }
            };
        }
Exemplo n.º 4
0
        private void Application_Launching(object sender, LaunchingEventArgs e)
        {
            //RootFrame.Navigated += delegate(object _sender, NavigationEventArgs _e)
            RootFrame.Loaded += delegate(object _sender, RoutedEventArgs _e)
            {
                if (machine == null)
                {
#if REBUILD
                    machine = MoSync.Machine.CreateNativeMachine(new CoreNativeProgram(), "resources");
                    machine.Run();
#elif LIB
                    machine = MoSync.Machine.CreateMachineLib("resources");
                    MoSync.Machine.runMain();
#else
                    machine = MoSync.Machine.CreateInterpretedMachine("program", "resources");
                    machine.Run();
#endif
                    InitExtensions(machine.GetCore(), machine.GetRuntime());
                }
            };

            RootFrame.BackKeyPress += new EventHandler <System.ComponentModel.CancelEventArgs>(BackKeyPressHandler);
        }
Exemplo n.º 5
0
        private void Application_Launching(object sender, LaunchingEventArgs e)
        {
            //RootFrame.Navigated += delegate(object _sender, NavigationEventArgs _e)
            RootFrame.Loaded += delegate(object _sender, RoutedEventArgs _e)
            {
                if (machine == null)
                {
            #if !REBUILD
                    machine = MoSync.Machine.CreateInterpretedMachine("program", "resources");

            #else
                    machine = MoSync.Machine.CreateNativeMachine(new CoreNativeProgram(), "resources");
            #endif
                    InitExtensions(machine.GetCore(), machine.GetRuntime());
                    machine.Run();
                }
            };

            RootFrame.BackKeyPress += new EventHandler<System.ComponentModel.CancelEventArgs>(BackKeyPressHandler);
        }