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

    #31
    Re: ui_dlg_ctl_goto() doesn't goto

    Here is the code:
    Code:
    DIM SHARED vcChoiceF as C = "Lastname"
    DIM SHARED vFind as C
    DIM SHARED vcFindWhat as C = ""
    DIM SHARED varC_result as C
    
    dlg_title="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()}"
    varC_result = ui_dlg_box(dlg_title,<<%dlg%
    {units=f}{font=calibri,11}{xmargin=2,2}{ysize=.3};;
    
    {region}
    (vcChoiceF:Last Name!x_*)
    (vcChoiceF:Company!x_*)
    (vcChoiceF:City!x_*);;
    {endregion};
    
    {region}
    Find:|{initial_focus} [%@vfind%.38vcFindWhat];{lf};
         | {font=arial,12,b}You chose the following: {text=vcfindwhat};
    {endregion};;
    
    {region}
    {justify=center,center}
    <8=ok_button_label!OK?vcFindWhat<\>""> <*8=cancel_button_label!CANCEL>
    {endregion};
    %dlg%,<<%code%
    if a_dlg_button="cancel"
    	end
    end if
    	if a_dlg_button="ok"
    	msgbox(vcFindWhat)
    	end if
    	
    select	
    			case vcChoiceF = "Company"
    			vfind = stritran_multi(vFind,"Lastname","Company")
    			vfind = stritran(vfind,"Last Name","Company")
    
    		case vcChoiceF = "City"
    			vfind = stritran_multi(vFind,"Lastname","bill_city")
    			vfind = stritran(vfind,"Last Name","City")
    end select	
    
    	if a_dlg_button="x_change"
    		vcFindWhat=""		
    		ui_dlg_refresh_targeted(dlg_title,vcFindWhat)
    		ui_dlg_ctl_goto(dlg_title,"vcFindWhat")
    	end if
    	a_dlg_button = ""
    %code%)
    The glitch is, only on the first change of the radio button the cursor will not go to the find box, beyond that it works as desired with no problems.
    I am sure it's all a timing issue, I have to pin point where and see if it can be remedied.

    Comment


      #32
      Re: ui_dlg_ctl_goto() doesn't goto

      Hi John,
      What if you add a 'None' selection to the radio control and set the default value for vChoiceF to that. You could open the dialog without a filter and then your change event for the radio I think will work as expected since the user will have to select one of the other buttons to change the list.
      Robin

      Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

      Comment


        #33
        Re: ui_dlg_ctl_goto() doesn't goto

        Ron, run this - it does as you want - you said you have additional controls, use one of those before (or after), as I tried to explain earlier I used that text box to illustrate
        Code:
        DIM SHARED vcChoiceF as C = "Lastname"
        DIM SHARED vFind as C
        DIM SHARED vcFindWhat as C = ""
        DIM SHARED varC_result as C
        DIM SHARED current_control 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}
        [textbox1]; 
        Find:|{initial_focus} [%@vcFW%.38vcFindWhat];
        {endregion};;
        {region}
        {justify=center,center}
        <8=ok_button_label!OK?vcFindWhat<\>""> <*8=cancel_button_label!CANCEL>
        {endregion};
        %dlg%,<<%code%
        current_control = alltrim(ui_dlg_ctl_current(dlg)) 
        if a_dlg_button = "change" then
        	ui_dlg_ctl_goto(dlg,"[textbox1]")
        	sys_send_keys("{TAB}")
        
        	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)
        Last edited by Ray in Capetown; 04-15-2015, 11:39 AM.

        Comment


          #34
          Re: ui_dlg_ctl_goto() doesn't goto

          Ray, I'm not sure what the issue is, but your work around works. A very simple work around I might add. I didn't understand what you meant with your first post. Tunnel vision I guess. Anyways, thanks so much to G., John and yourself for your help. For anyone interested, I've included my test code for Alpha Sports to see how it works.

          Thanks again,

          Ron

          Code:
          DIM SHARED vcChoiceF as C = "Last Name"
          DIM SHARED vFind as C
          DIM SHARED vcFindWhat as C = ""
          DIM SHARED varC_result as C
          
          dlg_title="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_title,<<%dlg%
          {units=f}{font=calibri,11}{xmargin=2,2}{ysize=.3};;
          
          {region}
          (vcChoiceF:Last Name!chg)
           (vcChoiceF:Company!chg)
           (vcChoiceF:City!chg);;
          {endregion};
          
          {region}
          Find:{initial_focus} [%@vcFW%.38vcFindWhat];
          {endregion};;
          
          {region}
          {justify=center,center}
          <8=ok_button_label!OK?len(alltrim(vcFindWhat))\>1> <*8=cancel_button_label!CANCEL>
          {endregion};
          %dlg%,<<%code%
           
          if a_dlg_button = "chg" then
          	'note:  any changes to the OK button code may need to be copied to the next line
          	ui_dlg_ctl_goto(dlg_title,"ok_button_label!OK")
          	sys_send_keys("{SHIFT-TAB}")
          
          	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)
          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


            #35
            Re: ui_dlg_ctl_goto() doesn't goto

            Ron,

            I added the auto-popup at event which I do like it.

            Code:
            DIM SHARED vcChoiceF as C '= "Last Name"
            DIM SHARED vFind as C
            DIM SHARED vcFindWhat as C = ""
            DIM SHARED varC_result as C
            
            dlg_title="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_title,<<%dlg%
            
            {units=f}{font=calibri,11}{xmargin=2,2}{ysize=.3};;
            
            {region}
            (vcChoiceF:Last Name!chg)
             (vcChoiceF:Company!chg)
             (vcChoiceF:City!chg);;
            {endregion};
            
            {region}
            Find:{initial_focus} [%@vcFW%.38vcFindWhat];
            {endregion};;
            
            {region}
            {justify=center,center}
            <8=ok_button_label!OK?len(alltrim(vcFindWhat))\>1> <*8=cancel_button_label!CANCEL>
            {endregion};
            %dlg%,<<%code%
            '{startup=Init} removed
            'If a_dlg_button ="init" then
            '	If vcFindWhat="" then    [COLOR="#FF0000"]'*condition - clean the default Radio value[/COLOR]'	
            '	sys_send_keys("{%DOWN}")
            '	end if
            '	a_dlg_button =""
            'end if 
            
            if a_dlg_button = "chg" then
            	'note:  any changes to the OK button code may need to be copied to the next line
            	ui_dlg_ctl_goto(dlg_title,"ok_button_label!OK")
            	sys_send_keys("{SHIFT-TAB}")
            
            	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
            	
            [COLOR="#FF0000"]	'Auto pop-up when it is null value
            	If vcFindWhat="" then
            		sys_send_keys("{%DOWN}")
            	end if[/COLOR]end if
            
            %code%)
            
            if varC_result <> "OK" then
            	end
            end if
            
            msgbox(vcFindWhat)

            Comment


              #36
              Re: ui_dlg_ctl_goto() doesn't goto

              Originally posted by Ronald Anusiewicz View Post
              Everyone, thank you for your help. Maybe this short video will better explain what I'm trying to do.

              http://screencast.com/t/C7tsFTPe

              The example I'm using is only to demonstrate what I'm trying to do. The live code is more complex than
              my demo.
              That does work in your example code, but when there are more controls, going back to prev from the OK won't work, you can change the control from which to go back.

              I just tested this, works similarly to your method without depending on the position of the OK control;-
              remove
              Code:
              	'note:  any changes to the OK button code may need to be copied to the next line
              	ui_dlg_ctl_goto(dlg_title,"ok_button_label!OK")
              	sys_send_keys("{SHIFT-TAB}")
              and change the if .. conditions to
              Code:
              	select
              		case vcChoiceF = "Last Name"
              			vcFW = vFind
              			sys_send_keys("{TAB}{TAB}{TAB}")
              		case vcChoiceF = "Company"
              			vcFW = stritran_multi(vFind,"Lastname","Company")
              			vcFW = stritran(vcFW,"Last Name","Company")
              			sys_send_keys("{TAB}{TAB}")
              		case vcChoiceF = "City"
              			vcFW = stritran_multi(vFind,"Lastname","bill_city")
              			vcFW = stritran(vcFW,"Last Name","City")
              			sys_send_keys("{TAB}")
              	end select

              Comment


                #37
                Re: ui_dlg_ctl_goto() doesn't goto

                Works great. I can't tell you how much time I spent on this and in the end, the answer has turned out to be so simple.

                Thanks Ray.
                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


                  #38
                  Re: ui_dlg_ctl_goto() doesn't goto

                  That's because simple solutions are much more time consuming - you wanted to simplify (eliminate the extra click)

                  I always tell clients that a complicated system could be much less costly than a simple one.

                  Comment


                    #39
                    Re: ui_dlg_ctl_goto() doesn't goto

                    Hi Ron,
                    In your select case statement did you try adding sys_send_keys("TAB"} after each case with the number of tabs needed to reach the next control?
                    Robin

                    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                    Comment

                    Working...
                    X