Exemplo n.º 1
0
        public PageGraphicRecog(MainWindow _mainWindow)
        {
            InitializeComponent();
            mMainWindow = _mainWindow;

            itemFileAddr     = FEITStandard.BASE_FOLDER + TEST_FOLDER + "items.csv";
            learningFileAddr = FEITStandard.BASE_FOLDER + TEST_FOLDER + "instruct.csv";

            mLearnList  = GRFormReader.GetList(learningFileAddr, GRFormReader.SCRIPT_TYPE.LEARNING);
            mDoList     = GRFormReader.GetList(itemFileAddr, GRFormReader.SCRIPT_TYPE.TEST);
            mUserAnswer = new List <String>();

            mLayout = new LayoutGFR(this);

            mImageGroup =
                new UIImageGroup(saveUserSelection, Next);

            mLearnImage1 = new CompImage(0);
            mLearnImage2 = new CompImage(0);
            mTargetImage = new CompImage(0);

            mTimer = new FEITTimer();

            mDoubleArrow        = new Image();
            mDoubleArrow.Width  = 90;
            mDoubleArrow.Height = 31;
            System.Drawing.Bitmap bmp = FiveElementsIntTest.Properties.Resources.DOUBLE_ARROW;
            mDoubleArrow.Source = BitmapSourceFactory.GetBitmapSource(bmp, out mIntPtr);

            if (!mMainWindow.mDB.TableExists(Names.GRAPH_ASSO_TABLENAME))
            {
                mMainWindow.mDB.CreateGraphAssoTable(GRFormReader.TOTAL_ITEM);
            }
        }
Exemplo n.º 2
0
        protected override async Task LoadContent()
        {
            await base.LoadContent();

            uiImages = Asset.Load<UIImageGroup>("UIImages");

            var lifeBar = new ImageElement { Source = uiImages["Logo"], HorizontalAlignment = HorizontalAlignment.Center };
            lifeBar.DependencyProperties.Set(GridBase.ColumnSpanPropertyKey, 3);

            var quitGameButton = new Button
                {
                    Content = new TextBlock { Text = "Quit Game", Font = Asset.Load<SpriteFont>("MicrosoftSansSerif15") },
                    VerticalAlignment = VerticalAlignment.Bottom,
                    HorizontalAlignment = HorizontalAlignment.Left,
                    Padding = Thickness.UniformRectangle(10),
                };
            quitGameButton.DependencyProperties.Set(GridBase.ColumnPropertyKey, 0);
            quitGameButton.DependencyProperties.Set(GridBase.RowPropertyKey, 2);
            quitGameButton.Click += (sender, args) => Exit();

            modalButton1Text = new TextBlock { Text = "Close Modal window 1", Font = Asset.Load<SpriteFont>("MicrosoftSansSerif15") };
            var modalButton1 = new Button
            {
                Name = "Button Modal 1",
                Content = modalButton1Text,
                VerticalAlignment = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                Padding = Thickness.UniformRectangle(10),
            };
            modalButton1.Click += ModalButton1OnClick;
            modal1 = new ModalElement { Content = modalButton1, Name = "Modal 1"};
            modal1.DependencyProperties.Set(Panel.ZIndexPropertyKey, 1);
            modal1.DependencyProperties.Set(GridBase.ColumnPropertyKey, 1);
            modal1.DependencyProperties.Set(GridBase.RowPropertyKey, 1);
            modal1.OutsideClick += Modal1OnOutsideClick;

            modalButton2Text = new TextBlock { Text = "Close Modal window 2", Font = Asset.Load<SpriteFont>("MicrosoftSansSerif15") };
            var modalButton2 = new Button
            {
                Name = "Button Modal 2",
                Content = modalButton2Text,
                VerticalAlignment = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                Padding = Thickness.UniformRectangle(10),
            };
            modalButton2.Click += ModalButton2OnClick;
            modal2 = new ModalElement { Content = modalButton2, Name = "Modal 2" };
            modal2.DependencyProperties.Set(Panel.ZIndexPropertyKey, 2);
            modal2.DependencyProperties.Set(GridBase.ColumnPropertyKey, 1);
            modal2.DependencyProperties.Set(GridBase.RowPropertyKey, 2);
            modal2.OutsideClick += Modal2OnOutsideClick;

            uniformGrid = new UniformGrid { Columns = 3, Rows = 3 };
            uniformGrid.Children.Add(modal1);
            uniformGrid.Children.Add(modal2);
            uniformGrid.Children.Add(lifeBar);
            uniformGrid.Children.Add(quitGameButton);
            
            UIComponent.RootElement = uniformGrid;
        }
Exemplo n.º 3
0
        protected override async Task LoadContent()
        {
            await base.LoadContent();

            sliderImages = Asset.Load<UIImageGroup>("DebugSlider");

            slider = new Slider { TrackStartingOffsets = new Vector2(10, 6), TickOffset = 10 };
            SetSliderImages(isRotatedImages);

            grid = new UniformGrid { Children = { slider } };

            UIComponent.RootElement = grid;
        }
Exemplo n.º 4
0
        protected override async Task LoadContent()
        {
            await base.LoadContent();

            sliderImages = Asset.Load <UIImageGroup>("DebugSlider");

            slider = new Slider {
                TrackStartingOffsets = new Vector2(10, 6), TickOffset = 10
            };
            SetSliderImages(isRotatedImages);

            grid = new UniformGrid {
                Children = { slider }
            };

            UI.RootElement = grid;
        }
Exemplo n.º 5
0
        protected override async Task LoadContent()
        {
            await base.LoadContent();

            uiImages = Asset.Load <UIImageGroup>("UIImages");

            var lifeBar = new ImageElement {
                Source = uiImages["Logo"], HorizontalAlignment = HorizontalAlignment.Center
            };

            lifeBar.DependencyProperties.Set(GridBase.ColumnSpanPropertyKey, 3);

            var quitGameButton = new Button
            {
                Content = new TextBlock {
                    Text = "Quit Game", Font = Asset.Load <SpriteFont>("MicrosoftSansSerif15")
                },
                VerticalAlignment   = VerticalAlignment.Bottom,
                HorizontalAlignment = HorizontalAlignment.Left,
                Padding             = Thickness.UniformRectangle(10),
            };

            quitGameButton.DependencyProperties.Set(GridBase.ColumnPropertyKey, 0);
            quitGameButton.DependencyProperties.Set(GridBase.RowPropertyKey, 2);
            quitGameButton.Click += (sender, args) => Exit();

            modalButton1Text = new TextBlock {
                Text = "Close Modal window 1", Font = Asset.Load <SpriteFont>("MicrosoftSansSerif15")
            };
            var modalButton1 = new Button
            {
                Name                = "Button Modal 1",
                Content             = modalButton1Text,
                VerticalAlignment   = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                Padding             = Thickness.UniformRectangle(10),
            };

            modalButton1.Click += ModalButton1OnClick;
            modal1              = new ModalElement {
                Content = modalButton1, Name = "Modal 1"
            };
            modal1.DependencyProperties.Set(Panel.ZIndexPropertyKey, 1);
            modal1.DependencyProperties.Set(GridBase.ColumnPropertyKey, 1);
            modal1.DependencyProperties.Set(GridBase.RowPropertyKey, 1);
            modal1.OutsideClick += Modal1OnOutsideClick;

            modalButton2Text = new TextBlock {
                Text = "Close Modal window 2", Font = Asset.Load <SpriteFont>("MicrosoftSansSerif15")
            };
            var modalButton2 = new Button
            {
                Name                = "Button Modal 2",
                Content             = modalButton2Text,
                VerticalAlignment   = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                Padding             = Thickness.UniformRectangle(10),
            };

            modalButton2.Click += ModalButton2OnClick;
            modal2              = new ModalElement {
                Content = modalButton2, Name = "Modal 2"
            };
            modal2.DependencyProperties.Set(Panel.ZIndexPropertyKey, 2);
            modal2.DependencyProperties.Set(GridBase.ColumnPropertyKey, 1);
            modal2.DependencyProperties.Set(GridBase.RowPropertyKey, 2);
            modal2.OutsideClick += Modal2OnOutsideClick;

            uniformGrid = new UniformGrid {
                Columns = 3, Rows = 3
            };
            uniformGrid.Children.Add(modal1);
            uniformGrid.Children.Add(modal2);
            uniformGrid.Children.Add(lifeBar);
            uniformGrid.Children.Add(quitGameButton);


            UI.RootElement = uniformGrid;
        }