public RealtimeTradeListDetail(TradeHistory trade, int w, int h)
        {
            mTrade = trade;
            float[]   columnPercents = { 25, 35, 40 };
            String[]  columnTexts    = { "Giờ", "Giá", "Khối lượng" };
            xListView l = xListView.createListView(null, columnTexts, columnPercents, w, h, Context.getInstance().getImageList(C.IMG_BLANK_ROW_ICON, 1, 21), false);

            l.setID(-1);
            l.setBackgroundColor(C.COLOR_GRAY);
            mList = l;

            for (int i = trade.getTransactionCount() - 1; i >= 0; i--)
            {
                RowOnlineTrade r = RowOnlineTrade.createRowQuoteList(trade, i, null);
                l.addRow(r);
            }

            mLastTime = trade.getLastTime();
        }
Exemple #2
0
        /*
         * 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);
        }