Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

ui_dlg_ctl_goto() doesn't goto

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    ui_dlg_ctl_goto() doesn't goto

    The following script I wrote for a custom find. It has been pared down so it may be run in Alpha Sports from the code tab.
    When the xDialog opens, the cursor is visibly flashing in the combo-box field. If I change the radio button choice, I can not get
    the cursor to return to the combo-box. If you look carefully, sometimes the combo-box flashes when the radio button is changed,
    but no cursor.

    What I'm looking for is after the radio button choice is changed, I'd like there to be a flashing cursor in the combo-box control
    waiting for the user to start entering letters. For now, when the radio button is changed, the user needs to mouse click in the
    combo-box control before they can start typing or click on the drop down control.

    Does anyone have any ideas as to what may be happening?

    Code:
    DIM SHARED vcChoiceF as C = "Lastname"
    DIM SHARED vFind as C
    DIM SHARED vcFindWhat as C = ""
    DIM SHARED varC_result as C
    
    dlg="Find What"
    ok_button_label = "&OK"
    cancel_button_label = "&Cancel"
    
    vfind = "k=customer,{keylist_build(\"H=.05,1:25[Last Name]\",''+Lastname,left(''+Lastname,40))}{.t. .and. unique_key_value()}"
    
    DIM vcFW as C = vFind
    
    varC_result = ui_dlg_box(dlg,<<%dlg%
    {units=f}{font=calibri,11}{xmargin=2,2}{ysize=.3};;
    
    {region}
    (vcChoiceF:Last Name!change)
     (vcChoiceF:Company!change)
     (vcChoiceF:City!change);;
    {endregion};
    
    {region}
    Find:|{initial_focus} [%@vcFW%.38vcFindWhat];
    {endregion};;
    
    {region}
    {justify=center,center}
    <8=ok_button_label!OK?vcFindWhat<\>""> <*8=cancel_button_label!CANCEL>
    {endregion};
    %dlg%,<<%code%
    
    if a_dlg_button = "change" then
    	a_dlg_button = ""
    	vcFindWhat = ""
    
    	select
    		case vcChoiceF = "Last Name"
    			vcFW = vFind
    		case vcChoiceF = "Company"
    			vcFW = stritran_multi(vFind,"Lastname","Company")
    			vcFW = stritran(vcFW,"Last Name","Company")
    		case vcChoiceF = "City"
    			vcFW = stritran_multi(vFind,"Lastname","bill_city")
    			vcFW = stritran(vcFW,"Last Name","City")
    	end select
    end if
    
    ui_dlg_ctl_goto(dlg,vcFW)
    
    %code%)
    
    if varC_result <> "OK" then
    	end
    end if
    
    msgbox(vcFindWhat)
    Alpha 5 Version 11
    AA Build 2999, Build 4269, Current Build
    DBF's and MySql
    Desktop, Web on the Desktop and WEB

    Ron Anusiewicz

    #2
    Re: ui_dlg_ctl_goto() doesn't goto

    HTML Code:
    DIM SHARED vcChoiceF as C = "Lastname"
    DIM SHARED vFind as C
    DIM SHARED vcFindWhat as C = ""
    DIM SHARED varC_result as C
    
    dlg="Find What"
    ok_button_label = "&OK"
    cancel_button_label = "&Cancel"
    
    vfind = "k=customer,{keylist_build(\"H=.05,1:25[Last Name]\",''+Lastname,left(''+Lastname,40))}{.t. .and. unique_key_value()}"
    
    DIM vcFW as C = vFind
    
    varC_result = ui_dlg_box(dlg,<<%dlg%
    {units=f}{font=calibri,11}{xmargin=2,2}{ysize=.3};;
    
    {region}
    (vcChoiceF:Last Name!change)
     (vcChoiceF:Company!change)
     (vcChoiceF:City!change);;
    {endregion};
    
    {region}
    Find:|{initial_focus} [.38vcFindWhat];
    {endregion};;
    
    {region}
    {justify=center,center}
    <8=ok_button_label!OK?vcFindWhat<\>""> <*8=cancel_button_label!CANCEL>
    {endregion};
    %dlg%,<<%code%
    
    if a_dlg_button = "change" then
    	ui_dlg_ctl_goto(dlg,"FindWhat")
    	a_dlg_button = ""
    	vcFindWhat = ""
    
    	select
    		case vcChoiceF = "Last Name"
    			vcFW = vFind
    		case vcChoiceF = "Company"
    			vcFW = stritran_multi(vFind,"Lastname","Company")
    			vcFW = stritran(vcFW,"Last Name","Company")
    		case vcChoiceF = "City"
    			vcFW = stritran_multi(vFind,"Lastname","bill_city")
    			vcFW = stritran(vcFW,"Last Name","City")
    	end select
    end if
    
    %code%)
    
    if varC_result <> "OK" then
    	end
    end if
    
    msgbox(vcFindWhat)

    Comment


      #3
      Re: ui_dlg_ctl_goto() doesn't goto

      Ron,

      It worked when I changed the Radio-Button to Combo-Box and used {on_key = enter} with event control.

      The radio button will be selected by "SpaceBar" but I do not know the equivalent string value for keyboard's "SpaceBar" .

      Comment


        #4
        Re: ui_dlg_ctl_goto() doesn't goto

        G. Thank you for your response. Your code works except for one thing. No combo-box.

        John, sorry, but I can't quite follow what you did. Can you paste in your code?
        Alpha 5 Version 11
        AA Build 2999, Build 4269, Current Build
        DBF's and MySql
        Desktop, Web on the Desktop and WEB

        Ron Anusiewicz

        Comment


          #5
          Re: ui_dlg_ctl_goto() doesn't goto

          Ron:
          I didn't run the code from alphasports and therefore, there were no combo box because the list comes from alphasports table..but that wasn't the issue.
          By the way, try not to use dlg as a name for a variable. And try not to use "change" as a name for an event handler.

          Comment


            #6
            Re: ui_dlg_ctl_goto() doesn't goto

            G.

            Thanks for the advice about using dlg and change. Apparently, ui_dlg_ctl_goto() will not work with a combo-box.
            Alpha 5 Version 11
            AA Build 2999, Build 4269, Current Build
            DBF's and MySql
            Desktop, Web on the Desktop and WEB

            Ron Anusiewicz

            Comment


              #7
              Re: ui_dlg_ctl_goto() doesn't goto

              Ron,

              You can find the detail from help at "ui_dlg_ctl_goto()" and this code is not perfect nor tested. I do not have the A5 at home.

              Code:
              varC_result = ui_dlg_box(dlg,<<%dlg%
              {units=f}{font=calibri,11}{xmargin=2,2}{ysize=.3};;
              
              {on_key=enter}
              
              {region}
              find by:| [.15vcChoiceF^+{Last Name,Company,City!change}];;
              {endregion};
              
              {region}
              Find:| [%@vcFW%.38vcFindWhat];
              {endregion};;
              
              {region}
              {justify=center,center}
              <8=ok_button_label!OK?vcFindWhat<\>""> <*8=cancel_button_label!CANCEL>
              {endregion};
              %dlg%,<<%code%
              
              If a_dlg_button ="enter" then  
              	'see the help for sample, ***this code is not 100% sure without my office computer
              	'get current point
              	'current_point= [.15vcChoiceF^+{Last Name,Company,City!change}]
              
              	'set the condition
              	select
               		case current_point = [.15vcChoiceF^+{Last Name,Company,City!change}]
              			'get next_point where you want to move
              			'next_point = [%@vcFW%.38vcFindWhat]	
              		case current_point = [%@vcFW%.38vcFindWhat]
              			next_point = <*8=cancel_button_label!CANCEL>	
              	end select
              	     	
              	ui_dlg_ctl_goto(dlg,next_point)
              	'It will move to next but will not pop-up the list by automatic
              	a_dlg_button=""
              end if
              
              if a_dlg_button = "change" then
              	a_dlg_button = ""
              	vcFindWhat = ""
              
              	select
              		case vcChoiceF = "Last Name"
              			vcFW = vFind
              		case vcChoiceF = "Company"
              			vcFW = stritran_multi(vFind,"Lastname","Company")
              			vcFW = stritran(vcFW,"Last Name","Company")
              		case vcChoiceF = "City"
              			vcFW = stritran_multi(vFind,"Lastname","bill_city")
              			vcFW = stritran(vcFW,"Last Name","City")
              	end select
              end if

              Comment


                #8
                Re: ui_dlg_ctl_goto() doesn't goto

                It does:
                Code:
                DIM SHARED vcChoiceF as C = "Lastname"
                DIM SHARED vFind as C
                DIM SHARED vcFindWhat as C = ""
                DIM SHARED varC_result as C
                
                dlg="Find What"
                ok_button_label = "&OK"
                cancel_button_label = "&Cancel"
                
                vfind = <<%a%
                A
                B
                C
                %a%
                
                DIM vcFW as C = vFind
                
                varC_result = ui_dlg_box(dlg,<<%dlg%
                {units=f}{font=calibri,11}{xmargin=2,2}{ysize=.3};;
                
                {region}
                (vcChoiceF:Last Name!change)
                 (vcChoiceF:Company!change)
                 (vcChoiceF:City!change);;
                {endregion};
                
                {region}
                Options: | [.10v1^+vfind!x_*];
                Find:|{initial_focus} [.38vcFindWhat];
                {endregion};;
                
                {region}
                {justify=center,center}
                <8=ok_button_label!OK?vcFindWhat<\>""> <*8=cancel_button_label!CANCEL>
                {endregion};
                %dlg%,<<%code%
                if left(a_dlg_button,2)="x_"
                	ui_dlg_ctl_goto(dlg,"FindWhat")
                	a_dlg_button = ""
                	if a_dlg_button="x_change"
                	end if
                end if	
                
                if a_dlg_button = "change" then
                	ui_dlg_ctl_goto(dlg,"FindWhat")
                	a_dlg_button = ""
                	vcFindWhat = ""
                
                	select
                		case vcChoiceF = "Last Name"
                			vcFW = vFind
                		case vcChoiceF = "Company"
                			vcFW = stritran_multi(vFind,"Lastname","Company")
                			vcFW = stritran(vcFW,"Last Name","Company")
                		case vcChoiceF = "City"
                			vcFW = stritran_multi(vFind,"Lastname","bill_city")
                			vcFW = stritran(vcFW,"Last Name","City")
                	end select
                end if
                
                %code%)
                
                if varC_result <> "OK" then
                	end
                end if
                
                msgbox(vcFindWhat)

                Comment


                  #9
                  Re: ui_dlg_ctl_goto() doesn't goto

                  G:

                  Thank you for looking at my issue.

                  Yes, your code works. Unfortunately, you have changed my code and your code does not do what I want.

                  My xdialog builds a keylist which is displayed in a combo-box. The radio buttons are used to change
                  the key and rebuilds the keylist. My code does exactly what I want with but one exception. My code
                  does not put a flashing cursor into the combo-box control. In the end, I do believe it is a timing issue.
                  If you run my code against a table, the customer table in Alpha Sports, you will see what I mean.

                  Thanks,

                  Ron

                  Code:
                  DIM SHARED vcChoiceF as C = "Lastname"
                  DIM SHARED vFind as C
                  DIM SHARED vcFindWhat as C = ""
                  DIM SHARED varC_result as C
                  
                  dlg="Find What"
                  ok_button_label = "&OK"
                  cancel_button_label = "&Cancel"
                  
                  vfind = "k=customer,{keylist_build(\"H=.05,1:25[Last Name]\",''+Lastname,left(''+Lastname,40))}{.t. .and. unique_key_value()}"
                  
                  DIM vcFW as C = vFind
                  
                  varC_result = ui_dlg_box(dlg,<<%dlg%
                  {units=f}{font=calibri,11}{xmargin=2,2}{ysize=.3};;
                  
                  {region}
                  (vcChoiceF:Last Name!change)
                   (vcChoiceF:Company!change)
                   (vcChoiceF:City!change);;
                  {endregion};
                  
                  {region}
                  Find:|{initial_focus} [%@vcFW%.38vcFindWhat];
                  {endregion};;
                  
                  {region}
                  {justify=center,center}
                  <8=ok_button_label!OK?vcFindWhat<\>""> <*8=cancel_button_label!CANCEL>
                  {endregion};
                  %dlg%,<<%code%
                  
                  if a_dlg_button = "change" then
                  	a_dlg_button = ""
                  	vcFindWhat = ""
                  
                  	select
                  		case vcChoiceF = "Last Name"
                  			vcFW = vFind
                  		case vcChoiceF = "Company"
                  			vcFW = stritran_multi(vFind,"Lastname","Company")
                  			vcFW = stritran(vcFW,"Last Name","Company")
                  		case vcChoiceF = "City"
                  			vcFW = stritran_multi(vFind,"Lastname","bill_city")
                  			vcFW = stritran(vcFW,"Last Name","City")
                  	end select
                  end if
                  
                  ui_dlg_ctl_goto(dlg,vcFW)
                  
                  %code%)
                  
                  if varC_result <> "OK" then
                  	end
                  end if
                  
                  msgbox(vcFindWhat)
                  Alpha 5 Version 11
                  AA Build 2999, Build 4269, Current Build
                  DBF's and MySql
                  Desktop, Web on the Desktop and WEB

                  Ron Anusiewicz

                  Comment


                    #10
                    Re: ui_dlg_ctl_goto() doesn't goto

                    I will do that when I get a minute.

                    Comment


                      #11
                      Re: ui_dlg_ctl_goto() doesn't goto

                      Ron,

                      see this example. Just want to show you how to... and see reference forum.


                      're: XDialog; Auto dropdown when 'field' gets focus
                      'http://www.alphasoftware.com/alphaforum/showthread.php?85013-XDialog-Auto-dropdown-when-field-gets-focus&highlight=dropdown

                      dim vc_title as C=""
                      dim vSal as C
                      vsel=comma_to_crlf("Mr,Mrs,Mr. and Mrs.,Ms.")


                      dim current_control as C = ""
                      dim target_control as C = ""


                      dim vR as C
                      vR=ui_dlg_box("Test",<<%dlg%
                      {startup=Init}{lf};
                      {region}
                      Title:|[.12vc_title^+{Mr,Mrs,Mr and Mrs,Ms}!vTitle_changed]; {comment=problem worked with only dropdown}
                      Field 2:|[.20vf2]
                      {endregion};
                      <15OK> <15Cancel>
                      %dlg%,<<%code%
                      If a_dlg_button ="init" then
                      ' Set focus on drop down object
                      ui_dlg_ctl_goto("test","Vc_title")
                      ' Force drop down the "sloppy" way by sending an Alt-Down key
                      sys_send_keys("{%DOWN}")
                      a_dlg_button =""
                      end if
                      if a_dlg_button = "vTitle_changed"
                      if vc_title=""
                      ui_modeless_dlg_box("Message",<<%dlg%
                      {nocaption}{background=yellow}
                      {region}
                      Title is a required field...
                      {endregion};
                      %dlg%)
                      xbasic_wait_for_idle()
                      sleep(2)
                      ui_modeless_dlg_close("Message")
                      else
                      'ui_dlg_ctl_goto("Test","vc_title")
                      current_control = alltrim(ui_dlg_ctl_current("test"))
                      'test the location and value as help
                      'msgbox("wher",current_control)
                      'If current_control = "[.12vc_title^+{Mr,Mrs,Mr and Mrs,Ms}!vTitle_changed]" then
                      ' msgbox("where am I?","from "+current_control)
                      'end if

                      select
                      case current_control = "[.12vc_title^+{Mr,Mrs,Mr and Mrs,Ms}!vTitle_changed]"
                      target_control = "[.20vf2]"
                      'msgbox("where am I?","from "+current_control+" mov to "+target_control)
                      end select
                      ui_dlg_ctl_goto("test",target_control)
                      end if

                      a_dlg_button=""



                      else if a_dlg_button= "OK"
                      if vc_title=""
                      ui_modeless_dlg_box("Message",<<%dlg%
                      {nocaption}{background=yellow}
                      {nocaption}{background=yellow}
                      {region}
                      Title is a required field...
                      {endregion};
                      %dlg%)
                      xbasic_wait_for_idle()
                      sleep(2)
                      ui_modeless_dlg_close("Message")
                      ui_dlg_ctl_goto("Test","vc_title")
                      a_dlg_button=""
                      else
                      end
                      end if
                      else if a_dlg_button="cancel"
                      IF IS_OBJECT("MESSAGE")
                      ui_modeless_dlg_close("Message")
                      END IF
                      end
                      end if
                      a_dlg_button=""
                      %code%)

                      Comment


                        #12
                        Re: ui_dlg_ctl_goto() doesn't goto

                        John:

                        Thank you for you help. I have run your code and it's interesting. But as it is now, it does not do what I want.
                        The combo-box is populated with data from a keylist build. My radio button changes parameters from the default keylist
                        definition and recreates the keylist displayed in the combo-box. Entering the combo-box and clicking on the drop down
                        will display either the Last Name, the Customer or the City depending on the radio control selection.
                        This is working fine.

                        But the ui_dlg_ctl_goto() doesn't move the cursor to the combo=box object.

                        Actually, I think it does but there may be some kind of timing issue. I say that as when I change the radio button, the
                        combo-box object can be seen flashing and then focus returns to the radio control.

                        Ron
                        Alpha 5 Version 11
                        AA Build 2999, Build 4269, Current Build
                        DBF's and MySql
                        Desktop, Web on the Desktop and WEB

                        Ron Anusiewicz

                        Comment


                          #13
                          Re: ui_dlg_ctl_goto() doesn't goto

                          Ron
                          I can't agree that timing has anything to do with it.
                          I suspect that the controls name is unclear.
                          add this
                          Code:
                          Find:|{initial_focus} [%@vcFW%.38vcFindWhat];
                          [B][COLOR="#FF0000"][textbox1]; [/COLOR][/B]
                          {endregion};;
                          and change to your goto line to
                          Code:
                          target_control = "[textbox1]" 
                          ui_dlg_ctl_goto(dlg,target_control)
                          Run it and see what I mean
                          vcFW is used in so many ways, confusing, but I cant seem to extract the correct name for your control.

                          Comment


                            #14
                            Re: ui_dlg_ctl_goto() doesn't goto

                            Ray:

                            I've set the target_control to "[%@vcFW%.38vcFindWhat]" plus all kinds of things and I cannot get the goto to work with the combo-box. I used your code and yes it worked. But "[textbox1]" is not a combo-box.

                            Ron
                            Alpha 5 Version 11
                            AA Build 2999, Build 4269, Current Build
                            DBF's and MySql
                            Desktop, Web on the Desktop and WEB

                            Ron Anusiewicz

                            Comment


                              #15
                              Re: ui_dlg_ctl_goto() doesn't goto

                              Change:
                              ui_dlg_ctl_goto(dlg,vcFW)

                              TO:
                              ui_dlg_ctl_goto(dlg,"[%@vcFW%.38vcFindWhat]")
                              and add:
                              ui_dlg_refresh(dlg)

                              Comment

                              Working...
                              X