Exemplo n.º 1
0
        //==============================================
        public RealtimeChart(TradeHistory trade, xIEventListener listener)
            : base(listener)
        {
            makeCustomRender(true);

            mContext = Context.getInstance();
            mTrade   = trade;

            mChartXYLength = 4000;
            mChartXYs      = new short[2 * mChartXYLength];

            mCurrentTradeSel = 0;

            setBackgroundColor(C.COLOR_BLACK);

            pBBUppers = new float[10000];
            pBBLowers = new float[10000];
            pTmp      = new float[10000];
            pTmpInt   = new int[5000];

            mPrices  = new float[10000];
            mVolumes = new int[10000];
            mTimes   = new int[10000];

            mButtonMACD = xButton.createStandardButton(0, null, "MACD", 60);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ZeroitImageSlider"/> class.
        /// </summary>
        public ZeroitImageSlider()
        {
            //this.Animation = true;
            //this.CaptionAnimationSpeed = 50;
            this.CaptionTextLeft = 20;
            //this.CaptionHeight = 50;
            //this.CaptionBackgrounColor = Color.Black;
            //this.CaptionOpacity = 100;

            leftButton = new xButton();

            leftButton.Text       = "<";
            leftButton.ImageAlign = ContentAlignment.MiddleCenter;
            leftButton.Image      = Properties.Resources.Back_32px;
            leftButton.Click     += new EventHandler(leftButton_Click);

            rightButton = new xButton();

            rightButton.Text       = ">";
            rightButton.ImageAlign = ContentAlignment.MiddleCenter;
            rightButton.Image      = Properties.Resources.Forward_32px;
            rightButton.Click     += new EventHandler(rightButton_Click);

            this.Resize += ZeroitImageSlider_Resize;

            this.Controls.Add(leftButton);
            this.Controls.Add(rightButton);
        }
Exemplo n.º 3
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);
             */
        }
        public ImageSlider()
        {
            this.Animation             = true;
            this.CaptionAnimationSpeed = 50;
            this.CaptionTextLeft       = 20;
            this.CaptionHeight         = 50;
            this.CaptionBackgrounColor = Color.Black;
            this.CaptionOpacity        = 100;

            leftButton        = new xButton();
            leftButton.Text   = "<";
            leftButton.Click += new EventHandler(leftButton_Click);

            rightButton        = new xButton();
            rightButton.Text   = ">";
            rightButton.Click += new EventHandler(rightButton_Click);
            this.Resize       += ImageSlider_Resize;
            this.Controls.Add(leftButton);
            this.Controls.Add(rightButton);
        }
Exemplo n.º 5
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
            }
        }
Exemplo n.º 6
0
        public void setChart(ChartBase c)
        {
            //removeControl(mSwitchButton);
            c.mShouldDrawGrid = mHasGrid;

            removeAllControls();
            //====================================

            if (mCurrentChart != null)
            {
                removeControl(mCurrentChart);
            }

            //  chart
            //addControl(c);
            mCurrentChart = c;
            mCurrentChart.setListener(this);

            Context ctx = Context.getInstance();

            ImageList imgs = ctx.getImageList(C.IMG_SUB_BUTTONS, 16, 15);
            int       x    = 0;
            int       y    = 0;

            //  setting
            if (mSettingButton == null)
            {
                mSettingButton = xButton.createImageButton(C.ID_BUTTON_SETTING_CHART, this, imgs, 0);

                mSettingButton.setPosition(0, (getH() - mSettingButton.getH()) - 1);

                x = mSettingButton.getRight();
            }
            addControl(mSettingButton);
            y = (getH() - mSettingButton.getH()) - 1;
            //  grid
            if (mDrawGridButton == null)
            {
                mDrawGridButton = xButton.createImageButton(C.ID_BUTTON_DRAW_GRID, this, imgs, 4);
                mDrawGridButton.setPosition(x, y);
                x = mDrawGridButton.getRight();
            }
            addControl(mDrawGridButton);
            //  sma
            if (c.isSupportSecondChart())
            {
                if (mSecondChartButton == null)
                {
                    mSecondChartButton = xButton.createImageButton(C.ID_BUTTON_SECOND_CHART, this, imgs, 1);

                    mSecondChartButton.setPosition(x, y);
                    x = mSecondChartButton.getRight();
                }
                addControl(mSecondChartButton);
            }
            //  help
            bool hasHelp   = false;
            int  chartType = c.getChartType();

            if (chartType == ChartBase.CHART_ADL ||
                chartType == ChartBase.CHART_ADX ||
                chartType == ChartBase.CHART_CCI ||
                chartType == ChartBase.CHART_CHAIKIN ||
                chartType == ChartBase.CHART_ICHIMOKU ||
                chartType == ChartBase.CHART_MACD ||
                chartType == ChartBase.CHART_MFI ||
                chartType == ChartBase.CHART_OBV ||
                chartType == ChartBase.CHART_ROC ||
                chartType == ChartBase.CHART_NVI ||
                chartType == ChartBase.CHART_PVI ||
                chartType == ChartBase.CHART_PVT ||
                chartType == ChartBase.CHART_CCI ||
                chartType == ChartBase.CHART_MASSINDEX ||
                chartType == ChartBase.CHART_RSI ||
                chartType == ChartBase.CHART_STOCHASTIC_FAST ||
                chartType == ChartBase.CHART_STOCHASTIC_SLOW ||
                chartType == ChartBase.CHART_STOCHRSI ||
                chartType == ChartBase.CHART_TRIX ||
                chartType == ChartBase.CHART_WILLIAMR ||
                chartType == ChartBase.CHART_VOLUMEBYPRICE)
            {
                hasHelp = true;
            }

            if (mHelpButton == null)
            {
                mHelpButton = xButton.createImageButton(C.ID_BUTTON_CONTEXT_HELP, this, imgs, 3);
                mHelpButton.setPosition(0, y - mHelpButton.getH());
            }
            if (hasHelp)
            {
                addControl(mHelpButton);
            }

            /*
             * if (mRemoveButton == null)
             * {
             * //mAddButton = xButton.createStandardButton(Constants.ID_ADD_SUB_CHART, this, " + ", 30);
             * //mAddButton.setPosition(mSwitchButton.getRight(), mSwitchButton.getY());
             * mRemoveButton = xButton.createStandardButton(C.ID_REMOVE_SUB_CHART, this, " - ", 30);
             * mRemoveButton.setPosition(0, getH() - mRemoveButton.getH()-1);
             * //mRemoveButton.setPosition(mSwitchButton.getRight(), mSwitchButton.getY());
             * }*/

            //addControl(mAddButton);
            //addControl(mRemoveButton);

            addControl(c);

            //  context menu here

            /*
             * //  help
             * img = ctx->getImage("help0.png");
             * img1 = ctx->getImage("help1.png");
             * xUIButton *bt = xUIButton::createImageButton(ID_BUTTON_CONTEXT_HELP, this, 0, img, img1);
             * bt->setPosition(0, mSwitchButton->getY() - mSwitchButton ->getH());
             * addControl(bt);
             */
        }