void Selection_SelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
        {
            if (FParentForm.FIAmUpdating == 0)
            {
                int         previousRowId = FPrevRowChangedRow;
                int         newRowId      = grdCostCentres.Selection.ActivePosition.Row;
                DataRowView rowView       = (DataRowView)grdCostCentres.Rows.IndexToDataSourceRow(newRowId);

                if (rowView == null)
                {
                    FPreviouslySelectedDetailRow = null;
                    FParentForm.SetSelectedCostCentre(null);
                    FParentForm.PopulateControlsAfterRowSelection();
                    Console.WriteLine("Selected row is NULL");
                }
                else
                {
                    FPreviouslySelectedDetailRow = rowView.Row;
                    String SelectedCostCentreCode = ((ACostCentreRow)rowView.Row).CostCentreCode;
                    FParentForm.SetSelectedCostCentreCode(SelectedCostCentreCode);

                    if (previousRowId == -1)
                    {
                        FParentForm.PopulateControlsAfterRowSelection();
                    }

                    Console.WriteLine("Row is {0}", FPreviouslySelectedDetailRow.ItemArray[1]);
                }

                FPrevRowChangedRow = newRowId;
            }
        }
        private void OnSelChangeGrid(object sender, SourceGrid.RangeRegionChangedEventArgs e)
        {
            try
            {
                // analysis name/description
                if (null != SelectedAnalysis)
                {
                    AnalysisName        = string.Format("Analysis_{0}_in_{1}", SelectedAnalysis.Content.Name, SelectedAnalysis.Container.Name);
                    AnalysisDescription = string.Format(" Packing {0} in {1}", SelectedAnalysis.Content.Name, SelectedAnalysis.Container.Name);
                }
                else
                {
                    AnalysisName        = string.Empty;
                    AnalysisDescription = string.Empty;
                }
                // update drawing
                graphCtrl.Invalidate();

                UpdateStatus(string.Empty);
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message);
            }
        }
        private void onSelChangeGrid(object sender, SourceGrid.RangeRegionChangedEventArgs e)
        {
            try
            {
                SourceGrid.Selection.RowSelection select = sender as SourceGrid.Selection.RowSelection;
                SourceGrid.Grid g = select.Grid as SourceGrid.Grid;

                SourceGrid.RangeRegion region = g.Selection.GetSelectionRegion();
                int[] indexes = region.GetRowsIndex();
                if (indexes.Length < 1 || indexes[0] < 1)
                {
                    _selectedAnalysis = null;
                }
                else
                {
                    _selectedAnalysis = _analyses[indexes[0] - 1];
                    // analysis name/description
                    if (null != _selectedAnalysis)
                    {
                        BoxProperties  box  = SelectedBox;
                        PackProperties pack = _selectedAnalysis.Content as PackProperties;
                        UpdateStatus(string.Empty);
                    }
                }

                graphCtrlPack.Invalidate();
                graphCtrlSolution.Invalidate();
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message);
            }
        }
Пример #4
0
 void Selection_SelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
 {
     // redraw
     graphCtrlBoxesLayout.Invalidate();
     graphCtrlPallet.Invalidate();
     // update "Add solution" button status
     UpdateButtonAddSolutionStatus();
 }
Пример #5
0
        void Selection_SelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
        {
            object[] rows = dataGrid.SelectedDataRows;
            if (rows != null && rows.Length > 0)
            {
                DataRowView row = (DataRowView)rows[0];

                lblSelectedRow.Text = row["Country"].ToString();
            }
        }
Пример #6
0
        /*
         *  SourceGrid用イベント
         */
        #region SGEvent

        // 選択行変更時
        private void Selection_SelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
        {
            int intActRow = griList.Selection.ActivePosition.Row;

            if (intActRow > 0)
            {
                SettingPreviewWallpaper(txtWallpaperFolder.Text + "\\" + griList[intActRow, (int)MainProgram.enuGrid.FILENAME].Value);
                this.PreviewFileName = Path.GetFileName((string)griList[intActRow, (int)MainProgram.enuGrid.FILENAME].Value);
                lblPreviewSize.Text  = (string)griList[intActRow, (int)MainProgram.enuGrid.WALLPAPERSIZE].Value + " pixel";
            }
        }
Пример #7
0
 private void onGridSolutionSelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
 {
     SourceGrid.RangeRegion region = gridSolutions.Selection.GetSelectionRegion();
     int[] indexes = region.GetRowsIndex();
     // no selection -> exit
     if (indexes.Length == 0)
     {
         return;
     }
     // redraw
     Draw();
 }
 void Selection_SelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
 {
     int[] rows = channelsGrid.Selection.GetSelectionRegion().GetRowsIndex();
     if (rows.Length > 0)
     {
         if (SelectChannel != null)
         {
             SelectChannel(this.channelsGrid.Rows[rows[0]].Tag);
         }
         //this.propertyGrid.SelectedObject = this.channelsGrid.Rows[rows[0]].Tag;
         //this.propertyGrid.ReadOnly = true;
     }
 }
Пример #9
0
        private void OnSolutionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
        {
            if (PreventUpdate)
            {
                return;
            }

            if (SelectedSolutionIndex != _selectedSolutionIndex)
            {
                _selectedSolutionIndex = SelectedSolutionIndex;
                OnSolutionChangedActual();
            }
        }
Пример #10
0
 private void onGridSolutionSelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
 {
     SourceGrid.RangeRegion region = gridSolutions.Selection.GetSelectionRegion();
     int[] indexes = region.GetRowsIndex();
     // no selection -> exit
     if (indexes.Length == 0)
     {
         return;
     }
     // update select/unselect button text
     UpdateSelectButtonText();
     // redraw
     graphCtrlCaseSolution.Invalidate();
     graphCtrlPalletSolution.Invalidate();
 }
 private void onGridSolutionSelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
 {
     SourceGrid.RangeRegion region = gridSolutions.Selection.GetSelectionRegion();
     int[] indexes = region.GetRowsIndex();
     // no selection -> exit
     if (indexes.Length == 0)
     {
         return;
     }
     // get selected solution
     _sol = _analysis.Solutions[indexes[0] - 1];
     // redraw
     graphCtrlCase.Invalidate();
     graphCtrlPallet.Invalidate();
 }
Пример #12
0
 void Selection_SelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
 {
     SourceGrid.RangeRegion region = gridSolutions.Selection.GetSelectionRegion();
     int[] indexes = region.GetRowsIndex();
     // no selection -> exit
     if (indexes.Length == 0)
     {
         return;
     }
     // redraw
     graphCtrlBoxesLayout.Invalidate();
     graphCtrlPallet.Invalidate();
     // update "Add solution" button status
     UpdateButtonAddSolutionStatus();
 }
Пример #13
0
 private void onGridSolutionSelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
 {
     SourceGrid.RangeRegion region = gridSolutions.Selection.GetSelectionRegion();
     int[] indexes = region.GetRowsIndex();
     // no selection -> exit
     if (indexes.Length == 0)
     {
         return;
     }
     // get selected solution
     _sol = _analysis.Solutions[indexes[0] - 1];
     // update select/unselect button text
     UpdateSelectButtonText();
     // redraw
     Draw();
 }
Пример #14
0
            protected void Selection_SelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
            {
                int selectedRow = -1;

                if (sender is SourceGrid.Selection.SelectionBase)
                {
                    SourceGrid.Selection.SelectionBase sel = (sender as SourceGrid.Selection.SelectionBase);
                    selectedRow = (sender as SourceGrid.Selection.SelectionBase).ActivePosition.Row;
                }

                if (selectedRow < 0)
                {
                    return;
                }

                RefreshPropertyGrid(selectedRow);
            }
Пример #15
0
 void Selection_SelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
 {
     try
     {
         SourceGrid.RangeRegion region = gridSolutions.Selection.GetSelectionRegion();
         int[] indexes = region.GetRowsIndex();
         // no selection -> exit
         if (indexes.Length == 0)
         {
             return;
         }
         // redraw
         Draw();
         // update "Add solution" button status
         UpdateToolbarButtons();
     }
     catch (Exception ex) { _log.Error(ex.ToString()); }
 }
Пример #16
0
        private void OnSelChangeGrid(object sender, SourceGrid.RangeRegionChangedEventArgs e)
        {
            try
            {
                SourceGrid.Selection.RowSelection select = sender as SourceGrid.Selection.RowSelection;
                SourceGrid.Grid g = select.Grid as SourceGrid.Grid;

                SourceGrid.RangeRegion region = g.Selection.GetSelectionRegion();
                int[] indexes = region.GetRowsIndex();
                if (indexes.Length < 1 || indexes[0] < 1)
                {
                    _selectedAnalysis = null;
                }
                else
                {
                    _selectedAnalysis = _analyses[indexes[0] - 1];
                    // analysis name/description
                    if (null != _selectedAnalysis)
                    {
                        BoxProperties  box  = SelectedBox;
                        PackProperties pack = _selectedAnalysis.Content as PackProperties;
                        AnalysisName = string.Format("Analysis_{0}x{1}x{2}_{3}_on_{4}",
                                                     pack.Dim0, pack.Dim1, pack.Dim2, box.Name, _selectedAnalysis.Container.Name);
                        AnalysisDescription = string.Format("Packing {0}x{1}x{2} {3} on {4}",
                                                            pack.Dim0, pack.Dim1, pack.Dim2, box.Name, _selectedAnalysis.Container.Name);

                        UpdateStatus(string.Empty);
                    }
                    else
                    {
                        AnalysisName        = string.Empty;
                        AnalysisDescription = string.Empty;
                    }
                }

                graphCtrlPack.Invalidate();
                graphCtrlSolution.Invalidate();
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message);
            }
        }
Пример #17
0
        private void OnSelChangeGrid(object sender, SourceGrid.RangeRegionChangedEventArgs e)
        {
            try
            {
                if (sender is SourceGrid.Selection.RowSelection select &&
                    select.Grid is SourceGrid.Grid g)
                {
                    var region  = g.Selection.GetSelectionRegion();
                    var indexes = region.GetRowsIndex();
                    if (indexes.Length < 1 || indexes[0] < 1)
                    {
                        _selectedAnalysis = null;
                    }
                    else
                    {
                        _selectedAnalysis = _analyses[indexes[0] - 1];
                        // analysis name/description
                        if (null != _selectedAnalysis)
                        {
                            var box = SelectedBox;
                            if (_selectedAnalysis.Content is PackProperties pack)
                            {
                                AnalysisName        = $"Analysis_{pack.Dim0}x{pack.Dim1}x{pack.Dim2}_{box.Name}_on_{_selectedAnalysis.Container.Name}";
                                AnalysisDescription = $"Packing {pack.Dim0}x{pack.Dim1}x{pack.Dim2} {box.Name} on {_selectedAnalysis.Container.Name}";
                            }
                            UpdateStatus(string.Empty);
                        }
                        else
                        {
                            AnalysisName        = string.Empty;
                            AnalysisDescription = string.Empty;
                        }
                    }
                }

                graphCtrlPack.Invalidate();
                graphCtrlSolution.Invalidate();
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message);
            }
        }
Пример #18
0
        void Selection_SelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;

            if (FParentForm.FIAmUpdating == 0)
            {
                int         previousRowId = FPrevRowChangedRow;
                int         newRowId      = grdAccounts.Selection.ActivePosition.Row;
                DataRowView rowView       = (DataRowView)grdAccounts.Rows.IndexToDataSourceRow(newRowId);

                if (rowView == null)
                {
                    FPreviouslySelectedDetailRow = null;
                    FParentForm.SetSelectedAccount(null);
                    FParentForm.PopulateControlsAfterRowSelection();
                    Console.WriteLine("Selected row is NULL");
                }
                else
                {
                    FPreviouslySelectedDetailRow = rowView.Row;
                    String SelectedAccountCode = ((GLSetupTDSAAccountRow)rowView.Row).AccountCode;

                    FSelectionMadeInList = true;
                    FParentForm.SetSelectedAccountCode(SelectedAccountCode);
                    FSelectionMadeInList = false;

                    if (previousRowId == -1)
                    {
                        FParentForm.PopulateControlsAfterRowSelection();
                    }

                    Console.WriteLine("Row is {0}", FPreviouslySelectedDetailRow.ItemArray[1]);
                }

                FPrevRowChangedRow = newRowId;
            }
            else
            {
                Console.WriteLine("Skipping selection_changed...");
            }

            this.Cursor = Cursors.Default;
        }
Пример #19
0
        private void onSelChangeGrid(object sender, SourceGrid.RangeRegionChangedEventArgs e)
        {
            try
            {
                SourceGrid.Selection.RowSelection select = sender as SourceGrid.Selection.RowSelection;
                SourceGrid.Grid g = select.Grid as SourceGrid.Grid;

                SourceGrid.RangeRegion region = g.Selection.GetSelectionRegion();
                int[] indexes = region.GetRowsIndex();
                if (indexes.Length < 1 || indexes[0] < 1)
                {
                    _selectedAnalysis = null;
                }
                else
                {
                    _selectedAnalysis = _analyses[indexes[0] - 1];
                    // analysis name/description
                    if (null != _selectedAnalysis)
                    {
                        AnalysisName        = string.Format("Analysis_{0}_in_{1}", _selectedAnalysis.Content.Name, _selectedAnalysis.Container.Name);
                        AnalysisDescription = string.Format(" Packing {0} in {1}", _selectedAnalysis.Content.Name, _selectedAnalysis.Container.Name);
                    }
                    else
                    {
                        AnalysisName        = string.Empty;
                        AnalysisDescription = string.Empty;
                    }
                }
                // update drawing
                graphCtrl.Invalidate();
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message);
            }
        }
Пример #20
0
 private void grdResult_SelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
 {
     FPrevRowChangedRow = grdResult.Selection.ActivePosition.Row;
     SetEnabledStates();
 }
 void Selection_SelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
 {
     FPrevRowChangedRow = grdInvoices.Selection.ActivePosition.Row;
 }
Пример #22
0
 void OnSelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
 {
     UpdateSelectedChannels();
 }
 void HandleSelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
 {
     FIndexedGridRowsHelper.UpdateButtons(grdDetails.Selection.ActivePosition.Row, FPetraUtilsObject.SecurityReadOnly);
 }
Пример #24
0
 public void SelectionChanged(Object sender, SourceGrid.RangeRegionChangedEventArgs e)
 {
     this.StartTimer();
 }
Пример #25
0
 private void GridSolutionsSelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
 {
     graphCtrl.Invalidate();
 }
Пример #26
0
 void HandleSelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
 {
     FIndexedGridRowsHelper.UpdateButtons(grdDetails.Selection.ActivePosition.Row);
 }
Пример #27
0
 void OnSelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e)
 {
     UpdateExpressionField();
 }