예제 #1
0
        public override void onActivate()
        {
            base.onActivate();

            xLabel l = xLabel.createSingleLabel("This is Help screen", null, getW());

            addControl(l);

            xButton bt = xButton.createStandardButton(1000, this, "back to Home screen", 250);

            bt.setPosition(150, 0);
//            bt.setSize(-1, bt.getH()*2);

            Font f = new Font(new FontFamily("Arial"), 13.0f);

            bt.setFont(f);
            bt.setTextColor(Color.Red.ToArgb());

            addControl(bt);

            //====================================try list view=======
            xContainer c = new xContainer();

            c.setSize(235, 200);
            c.setPosition(0, 40);
            addControl(c);

            /*
             * String[] columns = {"CODE", "PRICE", "+/-"};
             * float[] ws = { 50, 100, 80};
             * //  create table
             * xListView lv = xListView.createListView(this, columns, ws, null);
             * for (int i = 0; i < 4; i++)
             * {
             *  columns[0] = "CODE" + i;
             *  columns[1] = "" + (100 * (5-i));
             *  columns[2] = "" + (i * i);
             *  //  create row
             *  xListViewItem item = xListViewItem.createListViewItem(this, 3);//, columns);
             *  for (int j = 0; j < 3; j++)
             *  {
             *      item.setTextForCell(j, columns[j]);
             *  }
             *
             *  lv.addRow(item);
             *  item.setTextColor(1, 0xffff0000);
             * }
             *
             * lv.setSize(230, 100);
             * lv.setPosition(100, 100);
             *
             * c.addControl(lv);
             */
        }
예제 #2
0
        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());
            }
        }
예제 #3
0
        public void setFilterSet(FilterSet filterSet)
        {
            this.filterSet = filterSet;

            if (filterSet.name != null)
            {
                this.textBox1.Text = filterSet.name;
            }

            xVector v = FilterManager.getAvailableSignalItemsAndFilterSet(filterSet);

            vFilters = v;

            int w     = 340;
            int h     = 500;
            int itemH = 30;
            int itemW = w;

            xScrollView scroll = new xScrollView(null, w, h);

            scroll.setSize(w, h);

            w    -= 26;
            itemW = w;

            panel1.Controls.Add(scroll.getControl());

            xContainer container = new xContainer();

            //container.setBackgroundColor(0xff00ff00);
            container.setSize(w, v.size() * itemH);
            //scroll.setControl(container.getControl());

            scroll.addControl(container);

            Context   ctx  = Context.getInstance();
            ImageList imgs = ctx.getImageList(C.IMG_SUB_BUTTONS, 16, 15);

            for (int i = 0; i < v.size(); i++)
            {
                FilterItem item = (FilterItem)v.elementAt(i);
                xContainer c    = new xContainer();
                c.setPosition(0, i * itemH);
                c.setSize(itemW, itemH);

                //  title
                //xLabel l = xLabel.createSingleLabel("asdas ad sad asd");//item.getTitle());

                string s = item.getTitle();
                Utils.trace(s);

                xCheckbox l = xCheckbox.createCheckbox(item.getTitle(), item.selected, null, itemW - 60);

                xFillBackground sep = new xFillBackground(0x80808080);
                sep.setPosition(0, itemH - 1);
                sep.setSize(w, 1);

                xButton setting = null;

                if (item.hasSetting)
                {
                    setting = xButton.createImageButton(0, this, imgs, 0);
                    setting.setPosition(0, (itemH - setting.getH()) / 2);
                    setting.setID(i);

                    l.setPosition(30, (itemH - l.getH()) / 2);
                }
                else
                {
                    l.setPosition(30, (itemH - l.getH()) / 2);
                }

                if (setting != null)
                {
                    c.addControl(setting);
                }

                c.addControl(l);
                c.addControl(sep);

                container.addControl(c);
                //xSco
            }
        }
예제 #4
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);
        }