Loading ...
Sorry, an error occurred while loading the content.

autofocus

Expand Messages
  • green8819
    Hello All, In the following example, why is the NR button focussed? It is misleading; how to remove the focus? Anyone? This doesn t happen if I use window_nf.
    Message 1 of 9 , Jul 7, 2013
    • 0 Attachment
      Hello All,

      In the following example, why is the NR button focussed?
      It is misleading; how to remove the focus? Anyone?
      This doesn't happen if I use window_nf.
      Thanks.

      nomainwin
      WindowWidth = 415 :WindowHeight = 190
      UpperLeftX=10 :UpperLeftY=10
      button #w.nr,"NR",[NR], UL, 35, 42, 50, 25
      button #w.ai,"AI",[AI], UL, 115, 42, 50, 25
      button #w.ci,"CI",[CI], UL, 200, 42, 50, 25
      button #w.hi,"HI",[HI], UL, 285, 42, 50, 25
      open "untitled" for dialog_nf as #w
      #w, "trapclose [quit.w]"
      wait

      [NR]
      wait
      [AI]
      wait
      [CI]
      wait
      [HI]
      wait

      [quit.w]
      close #w
      END
    • Sarmed N.
      Hello Green, Just turn around, who knows, it s a machine. nomainwin WindowWidth = 415 :WindowHeight = 190 UpperLeftX=10 :UpperLeftY=10 textbox #w.n, 35, 42, 0,
      Message 2 of 9 , Jul 7, 2013
      • 0 Attachment
        Hello Green,

        Just turn around, who knows, it's a machine.

        nomainwin
        WindowWidth = 415 :WindowHeight = 190
        UpperLeftX=10 :UpperLeftY=10
        textbox #w.n, 35, 42, 0, 25
        button #w.nr,"NR",[NR], UL, 35, 42, 50, 25
        button #w.ai,"AI",[AI], UL, 115, 42, 50, 25
        button #w.ci,"CI",[CI], UL, 200, 42, 50, 25
        button #w.hi,"HI",[HI], UL, 285, 42, 50, 25
        open "untitled" for dialog_nf as #w
        #w, "trapclose [quit.w]"
        wait

        [NR]
        wait
        [AI]
        wait
        [CI]
        wait
        [HI]
        wait

        Regards,


        ________________________________
        From: green8819 <green8819@...>
        To: libertybasic@yahoogroups.com
        Sent: Sunday, July 7, 2013 2:02 PM
        Subject: [libertybasic] autofocus



         
        Hello All,

        In the following example, why is the NR button focussed?
        It is misleading; how to remove the focus? Anyone?
        This doesn't happen if I use window_nf.
        Thanks.

        nomainwin
        WindowWidth = 415 :WindowHeight = 190
        UpperLeftX=10 :UpperLeftY=10
        button #w.nr,"NR",[NR], UL, 35, 42, 50, 25
        button #w.ai,"AI",[AI], UL, 115, 42, 50, 25
        button #w.ci,"CI",[CI], UL, 200, 42, 50, 25
        button #w.hi,"HI",[HI], UL, 285, 42, 50, 25
        open "untitled" for dialog_nf as #w
        #w, "trapclose [quit.w]"
        wait

        [NR]
        wait
        [AI]
        wait
        [CI]
        wait
        [HI]
        wait

        [quit.w]
        close #w
        END




        [Non-text portions of this message have been removed]
      • Stefan Pendl
        ... I dialog is a special purpose window and buttons are always getting focus. See the dialog box section at MSDN for further information
        Message 3 of 9 , Jul 7, 2013
        • 0 Attachment
          Am 07.07.2013 13:02, schrieb green8819:
          > Hello All,
          >
          > In the following example, why is the NR button focussed?
          > It is misleading; how to remove the focus? Anyone?
          > This doesn't happen if I use window_nf.
          > Thanks.
          >

          I dialog is a special purpose window and buttons are always getting focus.

          See the dialog box section at MSDN for further information
          http://msdn.microsoft.com/en-us/library/ms632588%28VS.85%29.aspx


          --
          Stefan Pendl
          http://stefanpendl.runbasichosting.com/

          LB 4.04 Pro ... http://www.libertybasic.com/assist.html
          LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe

          LB Community Wiki .............. http://basic.wikispaces.com/
          LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
          LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/

          Books at http://www.lulu.com/ and http://www.amazon.com/
          Alyce Watson ... APIs for Liberty BASIC
          Carl Gundel .... Beginning Programming with Liberty BASIC

          Windows 7 Home Premium 64-bit SP1
          AMD Turion X2 RM-70 2GHz, 4GB RAM
        • paradisejb
          Remember, the order in which you list the controls in your definitions also has an effect on which control gets focus...
          Message 4 of 9 , Jul 7, 2013
          • 0 Attachment
            Remember, the order in which you list the controls in your definitions also has an effect on which control gets focus...

            --- In libertybasic@yahoogroups.com, "green8819" <green8819@...> wrote:
            >
            > Hello All,
            >
            > In the following example, why is the NR button focussed?
            > It is misleading; how to remove the focus? Anyone?
            > This doesn't happen if I use window_nf.
            > Thanks.
            >
            > nomainwin
            > WindowWidth = 415 :WindowHeight = 190
            > UpperLeftX=10 :UpperLeftY=10
            > button #w.nr,"NR",[NR], UL, 35, 42, 50, 25
            > button #w.ai,"AI",[AI], UL, 115, 42, 50, 25
            > button #w.ci,"CI",[CI], UL, 200, 42, 50, 25
            > button #w.hi,"HI",[HI], UL, 285, 42, 50, 25
            > open "untitled" for dialog_nf as #w
            > #w, "trapclose [quit.w]"
            > wait
            >
            > [NR]
            > wait
            > [AI]
            > wait
            > [CI]
            > wait
            > [HI]
            > wait
            >
            > [quit.w]
            > close #w
            > END
            >
          • Green Mike
            Thanks to All for the responses. Thanks, Sarmed for the workaround. Apparently there is no other solution; so this workaround qualifies as THE solution .
            Message 5 of 9 , Jul 7, 2013
            • 0 Attachment
              Thanks to All for the responses.
              Thanks, Sarmed for the workaround. Apparently there is no other solution; so this workaround qualifies as THE "solution".

              ________________________________
              From: Sarmed N. <sarmednafi@...>
              To: "libertybasic@yahoogroups.com" <libertybasic@yahoogroups.com>
              Sent: Sunday, 7 July 2013, 21:36
              Subject: Re: [libertybasic] autofocus



               
              Hello Green,

              Just turn around, who knows, it's a machine.

              nomainwin
              WindowWidth = 415 :WindowHeight = 190
              UpperLeftX=10 :UpperLeftY=10
              textbox #w.n, 35, 42, 0, 25
              button #w.nr,"NR",[NR], UL, 35, 42, 50, 25
              button #w.ai,"AI",[AI], UL, 115, 42, 50, 25
              button #w.ci,"CI",[CI], UL, 200, 42, 50, 25
              button #w.hi,"HI",[HI], UL, 285, 42, 50, 25
              open "untitled" for dialog_nf as #w
              #w, "trapclose [quit.w]"
              wait

              [NR]
              wait
              [AI]
              wait
              [CI]
              wait
              [HI]
              wait

              Regards,

              ________________________________
              From: green8819 <green8819@...>
              To: libertybasic@yahoogroups.com
              Sent: Sunday, July 7, 2013 2:02 PM
              Subject: [libertybasic] autofocus


               
              Hello All,

              In the following example, why is the NR button focussed?
              It is misleading; how to remove the focus? Anyone?
              This doesn't happen if I use window_nf.
              Thanks.

              nomainwin
              WindowWidth = 415 :WindowHeight = 190
              UpperLeftX=10 :UpperLeftY=10
              button #w.nr,"NR",[NR], UL, 35, 42, 50, 25
              button #w.ai,"AI",[AI], UL, 115, 42, 50, 25
              button #w.ci,"CI",[CI], UL, 200, 42, 50, 25
              button #w.hi,"HI",[HI], UL, 285, 42, 50, 25
              open "untitled" for dialog_nf as #w
              #w, "trapclose [quit.w]"
              wait

              [NR]
              wait
              [AI]
              wait
              [CI]
              wait
              [HI]
              wait

              [quit.w]
              close #w
              END

              [Non-text portions of this message have been removed]




              [Non-text portions of this message have been removed]
            • Harry
              I m 99% sure that it s because it s a dialog window. Dialog windows may have a default button, which is by default the active button until you do something
              Message 6 of 9 , Jul 7, 2013
              • 0 Attachment
                I'm 99% sure that it's because it's a dialog window. Dialog windows may have a default button, which is by default the active button until you do something else, and is activated on Enter at (almost) any time. You didn't designate a default button. The NR button was the first defined. So the NR button receives focus by default.

                Or it may be that it's just because that button was the first control defined.

                Anyway, if you want a button to receive focus initially and to react to the Enter key, define that button as the default - #w.default.

                Or, use the SETFOCUS command to put the focus wherever you want it, whenever you want it there - #w.ai, "!setfocus";

                --- In libertybasic@yahoogroups.com, "green8819" <green8819@...> wrote:
                >
                > Hello All,
                >
                > In the following example, why is the NR button focussed?
                > It is misleading; how to remove the focus? Anyone?
                > This doesn't happen if I use window_nf.
                > Thanks.
                >
                > nomainwin
                > WindowWidth = 415 :WindowHeight = 190
                > UpperLeftX=10 :UpperLeftY=10
                > button #w.nr,"NR",[NR], UL, 35, 42, 50, 25
                > button #w.ai,"AI",[AI], UL, 115, 42, 50, 25
                > button #w.ci,"CI",[CI], UL, 200, 42, 50, 25
                > button #w.hi,"HI",[HI], UL, 285, 42, 50, 25
                > open "untitled" for dialog_nf as #w
                > #w, "trapclose [quit.w]"
                > wait
                >
                > [NR]
                > wait
                > [AI]
                > wait
                > [CI]
                > wait
                > [HI]
                > wait
                >
                > [quit.w]
                > close #w
                > END
                >
              • Green Mike
                Anyway, if you want a button to receive focus initially and to react to the Enter key, define that button as the default - #w.default. I had done that in my
                Message 7 of 9 , Jul 7, 2013
                • 0 Attachment
                  "Anyway, if you want a button to receive focus initially and to react to
                  the Enter key, define that button as the default - #w.default."

                  I had done that in my original program; my default for 'Enter' is a textbox. The cursor blinks there alright. The NR button is still focussed.



                  ________________________________
                  From: Harry <harrybee99@...>
                  To: libertybasic@yahoogroups.com
                  Sent: Monday, 8 July 2013, 0:25
                  Subject: [libertybasic] Re: autofocus



                   
                  I'm 99% sure that it's because it's a dialog window. Dialog windows may have a default button, which is by default the active button until you do something else, and is activated on Enter at (almost) any time. You didn't designate a default button. The NR button was the first defined. So the NR button receives focus by default.

                  Or it may be that it's just because that button was the first control defined.

                  Anyway, if you want a button to receive focus initially and to react to the Enter key, define that button as the default - #w.default.

                  Or, use the SETFOCUS command to put the focus wherever you want it, whenever you want it there - #w.ai, "!setfocus";

                  --- In libertybasic@yahoogroups.com, "green8819" <green8819@...> wrote:
                  >
                  > Hello All,
                  >
                  > In the following example, why is the NR button focussed?
                  > It is misleading; how to remove the focus? Anyone?
                  > This doesn't happen if I use window_nf.
                  > Thanks.
                  >
                  > nomainwin
                  > WindowWidth = 415 :WindowHeight = 190
                  > UpperLeftX=10 :UpperLeftY=10
                  > button #w.nr,"NR",[NR], UL, 35, 42, 50, 25
                  > button #w.ai,"AI",[AI], UL, 115, 42, 50, 25
                  > button #w.ci,"CI",[CI], UL, 200, 42, 50, 25
                  > button #w.hi,"HI",[HI], UL, 285, 42, 50, 25
                  > open "untitled" for dialog_nf as #w
                  > #w, "trapclose [quit.w]"
                  > wait
                  >
                  > [NR]
                  > wait
                  > [AI]
                  > wait
                  > [CI]
                  > wait
                  > [HI]
                  > wait
                  >
                  > [quit.w]
                  > close #w
                  > END
                  >




                  [Non-text portions of this message have been removed]
                • mike -
                  Thanks All for the responses. Thanks, Sarmed for the workaround. Apparently there is no other solution; so this workaround qualifies as THE solution .
                  Message 8 of 9 , Jul 7, 2013
                  • 0 Attachment
                    Thanks All for the responses.
                    Thanks, Sarmed for the workaround. Apparently there is no other solution; so this workaround qualifies as THE "solution".


                    [Non-text portions of this message have been removed]
                  • Stefan Pendl
                    ... The extension default only works with buttons. To set the focus to another control use SETFOCUS. You can t prevent any button from receiving the action
                    Message 9 of 9 , Jul 7, 2013
                    • 0 Attachment
                      Am 07.07.2013 18:33, schrieb Green Mike:
                      >
                      > "Anyway, if you want a button to receive focus initially and to react to
                      > the Enter key, define that button as the default - #w.default."
                      >
                      > I had done that in my original program; my default for 'Enter' is a textbox. The cursor blinks there alright. The NR button is still focussed.
                      >

                      The extension "default" only works with buttons.

                      To set the focus to another control use SETFOCUS.

                      You can't prevent any button from receiving the action for the ENTER key
                      in a dialog window.

                      There is no way to change the behavior that is implemented by Windows
                      and not LB.


                      --
                      Stefan Pendl
                      http://stefanpendl.runbasichosting.com/

                      LB 4.04 Pro ... http://www.libertybasic.com/assist.html
                      LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe

                      LB Community Wiki .............. http://basic.wikispaces.com/
                      LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
                      LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/

                      Books at http://www.lulu.com/ and http://www.amazon.com/
                      Alyce Watson ... APIs for Liberty BASIC
                      Carl Gundel .... Beginning Programming with Liberty BASIC

                      Windows 7 Home Premium 64-bit SP1
                      AMD Turion X2 RM-70 2GHz, 4GB RAM
                    Your message has been successfully submitted and would be delivered to recipients shortly.