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

Wizard setup - multiple forms

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

    Wizard setup - multiple forms

    I have created a "setup wizard" with about 11 forms that gather info for an app. Works fine using Next, Back and Quit buttons to navigate back and forth between the forms. I call it from the main menu of the app. However, I would like for each form to act as a Modal type form where the form you are working in can't lose focus except, of course, clicking Next, Back or Quit. If forms are set to Modal (i.e. frm = form.view("nextform","Dialog") the forms stay open, so you end up with multiple open forms.

    Seems a CanDeActivate event is needed. In the OnDeActivate event, the form is already deactivated and I can't figure out how to get it back to being the active form, i.e. not allowing the user to click elsewhere in the app and lose focus for the current form.

    I've tried :currentForm.Show() then :currentForm.Activate(), but that doesn't work. I hide the Main Menu when calling the first form (Quit button on each form un-hides it), but if the user clicks outside the form he's working on, the form loses focus and nothing is showing except the wallpaper. (I use a wallpaper background maximized.)

    Any ideas on how to make this work?
    Thanks.
    Ernie

    #2
    Re: Wizard setup - multiple forms

    Originally posted by enstorms View Post
    If forms are set to Modal (i.e. frm = form.view("nextform","Dialog") the forms stay open, so you end up with multiple open forms.
    Other solutions available.. but why not just close the form when you click "Next"?

    Comment


      #3
      Re: Wizard setup - multiple forms

      Well, doesn't work for me.
      code on first forms next button:

      Code:
      topparent.Commit()
      topparent.Close()
      dim frm as p
      frm = form.view("wiz_bank_acct","Dialog")
      frm.Close()
      Ernie

      Comment


        #4
        Re: Wizard setup - multiple forms

        Try the next button like this.

        Code:
        dim ptr as P
        ptr = obj(a_form_current)
        topparent.Commit()
        dim frm as p
        frm = form.view("wiz_bank_acct","Dialog")
        ptr.Close()
        There can be only one.

        Comment


          #5
          Re: Wizard setup - multiple forms

          Same result, Stan.
          Ernie

          Comment


            #6
            Re: Wizard setup - multiple forms

            Not sure why it doesn't work for you?
            It works for me:
            Code:
            form.view("Next_form")
            topparent.close(.f.)
            We could write a much fancier code, but the above works just fine. Put the code in the "Next" button.

            Comment


              #7
              Re: Wizard setup - multiple forms

              G. it does work if you're not calling the form as "Dialog".

              Code:
              frm = form.view("wiz_bank_acct",[COLOR="Red"]"Dialog"[/COLOR])
              I am looking to have Modal behavior so I can keep the current form from losing focus.
              Ernie

              Comment


                #8
                Re: Wizard setup - multiple forms

                I tried it with Dialog using same script as you have and it works. Something else is going on.

                Comment


                  #9
                  Re: Wizard setup - multiple forms

                  Here's a very simple app. Open the mainmenu form and press the "Run Setup Wizard" button to Hide() the Main Menu and bring up the first form. On that form, the Next button should take you to the second form and Hide() the first. The second form has a Back button that I am wanting to close the second form and take you back/show() the first form. The Quit button on both forms are supposed to shut down the forms and show() the Main Menu. Hope somebody can see where I'm going wrong in trying to get this working. There may be a better way, but I haven't found it.
                  Ernie

                  Comment


                    #10
                    Re: Wizard setup - multiple forms

                    ..stand by..
                    will work on it later

                    Comment


                      #11
                      Re: Wizard setup - multiple forms

                      The Help states that using the form.view() command, the form must be closed from the calling form or the underlying tables will not be closed. In debugging code to try to figure out how opening/closing dialog forms works, I see my :wiz_bank_acct.Close() code never fires. When the wiz_bank_acct form closes (or disappears) it is really still opened since the tab is still showing and the debug window doesn't open back up at the line following the :form.view(..... line.

                      Code:
                      :wiz_company.Hide()
                      
                      if is_object(":wiz_bank_acct") then
                          :wiz_bank_acct.Show()
                      else
                          :form.view("wiz_bank_acct","Dialog")
                          [COLOR="Red"]:wiz_bank_acct.Close()[/COLOR]
                      end if
                      This is code on the "Back" button of the wiz_bank_acct form. In trying to get the wiz_bank_acct form to close, I've tried referencing it with topparent.close() also.

                      Code:
                      topparent.Commit()
                      
                      [COLOR="Red"]:wiz_bank_acct.Close()[/COLOR]
                      :wiz_company.Show()
                      This code is on the "Quit" button of the wiz_bank_acct form and it works.
                      Code:
                      :wiz_bank_acct.Close()
                      :wiz_company.close()
                      :mainmenu.show()
                      Is this the way it is designed to work? Does anybody really understand what is going on? Maybe there's just not a way to get multiple forms to work as dialog and also allow flexibility to navigate back and forth until last form is called. I have 12 forms to step through.
                      Ernie

                      Comment


                        #12
                        Re: Wizard setup - multiple forms

                        Originally posted by enstorms View Post
                        Is this the way it is designed to work? Does anybody really understand what is going on? Maybe there's just not a way to get multiple forms to work as dialog and also allow flexibility to navigate back and forth until last form is called. I have 12 forms to step through.
                        Fear not, Ernie. There is a way. ;) Dialog forms are prickly critters. I like them, but you have to treat them "right", otherwise they bite you! The trick is that you have to call any subsequent dialogs from the main calling form. Dialogs won't close if you try to call one from the other. Also, I have found that dialogs don't like the .hide() method. Anyway check out the attached sample. Notice how I use a global variable to control the action. Check out the quit button code as well. Plus, when using dialogs, you really need to get rid of the "X" in the upper right corner so that the user doesn't usurp control away from your design flow. Hope this helps...
                        Attached Files
                        Peter
                        AlphaBase Solutions, LLC

                        [email protected]
                        https://www.alphabasesolutions.com


                        Comment


                          #13
                          Re: Wizard setup - multiple forms

                          Thanks so much Peter for helping. I'll take a look. Lots of good suggestions.
                          Ernie

                          Comment


                            #14
                            Re: Wizard setup - multiple forms

                            One other note. When working (i.e. coding/developing) with dialogs, check the xbasic explorer/Objects/Windows often to see if you have any duplicate copies of dialogs -

                            e.g.
                            wiz_company
                            wiz_company0
                            wiz_company1
                            etc

                            If you see that, it means your dialogs are not closing properly and you're leaving invisible copies of the form in memory. As long as you follow procedures similar to my code example, it should work.
                            Peter
                            AlphaBase Solutions, LLC

                            [email protected]
                            https://www.alphabasesolutions.com


                            Comment


                              #15
                              Re: Wizard setup - multiple forms

                              Peter,
                              Works perfectly!!!!!!!! Could you explain how this code works:

                              OPEN_DIALOG:

                              GOTO OPEN_DIALOG
                              Is it necessary to wrap the Select....End Select in it?

                              Ernie

                              P.S. I always watch the tabs at the bottom when opening/closing forms, especially when using "Dialog", to determine if a new instance of a form is opening or just another instance.

                              Comment

                              Working...
                              X