public MarketsTab(xIEventListener listener, int w, int h) : base(listener) { mTabControl = new xTabControl(); this.setSize(w, h); mContext = Context.getInstance(); mTabControl.setSize(w, h); addControl(mTabControl); // common xTabPage page = new xTabPage("Hose && Hnx"); xBaseControl c = createCommonTab(); page.addControl(c); mTabControl.addPage(page); for (int i = 0; i < mContext.mPriceboard.getIndicesCount(); i++) { stPriceboardStateIndex pi = mContext.mPriceboard.getPriceboardIndexAt(i); if (pi == null || pi.code == null) { break; } // Hose page = new xTabPage(pi.code); c = createMarketFullControl(pi); page.addControl(c); mTabControl.addPage(page); } }
public void onApplicationSizeChanged() { mTab.setSize(this.Size.Width, this.Size.Height); for (int i = 0; i < mScreens.size(); i++) { ScreenBase sc = (ScreenBase)mScreens.elementAt(i); sc.setSize(mHomePage.getW(), mHomePage.getH()); } }
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(); }
public IndexControl(xIEventListener listener, int marketID, int w, int h) : base(listener) { mMarketID = marketID; mContext = Context.getInstance(); setSize(w, h); //setBackgroundColor(0xffff0000); mTab = new xTabControl(); addControl(mTab); mTab.setSize(w, h); TabControl tc = (TabControl)mTab.getControl(); tc.Selected += new TabControlEventHandler(tabControlSelected); int y = 0; for (int i = 0; i < TAB_TITLE.Length; i++) { xTabPage page = new xTabPage(TAB_TITLE[i]); mTab.addPage(page); if (i == 0) { stPriceboardStateIndex pi = mContext.mPriceboard.getPriceboardIndexOfMarket(marketID); TradeHistory trade = mContext.getTradeHistory(pi.id); // realtime RealtimeChart rc = new RealtimeChart(trade, this); h = getH() - y; rc.setPosition(0, y); rc.setSize(w, h); page.addControl(rc); mRealtimeChart = rc; mCurrentChart = mRealtimeChart; } } int currentTab = mContext.getMarketControlTab(mMarketID); if (currentTab < 0 || currentTab >= TAB_INDEX.Length) { currentTab = 0; } if (currentTab != -1) { ((TabControl)mTab.getControl()).SelectedIndex = currentTab; onPageSelected(currentTab); } /* * // Do thi phien * * int[] ids = {ID_ONLINE_CHART, ID_MONEY_CHART, ID_VOLUMN_CHART, ID_HIS_CHART}; * int x = 0; * int y = 0; * int bw = (w / 4) - 2; * for (int i = 0; i < text.Length; i++) * { * bt = xButton.createStandardButton(ids[i], this, text[i], bw); * bt.setPosition(x, 0); * * addControl(bt); * x = bt.getRight() + 2; * y = bt.getBottom() + 4; * } */ }