public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			webView = new UIWebView (new RectangleF(0, (_addCancelButton) ? navigationBarHeight : 0, View.Frame.Width, (_addCancelButton) ? View.Frame.Height - navigationBarHeight : View.Frame.Height));
			webView.Delegate = new WebViewDelegate(RequestStarted, RequestFinished);

			if (!_addCancelButton) {
				this.View.AddSubview (webView);
			} else {
				var cancelButton = new UIBarButtonItem (UIBarButtonSystemItem.Cancel);
				cancelButton.Clicked += (object sender, EventArgs e) => {
					_cancelled();
					this.DismissViewController(true, null);
				};

				var navigationItem = new UINavigationItem {
					LeftBarButtonItem = cancelButton
				};

				navigationBar = new UINavigationBar (new RectangleF (0, 0, View.Frame.Width, navigationBarHeight));
				navigationBar.PushNavigationItem (navigationItem, false);

				this.View.AddSubviews (navigationBar, webView);
			}
		}
Ejemplo n.º 2
0
        public NotePanel(UIViewController parentVC, Book book, CGRect frame) : base(frame)
        {
            this.BackgroundColor = eBriefingAppearance.Gray5;
            this.parentVC        = parentVC;
            this.book            = book;

            this.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleHeight;

            // navBar
            UINavigationBar navBar = new UINavigationBar();

            navBar.Frame = new CGRect(0, 0, this.Frame.Width, 44);
            this.AddSubview(navBar);

            // closeButton
            UIBarButtonItem closeButton = new UIBarButtonItem("Close", UIBarButtonItemStyle.Plain, HandleCloseTouchUpInside);

            closeButton.TintColor = eBriefingAppearance.BlueColor;

            UINavigationItem item = new UINavigationItem();

            item.RightBarButtonItem = closeButton;
            item.Title = "Notes";
            navBar.PushNavigationItem(item, false);

            UIStringAttributes stringAttributes = new UIStringAttributes();

            stringAttributes.StrokeColor = eBriefingAppearance.Gray3;
            stringAttributes.Font        = eBriefingAppearance.ThemeRegularFont(17f);
            navBar.TitleTextAttributes   = stringAttributes;
        }
Ejemplo n.º 3
0
        Composer()
            : base(null, null)
        {
            // Navigation Bar
            navigationBar = new UINavigationBar (new RectangleF (0, 0, 320, 44));
            navItem = new UINavigationItem ("");
            var close = new UIBarButtonItem ("Close", UIBarButtonItemStyle.Plain, CloseComposer);
            navItem.LeftBarButtonItem = close;
            sendItem = new UIBarButtonItem ("Send", UIBarButtonItemStyle.Plain, PostCallback);
            navItem.RightBarButtonItem = sendItem;

            navigationBar.PushNavigationItem (navItem, false);

            // Composer
            composerView = new ComposerView (ComputeComposerSize (RectangleF.Empty), this);
            composerView.LookupUserRequested += delegate {
                PresentModalViewController (new UserSelector (userName => {
                    composerView.Text += ("@" + userName + " ");
                }), true);
            };

            // Add the views
            NSNotificationCenter.DefaultCenter.AddObserver ("UIKeyboardWillShowNotification", KeyboardWillShow);

            View.AddSubview (composerView);
            View.AddSubview (navigationBar);
        }
Ejemplo n.º 4
0
        Composer() : base(null, null)
        {
            // Navigation Bar
            navigationBar = new UINavigationBar(new RectangleF(0, 0, 320, 44));
            navItem       = new UINavigationItem("");
            var close = new UIBarButtonItem(Locale.GetText("Close"), UIBarButtonItemStyle.Plain, CloseComposer);

            navItem.LeftBarButtonItem = close;
            sendItem = new UIBarButtonItem(Locale.GetText("Send"), UIBarButtonItemStyle.Plain, PostCallback);
            navItem.RightBarButtonItem = sendItem;

            navigationBar.PushNavigationItem(navItem, false);

            // Composer
            composerView = new ComposerView(ComputeComposerSize(RectangleF.Empty), this, CameraTapped);
            composerView.LookupUserRequested += delegate {
                PresentModalViewController(new UserSelector(userName => {
                    composerView.Text += ("@" + userName + " ");
                }), true);
            };

            // Add the views
            NSNotificationCenter.DefaultCenter.AddObserver("UIKeyboardWillShowNotification", KeyboardWillShow);

            View.AddSubview(composerView);
            View.AddSubview(navigationBar);
        }
Ejemplo n.º 5
0
        public Composer() : base(null, null)
        {
            Title = "New Comment";

            // Navigation Bar
            _navigationBar = new UINavigationBar(new RectangleF(0, 0, UIScreen.MainScreen.Bounds.Width, 44))
            {
                AutoresizingMask = UIViewAutoresizing.FlexibleWidth, AutosizesSubviews = true
            };
            _navItem = new UINavigationItem("");
            var close = new UIBarButtonItem(NavigationButton.Create(Images.Buttons.Cancel, CloseComposer));

            _navItem.LeftBarButtonItem = close;
            SendItem = new UIBarButtonItem(NavigationButton.Create(Images.Buttons.Save, PostCallback));
            _navItem.RightBarButtonItem = SendItem;

            _navigationBar.PushNavigationItem(_navItem, false);

            // Composer
            _composerView = new ComposerView(ComputeComposerSize(RectangleF.Empty), this);

            // Add the views
            View.AddSubview(_composerView);
            View.AddSubview(_navigationBar);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            // no XIB !
            navBar = new UINavigationBar();
            navBar.PushNavigationItem (new UINavigationItem("Choose Location"), false);
            navBar.BarStyle = UIBarStyle.Black;
            navBar.Frame = new RectangleF(0,0,this.View.Frame.Width,45);
            navBar.TopItem.RightBarButtonItem = new UIBarButtonItem("Done",UIBarButtonItemStyle.Bordered, delegate {FlipController.Flip();});
            tableView = new UITableView()
            {
                Delegate = new TableViewDelegate(this, _locations),
                DataSource = new TableViewDataSource(this, _locations),
                AutoresizingMask = UIViewAutoresizing.FlexibleHeight|
                                   UIViewAutoresizing.FlexibleWidth,
                Frame = new RectangleF (0, 45, this.View.Frame.Width, this.View.Frame.Height-44)
                , TableHeaderView = navBar,
                BackgroundColor = UIColor.Black,
            };

            //quick hack to make cell text white
            foreach (var item in tableView.VisibleCells) {
                item.TextLabel.TextColor = UIColor.White;
            }

            // Set the table view to fit the width of the app.
            tableView.SizeToFit();

            // Reposition and resize the receiver
            tableView.Frame = new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height);

            // Add the table view as a subview
            this.View.AddSubview(tableView);
        }
Ejemplo n.º 7
0
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			NavBar=new UINavigationBar(new CoreGraphics.CGRect (0, 0, pview.uvWidth, 44));
			NavBar.BackgroundColor = UIColor.Red;
//			UIBarButtonItem bbitemCancel = new UIBarButtonItem (UIBarButtonSystemItem.Cancel, CancelButtonClicked);
			UIButton btnCancel = new UIButton (new CGRect (0, 0, 80, 30));
			btnCancel.SetTitleColor (UIColor.Blue, UIControlState.Normal);
			btnCancel.SetTitle ("Cancel", UIControlState.Normal);
			btnCancel.TouchUpInside += (object sender, EventArgs e) => {
				pview.popover.Dismiss(false);
			};
			UIBarButtonItem bbitemCancel = new UIBarButtonItem (btnCancel);

//			UIBarButtonItem bbitemDone = new UIBarButtonItem (UIBarButtonSystemItem.Done, DoneButtonClicked);
			UIButton btnDone = new UIButton (new CGRect (0, 0, 80, 30));
			btnDone.SetTitleColor (UIColor.Blue, UIControlState.Normal);
			btnDone.SetTitle ("Done", UIControlState.Normal);
			btnDone.TouchUpInside += (object sender, EventArgs e) => {
				pview.DismissPopOver ();
			};
			UIBarButtonItem bbitemDone = new UIBarButtonItem (btnDone);

			UINavigationItem navgitem = new UINavigationItem ("Select");
			navgitem.SetLeftBarButtonItem(bbitemCancel,true);
			navgitem.SetRightBarButtonItem (bbitemDone, true);
			NavBar.PushNavigationItem(navgitem,true);
			this.View.Add (NavBar);
			searchBar=new UISearchBar(new CoreGraphics.CGRect (0, 44, pview.uvWidth, 44));
			this.View.Add(searchBar);
			rvc = new RootViewController (RootData,pview);
			rvc.View.Frame = new CoreGraphics.CGRect (0, 88, pview.uvWidth, 600);
			this.subview.SetRootview(rvc);
			this.View.Add (rvc.View);
		}
 public override void ViewDidLoad()
 {
     base.ViewDidLoad();
     navBar = new UINavigationBar();
     navBar.PushNavigationItem(new UINavigationItem("Choose Location"), false);
     navBar.BarStyle = UIBarStyle.Black;
     navBar.Frame    = new RectangleF(0, 0, this.View.Frame.Width, 45);
     navBar.TopItem.RightBarButtonItem = new UIBarButtonItem("Done", UIBarButtonItemStyle.Bordered, delegate { FlipController.Flip(); });
     tableView.TableHeaderView         = navBar;
     tableView.Source = new TableViewSource(this, locations);
 }
 public override void ViewDidLoad()
 {
     base.ViewDidLoad ();
     navBar = new UINavigationBar();
     navBar.PushNavigationItem (new UINavigationItem("Choose Location"), false);
     navBar.BarStyle = UIBarStyle.Black;
     navBar.Frame = new RectangleF(0,0,this.View.Frame.Width,45);
     navBar.TopItem.RightBarButtonItem = new UIBarButtonItem("Done",UIBarButtonItemStyle.Bordered, delegate {FlipController.Flip();});
     tableView.TableHeaderView = navBar;
     tableView.Source = new TableViewSource(this, locations);
 }
        private void InitializeControls()
        {
            this.View.BackgroundColor = UIColor.FromPatternImage(UIImage.FromBundle("Assets/Backgrounds/background_portrait.png"));
            this.View.Frame           = new CGRect(0, 0, FRAME_WIDTH, FRAME_HEIGHT);

            // navBar
            UIImage navImage = UIImage.FromBundle("Assets/Backgrounds/topBar.png").CreateResizableImage(new UIEdgeInsets(0, 22, 0, 22));

            navBar = new UINavigationBar(new CGRect(0, 0, this.View.Frame.Width, 44));
            navBar.TitleTextAttributes = new UIStringAttributes()
            {
                ForegroundColor = UIColor.White
            };
            navBar.TintColor = UIColor.White;
            navBar.SetBackgroundImage(navImage, UIBarMetrics.Default);
            this.View.AddSubview(navBar);

            // doneButton
            UINavigationItem item = new UINavigationItem();

            item.Title = "Privacy Policy";
            item.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Done, HandleCloseButtonTouchUpInside);
            navBar.PushNavigationItem(item, false);

            // scrollView
            scrollView = new UIScrollView(new CGRect(0, navBar.Frame.Bottom, this.View.Frame.Width, this.View.Frame.Height - 44));
            scrollView.BackgroundColor = UIColor.Clear;
            this.View.AddSubview(scrollView);

            // webView
            webView        = new UIWebView(new CGRect(15, 15, scrollView.Frame.Width - 30, scrollView.Frame.Height - 30));
            webView.Alpha  = 0f;
            webView.Opaque = false;

            CustomWebViewDelegate customDelegate = new CustomWebViewDelegate();

            customDelegate.LoadFinishedEvent += HandleLoadFinishedEvent;
            webView.Delegate        = customDelegate;
            webView.BackgroundColor = UIColor.Clear;

            foreach (var sv in webView.Subviews)
            {
                if (sv is UIScrollView)
                {
                    ((UIScrollView)sv).Bounces = false;
                }
            }
            scrollView.AddSubview(webView);
        }
        public IPhoneUIViewController(string title, string backButtonText)
        {
            contentView                  = new UIView();
            contentView.Frame            = new RectangleF(new PointF(0, 0), new SizeF(this.View.Frame.Size.Width, this.View.Frame.Size.Height));
            contentView.BackgroundColor  = UIColor.White;
            contentView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;

            UIBarButtonItem backButton = new UIBarButtonItem();

            backButton.Title    = backButtonText;
            backButton.Style    = UIBarButtonItemStyle.Bordered;
            backButton.Clicked += delegate(object sender, EventArgs e) {
                UIApplication.SharedApplication.InvokeOnMainThread(delegate {
                    UIView[] subviews = this.View.Subviews;
                    foreach (UIView subview in subviews)
                    {
                        if (subview.GetType() == typeof(UIWebView))
                        {
                            UIWebView webView = (UIWebView)subview;
                            //clean webview by loading a blank page (prevent video players keep playing after view controller closes)
                            webView.LoadHtmlString("<html></html>", new NSUrl("/"));
                        }
                    }
                    IPhoneServiceLocator.CurrentDelegate.MainUIViewController().DismissModalViewControllerAnimated(true);
                });
            };

            UINavigationItem navItem = new UINavigationItem(title);

            navItem.LeftBarButtonItem = backButton;

            UINavigationBar toolBar = new UINavigationBar();

            toolBar.Frame = new RectangleF(new PointF(0, 0), new SizeF(this.View.Frame.Size.Width, this.GetNavigationBarHeight()));
            toolBar.PushNavigationItem(navItem, false);
            toolBar.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;
            contentView.AddSubview(toolBar);

            this.View = contentView;

            this.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
            this.ModalTransitionStyle   = UIModalTransitionStyle.CoverVertical;
            this.ModalInPopover         = true;
        }
        /// <summary>
        /// Construct the UI
        /// </summary>
        public override void LoadView()
        {
            UIWindow   appWindow      = UIApplication.SharedApplication.Delegate.Window;
            float      titlebarHeight = 45F;
            float      appHeight      = appWindow.Frame.Size.Height;
            float      appWidth       = appWindow.Frame.Size.Width;
            RectangleF frame          = new RectangleF(0F, 0F, appWidth, appHeight);

            topView = new UIView(frame);
            topView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;
            RectangleF barFrame = new RectangleF(0F, 0F, appWidth, titlebarHeight);

            titleBar                  = new UINavigationBar(barFrame);
            titleBar.BarStyle         = UIBarStyle.Black;
            titleBar.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;

            RectangleF webviewFrame = new RectangleF(0F, titlebarHeight, appWidth, appHeight - titleBar.Frame.Size.Height);

            webView = new UIWebView(webviewFrame);
            webView.ScalesPageToFit = true;

            RectangleF activityFrame = new RectangleF(appWidth / 2 - 12.5f, appHeight / 2 - 12.5f, 25F, 25F);

            activityView = new UIActivityIndicatorView(activityFrame);
            activityView.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.Gray;
            activityView.SizeToFit();
            activityView.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin | UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleBottomMargin;

            topView.AddSubview(titleBar);
            topView.AddSubview(activityView);
            topView.AddSubview(webView);

            UINavigationItem titleBarItem = new UINavigationItem("Login");
            UIBarButtonItem  done         = new UIBarButtonItem("Close", UIBarButtonItemStyle.Done, delegate(object sender, EventArgs e) {
                cancelled = true;
                CloseView();
            });

            titleBarItem.SetLeftBarButtonItem(done, true);
            titleBar.PushNavigationItem(titleBarItem, true);

            this.View = topView;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // no XIB !
            navBar = new UINavigationBar();
            navBar.PushNavigationItem(new UINavigationItem("Choose Location"), false);
            navBar.BarStyle = UIBarStyle.Black;
            navBar.Frame    = new RectangleF(0, 0, this.View.Frame.Width, 45);
            navBar.TopItem.RightBarButtonItem = new UIBarButtonItem("Done", UIBarButtonItemStyle.Bordered, delegate { FlipController.Flip(); });
            tableView = new UITableView()
            {
                Delegate         = new TableViewDelegate(this, _locations),
                DataSource       = new TableViewDataSource(this, _locations),
                AutoresizingMask = UIViewAutoresizing.FlexibleHeight |
                                   UIViewAutoresizing.FlexibleWidth,
                Frame             = new RectangleF(0, 45, this.View.Frame.Width, this.View.Frame.Height - 44)
                , TableHeaderView = navBar
            };

            // Set the table view to fit the width of the app.
            tableView.SizeToFit();

            // Reposition and resize the receiver
            tableView.Frame = new RectangleF(0, 0, this.View.Frame.Width, this.View.Frame.Height);

            // Add the table view as a subview
            this.View.AddSubview(tableView);

            /*
             * Console.WriteLine("make flip button");
             * var flipButton = UIButton.FromType(UIButtonType.InfoDark);
             * flipButton.Frame = new RectangleF(290,10,20,20);
             * flipButton.Title (UIControlState.Normal);
             * flipButton.TouchDown += delegate {
             *      FlipController.Flip();
             * };
             * Console.WriteLine("flipbutton created");
             * this.View.AddSubview(flipButton);
             */
        }
Ejemplo n.º 14
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            // no XIB !
            navBar = new UINavigationBar();
            navBar.PushNavigationItem (new UINavigationItem("Choose Location"), false);
            navBar.BarStyle = UIBarStyle.Black;
            navBar.Frame = new RectangleF(0,0,this.View.Frame.Width,45);
            navBar.TopItem.RightBarButtonItem = new UIBarButtonItem("Done",UIBarButtonItemStyle.Bordered, delegate {FlipController.Flip();});
            tableView = new UITableView()
            {
                Delegate = new TableViewDelegate(this, _locations),
                DataSource = new TableViewDataSource(this, _locations),
                AutoresizingMask = UIViewAutoresizing.FlexibleHeight|
                                   UIViewAutoresizing.FlexibleWidth,
                Frame = new RectangleF (0, 45, this.View.Frame.Width, this.View.Frame.Height-44)
                , TableHeaderView = navBar
            };

            // Set the table view to fit the width of the app.
            tableView.SizeToFit();

            // Reposition and resize the receiver
            tableView.Frame = new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height);

            // Add the table view as a subview
            this.View.AddSubview(tableView);

            /*
            Console.WriteLine("make flip button");
            var flipButton = UIButton.FromType(UIButtonType.InfoDark);
            flipButton.Frame = new RectangleF(290,10,20,20);
            flipButton.Title (UIControlState.Normal);
            flipButton.TouchDown += delegate {
                FlipController.Flip();
            };
            Console.WriteLine("flipbutton created");
            this.View.AddSubview(flipButton);
            */
        }
        public IPhoneUIViewController(string title, string backButtonText)
        {
            contentView = new UIView();
            contentView.Frame = new CGRect(new CGPoint(0,0),new CGSize(this.View.Frame.Size.Width, this.View.Frame.Size.Height));
            contentView.BackgroundColor = UIColor.White;
            contentView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;

            UIBarButtonItem backButton = new UIBarButtonItem();
            backButton.Title=backButtonText;
            backButton.Style = UIBarButtonItemStyle.Bordered;
            backButton.Clicked += delegate(object sender, EventArgs e) {
                UIApplication.SharedApplication.InvokeOnMainThread (delegate {
                    UIView[] subviews = this.View.Subviews;
                    foreach(UIView subview in subviews) {
                        if(subview.GetType() == typeof(UIWebView) ) {
                            UIWebView webView = (UIWebView) subview;
                            //clean webview by loading a blank page (prevent video players keep playing after view controller closes)
                            webView.LoadHtmlString("<html></html>", new NSUrl("/"));
                        }
                    }
                    IPhoneServiceLocator.CurrentDelegate.MainUIViewController ().DismissModalViewController(true);
                });
            };

            UINavigationItem navItem = new UINavigationItem(title);
            navItem.LeftBarButtonItem = backButton;

            UINavigationBar toolBar = new UINavigationBar();
            toolBar.Frame = new CGRect(new CGPoint(0,0), new CGSize(this.View.Frame.Size.Width, this.GetNavigationBarHeight()));
            toolBar.PushNavigationItem(navItem, false);
            toolBar.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;
            contentView.AddSubview(toolBar);

            this.View = contentView;

            this.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
            this.ModalTransitionStyle = UIModalTransitionStyle.CoverVertical;
            this.ModalInPopover = true;
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Construct the UI
        /// </summary>
		public override void LoadView()
		{
			UIWindow appWindow = UIApplication.SharedApplication.Delegate.Window;
			float titlebarHeight = 45F;
			float appHeight = appWindow.Frame.Size.Height;
			float appWidth = appWindow.Frame.Size.Width;
			RectangleF frame = new RectangleF (0F, 0F, appWidth, appHeight);
			topView = new UIView (frame);
			topView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;
			RectangleF barFrame = new RectangleF (0F, 0F, appWidth, titlebarHeight);
			titleBar = new UINavigationBar (barFrame);
			titleBar.BarStyle = UIBarStyle.Black;
			titleBar.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;

			RectangleF webviewFrame = new RectangleF (0F, titlebarHeight, appWidth, appHeight - titleBar.Frame.Size.Height);
			webView = new UIWebView (webviewFrame);
			webView.ScalesPageToFit = true;

			RectangleF activityFrame = new RectangleF(appWidth/2 - 12.5f, appHeight/2 -12.5f, 25F, 25F);
			activityView = new UIActivityIndicatorView (activityFrame);
			activityView.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.Gray;
			activityView.SizeToFit ();
			activityView.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin | UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleBottomMargin;

			topView.AddSubview (titleBar);
			topView.AddSubview (activityView);
			topView.AddSubview (webView);

			UINavigationItem titleBarItem = new UINavigationItem ("Login");
			UIBarButtonItem done = new UIBarButtonItem ("Close", UIBarButtonItemStyle.Done, delegate (object sender, EventArgs e) {
				cancelled = true;
				CloseView();
			});

			titleBarItem.SetLeftBarButtonItem (done, true);
			titleBar.PushNavigationItem (titleBarItem, true);

			this.View = topView;
		}
Ejemplo n.º 17
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.BackgroundColor = UIColor.ScrollViewTexturedBackgroundColor;
            var navigationBar = new UINavigationBar(new RectangleF(0, 0, View.Frame.Width, 44));

            navigationBar.BarStyle = UIBarStyle.Black;
            //navigationBar.TintColor = UIColor.DarkGray;
            var navigationItem = new UINavigationItem("Extras");
            var doneButton     = new UIBarButtonItem(UIBarButtonSystemItem.Done, (sender, args) =>
            {
                OnDone.Fire(this, EventArgs.Empty);
            });

            navigationItem.SetRightBarButtonItem(doneButton, false);
            navigationBar.PushNavigationItem(navigationItem, false);
            View.AddSubview(navigationBar);

            _tableView = new MoreTableView(this, new RectangleF(0, 44, View.Frame.Width, View.Frame.Height - 44));
            View.AddSubview(_tableView);
        }
Ejemplo n.º 18
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // no XIB !
            navBar = new UINavigationBar();
            navBar.PushNavigationItem(new UINavigationItem("Choose Location"), false);
            navBar.BarStyle = UIBarStyle.Black;
            navBar.Frame    = new RectangleF(0, 0, this.View.Frame.Width, 45);
            navBar.TopItem.RightBarButtonItem = new UIBarButtonItem("Done", UIBarButtonItemStyle.Bordered, delegate { FlipController.Flip(); });
            tableView = new UITableView()
            {
                Delegate         = new TableViewDelegate(this, _locations),
                DataSource       = new TableViewDataSource(this, _locations),
                AutoresizingMask = UIViewAutoresizing.FlexibleHeight |
                                   UIViewAutoresizing.FlexibleWidth,
                Frame             = new RectangleF(0, 45, this.View.Frame.Width, this.View.Frame.Height - 44)
                , TableHeaderView = navBar,
                BackgroundColor   = UIColor.Black,
            };

            //quick hack to make cell text white
            foreach (var item in tableView.VisibleCells)
            {
                item.TextLabel.TextColor = UIColor.White;
            }

            // Set the table view to fit the width of the app.
            tableView.SizeToFit();

            // Reposition and resize the receiver
            tableView.Frame = new RectangleF(0, 0, this.View.Frame.Width, this.View.Frame.Height);

            // Add the table view as a subview
            this.View.AddSubview(tableView);
        }
Ejemplo n.º 19
0
        private void InitView()
        {
            this.scrollview = new UIScrollView(this.View.Frame);
            this.scrollview.BackgroundColor  = UIColor.DarkGray;
            this.scrollview.ContentInset     = new UIEdgeInsets(100, 100, 100, 100);
            this.scrollview.MinimumZoomScale = 0.1f;
            this.scrollview.MaximumZoomScale = 2;
            this.scrollview.ZoomScale        = 1;
            this.View.AddSubview(this.scrollview);

            this.scrollview.AddGestureRecognizer(new UITapGestureRecognizer(this.OnMuralTapped)
            {
                NumberOfTapsRequired    = 1,
                NumberOfTouchesRequired = 1
            });

            this.muralView = new UIView(new CGRect(CGPoint.Empty, new CGSize(6000, 3000)))
            {
                BackgroundColor = UIColor.LightGray
            };
            this.scrollview.ContentSize = this.muralView.Frame.Size;
            this.scrollview.ViewForZoomingInScrollView += sv => this.muralView;
            this.scrollview.AddSubview(this.muralView);

            this.shareButton = new UIBarButtonItem("Share", UIBarButtonItemStyle.Done, null);
            var navigationBar  = new UINavigationBar(new CGRect(0, 0, this.View.Frame.Width, 60));
            var navigationItem = new UINavigationItem("Mural")
            {
                RightBarButtonItem = this.shareButton
            };

            navigationBar.PushNavigationItem(navigationItem, false);
            this.View.AddSubview(navigationBar);

            this.shareButton.Clicked += this.OnShareButtonTapped;
        }
Ejemplo n.º 20
0
		public Composer () : base (null, null)
		{
            Title = "New Comment";

			// Navigation Bar
		    _navigationBar = new UINavigationBar(new RectangleF(0, 0, UIScreen.MainScreen.Bounds.Width, 44))
		                         {AutoresizingMask = UIViewAutoresizing.FlexibleWidth, AutosizesSubviews = true};
		    _navItem = new UINavigationItem ("");
			var close = new UIBarButtonItem (NavigationButton.Create(Images.Buttons.Cancel, CloseComposer));
			_navItem.LeftBarButtonItem = close;
            SendItem = new UIBarButtonItem (NavigationButton.Create(Images.Buttons.Save, PostCallback));
			_navItem.RightBarButtonItem = SendItem;

			_navigationBar.PushNavigationItem (_navItem, false);
			
			// Composer
			_composerView = new ComposerView (ComputeComposerSize (RectangleF.Empty), this);
			
			// Add the views
			View.AddSubview (_composerView);
			View.AddSubview (_navigationBar);
		}
Ejemplo n.º 21
0
        public PrintPanel(String bookID, PSPDFPrintBarButtonItem barButton, CGRect frame) : base(frame)
        {
            this.BackgroundColor  = eBriefingAppearance.Gray5;
            this.bookID           = bookID;
            this.barButton        = barButton;
            this.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleHeight;

            Range       = PrintHelper.RANGE.CURRENT;
            Orientation = PrintHelper.ORIENTATION.PORTRAIT;
            Annotation  = PrintHelper.ANNOTATION.WITHOUT;
            Note        = PrintHelper.NOTE.WITHOUT;

            // navBar
            UINavigationBar navBar = new UINavigationBar();

            navBar.Frame = new CGRect(0, 0, this.Frame.Width, 44);
            this.AddSubview(navBar);

            // closeButton
            UIBarButtonItem closeButton = new UIBarButtonItem("Close", UIBarButtonItemStyle.Plain, HandleCloseTouchUpInside);

            closeButton.TintColor = eBriefingAppearance.BlueColor;

            UINavigationItem item = new UINavigationItem();

            item.RightBarButtonItem = closeButton;
            item.Title = "Print Options";
            navBar.PushNavigationItem(item, false);

            UIStringAttributes stringAttributes = new UIStringAttributes();

            stringAttributes.StrokeColor = eBriefingAppearance.Gray3;
            stringAttributes.Font        = eBriefingAppearance.ThemeRegularFont(17f);
            navBar.TitleTextAttributes   = stringAttributes;

            // tableView
            UITableView tableView = new UITableView(new CGRect(0, navBar.Frame.Bottom + 1, this.Frame.Width, this.Frame.Height - navBar.Frame.Bottom - 1), UITableViewStyle.Grouped);

            tableView.BackgroundColor = UIColor.Clear;
            dataSource       = new PrintDataSource(this);
            tableView.Source = dataSource;
            this.AddSubview(tableView);

            tableView.LayoutIfNeeded();
            tableView.Frame = new CGRect(tableView.Frame.X, tableView.Frame.Y, tableView.Frame.Width, tableView.ContentSize.Height);

            // printView
            UIView printView = new UIView(new CGRect(0, tableView.Frame.Bottom + 30, this.Frame.Width, 44));

            printView.BackgroundColor = UIColor.White;
            this.AddSubview(printView);

            // printButton
            UIButton printButton = UIButton.FromType(UIButtonType.Custom);

            printButton.Frame = new CGRect(0, 0, printView.Frame.Width, printView.Frame.Height);
            printButton.Font  = eBriefingAppearance.ThemeRegularFont(17);
            printButton.SetTitle(StringRef.print, UIControlState.Normal);
            printButton.SetTitleColor(eBriefingAppearance.BlueColor, UIControlState.Normal);
            printButton.TouchUpInside += HandlePrintTouchUpInside;
            printView.AddSubview(printButton);

            // emailButton
//			UIButton emailButton = UIButton.FromType(UIButtonType.Custom);
//			emailButton.Frame = new CGRect(0,printView.Frame.Bottom+30 , printView.Frame.Width, printView.Frame.Height);
//			emailButton.Font = eBriefingAppearance.ThemeRegularFont(17);
//			emailButton.BackgroundColor = UIColor.White;
//			emailButton.SetTitle("Email", UIControlState.Normal);
//			emailButton.SetTitleColor(eBriefingAppearance.BlueColor, UIControlState.Normal);
//			emailButton.TouchUpInside +=  (object sender, EventArgs e) =>
//			{
//				 PrintSetup (true);
//			};
//
//			this.AddSubview(emailButton);
        }
Ejemplo n.º 22
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();
            this.View.Layer.Frame = new CoreGraphics.CGRect (0, 0, uvWidth, uvheight);
            mutListView = new UITableView (new CoreGraphics.CGRect (0, 88, uvWidth, uvheight-100));
            mutListView.AllowsMultipleSelection = AllowsMultipleSelection;
            mutListView.AllowsMultipleSelectionDuringEditing = AllowsMultipleSelection;
            NavBar=new UINavigationBar(new CoreGraphics.CGRect (0, 0, uvWidth, 44));
            //			UIBarButtonItem bbitemCancel = new UIBarButtonItem (UIBarButtonSystemItem.Cancel, CancelButtonClicked);
            UIButton btnCancel = new UIButton (new CGRect (0, 0, 80, 30));
            btnCancel.SetTitleColor (UIColor.Blue, UIControlState.Normal);
            btnCancel.SetTitle ("Cancel", UIControlState.Normal);
            btnCancel.TouchUpInside += (object sender, EventArgs e) => {
                popover.Dismiss(false);
            };
            UIBarButtonItem bbitemCancel = new UIBarButtonItem (btnCancel);

            //			UIBarButtonItem bbitemDone = new UIBarButtonItem (UIBarButtonSystemItem.Done, DoneButtonClicked);
            UIButton btnDone = new UIButton (new CGRect (0, 0, 80, 30));
            btnDone.SetTitleColor (UIColor.Blue, UIControlState.Normal);
            btnDone.SetTitle ("Done", UIControlState.Normal);
            btnDone.TouchUpInside += (object sender, EventArgs e) => {
                DismissPopOver();
            };
            UIBarButtonItem bbitemDone = new UIBarButtonItem (btnDone);

            UINavigationItem navgitem = new UINavigationItem ("Select");
            navgitem.SetLeftBarButtonItem(bbitemCancel,true);
            navgitem.SetRightBarButtonItem (bbitemDone, true);
            NavBar.PushNavigationItem(navgitem,true);
            searchBar=new UISearchBar(new CoreGraphics.CGRect (0, 44, uvWidth, 44));
            this.View.Add (NavBar);
            this.View.AddSubview(mutListView);
            this.View.AddSubview(searchBar);
            this.mutListView.Source =new mCodePickerSource(this);
            //mutListView.SetContentOffset (new CoreGraphics.CGPoint (0, mutListView.ContentSize.Height - mutListView.Frame.Size.Height), false);
            //CoreGraphics.CGRect fram = mutListView.Frame;
            //fram.Height = mutListView.ContentSize.Height;
            //	mutListView.Frame = fram;
            this.searchBar.TextChanged += (object sender, UISearchBarTextChangedEventArgs e) =>
            {
                //DataSource.Clear();
                DataSource=tempds.FindAll(u=>u.ItemText.ToLower().Contains(searchBar.Text.ToLower()));
                this.mutListView.Source =new mCodePickerSource(this);
                this.mutListView.ReloadData();
                searchBar.ShowsCancelButton = true;

            };

            this.searchBar.CancelButtonClicked += (object sender, EventArgs e) => {
                searchBar.Text=string.Empty;
                DataSource=tempds;
                searchBar.ResignFirstResponder();
                searchBar.ShowsCancelButton = false;
                this.mutListView.ReloadData();
            };
            //lbltitle.Title = "Select";
            //btnDone.Clicked+= (object sender, EventArgs e) => {
            //	DismissPopOver();
            //};
            //BtnCancel.Clicked+= (object sender, EventArgs e) => {
            //
            //};
            //mTrashBtn.Clicked+= (object sender, EventArgs e) => {
                //if(popover!=null)
                //	popover.Dismiss(false);
            //};
            // Perform any additional setup after loading the view, typically from a nib.
        }
Ejemplo n.º 23
0
        private void Initialize()
        {
            var view = new EventedView(View.Frame);

            view.OnTouchesEnded += (sender, args) =>
            {
                _tableView.ResignTextFieldAsFirstResponder();
            };

            View = view;

            // add navigation item
            View.BackgroundColor = UIColor.GroupTableViewBackgroundColor;
            var navigationBar = new UINavigationBar(new RectangleF(0, 0, View.Frame.Width, 44));
            //navigationBar.TintColor = UIColor.DarkGray;
            var navigationItem = new UINavigationItem(Comparison == null ? "New Comparison" : Comparison.Name);
            var doneButton     = new UIBarButtonItem(UIBarButtonSystemItem.Done, (sender, args) =>
            {
                if (_tableView.ComparisonName == null || _tableView.ComparisonName.Trim() == string.Empty)
                {
                    new UIAlertView("Warning", "Please provide a comparison name", null, "Dismiss").Show();
                    return;
                }

                if (Comparison == null)
                {
                    Comparison = new ComparisonModel()
                    {
                        Name       = _tableView.ComparisonName.Trim(),
                        UnitId     = _unitPicker.SelectedUnit.Id,
                        UnitTypeId = _tableView.UnitTypeId
                    };
                    Comparison.Id = DataService.SaveComparison(Comparison);
                }
                else
                {
                    Comparison.Name       = _tableView.ComparisonName.Trim();
                    Comparison.UnitId     = _unitPicker.SelectedUnit.Id;
                    Comparison.UnitTypeId = _tableView.UnitTypeId;
                    DataService.UpdateComparison(Comparison);
                }

                if (OnFinished != null)
                {
                    OnFinished(this, EventArgs.Empty);
                }
            });

            var cancelButton = new UIBarButtonItem(UIBarButtonSystemItem.Cancel, (sender, args) =>
            {
                if (Comparison != null)
                {
                    navigationItem.Title = Comparison.Name;
                }

                if (OnCanceled != null)
                {
                    OnCanceled(this, EventArgs.Empty);
                }
            });

            navigationItem.SetRightBarButtonItem(doneButton, false);
            navigationItem.SetLeftBarButtonItem(cancelButton, false);
            navigationBar.PushNavigationItem(navigationItem, false);
            View.AddSubview(navigationBar);

            _tableView = new ComparisonTableView(new RectangleF(0, 44, View.Frame.Width, View.Frame.Height - 44), UITableViewStyle.Grouped);
            _tableView.OnUnitTypeChanged += (sender, args) =>
            {
                _unitPicker.SetUnitType(_tableView.UnitTypeId);
                _tableView.SetUnitText(_unitPicker.SelectedUnit.FullName);
            };

            _tableView.OnTouchesEnded += (sender, args) =>
            {
                _tableView.ResignTextFieldAsFirstResponder();
            };

            _tableView.OnKeyboardDone += (sender, args) =>
            {
                _tableView.ResignTextFieldAsFirstResponder();
            };

            if (Comparison != null)
            {
                _tableView.OnNameChanged += (sender, args) =>
                {
                    navigationItem.Title = _tableView.ComparisonName;
                };
            }

            View.AddSubview(_tableView);

            if (Comparison == null)
            {
                _unitPicker = new UnitPicker(1, new RectangleF(0, View.Frame.Height - 216, 320, 216));
            }
            else
            {
                _unitPicker = new UnitPicker(Comparison.UnitTypeId, new RectangleF(0, View.Frame.Height - 216, 320, 216));
            }

            _unitPicker.OnSelectionChanged += (sender, args) =>
            {
                _tableView.SetUnitText(_unitPicker.SelectedUnit.FullName);
            };

            View.AddSubview(_unitPicker);
        }
Ejemplo n.º 24
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            View.Layer.Frame = new CoreGraphics.CGRect (0, 0, uvWidth, uvheight);
            NavBar=new UINavigationBar(new CoreGraphics.CGRect (0, 0, uvWidth, 44));
            utListView = new UITableView (new CoreGraphics.CGRect (0, 44, uvWidth, uvheight));
            //			UIBarButtonItem TrashBtn = new UIBarButtonItem (UIBarButtonSystemItem.Cancel, TrashBtnClicked);

            UIButton btnCancel = new UIButton (new CGRect (0, 0, 80, 30));
            btnCancel.SetTitleColor (UIColor.Blue, UIControlState.Normal);
            btnCancel.SetTitle ("Cancel", UIControlState.Normal);
            btnCancel.TouchUpInside += (object sender, EventArgs e) => {
                if(popover!=null)
                    popover.Dismiss(false);
            };
            UIBarButtonItem TrashBtn = new UIBarButtonItem (btnCancel);

            UINavigationItem navgitem = new UINavigationItem ("Select");
            navgitem.SetLeftBarButtonItem (TrashBtn, true);
            NavBar.PushNavigationItem(navgitem,true);
            searchBar=new UISearchBar(new CoreGraphics.CGRect (100, 0, uvWidth-100, 44));
            this.View.Add (NavBar);
            this.View.AddSubview(utListView);
            this.View.AddSubview(searchBar);
            this.utListView.Source =new CodePickerSource(this);
            searchBar.BecomeFirstResponder ();
            searchBar.Text = searchkey;
            searchBar.TextChanged+= async (object sender, UISearchBarTextChangedEventArgs e) => {
                if(!string.IsNullOrEmpty(searchBar.Text))
                {
                    AppDelegate.pb.Start(this.View,"Searching...");
                    var webClient = new WebClient();
                    string url =  "http://reference.iprocedures.com/"+type+"/"+searchBar.Text.Trim()+"/20";
                    string procData = webClient.DownloadString (url);
                    procedureItems = (ProcedureDiagnosticMaster)JsonConvert.DeserializeObject (procData, typeof(ProcedureDiagnosticMaster));
                    int uwidth = 0;
                    DataSource = SetProcedureDataSource(out uwidth);
                    this.utListView.Source =new CodePickerSource(this);
                    this.utListView.ReloadData();
                    AppDelegate.pb.Stop();
                }

                    //RectangleF fillrect = new RectangleF(0,0,uwidth,uvheight);
                    //this.View.Frame=fillrect;

            };

            // Perform any additional setup after loading the view, typically from a nib.
        }