Example #1
0
 /// <summary>
 /// Handles the CellPropertyChanged event of the tableCards control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="XPTable.Events.CellEventArgs"/> instance containing the event data.</param>
 /// <remarks>Documented by Dev05, 2007-10-01</remarks>
 private void tableCards_CellPropertyChanged(object sender, XPTable.Events.CellEventArgs e)
 {
     if (tableCards.TableModel.Rows.Count > 0 && buttonStart.Enabled)
     {
         LoadCardForEditing();
     }
 }
 /// <summary>
 /// Handles the CellPropertyChanged event of the tableOtherElements control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="XPTable.Events.CellEventArgs"/> instance containing the event data.</param>
 /// <remarks>Documented by Dev05, 2007-11-02</remarks>
 private void tableOtherElements_CellPropertyChanged(object sender, XPTable.Events.CellEventArgs e)
 {
     if (!actualizing)
     {
         Actualize(sender);
     }
 }
 private void tableBoneTransforms_CellPropertyChanged(object sender, XPTable.Events.CellEventArgs e)
 {
     if (e.EventType == XPTable.Events.CellEventType.CheckStateChanged)
     {
         int index = e.CellPos.Row;
         CompositeKeyFrame      selectedFrame = SelectedCompositeKeyFrame;
         CompositeBoneTransform boneTransform = selectedFrame.BoneTransforms[index];
         boneTransform.IsVisible = (bool)e.Cell.Checked;
     }
 }
 private void tableKeyFrames_CellPropertyChanged(object sender, XPTable.Events.CellEventArgs e)
 {
     // Duration
     if (e.Cell.Data != null)
     {
         Console.WriteLine("KF duration modified from " + e.OldValue + " to " + e.Cell.Data);
         CompositeKeyFrame selectedKeyFrame = SelectedCompositeKeyFrame;
         selectedKeyFrame.Duration = Int32.Parse(e.Cell.Data.ToString());
         SelectedCompositeAnimation.Reset();
         this.UpdatePreview = true;
     }
     else
     {
         Console.WriteLine("KF name modified from " + e.OldValue + " to " + e.Cell.Text);
         SelectedCompositeKeyFrame.Name = e.Cell.Text;
     }
 }
        private void tableFrames_CellPropertyChanged(object sender, XPTable.Events.CellEventArgs e)
        {
            AnimationFrame newFrame = new AnimationFrame();

            // Duration
            if (e.Cell.Data != null)
            {
                newFrame.Duration = Int32.Parse(e.Cell.Data.ToString());
                newFrame.Area     = this.SelectedAnimationInfo.AnimationFrames[this.SelectedAnimationFrameIndex].Area;
                SelectedAnimationInfo.Reset();
            }
            else
            {
                newFrame.Area     = e.Cell.Text;
                newFrame.Duration =
                    this.SelectedAnimationInfo.AnimationFrames[this.SelectedAnimationFrameIndex].Duration;
            }
            this.SelectedAnimationInfo.AnimationFrames[this.SelectedAnimationFrameIndex] = newFrame;
        }
Example #6
0
        private void artistTable_CellPropertyChanged(object sender, XPTable.Events.CellEventArgs e)
        {
            try
            {
                PersonGroupDataSet.PersonGroupRow personGroupRow = (PersonGroupDataSet.PersonGroupRow)personGroupTable.TableModel.Rows[e.Row].Tag;

                switch (e.Column)
                {
                case 0:
                    personGroupRow.Name = e.Cell.Text;
                    break;

                case 1:
                    personGroupRow.SaveAs = e.Cell.Text;
                    break;

                case 4:
                    personGroupRow.Country = e.Cell.Text;
                    break;

                case 7:
                    personGroupRow.URL = e.Cell.Text;
                    break;

                case 8:
                    personGroupRow.ImageFilename = e.Cell.Text;
                    break;

                case 9:
                    personGroupRow.Comment = e.Cell.Text;
                    break;
                }

                personGroupRow.EndEdit();
                personGroupAdapter.Update(personGroupRow);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Example #7
0
        void OnCellPropertyChanged(object sender, XPTable.Events.CellEventArgs e)
        {
            if (e.EventType != XPTable.Events.CellEventType.ValueChanged && e.EventType != XPTable.Events.CellEventType.CheckStateChanged)
            {
                return;
            }
            Model.FoldersRow folder = table.TableModel.Rows[e.Row].Tag as Model.FoldersRow;

            lock (folder)
            {
                // update model with the new value from table
                switch (e.CellPos.Column)
                {
                case 0:                         // project name
                    if (folder.Name != e.Cell.Text)
                    {
                        folder.Name = MakeUniqueName(e.Cell.Text);
                        e.Cell.Text = folder.Name;
                    }
                    folder.Enabled = e.Cell.Checked;
                    StrikeRow(table.TableModel.Rows[e.Row], !folder.Enabled);
                    break;

                case 1:                         // project path
                    folder.Path    = e.Cell.Text;
                    e.Cell.Checked = Directory.Exists(folder.Path);
                    break;

                case 2:                                                            // project type
                    folder.Type = e.Cell.Text;
                    table.TableModel.Rows[e.Row].Cells[0].Data = (int)e.Cell.Data; // set new project icon
                    table.InvalidateCell(e.Row, 0);
                    break;
                }
            }
        }
        void tableRegDescr_CellPropertyChanged(object sender, XPTable.Events.CellEventArgs e)
        {
            // MessageBox.Show( e.CellPos.Column + "\n" + e.CellPos.Row + "\n" + e.Cell.Text + "\n" +  tableRegDescr.TableModel.Rows[e.CellPos.Row].Cells[0].Text + "\n" + e.OldValue);

            if (e.Column == 1)
            {
                if (tableRegDescr.TableModel.Rows[e.CellPos.Row].Cells[0].Text == " Density")
                {
                    RMS.Density = Convert.ToDouble(tableRegDescr.TableModel.Rows[15].Cells[1].Data);
                    RMS.G       = RMS.Density * RMS.LinearVolume;
                    tableRegDescr.TableModel.Rows[16].Cells[1].Data = RMS.G;
                    tableRegDescr.TableModel.Rows[17].Cells[1].Data = RMS.G;
                    tableRegDescr.TableModel.Rows[18].Cells[1].Data = RMS.G * 9.80665;
                }

                return;
            }

            UnitsValue UnitToConvertTo = UnitsValue.Millimeters;

            foreach (UnitsValue aUnit in Enum.GetValues(typeof(UnitsValue)))
            {
                if (aUnit.ToString() == e.Cell.Text)
                {
                    UnitToConvertTo = aUnit;
                }
            }

            string     checkStr        = tableRegDescr.TableModel.Rows[e.CellPos.Row].Cells[0].Text;
            UnitsValue scaleUnitsValue = UnitsValue.Millimeters;
            string     sysUnits        = (Application.GetSystemVariable("INSUNITS")).ToString();

            switch (sysUnits)
            {
            case "1":
                scaleUnitsValue = UnitsValue.Inches;
                break;

            case "2":
                scaleUnitsValue = UnitsValue.Feet;
                break;

            case "4":
                scaleUnitsValue = UnitsValue.Millimeters;
                break;

            case "5":
                scaleUnitsValue = UnitsValue.Centimeters;
                break;

            case "6":
                scaleUnitsValue = UnitsValue.Meters;
                break;

            case "14":
                scaleUnitsValue = UnitsValue.Decimeters;
                break;

            default:
                MessageBox.Show("\nUnits to scale inserted content: UNRECOGNIZED ?!", "units E R R O R");
                break;
            }
            switch (checkStr.Remove(0, 1) /*tableRegDescr.TableModel.Rows[e.CellPos.Row].Cells[0].Text*/)
            {
            case "Area":
                RMS.AreaUnit = UnitToConvertTo;
                tableRegDescr.TableModel.Rows[0].Cells[1].Data = RMS.Area *
                                                                 Math.Pow(
                    UnitsConverter.GetConversionFactor(
                        scaleUnitsValue, RMS.AreaUnit), 2);
                break;

            case "Iy":
                RMS.IyUnit = UnitToConvertTo;
                tableRegDescr.TableModel.Rows[1].Cells[1].Data = RMS.Iy *
                                                                 Math.Pow(
                    UnitsConverter.GetConversionFactor(
                        scaleUnitsValue, RMS.IyUnit), 4);
                break;

            case "Wy_Upper":
                RMS.WyUpperUnit = UnitToConvertTo;
                tableRegDescr.TableModel.Rows[2].Cells[1].Data = RMS.WyUpper *
                                                                 Math.Pow(
                    UnitsConverter.GetConversionFactor(
                        scaleUnitsValue, RMS.WyUpperUnit), 3);
                break;

            case "Wy_Lower":
                RMS.WyLowerUnit = UnitToConvertTo;
                tableRegDescr.TableModel.Rows[3].Cells[1].Data = RMS.WyLower *
                                                                 Math.Pow(
                    UnitsConverter.GetConversionFactor(
                        scaleUnitsValue, RMS.WyLowerUnit), 3);
                break;

            case "D_Upper":
                RMS.DUpperUnit = UnitToConvertTo;
                tableRegDescr.TableModel.Rows[4].Cells[1].Data = RMS.DUpper *
                                                                 Math.Pow(
                    UnitsConverter.GetConversionFactor(
                        scaleUnitsValue, RMS.DUpperUnit), 1);
                break;

            case "D_Lower":
                RMS.DLowerUnit = UnitToConvertTo;
                tableRegDescr.TableModel.Rows[5].Cells[1].Data = RMS.DLower *
                                                                 Math.Pow(
                    UnitsConverter.GetConversionFactor(
                        scaleUnitsValue, RMS.DLowerUnit), 1);
                break;

            case "Iyy":
                RMS.IyyUnit = UnitToConvertTo;
                tableRegDescr.TableModel.Rows[6].Cells[1].Data = RMS.Iyy *
                                                                 Math.Pow(
                    UnitsConverter.GetConversionFactor(
                        scaleUnitsValue, RMS.IyyUnit), 1);
                break;

            case "Iz":
                RMS.IzUnit = UnitToConvertTo;
                tableRegDescr.TableModel.Rows[7].Cells[1].Data = RMS.Iz *
                                                                 Math.Pow(
                    UnitsConverter.GetConversionFactor(
                        scaleUnitsValue, RMS.IzUnit), 4);
                break;

            case "Wz_Right":
                RMS.WzRightUnit = UnitToConvertTo;
                tableRegDescr.TableModel.Rows[8].Cells[1].Data = RMS.WzRight *
                                                                 Math.Pow(
                    UnitsConverter.GetConversionFactor(
                        scaleUnitsValue, RMS.WzRightUnit), 3);
                break;

            case "Wz_Left":
                RMS.WzLeftUnit = UnitToConvertTo;
                tableRegDescr.TableModel.Rows[9].Cells[1].Data = RMS.WzLeft *
                                                                 Math.Pow(
                    UnitsConverter.GetConversionFactor(
                        scaleUnitsValue, RMS.WzLeftUnit), 3);
                break;

            case "D_Right":
                RMS.DRightUnit = UnitToConvertTo;
                tableRegDescr.TableModel.Rows[10].Cells[1].Data = RMS.DRight *
                                                                  Math.Pow(
                    UnitsConverter.GetConversionFactor(
                        scaleUnitsValue, RMS.DRightUnit), 1);
                break;

            case "D_Left":
                RMS.DLeftUnit = UnitToConvertTo;
                tableRegDescr.TableModel.Rows[11].Cells[1].Data = RMS.DLeft *
                                                                  Math.Pow(
                    UnitsConverter.GetConversionFactor(
                        scaleUnitsValue, RMS.DLeftUnit), 1);
                break;

            case "Izz":
                RMS.IzzUnit = UnitToConvertTo;
                tableRegDescr.TableModel.Rows[12].Cells[1].Data = RMS.Izz *
                                                                  Math.Pow(
                    UnitsConverter.GetConversionFactor(
                        scaleUnitsValue, RMS.IzzUnit), 1);
                break;

            case "Imin":
                RMS.IminUnit = UnitToConvertTo;
                tableRegDescr.TableModel.Rows[13].Cells[1].Data = RMS.Imin *
                                                                  Math.Pow(
                    UnitsConverter.GetConversionFactor(
                        scaleUnitsValue, RMS.IminUnit), 4);
                break;

            case "Imax":
                RMS.ImaxUnit = UnitToConvertTo;
                tableRegDescr.TableModel.Rows[14].Cells[1].Data = RMS.Imax *
                                                                  Math.Pow(
                    UnitsConverter.GetConversionFactor(
                        scaleUnitsValue, RMS.ImaxUnit), 4);
                break;
                // case "Density":
                // RMS.DensityUnit = UnitToConvertTo;
                //  break;
                //   case "G":
                //RMS.GUnit = UnitToConvertTo;
                //     break;
                //   case "LinearVolume":
                //     RMS.LinearVolumeUnit = UnitToConvertTo;
                //    break;
            }

            // RegionDescription.DrawText( ref RMS );
        }
Example #9
0
        /// <summary>
        /// Handles the PropertyChanged event of the XSLStyleEdit control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="XPTable.Events.CellEventArgs"/> instance containing the event data.</param>
        /// <remarks>Documented by Dev05, 2007-10-30</remarks>
        void XSLStyleEdit_PropertyChanged(object sender, XPTable.Events.CellEventArgs e)
        {
            if (!loading)
            {
                XSLStyleElement element = (e.Cell.Tag as XSLStyleElement);
                if (e.Cell.ToolTipText == "color" || e.Cell.ToolTipText == "background-color")
                {
                    Color color = (Color)e.Cell.Data;
                    if (element.Items.ContainsKey(e.Cell.ToolTipText))
                    {
                        element.Items[e.Cell.ToolTipText] = string.Format("#{0:x2}{1:x2}{2:x2}", color.R, color.G, color.B);
                    }
                    else
                    {
                        element.Items.Add(e.Cell.ToolTipText, string.Format("#{0:x2}{1:x2}{2:x2}", color.R, color.G, color.B));
                    }
                }
                else if (e.Cell.ToolTipText == "HAlign")
                {
                    if (e.Cell.Text == horizontalElements[0].ToString())
                    {
                        element.Items.Remove("text-align");
                    }
                    else
                    {
                        EnumLocalizer textAlign = horizontalElements.Find(delegate(EnumLocalizer loc)
                        {
                            return(loc.ToString().Equals(e.Cell.Text, StringComparison.CurrentCultureIgnoreCase));
                        });
                        if (textAlign == null)
                        {
                            element.Items.Remove("text-align");
                        }
                        else
                        {
                            if (element.Items.ContainsKey("text-align"))
                            {
                                element.Items["text-align"] = textAlign.value.ToString().ToLower();
                            }
                            else
                            {
                                element.Items.Add("text-align", textAlign.value.ToString().ToLower());
                            }
                        }
                    }
                }
                else if (e.Cell.ToolTipText == "float")
                {
                    if (element.Items.ContainsKey("float"))
                    {
                        element.Items["float"] = e.Cell.Text;
                    }
                    else
                    {
                        element.Items.Add("float", e.Cell.Text);
                    }

                    if (e.Cell.Text == horizontalElements[0].ToString())
                    {
                        element.Items.Remove("float");
                    }
                }
                else if (e.Cell.ToolTipText == "VAlign")
                {
                    if (e.Cell.Text == verticalElements[0].ToString())
                    {
                        element.Items.Remove("vertical-align");
                    }
                    else
                    {
                        EnumLocalizer verticalAlign = verticalElements.Find(delegate(EnumLocalizer loc)
                        {
                            return(loc.ToString().Equals(e.Cell.Text, StringComparison.CurrentCultureIgnoreCase));
                        });
                        if (verticalAlign == null)
                        {
                            element.Items.Remove("vertical-align");
                        }
                        else
                        {
                            if (element.Items.ContainsKey("vertical-align"))
                            {
                                element.Items["vertical-align"] = verticalAlign.value.ToString().ToLower();
                            }
                            else
                            {
                                element.Items.Add("vertical-align", verticalAlign.value.ToString().ToLower());
                            }
                        }
                    }
                }
                SaveFile();
                ShowPreview();
            }
        }
Example #10
0
 void tableExcludes_Changed(object sender, XPTable.Events.CellEventArgs e)
 {
     SaveTo(folder);
     tableTester.ReEval(folder);
 }