Confirm: How dont I show the focus in YES or NO ?

Hello.

I have a CONFIRM function but I need dont have the focus in YES or NO.
Or this, I need that the users push with mouse in the button YES or NO for validate. They cant use the key ENTER for validate the option.
How can I do ?

Thx a lot !.

Best Answers

  • AntidotEAntidotE Member Posts: 61
    edited 2016-04-08 Answer ✓
    Perhaps following example will show you where to look
    Pay attention to properties PushAction and Focusable on Confirm form.
    OBJECT Form 58887 TestForm
    {
      OBJECT-PROPERTIES
      {
        Date=04/08/16;
        Time=[ 3:43:08 PM];
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
        Width=3740;
        Height=2860;
      }
      CONTROLS
      {
        { 6000000;CommandButton;660;1540;2200 ;550  ;CaptionML=ENU=Confirm;
                                                     OnPush=VAR
                                                              ConfirmForm@6000000 : Form 58888;
                                                              CheckReturnedOption@6000002 : 'Equal,Less,Greater';
                                                              CheckReturnedDecimal@6000003 : Decimal;
                                                            BEGIN
                                                              ConfirmForm.SetConfirmText('Do you confirm variable value ' + FORMAT(SomeVar) + '?');
                                                              ConfirmForm.LOOKUPMODE := TRUE;
                                                              IF ConfirmForm.RUNMODAL = ACTION::LookupOK THEN BEGIN
                                                                ConfirmForm.GetValues(CheckReturnedOption,CheckReturnedDecimal);
                                                                MESSAGE('Confirmed :)\Returned values %1 and %2',CheckReturnedOption,CheckReturnedDecimal);
                                                              END ELSE
                                                                MESSAGE('Not confirmed :(');
                                                            END;
                                                             }
        { 6000001;TextBox   ;550  ;440  ;2420 ;440  ;SourceExpr=SomeVar }
      }
      CODE
      {
        VAR
          SomeVar@6000000 : Decimal;
    
        BEGIN
        END.
      }
    }
    
    OBJECT Form 58888 Confirm Form
    {
      OBJECT-PROPERTIES
      {
        Date=04/08/16;
        Time=[ 3:40:08 PM];
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
        Width=8140;
        Height=4070;
        CaptionML=ENU=Confirm;
        BorderStyle=Double;
        Minimizable=No;
        Maximizable=No;
        Sizeable=No;
      }
      CONTROLS
      {
        { 6000000;CommandButton;550;2970;1650 ;880  ;Focusable=No;
                                                     PushAction=LookupOK;
                                                     CaptionML=ENU=Yes }
        { 6000001;CommandButton;2420;2970;1650;880  ;Focusable=No;
                                                     Cancel=Yes;
                                                     PushAction=LookupCancel;
                                                     CaptionML=ENU=No }
        { 6000002;TextBox   ;110  ;220  ;4510 ;2420 ;Editable=No;
                                                     HorzAlign=Center;
                                                     VertAlign=Center;
                                                     MultiLine=Yes;
                                                     SourceExpr=ConfirmText }
        { 6000003;OptionButton;5830;990 ;1100 ;440  ;CaptionML=ENU=< 0;
                                                     SourceExpr=ReturnValue1;
                                                     OptionValue=lt }
        { 6000004;OptionButton;5830;1540;1100 ;440  ;CaptionML=ENU="= 0";
                                                     SourceExpr=ReturnValue1;
                                                     OptionValue=eq }
        { 6000005;OptionButton;5830;2090;1100 ;440  ;CaptionML=ENU=> 0;
                                                     SourceExpr=ReturnValue1;
                                                     OptionValue=gt }
        { 6000006;Label     ;4840 ;330  ;3080 ;440  ;HorzAlign=Center;
                                                     LeaderDots=No;
                                                     CaptionML=ENU=Some Option to return }
        { 6000007;TextBox   ;5500 ;3410 ;1700 ;440  ;SourceExpr=ReturnValue2 }
        { 6000008;Label     ;4730 ;2750 ;3300 ;440  ;ParentControl=6000007;
                                                     HorzAlign=Center;
                                                     LeaderDots=No;
                                                     CaptionML=ENU=Some Decimal to return }
      }
      CODE
      {
        VAR
          ConfirmText@6000000 : Text[1024];
          ReturnValue1@6000001 : 'eq,lt,gt';
          ReturnValue2@6000002 : Decimal;
    
        PROCEDURE SetConfirmText@6000000(NewText@6000000 : Text[1024]);
        BEGIN
          ConfirmText := NewText;
        END;
    
        PROCEDURE GetValues@6000003(VAR ReturnedOption@6000000 : 'eq,lt,gt';VAR ReturnedDecimal@6000001 : Decimal);
        BEGIN
          ReturnedOption := ReturnValue1;
          ReturnedDecimal := ReturnValue2;
        END;
    
        BEGIN
        END.
      }
    }
    
    It is hard to swim against self bloodstream... (c) Old, experienced kamikadze.

Answers

  • eugeseuges Member Posts: 8
    Hum, I have Nav2009. I cant create pages.
  • RockWithNAVRockWithNAV Member Posts: 1,139
    Hey Euges,

    I saw many people asking this question "How to restrict users using Enter Key". So First of all let me tell you Yes it's Possible and therefore finally I decided to find a way and introduce here in my Blog. Please check if this too helps you.

    https://rockwithnav.wordpress.com/2016/03/25/disable-specific-keyboard-keys-single-line-of-code/
  • eugeseuges Member Posts: 8
    Tnx a lot !.
    :)
  • eugeseuges Member Posts: 8
    swpolo wrote: »
    In 2009 it is not a big problem. Just create new form to imitate confirmation dialog.

    Ok, I did that and its the solution.
    But, how can I return the value of YES/NO to first form ?.
  • swpoloswpolo Member Posts: 80
    You can use standard Form 343 as example.
    Nav Upgrades and DEV outsourcing
    Reports transformation to RDLC
    List -1h , Complex List -3h, Document -4h (dev hours)
    navisionupgrade.com
  • AntidotEAntidotE Member Posts: 61
    edited 2016-04-08 Answer ✓
    Perhaps following example will show you where to look
    Pay attention to properties PushAction and Focusable on Confirm form.
    OBJECT Form 58887 TestForm
    {
      OBJECT-PROPERTIES
      {
        Date=04/08/16;
        Time=[ 3:43:08 PM];
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
        Width=3740;
        Height=2860;
      }
      CONTROLS
      {
        { 6000000;CommandButton;660;1540;2200 ;550  ;CaptionML=ENU=Confirm;
                                                     OnPush=VAR
                                                              ConfirmForm@6000000 : Form 58888;
                                                              CheckReturnedOption@6000002 : 'Equal,Less,Greater';
                                                              CheckReturnedDecimal@6000003 : Decimal;
                                                            BEGIN
                                                              ConfirmForm.SetConfirmText('Do you confirm variable value ' + FORMAT(SomeVar) + '?');
                                                              ConfirmForm.LOOKUPMODE := TRUE;
                                                              IF ConfirmForm.RUNMODAL = ACTION::LookupOK THEN BEGIN
                                                                ConfirmForm.GetValues(CheckReturnedOption,CheckReturnedDecimal);
                                                                MESSAGE('Confirmed :)\Returned values %1 and %2',CheckReturnedOption,CheckReturnedDecimal);
                                                              END ELSE
                                                                MESSAGE('Not confirmed :(');
                                                            END;
                                                             }
        { 6000001;TextBox   ;550  ;440  ;2420 ;440  ;SourceExpr=SomeVar }
      }
      CODE
      {
        VAR
          SomeVar@6000000 : Decimal;
    
        BEGIN
        END.
      }
    }
    
    OBJECT Form 58888 Confirm Form
    {
      OBJECT-PROPERTIES
      {
        Date=04/08/16;
        Time=[ 3:40:08 PM];
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
        Width=8140;
        Height=4070;
        CaptionML=ENU=Confirm;
        BorderStyle=Double;
        Minimizable=No;
        Maximizable=No;
        Sizeable=No;
      }
      CONTROLS
      {
        { 6000000;CommandButton;550;2970;1650 ;880  ;Focusable=No;
                                                     PushAction=LookupOK;
                                                     CaptionML=ENU=Yes }
        { 6000001;CommandButton;2420;2970;1650;880  ;Focusable=No;
                                                     Cancel=Yes;
                                                     PushAction=LookupCancel;
                                                     CaptionML=ENU=No }
        { 6000002;TextBox   ;110  ;220  ;4510 ;2420 ;Editable=No;
                                                     HorzAlign=Center;
                                                     VertAlign=Center;
                                                     MultiLine=Yes;
                                                     SourceExpr=ConfirmText }
        { 6000003;OptionButton;5830;990 ;1100 ;440  ;CaptionML=ENU=< 0;
                                                     SourceExpr=ReturnValue1;
                                                     OptionValue=lt }
        { 6000004;OptionButton;5830;1540;1100 ;440  ;CaptionML=ENU="= 0";
                                                     SourceExpr=ReturnValue1;
                                                     OptionValue=eq }
        { 6000005;OptionButton;5830;2090;1100 ;440  ;CaptionML=ENU=> 0;
                                                     SourceExpr=ReturnValue1;
                                                     OptionValue=gt }
        { 6000006;Label     ;4840 ;330  ;3080 ;440  ;HorzAlign=Center;
                                                     LeaderDots=No;
                                                     CaptionML=ENU=Some Option to return }
        { 6000007;TextBox   ;5500 ;3410 ;1700 ;440  ;SourceExpr=ReturnValue2 }
        { 6000008;Label     ;4730 ;2750 ;3300 ;440  ;ParentControl=6000007;
                                                     HorzAlign=Center;
                                                     LeaderDots=No;
                                                     CaptionML=ENU=Some Decimal to return }
      }
      CODE
      {
        VAR
          ConfirmText@6000000 : Text[1024];
          ReturnValue1@6000001 : 'eq,lt,gt';
          ReturnValue2@6000002 : Decimal;
    
        PROCEDURE SetConfirmText@6000000(NewText@6000000 : Text[1024]);
        BEGIN
          ConfirmText := NewText;
        END;
    
        PROCEDURE GetValues@6000003(VAR ReturnedOption@6000000 : 'eq,lt,gt';VAR ReturnedDecimal@6000001 : Decimal);
        BEGIN
          ReturnedOption := ReturnValue1;
          ReturnedDecimal := ReturnValue2;
        END;
    
        BEGIN
        END.
      }
    }
    
    It is hard to swim against self bloodstream... (c) Old, experienced kamikadze.
  • eugeseuges Member Posts: 8
    AntidotE wrote: »
    Perhaps following example will show you where to look
    Pay attention to properties PushAction and Focusable on Confirm form.
    OBJECT Form 58887 TestForm
    {
      OBJECT-PROPERTIES
      {
        Date=04/08/16;
        Time=[ 3:43:08 PM];
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
        Width=3740;
        Height=2860;
      }
      CONTROLS
      {
        { 6000000;CommandButton;660;1540;2200 ;550  ;CaptionML=ENU=Confirm;
                                                     OnPush=VAR
                                                              ConfirmForm@6000000 : Form 58888;
                                                              CheckReturnedOption@6000002 : 'Equal,Less,Greater';
                                                              CheckReturnedDecimal@6000003 : Decimal;
                                                            BEGIN
                                                              ConfirmForm.SetConfirmText('Do you confirm variable value ' + FORMAT(SomeVar) + '?');
                                                              ConfirmForm.LOOKUPMODE := TRUE;
                                                              IF ConfirmForm.RUNMODAL = ACTION::LookupOK THEN BEGIN
                                                                ConfirmForm.GetValues(CheckReturnedOption,CheckReturnedDecimal);
                                                                MESSAGE('Confirmed :)\Returned values %1 and %2',CheckReturnedOption,CheckReturnedDecimal);
                                                              END ELSE
                                                                MESSAGE('Not confirmed :(');
                                                            END;
                                                             }
        { 6000001;TextBox   ;550  ;440  ;2420 ;440  ;SourceExpr=SomeVar }
      }
      CODE
      {
        VAR
          SomeVar@6000000 : Decimal;
    
        BEGIN
        END.
      }
    }
    
    OBJECT Form 58888 Confirm Form
    {
      OBJECT-PROPERTIES
      {
        Date=04/08/16;
        Time=[ 3:40:08 PM];
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
        Width=8140;
        Height=4070;
        CaptionML=ENU=Confirm;
        BorderStyle=Double;
        Minimizable=No;
        Maximizable=No;
        Sizeable=No;
      }
      CONTROLS
      {
        { 6000000;CommandButton;550;2970;1650 ;880  ;Focusable=No;
                                                     PushAction=LookupOK;
                                                     CaptionML=ENU=Yes }
        { 6000001;CommandButton;2420;2970;1650;880  ;Focusable=No;
                                                     Cancel=Yes;
                                                     PushAction=LookupCancel;
                                                     CaptionML=ENU=No }
        { 6000002;TextBox   ;110  ;220  ;4510 ;2420 ;Editable=No;
                                                     HorzAlign=Center;
                                                     VertAlign=Center;
                                                     MultiLine=Yes;
                                                     SourceExpr=ConfirmText }
        { 6000003;OptionButton;5830;990 ;1100 ;440  ;CaptionML=ENU=< 0;
                                                     SourceExpr=ReturnValue1;
                                                     OptionValue=lt }
        { 6000004;OptionButton;5830;1540;1100 ;440  ;CaptionML=ENU="= 0";
                                                     SourceExpr=ReturnValue1;
                                                     OptionValue=eq }
        { 6000005;OptionButton;5830;2090;1100 ;440  ;CaptionML=ENU=> 0;
                                                     SourceExpr=ReturnValue1;
                                                     OptionValue=gt }
        { 6000006;Label     ;4840 ;330  ;3080 ;440  ;HorzAlign=Center;
                                                     LeaderDots=No;
                                                     CaptionML=ENU=Some Option to return }
        { 6000007;TextBox   ;5500 ;3410 ;1700 ;440  ;SourceExpr=ReturnValue2 }
        { 6000008;Label     ;4730 ;2750 ;3300 ;440  ;ParentControl=6000007;
                                                     HorzAlign=Center;
                                                     LeaderDots=No;
                                                     CaptionML=ENU=Some Decimal to return }
      }
      CODE
      {
        VAR
          ConfirmText@6000000 : Text[1024];
          ReturnValue1@6000001 : 'eq,lt,gt';
          ReturnValue2@6000002 : Decimal;
    
        PROCEDURE SetConfirmText@6000000(NewText@6000000 : Text[1024]);
        BEGIN
          ConfirmText := NewText;
        END;
    
        PROCEDURE GetValues@6000003(VAR ReturnedOption@6000000 : 'eq,lt,gt';VAR ReturnedDecimal@6000001 : Decimal);
        BEGIN
          ReturnedOption := ReturnValue1;
          ReturnedDecimal := ReturnValue2;
        END;
    
        BEGIN
        END.
      }
    }
    

    It is simply perfect.
    Thanks !!! :smiley:
Sign In or Register to comment.