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

            ChooseDataFieldTo(args);
        }
Exemplo n.º 7
0
        private void txtTaxDate_KeyPressEvent(object o, KeyPressEventArgs args)
        {
            if (!KeyShortcuts.Equal(args.Event, KeyShortcuts.ChooseKey))
            {
                return;
            }

            ChooseTaxDate();
            args.RetVal = true;
        }
Exemplo n.º 8
0
        private void txtExchangeLocation_KeyPress(object o, KeyPressEventArgs args)
        {
            if (!KeyShortcuts.Equal(args.Event, KeyShortcuts.ChooseKey))
            {
                return;
            }

            LocationChoose();
            args.RetVal = true;
        }
Exemplo n.º 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);
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 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);
        }