public override void onSizeChanged() { base.onSizeChanged(); this.Size = new Size(MainApplication.getInstance().getDeviceW(), MainApplication.getInstance().getDeviceH()); if (mStatusBar != null) { mStatusBar.setSize(getW(), mStatusBar.getH()); mStatusBar.setPosition(0, getH() - mStatusBar.getH()); } }
xBaseControl createCommonTab() { xContainer c = new xContainer(); c.setSize(getW() - 6, getH() - 6); int y = 0; int h = c.getH() / 2 - 10; mControlsShouldInvalideAfterNetDone.removeAllElements(); for (int i = 0; i < mContext.mPriceboard.getIndicesCount(); i++) { stPriceboardStateIndex pi = mContext.mPriceboard.getPriceboardIndexAt(i); if (pi == null || pi.code == null) { break; } IndexControl ic = new IndexControl(mListener, pi.marketID, c.getW(), h); ic.setPosition(0, y); ic.setSize(c.getW(), h); y += ic.getBottom() + 10; mControlsShouldInvalideAfterNetDone.addElement(ic); c.addControl(ic); } return(c); }
/* * protected xBaseControl createShareGroupDroplist(int id, String title, xVector groups) * { * xContainer c = new xContainer(); * xLabel l = xLabel.createSingleLabel(title, mContext.getFontTextB(), 150); * l.setTextColor(C.COLOR_BLUE); * l.setSize(l.getW(), 16); * int w = 150; * l.setPosition(0, 0); * c.addControl(l); * * ComboBox cb = new ComboBox(); * c.addControl(cb); * cb.Size = new Size(w, cb.Size.Height); * cb.Left = 0; * cb.Top = l.getBottom(); * cb.DropDownStyle = ComboBoxStyle.DropDownList; * * stShareGroup current = mContext.getCurrentShareGroup(); * * for (int i = 0; i < groups.size(); i++) * { * stShareGroup favor = (stShareGroup)groups.elementAt(i); * cb.Items.Add(favor.getName()); * * if (current != null && favor.getName().CompareTo(current.getName()) == 0) * { * cb.SelectedIndex = i; * mContext.setCurrentShareGroup(favor); * } * } * * cb.Tag = (Int32)id; * cb.SelectedIndexChanged += new EventHandler(cb_SelectedIndexChanged); * * c.setSize(w, 40); * * return c; * } */ protected xBaseControl createShareGroupList(bool editable, int id, String title, xVector groups, int w, int h) { xContainer c = new xContainer(); c.setSize(w, h); Font f = Context.getInstance().getFontText(); xLabel l = xLabel.createSingleLabel(title, f, w); l.setBackgroundColor(C.COLOR_ORANGE); l.setTextColor(C.COLOR_WHITE); c.addControl(l); int titleH = l.getH(); xContainer c1 = new xContainer(); if (editable) { c1.setSize(w, h - 30 - titleH); } else { c1.setSize(w, h - 6 - titleH); } c1.setPosition(0, l.getH()); c.addControl(c1); stShareGroup current = mContext.getCurrentShareGroup(); string[] ss = { title }; float[] cols = { 100.0f }; xListView list = xListView.createListView(this, ss, cols, w, c1.getH(), Context.getInstance().getImageList(C.IMG_BLANK_ROW_ICON, 1, 21)); list.hideHeader(); list.setID(id); ((ListView)list.getControl()).HideSelection = false; ((ListView)list.getControl()).Scrollable = true; list.setBackgroundColor(C.COLOR_GRAY_DARK); int y = 0; for (int i = 0; i < groups.size(); i++) { stShareGroup favor = (stShareGroup)groups.elementAt(i); xListViewItem item = xListViewItem.createListViewItem(this, new string[] { favor.getName() }); uint color = C.COLOR_WHITE; //if (favor.getGroupType() == stShareGroup.ID_GROUP_MARKET_OVERVIEW) //{ //color = C.COLOR_ORANGE; //} if (favor.getGroupType() == stShareGroup.ID_GROUP_GAINLOSS) { color = C.COLOR_ORANGE; } item.getItem().SubItems[0].Font = mContext.getFontText2(); item.getItem().SubItems[0].ForeColor = Color.FromArgb((int)color); item.setData(favor); list.addRow(item); } c1.addControl(list); //==================== if (editable) { xButton bt; bt = xButton.createStandardButton(C.ID_ADD_GROUP, this, "Thêm nhóm", w / 2 - 2); bt.setPosition(1, c1.getBottom() + 3); c.addControl(bt); bt = xButton.createStandardButton(C.ID_REMOVE_GROUP, this, "Xóa nhóm", w / 2 - 2); bt.setPosition(w / 2 + 1, c1.getBottom() + 3); c.addControl(bt); } return(c); }