コード例 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            View.BackgroundColor = UIColor.Black;

            UILabel title = new UILabel(new CGRect(
                                            (View.Frame.Width / 2) - 160,
                                            25,
                                            320,
                                            30)
                                        );

            title.Font          = UIFont.SystemFontOfSize(36.0f);
            title.TextAlignment = UITextAlignment.Center;
            title.TextColor     = UIColor.FromRGB(191, 222, 227);
            title.Text          = "About Graphic Foo";
            UITextView body = new UITextView(new CGRect(
                                                 50,
                                                 120,
                                                 View.Frame.Width - 100,
                                                 View.Frame.Height - 240)
                                             );

            title.Font = UIFont.FromName("Orange Kid", 40f);

            body.BackgroundColor   = UIColor.Black;
            body.TextColor         = UIColor.FromRGB(191, 222, 227);
            body.TextAlignment     = UITextAlignment.Center;
            body.Editable          = false;
            body.Layer.BorderWidth = 5f;
            body.Layer.BorderColor = new CGColor(191, 222, 227);
            body.Font = UIFont.FromName("Orange Kid", 28f);
            body.Text = " \n" +
                        "- Graphic Foo is an app which is intented for people that is just" +
                        " starting to discover the programming as an excellent tool" +
                        " to create and be creative nowadays, so Graphic Foo tries" +
                        " to be an easy and friendly interface to start" +
                        " developing those early skills \n\n" +
                        "- The creators of Graphic Foo wish you a really pleasant time" +
                        " using it hoping that you can become a great programmer and one" +
                        " day a leader in the programming world \n\n" +
                        " Enjoy it!";

            UIButton menuButton = ViewConstructorHelper.LoadMenuButton();

            menuButton.TouchUpInside += (sender, e) => {
                SidebarController.ToggleMenu();
            };

            View.Add(title);
            View.Add(body);
            View.Add(menuButton);
        }
コード例 #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            UILabel title = new UILabel(new CGRect(100, 50, 320, 30));

            title.Font          = UIFont.FromName("Orange Kid", 44f);
            title.TextAlignment = UITextAlignment.Center;
            title.TextColor     = UIColor.FromRGB(191, 222, 227);
            title.Text          = "Graphic Foo";

            programText       = new UITextView();
            programText.Frame = new CGRect(
                0,
                100,
                View.Frame.Size.Width,
                View.Frame.Size.Height - 300f
                );
            programText.TextColor          = UIColor.FromRGB(191, 222, 227);
            programText.BackgroundColor    = UIColor.Black;
            programText.Font               = UIFont.FromName("Orange Kid", 22f);
            programText.TintColor          = UIColor.FromRGB(191, 222, 227);
            programText.KeyboardAppearance = UIKeyboardAppearance.Dark;
            programText.Layer.BorderWidth  = 2.0f;
            programText.Layer.BorderColor  = new CGColor(191, 222, 227);

            UIButton menuButton = ViewConstructorHelper.LoadMenuButton();

            menuButton.TouchUpInside += (sender, e) => SidebarController.ToggleMenu();

            UIButton runButton = ViewConstructorHelper.CreatePlayButton();

            runButton.TouchUpInside += (sender, e) => SendToCompile();

            UIView consoleView = ViewConstructorHelper.CreateConsole(new CGRect(
                                                                         0,
                                                                         (float)View.Frame.Size.Height - 200f,
                                                                         (float)View.Frame.Size.Width,
                                                                         200f)
                                                                     );

            textOnConsole = ((UITextView)consoleView.Subviews.FirstOrDefault(v => v.Tag == 1));

            View.BackgroundColor = UIColor.Black;
            View.Add(runButton);
            View.Add(title);
            View.Add(programText);
            View.Add(menuButton);
            View.Add(consoleView);
        }
コード例 #3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Keyboard popup
            NSNotificationCenter.DefaultCenter.AddObserver
                (UIKeyboard.DidShowNotification, KeyBoardUpNotification);

            // Keyboard Down
            NSNotificationCenter.DefaultCenter.AddObserver
                (UIKeyboard.WillHideNotification, KeyBoardDownNotification);

            scrollViewOriginalWidth  = (float)View.Frame.Size.Width - 260f;
            scrollViewOriginalHeight = (float)View.Frame.Size.Height - 200f;
            scrollView = new UIScrollView();
            scrollView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight;
            scrollView.Frame            = new CGRect(
                260f,
                0f,
                scrollViewOriginalWidth,
                scrollViewOriginalHeight
                );
            scrollView.ContentSize = new CGSize(
                scrollViewOriginalWidth,
                scrollViewOriginalHeight
                );

            UILabel title = new UILabel(new CGRect(300, 20, 320, 30));

            title.Font          = UIFont.SystemFontOfSize(24.0f);
            title.TextAlignment = UITextAlignment.Center;
            title.Font          = UIFont.FromName("Orange Kid", 44f);
            title.TextColor     = UIColor.FromRGB(191, 222, 227);
            title.Text          = "Graphic Foo";

            UIButton runButton = ViewConstructorHelper.CreatePlayButton();

            runButton.TouchUpInside += (sender, e) => {
                SendToCompile();
            };

            UIButton menuButton = ViewConstructorHelper.LoadMenuButton();

            menuButton.TouchUpInside += (sender, e) => {
                SidebarController.ToggleMenu();
            };

            UIView blocksView = new UIView();

            blocksView.Frame = new RectangleF(
                0,
                0,
                260f,
                (float)View.Frame.Size.Height
                );

            consoleView = ViewConstructorHelper.CreateConsole(new CGRect(
                                                                  260f,
                                                                  (float)View.Frame.Size.Height - 200f,
                                                                  (float)View.Frame.Size.Width - 260f,
                                                                  200f)
                                                              );
            textOnConsole = ((UITextView)consoleView.Subviews.Where(v => v.Tag == 1).FirstOrDefault());

            // Line Layout
            lineLayout = new LineLayout {
                HeaderReferenceSize = new CGSize(260, 100),
                ScrollDirection     = UICollectionViewScrollDirection.Vertical
            };

            blocksCollectionViewController =
                new BlocksCollectionViewController(lineLayout);
            blocksCollectionViewController.SetParentController(this);

            blocksView.Add(blocksCollectionViewController.View);

            View.BackgroundColor = UIColor.Black;
            View.Add(blocksView);
            View.Add(scrollView);
            View.Add(consoleView);
            View.Add(title);
            View.Add(menuButton);
            View.Add(runButton);
        }
コード例 #4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            View.BackgroundColor = UIColor.Black;

            UILabel title = new UILabel(new CGRect(
                                            (View.Frame.Width / 2) - 160,
                                            25,
                                            320,
                                            30)
                                        );

            title.TextAlignment = UITextAlignment.Center;
            title.TextColor     = UIColor.FromRGB(191, 222, 227);
            title.Text          = "Instructions";
            title.Font          = UIFont.FromName("Orange Kid", 40f);

            UITextView body = new UITextView(new CGRect(
                                                 50,
                                                 120,
                                                 View.Frame.Width - 100,
                                                 View.Frame.Height - 240)
                                             );

            body.BackgroundColor   = UIColor.Black;
            body.TextColor         = UIColor.FromRGB(191, 222, 227);
            body.Font              = UIFont.SystemFontOfSize(24.0f);
            body.TextAlignment     = UITextAlignment.Center;
            body.Editable          = false;
            body.Layer.BorderWidth = 5f;
            body.Layer.BorderColor = new CGColor(191, 222, 227);
            body.Font              = UIFont.FromName("Orange Kid", 28f);
            body.Text              = " \n" +
                                     "- Start off by selecting a function block from your left" +
                                     " then to keep adding blocks just select the place to" +
                                     " add the new block and then what type of block you want to add" +
                                     " \n\n\n - If you want to remove a block just press on the" +
                                     " cross of which block you want to delete \n\n\n - " +
                                     " Once you're satisfied with your code your compile and run it," +
                                     " to do that, just click on the play button\n\n\n - The space" +
                                     " below your canvas is the Console, the place where you" +
                                     " see the output or errors, if any, of your program \n\n\n" +
                                     " - There are specific places to declare your variables," +
                                     " it can be either at the very top of the entire canvas, or" +
                                     " at the top of every function you create \n\n\n - To" +
                                     " get information and an explanation of each block, just " +
                                     " pressed for a couple of seconds the block you're " +
                                     " interested in, then the option of more info will " +
                                     " appear, click on it and you'll get more information about that" +
                                     " block and it's functionality \n\n\n" +
                                     " - The last function you create has to be the Main";

            UIButton menuButton = ViewConstructorHelper.LoadMenuButton();

            menuButton.TouchUpInside += (sender, e) => {
                SidebarController.ToggleMenu();
            };

            View.Add(title);
            View.Add(body);
            View.Add(menuButton);
        }