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

            _SelectionView.SetLocation(0, 0);
            _SelectionView.SetSize((float)_SelectionWidth, (float)Bounds.Height);

            _WebView.SetLocation((float)_SelectionView.Frame.Right, (float)_ButtonHeight + _ButtonMargin * 2.0f);
            _WebView.SetSize((float)Bounds.Width - (float)_SelectionView.Frame.Right, (float)Bounds.Height - _ButtonMargin * 2.0f);

            _EmailButton.SetSize(100f, _ButtonHeight);
            _EmailButton.SetLocation((float)Bounds.Width - (float)_EmailButton.Bounds.Width - _ButtonMargin, _ButtonMargin);



            //size selection view items
            _LevelTab.SetLocation(14f, 10f);
            _LevelTab.SetWidth(((float)_SelectionView.Bounds.Width - 28f) / 2.0f);
            _LevelTab.SetHeight(40f);

            _ItemsTab.SetLocation((float)_LevelTab.Frame.Right, 10f);
            _ItemsTab.SetSize(_LevelTab.Bounds.Size);


            _GenerateButton.SetSize((float)_SelectionView.Bounds.Width - 10f, 40f);
            _GenerateButton.SetLocation(5f, (float)_SelectionView.Bounds.Height - 50f);
            _GenerateButton.ImageEdgeInsets = new UIEdgeInsets(0, 0, 0, 10);

            _ItemsView.SetLocation(5f, (float)_ItemsTab.Frame.Bottom);
            _ItemsView.SetSize((float)_SelectionView.Bounds.Width - 10.0f, (float)_GenerateButton.Frame.Top - (float)_ItemsView.Frame.Top - 5.0f);

            _LevelView.Frame = _ItemsView.Frame;

            //size level view items

            CGRect levelRect = _LevelView.Bounds.Size.OriginRect();

            CGRect buttonRect = levelRect;

            buttonRect.Inflate(-_ButtonMargin, 0);
            buttonRect.Y      = _ButtonMargin;
            buttonRect.Height = _ButtonHeight;

            foreach (var v in new GradientButton[] { _LevelButton, _CoinButton, _GoodsButton, _ItemsButton })
            {
                v.Frame = buttonRect;

                buttonRect.Y += buttonRect.Height + _ButtonMargin;
            }


            //size item view items
            buttonRect = _ItemsView.Bounds.Size.OriginRect();
            buttonRect.Inflate(-_ButtonMargin, 0);
            buttonRect.Y      = _ButtonMargin;
            buttonRect.Height = _ButtonHeight;


            foreach (var v in new GradientButton[] { _CountButton, _ChartLevelButton })
            {
                v.Frame = buttonRect;

                buttonRect.Y += buttonRect.Height + _ButtonMargin;
            }

            foreach (var v in _ItemCheckButtons)
            {
                v.Frame = buttonRect;

                buttonRect.Y += buttonRect.Height + _ButtonMargin;
            }

            buttonRect.Height = buttonRect.Height * 2.0f;
            buttonRect.Width  = buttonRect.Width / 2.0f - _ButtonMargin;

            _SelectAllButton.Frame   = buttonRect;
            buttonRect.X            += buttonRect.Width + _ButtonMargin;
            _UnselectAllButton.Frame = buttonRect;
        }
Esempio n. 2
0
        public override void LayoutSubviews()
        {
            base.LayoutSubviews();

            CGRect rect = ConvertRectFromView(Frame, Superview);

            float sideTabSize = 0;

            if (ShowSideBar)
            {
                sideTabSize        = SideTabWidth;
                _SideTabBar.Frame  = new CGRect(0, 0, sideTabSize, rect.Height);
                _SideTabBar.Hidden = false;
            }

            filterField.SetLocation(sideTabSize + 5, 5);
            filterField.SetWidth(SideWidth - 10);
            filterField.SetHeight(30);

            listTable.SetLocation(sideTabSize, 40);
            listTable.SetWidth(SideWidth - 5);
            listTable.SetHeight((float)rect.Height - 25);


            float xLoc = (float)listTable.Frame.Right + 0.5f;

            _FilterView.Frame = new CGRect(xLoc + 10.0f, 0, rect.Width - xLoc - 10.0f, FilterHeight);

            float webViewHeight = (float)rect.Height - FilterHeight;

            if (_BottomViewHeight > 0 && BottomView != null)
            {
                webViewHeight -= _BottomViewHeight;
            }

            webView.Frame = new CGRect(xLoc, FilterHeight, rect.Width - xLoc, webViewHeight);

            if (BottomView != null)
            {
                CGRect bottomFrame = webView.Frame;
                bottomFrame.Y      = bottomFrame.Y + bottomFrame.Height;
                bottomFrame.Height = _BottomViewHeight;
                _BottomView.Frame  = bottomFrame;
            }

            _ResetButton.SetLocation((float)FilterView.Frame.Width - 40, 5);
            _ResetButton.SetWidth(30);
            _ResetButton.SetHeight(30);

            if (ShowSideBar)
            {
                CGRect rectTabView = new CGRect(_SideTabBar.Frame.Right, _SideTabBar.Frame.Top, Bounds.Width - _SideTabBar.Frame.Width, Bounds.Height);

                foreach (var view in from x in _SideTabBar.Tabs where ((LookupSideTabItem)x.Tag) != null select((LookupSideTabItem)x.Tag).View)
                {
                    if (view != null)
                    {
                        view.Frame = rectTabView;
                    }
                }
            }
        }