コード例 #1
0
 private void intzaTableGrid1_TableMouseClick(object sender, TableMouseEventArgs e)
 {
     try
     {
         if (e.RowIndex == -1)
         {
             string name = e.Column.Name;
             if (name != null)
             {
                 if (name == "side" || name == "stock")
                 {
                     if (this.intza.SortType == SortType.Asc)
                     {
                         this.intza.Sort(e.Column.Name, SortType.Desc);
                     }
                     else
                     {
                         this.intza.Sort(e.Column.Name, SortType.Asc);
                     }
                     this.intza.Redraw();
                 }
             }
         }
         else if (e.RowIndex > -1 && e.RowIndex <= this.intza.Rows - 1)
         {
             this._isUpdate = true;
             RecordItem recordItem = this.intza.Records(e.RowIndex);
             if (recordItem.Fields("side").Text.ToString() == "B")
             {
                 this.cbSide.Text = "BUY";
             }
             else if (recordItem.Fields("side").Text.ToString() == "S")
             {
                 this.cbSide.Text = "SELL";
             }
             else
             {
                 this.cbSide.Text = "";
             }
             this.tbStock.Text = recordItem.Fields("stock").Text.ToString();
             this.tbPrice.Text = Utilities.PriceFormat(recordItem.Fields("price").Text.ToString());
             this.tbVolume.Text = FormatUtil.VolumeFormat(recordItem.Fields("volume").Text.ToString(), true);
             this._isUpdate = false;
         }
     }
     catch (Exception ex)
     {
         this.ShowError("TableMouseClick", ex);
     }
 }
コード例 #2
0
 private void intzaOrderListTFEX_TableMouseClick(object sender, TableMouseEventArgs e)
 {
     try
     {
         if (e.Mouse.Button == MouseButtons.Left)
         {
             if (e.RowIndex == -1)
             {
                 string name = e.Column.Name;
                 if (name != null)
                 {
                     if (name == "checkbox")
                     {
                         this.SelectAllOrderForCancel(!this._isSelectAll);
                     }
                 }
             }
             else
             {
                 string name = e.Column.Name;
                 if (name != null)
                 {
                     if (!(name == "checkbox"))
                     {
                         if (name == "info")
                         {
                             if (this.intzaOrderListTFEX.FocusItemIndex >= 0)
                             {
                                 long orderNumber = Convert.ToInt64(this.intzaOrderListTFEX.Records(e.RowIndex).Fields("order_number").Text);
                                 string sendDate = this.intzaOrderListTFEX.Records(this.intzaOrderListTFEX.FocusItemIndex).Fields("send_date").Text.ToString().Trim();
                                 string orderType = this.intzaOrderListTFEX.Records(this.intzaOrderListTFEX.FocusItemIndex).Fields("ordType").Text.ToString().Trim();
                                 this.CallOrderInfoTfex(sendDate, orderType, orderNumber);
                             }
                         }
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("intzaOrderList_TableMouseClick", ex);
     }
 }
コード例 #3
0
 private void sortGrid_TableMouseClick(object sender, TableMouseEventArgs e)
 {
     try
     {
         if (e.RowIndex > -1)
         {
             if (e.Mouse.Button == MouseButtons.Left)
             {
                 if (e.Column.Name == "buyvol")
                 {
                     string price = this.sortGrid.Records(e.RowIndex).Fields("price").Text.ToString();
                     TemplateManager.Instance.MainForm.SendOrderBox.SetSmartOneClick("B", this._stockInfo.Symbol, price, false);
                 }
                 else if (e.Column.Name == "sellvol")
                 {
                     string price = this.sortGrid.Records(e.RowIndex).Fields("price").Text.ToString();
                     TemplateManager.Instance.MainForm.SendOrderBox.SetSmartOneClick("S", this._stockInfo.Symbol, price, false);
                 }
                 else if (e.Column.Name == "buycancel")
                 {
                     if (this.sortGrid.Records(e.RowIndex).Fields(e.Column.Name).Text.ToString() == "1")
                     {
                         this._cancelSide = "B";
                         decimal.TryParse(this.sortGrid.Records(e.RowIndex).Fields("price").Text.ToString(), out this._cancelPrice);
                         if (!this.bgwGetOrderForCancel.IsBusy)
                         {
                             this._cancelLocation = new Point(e.Mouse.X, e.FieldPosition.Top);
                             if (!this.bgwGetOrderForCancel.IsBusy)
                             {
                                 this.bgwGetOrderForCancel.RunWorkerAsync();
                             }
                         }
                     }
                 }
                 else if (e.Column.Name == "sellcancel")
                 {
                     if (this.sortGrid.Records(e.RowIndex).Fields(e.Column.Name).Text.ToString() == "1")
                     {
                         this._cancelSide = "S";
                         decimal.TryParse(this.sortGrid.Records(e.RowIndex).Fields("price").Text.ToString(), out this._cancelPrice);
                         if (!this.bgwGetOrderForCancel.IsBusy)
                         {
                             this._cancelLocation = new Point(e.Mouse.X, e.FieldPosition.Top);
                             if (!this.bgwGetOrderForCancel.IsBusy)
                             {
                                 this.bgwGetOrderForCancel.RunWorkerAsync();
                             }
                         }
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("sortGrid_TableMouseClick", ex);
     }
 }
コード例 #4
0
 private void tableStockList_TableMouseClick(object sender, TableMouseEventArgs e)
 {
     this.LoadByStock(this.tableStockList.Records(this.tableStockList.FocusItemIndex).Fields("stock").Text.ToString());
 }
コード例 #5
0
 private void intzaOrder_TableMouseClick(object sender, TableMouseEventArgs e)
 {
     try
     {
         if (e.Mouse.Button == MouseButtons.Left)
         {
             if (e.RowIndex == -1)
             {
                 string name = e.Column.Name;
                 if (name != null)
                 {
                     if (!(name == "checkbox"))
                     {
                         if (name == "ref_no" || name == "side" || name == "stock")
                         {
                             if (this.intzaOrder.SortType == SortType.Asc)
                             {
                                 this.intzaOrder.Sort(e.Column.Name, SortType.Desc);
                             }
                             else
                             {
                                 this.intzaOrder.Sort(e.Column.Name, SortType.Asc);
                             }
                             this.intzaOrder.Redraw();
                         }
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("intzaOrderList_TableMouseClick", ex);
     }
 }
コード例 #6
0
 private void intzaStockInPlay_TableMouseClick(object sender, TableMouseEventArgs e)
 {
     try
     {
         if (e.RowIndex >= 0)
         {
             if (Settings.Default.SmartOneClick)
             {
                 string side = (e.Mouse.Button == MouseButtons.Left) ? "B" : "S";
                 string text = this.intzaStockInPlay.Records(e.RowIndex).Fields("price").Text.ToString();
                 text = text.Replace("+", "");
                 text = text.Replace("-", "");
                 TemplateManager.Instance.MainForm.SendOrderBox.SetSmartOneClick(side, ApplicationInfo.CurrentSymbol, text, false);
             }
             else
             {
                 TemplateManager.Instance.MainForm.SendOrderBox.SetCurrentSymbol(ApplicationInfo.CurrentSymbol);
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("intzaStockInPlay_TableMouseClick", ex);
     }
 }
コード例 #7
0
 private void gridPzDetail_TableMouseClick(object sender, TableMouseEventArgs e)
 {
     try
     {
         if (e.RowIndex > -1)
         {
         }
     }
     catch (Exception ex)
     {
         this.ShowError("gridPzDetail_TableMouseClick", ex);
     }
 }
コード例 #8
0
 private void intzaOrderList_TableMouseDoubleClick(object sender, TableMouseEventArgs e)
 {
     try
     {
         if (e.Column.Name == "checkbox" && e.RowIndex == -1)
         {
             this.tsbtnCancelOrder.PerformClick();
         }
         else
         {
             long orderNumber = Convert.ToInt64(this.intzaOrderList.Records(e.RowIndex).Fields("order_number").Text);
             string sendDate = this.intzaOrderList.Records(this.intzaOrderList.FocusItemIndex).Fields("send_date").Text.ToString().Trim();
             string isFwAfterClose = this.intzaOrderList.Records(this.intzaOrderList.FocusItemIndex).Fields("offline").Text.ToString().Trim();
             this.CallOrderInfo(sendDate, orderNumber, isFwAfterClose);
         }
     }
     catch (Exception ex)
     {
         this.ShowError("lsvOrderList_DoubleClick", ex);
     }
 }
コード例 #9
0
 private void sortGrid1_TableMouseDoubleClick(object sender, TableMouseEventArgs e)
 {
     try
     {
         if ((float)e.Mouse.Y > this.sortGrid1.RowHeight)
         {
             string name = e.Column.Name;
             switch (name)
             {
             case "dateopen":
             case "dateclose":
             case "direction":
             case "positionsize":
             case "entryprice":
             case "stoploss":
             case "takeprofit":
             case "exitprice":
             case "loss":
             case "profit":
                 this.SetTextPosition(e.RowIndex, e.Column.Name);
                 break;
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("intza_TableMouseClick", ex);
     }
 }
コード例 #10
0
 private void sortGridTfex_TableMouseClick(object sender, TableMouseEventArgs e)
 {
     if (e.RowIndex == -1)
     {
         if (e.Column.Name == "unreal_settle")
         {
             this.sortGridTfex.GetColumn("unreal_settle").Visible = false;
             this.sortGridTfex.GetColumn("cost_settle").Visible = false;
             this.sortGridTfex.GetColumn("unreal_cost").Visible = true;
             this.sortGridTfex.GetColumn("cost_avg").Visible = true;
             this.sortGridTfexSumm.GetColumn("unreal_settle").Visible = false;
             this.sortGridTfexSumm.GetColumn("unreal_cost").Visible = true;
             this.sortGridTfex.Redraw();
             this.sortGridTfexSumm.Redraw();
         }
         else if (e.Column.Name == "unreal_cost")
         {
             this.sortGridTfex.GetColumn("unreal_settle").Visible = true;
             this.sortGridTfex.GetColumn("cost_settle").Visible = true;
             this.sortGridTfex.GetColumn("unreal_cost").Visible = false;
             this.sortGridTfex.GetColumn("cost_avg").Visible = false;
             this.sortGridTfexSumm.GetColumn("unreal_cost").Visible = false;
             this.sortGridTfexSumm.GetColumn("unreal_settle").Visible = true;
             this.sortGridTfex.Redraw();
             this.sortGridTfexSumm.Redraw();
         }
     }
 }
コード例 #11
0
 private void intzaReport_TableMouseClick(object sender, TableMouseEventArgs e)
 {
     try
     {
         if (!ApplicationInfo.SupportFreewill)
         {
             if (e.RowIndex == -1)
             {
                 if (e.Column.Name == "realize")
                 {
                     this.intzaReport.GetColumn("realize").Visible = false;
                     this.intzaReport.GetColumn("netsettle").Visible = true;
                     this.intzaReport.Redraw();
                     this.setSummaryTab();
                 }
                 else if (e.Column.Name == "netsettle")
                 {
                     this.intzaReport.GetColumn("netsettle").Visible = false;
                     this.intzaReport.GetColumn("realize").Visible = true;
                     this.intzaReport.Redraw();
                     this.setSummaryTab();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("intzaReport_TableMouseClick", ex);
     }
 }
コード例 #12
0
 private void intzaTableGrid1_TableMouseMove(TableMouseEventArgs e)
 {
     try
     {
         if (e.RowIndex >= 0)
         {
             if (!string.IsNullOrEmpty(this.intza1.Records(e.RowIndex).Fields("url").Text.ToString()))
             {
                 this.Cursor = Cursors.Hand;
             }
             else
             {
                 this.Cursor = Cursors.Default;
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("Open News Website", ex);
     }
 }
コード例 #13
0
 private void intzaTableGrid1_TableMouseDoubleClick(object sender, TableMouseEventArgs e)
 {
     if (e.Mouse.Button == MouseButtons.Left)
     {
         this.CallDetailBox(e.RowIndex);
     }
 }
コード例 #14
0
 private void intzaOrderListTFEX_TableMouseDoubleClick(object sender, TableMouseEventArgs e)
 {
     try
     {
         if (!(e.Column.Name == "checkbox") || e.RowIndex != -1)
         {
             long orderNumber = Convert.ToInt64(this.intzaOrderListTFEX.Records(e.RowIndex).Fields("order_number").Text);
             string sendDate = this.intzaOrderListTFEX.Records(this.intzaOrderListTFEX.FocusItemIndex).Fields("send_date").Text.ToString().Trim();
             string orderType = this.intzaOrderListTFEX.Records(this.intzaOrderListTFEX.FocusItemIndex).Fields("ordType").Text.ToString().Trim();
             this.CallOrderInfoTfex(sendDate, orderType, orderNumber);
         }
     }
     catch (Exception ex)
     {
         this.ShowError("lsvOrderList_DoubleClick", ex);
     }
 }
コード例 #15
0
 private void intzaLog_TableMouseDoubleClick(object sender, TableMouseEventArgs e)
 {
     try
     {
         this.ShowPushLogMessage(this.intzaLog.Records(e.RowIndex).Fields("message").Text.ToString());
     }
     catch (Exception ex)
     {
         this.ShowError("intzaLog_TableMouseDoubleClick", ex);
     }
 }
コード例 #16
0
 private void intzaOrderList_TableMouseClick(object sender, TableMouseEventArgs e)
 {
     try
     {
         if (e.Mouse.Button == MouseButtons.Left)
         {
             if (e.RowIndex == -1)
             {
                 string name = e.Column.Name;
                 switch (name)
                 {
                 case "checkbox":
                     this.SelectAllOrderForCancel(!this._isSelectAll);
                     break;
                 case "order_number":
                 case "side":
                 case "stock":
                 case "status":
                 case "time":
                 case "ttf":
                 case "quote":
                     if (this.intzaOrderList.SortType == SortType.Asc)
                     {
                         this.intzaOrderList.Sort(e.Column.Name, SortType.Desc);
                     }
                     else
                     {
                         this.intzaOrderList.Sort(e.Column.Name, SortType.Asc);
                     }
                     this.intzaOrderList.Redraw();
                     break;
                 }
             }
             else
             {
                 string name = e.Column.Name;
                 if (name != null)
                 {
                     if (!(name == "checkbox"))
                     {
                         if (name == "info")
                         {
                             if (this.intzaOrderList.FocusItemIndex >= 0)
                             {
                                 long orderNumber = Convert.ToInt64(this.intzaOrderList.Records(this.intzaOrderList.FocusItemIndex).Fields("order_number").Text);
                                 string sendDate = this.intzaOrderList.Records(this.intzaOrderList.FocusItemIndex).Fields("send_date").Text.ToString().Trim();
                                 string isFwAfterClose = this.intzaOrderList.Records(this.intzaOrderList.FocusItemIndex).Fields("offline").Text.ToString().Trim();
                                 this.CallOrderInfo(sendDate, orderNumber, isFwAfterClose);
                             }
                         }
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("intzaOrderList_TableMouseClick", ex);
     }
 }
コード例 #17
0
 private void intzaPortAlert_TableMouseClick(object sender, TableMouseEventArgs e)
 {
     try
     {
         if (e.RowIndex > -1)
         {
             RecordItem recordItem = this.intzaPortAlert.Records(e.RowIndex);
             this.tbPortStock.Text = recordItem.Fields("stock").Text.ToString();
             this.tbPortType.Text = recordItem.Fields("sType").Text.ToString();
             this.tbPortTTF.Text = recordItem.Fields("trusteeId").Text.ToString();
             this._costPct = 0m;
             this._sellPct = 0m;
             this._pChg = 0m;
             this.tbPortPCost.Text = Utilities.PriceFormat(recordItem.Fields("cost").Text, 2, 0);
             this.tbPortPchg.Text = Utilities.PriceFormat(recordItem.Fields("pchg").Text, 2, 0);
             this.tbPortPCost.Focus();
         }
     }
     catch (Exception ex)
     {
         this.ShowError("intzaPortAlert_TableMouseClick", ex);
     }
 }
コード例 #18
0
 private void gridPzMain_TableMouseDoubleClick(object sender, TableMouseEventArgs e)
 {
     try
     {
         if (e.RowIndex > -1)
         {
             long refNo;
             long.TryParse(this.gridPzMain.Records(e.RowIndex).Fields("refno").Text.ToString(), out refNo);
             if (this._frmPzInfo != null)
             {
                 if (!this._frmPzInfo.IsDisposed)
                 {
                     this._frmPzInfo.FormClosed -= new FormClosedEventHandler(this.frmPzInfo_FormClosed);
                     this._frmPzInfo.Dispose();
                 }
                 this._frmPzInfo = null;
             }
             this._frmPzInfo = new frmPzItemsInfo(refNo, this.gridPzMain.Records(e.RowIndex).Fields("stock").Text.ToString());
             this._frmPzInfo.FormClosed -= new FormClosedEventHandler(this.frmPzInfo_FormClosed);
             this._frmPzInfo.FormClosed += new FormClosedEventHandler(this.frmPzInfo_FormClosed);
             this._frmPzInfo.TopLevel = false;
             this._frmPzInfo.Parent = this.panelPZ;
             this._frmPzInfo.Bounds = new Rectangle(0, 0, this.panelPZ.Width, this.panelPZ.Height);
             this._frmPzInfo.TopMost = true;
             this._frmPzInfo.Show();
             this._frmPzInfo.BringToFront();
         }
     }
     catch (Exception ex)
     {
         this.ShowError("grid3_TableMouseDoubleClick", ex);
     }
 }
コード例 #19
0
 private void sortGrid1_TableMouseClick(object sender, TableMouseEventArgs e)
 {
     try
     {
         if (e.RowIndex == -1)
         {
             string name = e.Column.Name;
             if (name != null)
             {
                 if (!(name == "checkbox"))
                 {
                     if (name == "side" || name == "stock" || name == "volume" || name == "price" || name == "pubvol")
                     {
                         if (this.sortGrid1.SortType == SortType.Asc)
                         {
                             this.sortGrid1.Sort(e.Column.Name, SortType.Desc);
                         }
                         else
                         {
                             this.sortGrid1.Sort(e.Column.Name, SortType.Asc);
                         }
                         this.sortGrid1.Redraw();
                     }
                 }
                 else
                 {
                     this.SelectAllOrderForCancel(!this._isSelectAll);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("intza_TableMouseClick", ex);
     }
 }
コード例 #20
0
 private void intzaTopActive_TableMouseClick(object sender, TableMouseEventArgs e)
 {
     try
     {
         if (e.RowIndex >= 0)
         {
             string text = this.intzaTopActive.Records(e.RowIndex).Fields("stock").Text.ToString();
             if (!string.IsNullOrEmpty(text.Trim()))
             {
                 if (Settings.Default.SmartOneClick)
                 {
                     if (e.Column.Name == "high" || e.Column.Name == "low" || e.Column.Name == "last")
                     {
                         string price = this.intzaTopActive.Records(e.RowIndex).Fields("last").Text.ToString();
                         if (e.Column.Name == "high" || e.Column.Name == "low")
                         {
                             price = this.intzaTopActive.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);
                     }
                 }
                 if (e.Column.Name == "stock")
                 {
                     if (e.Mouse.Button == MouseButtons.Right)
                     {
                         this.contextLink.Tag = text;
                         this.contextLink.Show(this.intzaProjectedOpen, new Point(e.Mouse.X, e.Mouse.Y));
                     }
                     else
                     {
                         TemplateManager.Instance.MainForm.SendOrderBox.SetCurrentSymbol(text);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("intzaTopActive_TableMouseClick", ex);
     }
 }
コード例 #21
0
 private void sortGrid1_TableMouseDoubleClick(object sender, TableMouseEventArgs e)
 {
     try
     {
         if ((float)e.Mouse.Y > this.sortGrid1.RowHeight)
         {
             string name = e.Column.Name;
             switch (name)
             {
             case "side":
             case "stock":
             case "ttf":
             case "volume":
             case "price":
             case "pubvol":
             case "condition":
             case "deposit":
                 this.SetTextPosition(e.RowIndex, e.Column.Name);
                 break;
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("intza_TableMouseClick", ex);
     }
 }
コード例 #22
0
 private void intzaViewOddLot_TableMouseClick(object sender, TableMouseEventArgs e)
 {
     try
     {
         if (e.RowIndex >= 0)
         {
             if (Settings.Default.SmartOneClick)
             {
                 string price = string.Empty;
                 string side = (e.Mouse.Button == MouseButtons.Left) ? "B" : "S";
                 if (e.Column.Name == "bid" || e.Column.Name == "offer")
                 {
                     price = this.intzaViewOddLot.Records(e.RowIndex).Fields(e.Column.Name).Text.ToString();
                 }
                 TemplateManager.Instance.MainForm.SendOrderBox.SetSmartOneClick(side, ApplicationInfo.CurrentSymbol, price, false);
             }
             else
             {
                 TemplateManager.Instance.MainForm.SendOrderBox.SetCurrentSymbol(ApplicationInfo.CurrentSymbol);
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("intzaViewOddLot_TableMouseClick", ex);
     }
 }
コード例 #23
0
 private void sortGrid_ItemDragDrop(object sender, TableMouseEventArgs e, string dragValue)
 {
     this.setNewStock(dragValue, false);
 }