コード例 #1
0
 private void txtLocation_KeyPressEvent(object o, KeyPressEventArgs args)
 {
     if (KeyShortcuts.Equal(args.Event, KeyShortcuts.ChooseKey))
     {
         ChangeLocation();
     }
 }
コード例 #2
0
 private void txtFind_KeyPressEvent(object o, KeyPressEventArgs args)
 {
     if (KeyShortcuts.Equal(args.Event, KeyShortcuts.ChooseKey))
     {
         ChooseDataFieldValue(args);
     }
 }
コード例 #3
0
 private void txtCompany_KeyPressEvent(object o, KeyPressEventArgs args)
 {
     if (KeyShortcuts.Equal(args.Event, KeyShortcuts.ChooseKey))
     {
         ChangeCompany();
     }
 }
コード例 #4
0
 private void txtDefaultPartner_KeyPressEvent(object o, KeyPressEventArgs args)
 {
     if (KeyShortcuts.Equal(args.Event, KeyShortcuts.ChooseKey))
     {
         ChangeDefaultPartner();
     }
 }
コード例 #5
0
 protected void OnDueDateKeyPressEvent(object o, KeyPressEventArgs args)
 {
     if (KeyShortcuts.Equal(args.Event, KeyShortcuts.ChooseKey))
     {
         ChooseDate();
     }
 }
コード例 #6
0
        private void txtTo_KeyPressEvent(object o, KeyPressEventArgs args)
        {
            if (!KeyShortcuts.Equal(args.Event, KeyShortcuts.ChooseKey))
            {
                return;
            }

            ChooseDataFieldTo(args);
        }
コード例 #7
0
        private void txtTaxDate_KeyPressEvent(object o, KeyPressEventArgs args)
        {
            if (!KeyShortcuts.Equal(args.Event, KeyShortcuts.ChooseKey))
            {
                return;
            }

            ChooseTaxDate();
            args.RetVal = true;
        }
コード例 #8
0
        private void txtExchangeLocation_KeyPress(object o, KeyPressEventArgs args)
        {
            if (!KeyShortcuts.Equal(args.Event, KeyShortcuts.ChooseKey))
            {
                return;
            }

            LocationChoose();
            args.RetVal = true;
        }
コード例 #9
0
        private void DialogControl_KeyPressEvent(object o, KeyPressEventArgs args)
        {
            if (!KeyShortcuts.Equal(args.Event, KeyShortcuts.HelpKey))
            {
                return;
            }

            if (string.IsNullOrEmpty(HelpFile))
            {
                return;
            }

            FormHelper.ShowWindowHelp(HelpFile);
        }
コード例 #10
0
        private void txtDateTo_KeyPressEvent(object o, KeyPressEventArgs args)
        {
            if (!KeyShortcuts.Equal(args.Event, KeyShortcuts.ChooseKey))
            {
                return;
            }

            object ret = txtDateTo.Text;

            if (FormHelper.ChooseDataFieldValue(DataField.OperationDate, ref ret) != ResponseType.Ok)
            {
                return;
            }

            txtDateTo.Text = (string)ret;
            args.RetVal    = true;
        }
コード例 #11
0
        private void WbpPrintPreview_KeyPressEvent(object o, KeyPressEventArgs args)
        {
            if (KeyShortcuts.Equal(args.Event, KeyShortcuts.HelpKey) && !string.IsNullOrEmpty(HelpFile))
            {
                FormHelper.ShowWindowHelp(HelpFile);
                return;
            }

            switch (args.Event.Key)
            {
            case Key.Escape:
                RequestClose();
                return;

            case Key.F9:
                btnPrint_Clicked(null, EventArgs.Empty);
                return;

            case Key.Left:
                currentPreview.StartPage--;
                return;

            case Key.Right:
                currentPreview.StartPage++;
                return;

            case Key.End:
                if (KeyShortcuts.GetAllowedModifier(args.Event.State) == KeyShortcuts.ControlModifier)
                {
                    currentPreview.StartPage = currentPreview.TotalPages - 1;
                }

                return;

            case Key.Home:
                if (KeyShortcuts.GetAllowedModifier(args.Event.State) == KeyShortcuts.ControlModifier)
                {
                    currentPreview.StartPage = 0;
                }

                return;
            }
        }
コード例 #12
0
        public bool ColumnKeyPress(CellKeyPressEventArgs args, int colIndex, CellValueChooser chooser,
                                   CellValueEvaluator evaluator, CellValueContiueEdit editPrev, CellValueContiueEdit editNext)
        {
            if (args == null)
            {
                throw new ArgumentNullException("args");
            }

            string filter = args.Editing ? args.Entry.Text : string.Empty;

            if (KeyShortcuts.Equal(args.EventKey, KeyShortcuts.ChooseKey))
            {
                args.MarkAsHandled();
                return(ChooseCellValue(evaluator, chooser, filter));
            }

            switch (args.GdkKey)
            {
            case Key.Tab:
            case Key.Return:
            case Key.KP_Enter:
                if (args.Editing)
                {
                    ContinueEditingIfValid(args, evaluator, chooser, filter, editNext);
                }
                break;

            case Key.Right:
                if (args.Editing)
                {
                    // If the cursor is at the end of the text
                    if (args.Entry.CursorPosition == args.Entry.Text.Length)
                    {
                        ContinueEditingIfValid(args, evaluator, chooser, filter, editNext);
                    }
                }
                break;

            case Key.Left:
            case Key.ISO_Left_Tab:
                if (args.Editing)
                {
                    // If the cursor is at the end of the text
                    if (args.Entry.CursorPosition == args.Entry.Text.Length ||
                        args.Entry.CursorPosition == 0 ||
                        args.GdkKey == Key.ISO_Left_Tab)
                    {
                        ContinueEditingIfValid(args, evaluator, chooser, filter, editPrev);
                    }
                }
                break;

            case Key.Up:
            case Key.KP_Up:
                if (args.Editing)
                {
                    evaluator(grid.EditedCell.Row, args.Entry.Text);
                    cellUpEditor(colIndex);
                }
                break;

            case Key.Down:
            case Key.KP_Down:
                if (args.Editing)
                {
                    evaluator(grid.EditedCell.Row, args.Entry.Text);
                    cellDownEditor(colIndex);
                }
                break;

            case Key.BackSpace:
                if (args.Editing)
                {
                    if (args.Entry.Text.Length == 0)
                    {
                        evaluator(grid.EditedCell.Row, args.Entry.Text);
                        editPrev(grid.EditedCell.Row, args.GdkKey);
                    }
                }
                break;

            default:
                return(false);
            }

            return(true);
        }