private void UpdateBBOBidsTFEX(STIControl.ExpandTableGrid.RecordItem rec, SeriesList.SeriesInformation sf, string side, string price2, long volume2, string price3, long volume3, string price4, long volume4, string price5, long volume5)
 {
     try
     {
         Color fontColor = MyColor.UnChgColor;
         if (side == "B")
         {
             if (volume2 != -1L)
             {
                 fontColor = Utilities.ComparePriceCFColor(price2, sf);
                 rec.SubRecord[0].Fields("bidvol").Text = volume2;
                 rec.SubRecord[0].Fields("bidvol").FontColor = fontColor;
                 rec.SubRecord[0].Fields("bid").Text = Utilities.BidOfferPriceFormat(price2, volume2);
                 rec.SubRecord[0].Fields("bid").FontColor = fontColor;
             }
             if (volume3 != -1L)
             {
                 fontColor = Utilities.ComparePriceCFColor(price3, sf);
                 rec.SubRecord[1].Fields("bidvol").Text = volume3;
                 rec.SubRecord[1].Fields("bidvol").FontColor = fontColor;
                 rec.SubRecord[1].Fields("bid").Text = Utilities.BidOfferPriceFormat(price3, volume3);
                 rec.SubRecord[1].Fields("bid").FontColor = fontColor;
             }
             if (rec.Rows == 5)
             {
                 if (volume4 != -1L)
                 {
                     fontColor = Utilities.ComparePriceCFColor(price4, sf);
                     rec.SubRecord[2].Fields("bidvol").Text = volume4;
                     rec.SubRecord[2].Fields("bidvol").FontColor = fontColor;
                     rec.SubRecord[2].Fields("bid").Text = Utilities.BidOfferPriceFormat(price4, volume4);
                     rec.SubRecord[2].Fields("bid").FontColor = fontColor;
                 }
                 if (volume5 != -1L)
                 {
                     fontColor = Utilities.ComparePriceCFColor(price5, sf);
                     rec.SubRecord[3].Fields("bidvol").Text = volume5;
                     rec.SubRecord[3].Fields("bidvol").FontColor = fontColor;
                     rec.SubRecord[3].Fields("bid").Text = Utilities.BidOfferPriceFormat(price5, volume5);
                     rec.SubRecord[3].Fields("bid").FontColor = fontColor;
                 }
             }
         }
         else if (side == "A")
         {
             if (volume2 != -1L)
             {
                 fontColor = Utilities.ComparePriceCFColor(price2, sf);
                 rec.SubRecord[0].Fields("offvol").Text = volume2;
                 rec.SubRecord[0].Fields("offvol").FontColor = fontColor;
                 rec.SubRecord[0].Fields("offer").Text = Utilities.BidOfferPriceFormat(price2, volume2);
                 rec.SubRecord[0].Fields("offer").FontColor = fontColor;
             }
             if (volume3 != -1L)
             {
                 fontColor = Utilities.ComparePriceCFColor(price3, sf);
                 rec.SubRecord[1].Fields("offvol").Text = volume3;
                 rec.SubRecord[1].Fields("offvol").FontColor = fontColor;
                 rec.SubRecord[1].Fields("offer").Text = Utilities.BidOfferPriceFormat(price3, volume3);
                 rec.SubRecord[1].Fields("offer").FontColor = fontColor;
             }
             if (rec.Rows == 5)
             {
                 if (volume4 != -1L)
                 {
                     fontColor = Utilities.ComparePriceCFColor(price4, sf);
                     rec.SubRecord[2].Fields("offvol").Text = volume4;
                     rec.SubRecord[2].Fields("offvol").FontColor = fontColor;
                     rec.SubRecord[2].Fields("offer").Text = Utilities.BidOfferPriceFormat(price4, volume4);
                     rec.SubRecord[2].Fields("offer").FontColor = fontColor;
                 }
                 if (volume5 != -1L)
                 {
                     fontColor = Utilities.ComparePriceCFColor(price5, sf);
                     rec.SubRecord[3].Fields("offvol").Text = volume5;
                     rec.SubRecord[3].Fields("offvol").FontColor = fontColor;
                     rec.SubRecord[3].Fields("offer").Text = Utilities.BidOfferPriceFormat(price5, volume5);
                     rec.SubRecord[3].Fields("offer").FontColor = fontColor;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("UpdateTopPrice", ex);
     }
 }
 private void intzaTicker_TableMouseClick(object sender, STIControl.SortTableGrid.TableMouseEventArgs e)
 {
     try
     {
         if (e.Mouse.Button == MouseButtons.Left)
         {
             if (e.RowIndex >= 0)
             {
                 string text = this.intzaTicker.Records(e.RowIndex).Fields("stock").Text.ToString();
                 if (!string.IsNullOrEmpty(text))
                 {
                     TemplateManager.Instance.SendSymbolLink(this, SymbolLinkSource.StockSymbol, text);
                 }
             }
             else
             {
                 string text2 = e.Column.Name.ToLower();
                 if (text2 != null)
                 {
                     if (!(text2 == "change"))
                     {
                         if (text2 == "pchg")
                         {
                             this.intzaTicker.GetColumn("change").Visible = true;
                             this.intzaTicker.GetColumn("pchg").Visible = false;
                             this.intzaTicker.Redraw();
                         }
                     }
                     else
                     {
                         this.intzaTicker.GetColumn("pchg").Visible = true;
                         this.intzaTicker.GetColumn("change").Visible = false;
                         this.intzaTicker.Redraw();
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("intzaLS2_TableMouseClick", ex);
     }
 }
 private void intzaOption_TableMouseClick(object sender, STIControl.ExpandTableGrid.TableMouseEventArgs e)
 {
     try
     {
         if (e.RowIndex > -1 && e.RowIndex <= this.intzaOption.Rows - 1)
         {
             string text = string.Empty;
             if (e.Column.Name == "callbidvol" || e.Column.Name == "callbid" || e.Column.Name == "calloffer" || e.Column.Name == "calloffvol" || e.Column.Name == "calllast" || e.Column.Name == "callchg")
             {
                 text = this.intzaOption.Records(e.RowIndex).Fields("sSeriesOC").Text.ToString();
             }
             else if (e.Column.Name == "putbidvol" || e.Column.Name == "putbid" || e.Column.Name == "putoffer" || e.Column.Name == "putoffvol" || e.Column.Name == "putlast" || e.Column.Name == "putchg")
             {
                 text = this.intzaOption.Records(e.RowIndex).Fields("sSeriesOP").Text.ToString();
             }
             if (!string.IsNullOrEmpty(text.Trim()))
             {
                 this.SetNewStock_Info(text, false);
                 if (Settings.Default.SmartOneClick)
                 {
                     string side = (e.Mouse.Button == MouseButtons.Left) ? "B" : "S";
                     string price = "";
                     if (e.Column.Name == "callbid" || e.Column.Name == "calloffer" || e.Column.Name == "calllast")
                     {
                         price = this.intzaOption.Records(e.RowIndex).Fields(e.Column.Name).Text.ToString();
                     }
                     else if (e.Column.Name == "putbid" || e.Column.Name == "putoffer" || e.Column.Name == "putlast")
                     {
                         price = this.intzaOption.Records(e.RowIndex).Fields(e.Column.Name).Text.ToString();
                     }
                     TemplateManager.Instance.MainForm.SendOrderBox.SetSmartOneClick(side, text, price, false);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("TableMouseClick", ex);
     }
 }
 private void intzaTP_TableMouseClick(object sender, STIControl.SortTableGrid.TableMouseEventArgs e)
 {
     try
     {
         if (Settings.Default.SmartOneClick && e.RowIndex >= 0)
         {
             if (e.Column.Name == "bid" || e.Column.Name == "bidvolume")
             {
                 string price = this.intzaTP.Records(e.RowIndex).Fields("bid").Text.ToString();
                 string side = (e.Mouse.Button == MouseButtons.Left) ? "B" : "S";
                 TemplateManager.Instance.MainForm.SendOrderBox.SetSmartOneClick(side, this._currentStock, price, false);
             }
             else if (e.Column.Name == "offer" || e.Column.Name == "offervolume")
             {
                 string price = this.intzaTP.Records(e.RowIndex).Fields("offer").Text.ToString();
                 string side = (e.Mouse.Button == MouseButtons.Left) ? "B" : "S";
                 TemplateManager.Instance.MainForm.SendOrderBox.SetSmartOneClick(side, this._currentStock, price, false);
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("intzaTP_TableMouseClick", ex);
     }
 }
 private void intzaLS2_ItemDragDrop(object sender, STIControl.SortTableGrid.TableMouseEventArgs e, string dragValue)
 {
     this.SetNewStock_Info(dragValue, false);
 }
 private void intzaLS2_TableMouseClick(object sender, STIControl.ExpandTableGrid.TableMouseEventArgs e)
 {
     try
     {
         if (Settings.Default.SmartOneClick && e.RowIndex >= 0)
         {
             string side = (e.Mouse.Button == MouseButtons.Left) ? "B" : "S";
             string text = this.intzaLS.Records(e.RowIndex).Fields("price").Text.ToString();
             text = text.Replace("+", "");
             text = text.Replace("-", "");
             TemplateManager.Instance.MainForm.SendOrderBox.SetSmartOneClick(side, this._currentStock, text, false);
         }
     }
     catch (Exception ex)
     {
         this.ShowError("intzaLS2_TableMouseClick", ex);
     }
 }
 private void intzaBBO_TableMouseDoubleClick(object sender, STIControl.ExpandTableGrid.TableMouseEventArgs e)
 {
     try
     {
         if (this._mainGroupType == "Favorites")
         {
             if (e.Mouse.Button == MouseButtons.Left && e.RowIndex > -1 && e.Column.Name == "stock")
             {
                 this.ShowTextBoxPosition(new KeyEventArgs(Keys.Home));
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("intzaBBO_TableMouseDoubleClick", ex);
     }
 }
 private void intzaCMPR_TableMouseClick(object sender, STIControl.ExpandTableGrid.TableMouseEventArgs e)
 {
     try
     {
         if (e.RowIndex > -1 && e.RowIndex < this.intzaCMPR.Rows)
         {
             string text = this.intzaCMPR.Records(e.RowIndex).Fields("stock").Text.ToString();
             if (!string.IsNullOrEmpty(text.Trim()))
             {
                 if (e.Mouse.Button == MouseButtons.Left)
                 {
                     this.SetNewStock_Info(text, false);
                 }
                 else if (e.Mouse.Button == MouseButtons.Right && e.Column.Name == "stock")
                 {
                     this.contextLink.Tag = text;
                     this.contextLink.Show(this.intzaCMPR, e.Mouse.Location);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("CMPR.TableMouseClick", ex);
     }
 }
 private void intzaBBO_TableMouseClick(object sender, STIControl.ExpandTableGrid.TableMouseEventArgs e)
 {
     try
     {
         if (e.RowIndex > -1 && e.RowIndex < this.intzaBBO.Rows)
         {
             this.tbStockBBO.Hide();
             string text = this.intzaBBO.Records(e.RowIndex).Fields("stock").Text.ToString();
             if (!string.IsNullOrEmpty(text.Trim()))
             {
                 if (Settings.Default.SmartOneClick && (e.Column.Name == "bid" || e.Column.Name == "offer" || e.Column.Name == "prior" || e.Column.Name == "last" || e.Column.Name == "high" || e.Column.Name == "low" || e.Column.Name == "po" || e.Column.Name == "pc"))
                 {
                     this.SetNewStock_Info(text, false);
                     string side = (e.Mouse.Button == MouseButtons.Left) ? "B" : "S";
                     string price = this.intzaBBO.Records(e.RowIndex).Fields(e.Column.Name).Text.ToString();
                     TemplateManager.Instance.MainForm.SendOrderBox.SetSmartOneClick(side, text, price, false);
                 }
                 else if (e.Mouse.Button == MouseButtons.Left)
                 {
                     this.SetNewStock_Info(text, false);
                 }
                 else if (e.Mouse.Button == MouseButtons.Right && e.Column.Name == "stock")
                 {
                     this.contextLink.Tag = text;
                     this.contextLink.Show(this.intzaBBO, e.Mouse.Location);
                 }
             }
         }
         else
         {
             string text2 = e.Column.Name.ToLower();
             switch (text2)
             {
             case "pc":
             case "po":
                 this.SwitchColumns("avg");
                 break;
             case "avg":
                 if (ApplicationInfo.MarketState == "M" || ApplicationInfo.MarketState == "R" || ApplicationInfo.MarketState == "C")
                 {
                     this.SwitchColumns("pc");
                 }
                 else
                 {
                     this.SwitchColumns("po");
                 }
                 break;
             case "chg":
                 this.SwitchColumns("pchg");
                 break;
             case "pchg":
                 this.SwitchColumns("chg");
                 break;
             case "mval":
                 this.SwitchColumns("mvol");
                 break;
             case "mvol":
                 this.SwitchColumns("mval");
                 break;
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("TableMouseClick", ex);
     }
 }
 private void intzaBBO_TableHeaderMouseMove(STIControl.ExpandTableGrid.TableMouseEventArgs e)
 {
     try
     {
         if (e != null && e.Column != null && e.RowIndex == -1)
         {
             if (this._isTT != e.Column.Name)
             {
                 this.toolTip1.Hide(this.intzaBBO);
                 this._isTT = e.Column.Name;
                 if (e.Column.Name == "po")
                 {
                     this.toolTip1.SetToolTip(this.intzaBBO, "Click Swap to Avg");
                 }
                 else if (e.Column.Name == "avg")
                 {
                     this.toolTip1.SetToolTip(this.intzaBBO, "Click Swap to " + this.getPOorPC());
                 }
                 else if (e.Column.Name == "chg")
                 {
                     this.toolTip1.SetToolTip(this.intzaBBO, "Click Swap to %Chg");
                 }
                 else if (e.Column.Name == "pchg")
                 {
                     this.toolTip1.SetToolTip(this.intzaBBO, "Click Swap to Chg");
                 }
                 else if (e.Column.Name == "mvol")
                 {
                     this.toolTip1.SetToolTip(this.intzaBBO, "Click Swap to Value");
                 }
                 else if (e.Column.Name == "mval")
                 {
                     this.toolTip1.SetToolTip(this.intzaBBO, "Click Swap to Volume");
                 }
                 else
                 {
                     this.toolTip1.SetToolTip(this.intzaBBO, "");
                 }
             }
         }
         else
         {
             this._isTT = string.Empty;
             this.toolTip1.Hide(this.intzaBBO);
         }
     }
     catch (Exception ex)
     {
         this.ShowError("intzaBBO_TableMouseMove", ex);
     }
 }
 private void intzaBBO_TableClickExpand(object sender, STIControl.ExpandTableGrid.TableMouseEventArgs e)
 {
     try
     {
         if (e.Column.Name == "stock")
         {
             if (!this.bgwReloadBBOExp.IsBusy)
             {
                 string text = this.intzaBBO.Records(e.RowIndex).Fields("stock").Text.ToString();
                 StockList.StockInformation stockInformation = ApplicationInfo.StockInfo[text];
                 if (stockInformation.Number > 0)
                 {
                     this._expStockNo = stockInformation.Number;
                     this._expCurrentIsSET = true;
                 }
                 else
                 {
                     SeriesList.SeriesInformation seriesInformation = ApplicationInfo.SeriesInfo[text];
                     if (!(seriesInformation.Symbol != string.Empty))
                     {
                         return;
                     }
                     this._expSeries = seriesInformation.Symbol;
                     this._expCurrentIsSET = false;
                 }
                 this._expRowId = e.RowIndex;
                 this.contextMenuStrip1.Show(this.intzaBBO, e.Mouse.Location);
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("intzaBBO_TableClickExpand", ex);
     }
 }
 private void intzaBBO_ItemDragDrop(object sender, STIControl.ExpandTableGrid.TableMouseEventArgs e, string dragValue)
 {
     try
     {
         if (this._mainGroupType == "Favorites")
         {
             if (dragValue != null && !string.IsNullOrEmpty(dragValue))
             {
                 this.tbStockBBO.Hide();
                 if (e != null && e.RowIndex <= this.intzaBBO.Rows - 1)
                 {
                     this.intzaBBO.FocusItemIndex = e.RowIndex;
                     this.SetBBONewStock(dragValue);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("intzaBBO_ItemDragDrop", ex);
     }
 }
Beispiel #13
0
 private void intzaTP_TableMouseClick(object sender, STIControl.SortTableGrid.TableMouseEventArgs e)
 {
     try
     {
         if (e.RowIndex >= 0 && (e.Column.Name == "bid" || e.Column.Name == "offer"))
         {
             SortGrid sortGrid = (SortGrid)sender;
             string text = string.Empty;
             text = ApplicationInfo.StockInfo[this._currStockNo].Symbol;
             if (!string.IsNullOrEmpty(text))
             {
                 if (Settings.Default.SmartOneClick)
                 {
                     string price = sortGrid.Records(e.RowIndex).Fields(e.Column.Name).Text.ToString();
                     string side = (e.Mouse.Button == MouseButtons.Left) ? "B" : "S";
                     TemplateManager.Instance.MainForm.SendOrderBox.SetSmartOneClick(side, text, price, false);
                 }
                 else
                 {
                     TemplateManager.Instance.MainForm.SendOrderBox.SetCurrentSymbol(text);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("intzaTP_TableMouseClick", ex);
     }
 }