コード例 #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);
        }
コード例 #2
0
        public xListView(xIEventListener listener, ImageList imglist, bool sortable)
            : base(listener)
        {
            ListView lv = new ListView();

            lv.Dock      = DockStyle.Fill;
            lv.GridLines = true;
            lv.View      = View.Details;

            lv.FullRowSelect = true;

            if (imglist != null)
            {
                lv.SmallImageList = imglist;
            }

            lv.Alignment   = ListViewAlignment.Default;
            lv.BorderStyle = BorderStyle.Fixed3D;
            //lv.Alignment = ListViewAlignment.Top;

            //--------------------------------------
            setControl(lv);

            System.Threading.ThreadPool.QueueUserWorkItem(delegate
            {
                ListView _lv = (ListView)getControl();
                if (sortable)
                {
                    _lv.ColumnClick += new ColumnClickEventHandler(columnClick);
                }
                _lv.DoubleClick          += new EventHandler(lv_DoubleClick);
                _lv.SelectedIndexChanged += new EventHandler(selectChanged);
            }, null);
        }
コード例 #3
0
        static public xCheckbox createCheckbox(String text, bool[] o, xIEventListener listener, int w)
        {
            xCheckbox cb = new xCheckbox(text, o, listener);

            cb.setSize(w, cb.getH());
            return(cb);
        }
コード例 #4
0
        public RowFilterResult(xIEventListener listener, Share share)
            : base(listener, TOTAL_COLUMES)
        {
            mContext = Context.getInstance();
            mShare   = share;

            uint b = C.COLOR_BLACK;
            uint g = C.COLOR_GRAY_DARK;

            uint[] bg = { b, g, b };
            Font   f  = mContext.getFontText();
            Font   fb = mContext.getFontSmallB();

            if (mShare.isIndex())
            {
                bg[0] = 0xff804000;
                bg[1] = 0xff804000;
                bg[2] = 0xff804000;
            }

            Font[] fs = { fb, fb, f };

            for (int i = 0; i < bg.Length; i++)
            {
                setBackgroundColorForCell(i, bg[i]);
                setTextFont(i, fs[i]);
            }
        }
コード例 #5
0
ファイル: MarketsTab.cs プロジェクト: thuyps/vnchart_windows
        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);
            }
        }
コード例 #6
0
        public static xListView createListView(xIEventListener listener, String[] columnHeaders, float[] columnPercents, int w, int h, ImageList imglist, bool sortable)
        {
            xListView lv = new xListView(listener, imglist, sortable);

            lv.setSize(w, h);
            lv.setColumnHeaders(columnHeaders, columnPercents);

            return(lv);
        }
コード例 #7
0
ファイル: xScrollView.cs プロジェクト: thuyps/vnchart_windows
        public xScrollView(xIEventListener listener, int w, int h)
            : base(listener)
        {
            mPanel            = new Panel();
            mPanel.AutoScroll = true;
            setControl(mPanel);

            setSize(w, h);
        }
コード例 #8
0
 public void postMessageInUIThread(Object sender, xIEventListener listener, int evt, int intParam, Object param)
 {
     try
     {
         mAppForm.Invoke(new PostMessage(this.postMessage), sender, listener, evt, intParam, param);
     }
     catch (Exception e)
     {
     }
 }
コード例 #9
0
        public xListViewItem(xIEventListener listener, int columnCnt)
            : base(listener)
        {
            ListViewItem item = new ListViewItem();

            mListViewItem = item;
            item.Tag      = this;

            setColumnCnt(columnCnt);
        }
コード例 #10
0
        public xListViewItem(xIEventListener listener, String[] subItems)
            : base(listener)
        {
            ListViewItem item = new ListViewItem(subItems, 1);



            mListViewItem = item;
            item.Tag      = this;
        }
コード例 #11
0
ファイル: xTextField.cs プロジェクト: thuyps/vnchart_windows
        public void setButtonEvent(int id, xIEventListener listener)
        {
            TextBox tb = (TextBox)getControl();

            //tb.KeyUp += new KeyEventHandler(tb_KeyUp);
            tb.KeyPress += new KeyPressEventHandler(tb_KeyPress);

            mListener = listener;
            mID       = id;
        }
コード例 #12
0
        public xButton(Button bt, int id, xIEventListener listener) : base(listener)
        {
            //bt.Click += new EventHandler(onClick);
            setControl(bt);
            setID(id);

            System.Threading.ThreadPool.QueueUserWorkItem(delegate
            {
                ((Button)getControl()).Click += onClick;
            }, null);
        }
コード例 #13
0
ファイル: xLabel.cs プロジェクト: thuyps/vnchart_windows
        public void enableClick(int id, xIEventListener listener)
        {
            setID(id);
            mListener = listener;

            System.Threading.ThreadPool.QueueUserWorkItem(delegate
            {
                Label l  = (Label)getControl();
                l.Click += new EventHandler(onClick);
            }, null);
        }
コード例 #14
0
        public MiniFormMoving(xIEventListener listener, ImageList imglist)
            : base(imglist, 5)
        {
            mContext = Context.getInstance();

            mImgIndex    = mContext.isOnline()?4:5;
            mLastX       = -1;
            mIsMouseDown = false;

            mListener = listener;
        }
コード例 #15
0
        public TablePriceboard(xIEventListener listener, stShareGroup g, int w, int rowH)
            : base(listener)
        {
            //makeCustomRender(true);
            setBackgroundColor(C.COLOR_BLACK);


            rowW      = w;
            this.rowH = rowH;

            setShareGroup(g, ShareSortUtils.SORT_DUMUA_DUBAN);
        }
コード例 #16
0
        public xButton(xIEventListener listener) : base(listener)
        {
            Button bt = new Button();

            //bt.Click += new EventHandler(onClick);
            //bt.FlatStyle = FlatStyle.Flat;
            setControl(bt);

            System.Threading.ThreadPool.QueueUserWorkItem(delegate
            {
                ((Button)getControl()).Click += onClick;
            }, null);
        }
コード例 #17
0
        public RowNormalShare(xIEventListener listener, int _id, int w, int h)
            : base(listener)
        {
            makeCustomRender(true);

            setID(_id);

            setSize(w, h);

            sortType = ShareSortUtils.SORT_DUMUA_DUBAN;

            createRow(_id, w, h);
        }
コード例 #18
0
        //TablePriceboard mParent;
        //xVector mCells = new xVector(10);
        //long mHoldingTimeStart;
        //bool mIsSelected = false;
        //bool mIsRejectTouchUp = false;
        //bool mAllowDelete = false;
        //public int mCandleColumeIdx = 1;

        //const int COLOR_NONE = 1;

        public RowIndice(xIEventListener listener, int _id, int w, int h)
            : base(listener, _id, w, h)
        {
            /*
             * makeCustomRender(true);
             *
             * setID(_id);
             *
             * setSize(w, h);
             *
             * createRow(_id, w, h);
             */
        }
コード例 #19
0
ファイル: xTextField.cs プロジェクト: thuyps/vnchart_windows
        public xTextField(xIEventListener listener, int w, bool multiLine)
            : base(listener)
        {
            TextBox tb = new TextBox();

            if (multiLine)
            {
                tb.ScrollBars = ScrollBars.Vertical;
                tb.WordWrap   = true;
            }

            setControl(tb);
        }
コード例 #20
0
        public static xButton createImageButton(int id, xIEventListener listener, ImageList imglist, int imgIndex)
        {
            Button bt = new Button();

            bt.ImageList  = imglist;
            bt.ImageIndex = imgIndex;

            xButton xbt = new xButton(bt, id, listener);

            xbt.setSize(imglist.ImageSize.Width + 2, imglist.ImageSize.Height + 2);
            //xbt.makeFlat();

            return(xbt);
        }
コード例 #21
0
ファイル: ChartBubble.cs プロジェクト: thuyps/vnchart_windows
        //==========================================
        public ChartBubble(int marketID, xIEventListener listener)
            : base(listener)
        {
            makeCustomRender(true);

            mContext  = Context.getInstance();
            mMarketID = marketID;

            for (int i = 0; i < 1000; i++)
            {
                stBubbleBlock b = new stBubbleBlock();
                mFreeBlocks.addElement(b);
            }
        }
コード例 #22
0
        public static xButton createStandardButton(int id, xIEventListener listener, string text, int w)
        {
            xButton bt = new xButton(listener);

            bt.setText(text);
            if (w != -1)
            {
                bt.setSize(w, -1);
            }

            bt.setID(id);

            return(bt);
        }
コード例 #23
0
        public void postMessage(Object sender, xIEventListener listener, int evt, int intParam, Object param)
        {
            lock (mQueueMessages)
            {
                Msg msg = new Msg();

                msg.listener = listener;
                msg.sender   = sender;
                msg.evt      = evt;
                msg.intParam = intParam;
                msg.param    = param;

                mQueueMessages.Add(msg);
            }
        }
コード例 #24
0
        public xCheckbox(String text, bool[] o, xIEventListener listener) : base(listener)
        {
            CheckBox cb = new CheckBox();

            setControl(cb);
            cb.Text = text;

            setCheck(o[0]);

            System.Threading.ThreadPool.QueueUserWorkItem(delegate
            {
                ((CheckBox)getControl()).CheckedChanged += new EventHandler(cb_CheckedChanged);
            }, null);

            mValue = o;
        }
コード例 #25
0
        public xSlider(xFloat o, xIEventListener listener)
            : base(listener)
        {
            TrackBar tb = new TrackBar();

            setControl(tb);

            tb.Orientation = Orientation.Horizontal;
            tb.TickStyle   = TickStyle.None;

            tb.ValueChanged += new EventHandler(tb_ValueChanged);

            mValueZoom = 1;

            mValue = o;
        }
コード例 #26
0
        public RowOnlineTrade(xIEventListener listener, TradeHistory trade, int idx)
            : base(listener, TOTAL_COLUMES)
        {
            mContext    = Context.getInstance();
            mTrade      = trade;
            mTradeIndex = idx;

            uint b = C.COLOR_BLACK;
            uint g = C.COLOR_GRAY_DARK;

            uint[] bg = { g, b, b };
            Font   f  = mContext.getFontText();
            Font   fb = mContext.getFontTextB();

            Font[] fs = { f, fb, fb };

            for (int i = 0; i < bg.Length; i++)
            {
                setBackgroundColorForCell(i, bg[i]);
                setTextFont(i, fs[i]);
            }
            //====================
            update();
        }
コード例 #27
0
        static public RowFilterResult createRowQuoteList(Share share, xIEventListener listener)
        {
            RowFilterResult row = new RowFilterResult(listener, share);

            return(row);
        }
コード例 #28
0
        static public RowOnlineTrade createRowQuoteList(TradeHistory trade, int idx, xIEventListener listener)
        {
            RowOnlineTrade row = new RowOnlineTrade(listener, trade, idx);

            return(row);
        }
コード例 #29
0
ファイル: RowGainloss.cs プロジェクト: thuyps/vnchart_windows
 public RowGainloss(xIEventListener listener, int _id, int w, int h)
     : base(listener, _id, w, h)
 {
     //mCandleColumeIdx = -1;
 }
コード例 #30
0
        public TablePriceboard(xIEventListener listener, GainLossManager gainlosses, int w, int rowH)
            : base(listener)
        {
            setBackgroundColor(C.COLOR_BLACK);

            int cnt = gainlosses.getTotal();

            int y = 0;

            Font   f = Context.getInstance().getFontText();
            xLabel l = xLabel.createSingleLabel("Lãi lỗ");

            l.setBackgroundColor(C.COLOR_ORANGE);
            l.setSize(w, (int)f.GetHeight() + 4);
            l.setPosition(0, 0);
            l.setTextColor(C.COLOR_GREEN);
            y = l.getBottom() + 1;

            addControl(l);

            for (int i = 0; i <= cnt; i++)
            {
                int idx = i - 1;
                int rH  = rowH;
                if (idx == -1)
                {
                    rH = 20;
                }

                RowGainloss r = new RowGainloss(listener, i, w, rH);

                if (idx >= 0)
                {
                    stGainloss g = (stGainloss)gainlosses.getGainLossAt(idx);

                    r.setData(g);
                }
                r.setParent(this);
                r.setPosition(0, y);

                addControl(r);
                vRows.addElement(r);

                y += rH + 1;
            }

            //	thong ke
            {
                GainLossSumary sumary = new GainLossSumary(w);
                sumary.setPosition(0, y);
                addControl(sumary);

                y += sumary.getH();
            }
            //  Help
            {
                xFillBackground bottom = xFillBackground.createFill(w, 1, C.COLOR_GRAY_LIGHT);
                bottom.setPosition(0, y);
                addControl(bottom);
                y += 1;

                l = xLabel.createSingleLabel("Click phím phải chuột để thêm/xóa mã hoặc nhóm");
                l.setTextColor(C.COLOR_WHITE);
                l.setPosition(l.getW() - 4, y + 3);
                addControl(l);

                y += l.getH() + 4;
            }

            xFillBackground fillBottom = xFillBackground.createFill(w, 2, C.COLOR_GRAY_LIGHT);

            fillBottom.setPosition(0, y);
            addControl(fillBottom);

            invalidate();
        }