コード例 #1
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);
        }
コード例 #2
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);
        }