Exemple #1
0
        public void createNewHistory(Share oriShare)
        {
            if (mScreens.size() > 30)
            {
                return;
            }

            xTabPage         exist = getTabPageOfShare(oriShare);
            ViewHistoryChart his;

            if (exist != null)
            {
                mTab.selectPage(exist);
                return;
            }
            //--------------------

            Share share = oriShare;

            if (share != null && share.getShareID() > 0)
            {
                share = new Share(Share.MAX_CANDLE_CHART_COUNT);
                share.setCode(oriShare.getCode(), 0);
                share.setID(oriShare.getShareID());
                share.mIsRealtime   = oriShare.mIsRealtime;
                share.mIsGroupIndex = oriShare.mIsGroupIndex;
            }

            his = new ViewHistoryChart(share);
            his.setSize(mTab.getW(), mTab.getH());
            //his.onActivate();
            mScreens.addElement(his);

            String title = "Lọc mã";

            if (share != null)
            {
                if (share.getCode() != null & share.getCode().Length > 0)
                {
                    title = share.getCode();
                }
            }
            xTabPage page = new xTabPage(title);

            page.userData  = oriShare;
            page.userData2 = his;

            his.Tag = page;

            page.addControl(his);
            mTab.addPage(page);

            mTab.selectLastPage();

            utils.AsyncUtils.DelayCall(500, () =>
            {
                his.onActivate();
            });
        }
Exemple #2
0
        public override void onActivate()
        {
            base.onActivate();

            mTab = new xTabControl();
            mTab.setSize(this.Size.Width, this.Size.Height);

            addControl(mTab);

            mScreens   = new xVector();
            screenHome = new ScreenHome();
            mScreens.addElement(screenHome);

            mHomePage = new xTabPage("Bảng giá");
            mHomePage.setSize(mTab.getW(), mTab.getH());
            mHomePage.addControl(screenHome);

            /*
             * xFillBackground v = new xFillBackground(0xffff0000);
             * v.setSize(mTab.getW(), mTab.getH());
             * mHomePage.addControl(v);
             */
            mTab.addPage(mHomePage);

            mTab.showClosePageButton(true, (int tabIndex) =>
            {
                if (tabIndex == 0)
                {
                    return(false);
                }
                return(true);
            },
                                     (int tabIndex) =>
            {
                if (tabIndex > 0)
                {
                    mScreens.removeElementAt(tabIndex);
                }
            }
                                     );

            screenHome.setSize(mHomePage.getW(), mHomePage.getH());
            screenHome.onActivate();
        }