Exemplo n.º 1
0
        private void contacts_ButtonClick(object sender, Resco.Controls.AdvancedList.CellEventArgs e)
        {
            switch (e.CellIndex)
            {
            case 0:
                //MessageBox.Show("Handle phone call: " + e.CellData);
                break;

            case 2:
                //MessageBox.Show("Handle e-mail.");
                break;

            case 3:
                //MessageBox.Show("Handle web link.");
                break;

            case 4:
                //MessageBox.Show("Show more info.");
                break;

            case 5:
                //MessageBox.Show("Show more info.");
                break;
            }
        }
Exemplo n.º 2
0
 private void HandleContextMenu(CellEventArgs cea, Point pos)
 {
     if (this.ContextMenu != null)
     {
         if (cea == null)
         {
             cea = this.GetCellAtPoint(pos);
         }
         this.HandleRowSelection(cea, this.SelectionMode == Resco.Controls.AdvancedList.SelectionMode.SelectDeselect, true);
         this.m_bShowingContextMenu = true;
         this.ContextMenu.Show(this, pos);
     }
 }
Exemplo n.º 3
0
 private void HandleRowSelection(CellEventArgs cea, bool bDisableDeselecting, bool bDisableRowEntered)
 {
     if ((cea != null) && (cea.DataRow != null))
     {
         Row dataRow = cea.DataRow;
         int currentTemplateIndex = dataRow.CurrentTemplateIndex;
         if (this.m_mode != Resco.Controls.AdvancedList.SelectionMode.NoSelect)
         {
             bool active = dataRow.Active;
             bool selected = dataRow.Selected;
             this.SuspendRedraw();
             if (this.m_mode == Resco.Controls.AdvancedList.SelectionMode.SelectDeselect)
             {
                 if (dataRow.Selected && bDisableDeselecting)
                 {
                     this.ResumeRedraw();
                     return;
                 }
                 dataRow.Selected = !dataRow.Selected;
             }
             else if (!dataRow.Selected)
             {
                 dataRow.Selected = true;
             }
             else if (!dataRow.Active)
             {
                 dataRow.Active = true;
             }
             this.ResumeRedraw();
             this.OnRowSelect(cea.DataRow, cea.RowIndex, cea.Offset, dataRow.Selected != selected, dataRow.Active != active);
         }
         if (((currentTemplateIndex == dataRow.CurrentTemplateIndex) && (cea.CellIndex >= 0)) && (this.CellClick != null))
         {
             this.CellClick(this, cea);
         }
         if ((!bDisableRowEntered && (this.m_rcRows != null)) && ((this.m_mode == Resco.Controls.AdvancedList.SelectionMode.SelectOnly) || ((this.m_mode == Resco.Controls.AdvancedList.SelectionMode.SelectDeselect) && !dataRow.Selected)))
         {
             this.OnRowEntered(new RowEnteredEventArgs(cea.DataRow, cea.RowIndex));
             if ((cea.CellIndex >= 0) && cea.Cell.IsSelectable(cea.DataRow))
             {
                 try
                 {
                     this.SelectedCell = cea.Cell;
                 }
                 catch
                 {
                 }
                 this.OnCellEntered(new CellEnteredMainEventArgs(cea.Cell, cea.CellIndex, cea.DataRow));
             }
             else
             {
                 this.SelectedCell = null;
             }
         }
     }
 }
Exemplo n.º 4
0
 protected virtual void OnButton(ButtonCell c, Row r, Point index, int yOffset)
 {
     CellEventArgs e = new CellEventArgs(r, c, index.X, index.Y, yOffset);
     if (this.ButtonClick != null)
     {
         this.ButtonClick(this, e);
     }
 }