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

Popup and Normal Forms - OnActivate

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

    Popup and Normal Forms - OnActivate

    Popup and Normal Forms

    For my Contact Manager I want to have 1) a Background Form which is maximized and stays consistent regardless of which other form is opened; 2) a Family Form which lists the families and includes an embedded browse of family members; 3) an Individuals Form which lists the details for the individuals. The desire is that on the Family Form you can double-click on the name of the individual in the embedded browse and the Individuals Form would open with that individual displayed. The Family Form and Individuals Form are also coded so that they are first opened with form.view(), and then hidden with a form.hide(). The next time the form is opened it responds to a form.show() command.

    I actually got this to work fine, but whenever the Background Form lost focused (deactivated?) then it shrank in size and no longer filled the screen as it should when it is maximized. I read many posts and tried fill,fill etc, but could only get it to work properly when I changed the Family Form and Individuals Form to 'Popup' forms. Then everything appears as I desire it.

    But then I discovered that the correct individual was not appearing in the Individuals Form after the double-click. After playing with this for some time I realized that the xbasic query in the OnActivate event of the Individuals Form was not working.

    I then did some testing with the Trace window. I discovered that a Popup form does not fire OnActivate. When the Popup form is first viewed, it goes through OnInit, OnFetch and CanChange, before settling on the first field of the Tab Order with an OnArrive. That is, unless that first field is on a Tabbed Object, in which case it doesn't settle on anything, unless you physically click in the field. If the Popup form is hidden and then subsequently show()n, then even the OnArrive for that first field is not fired.

    So, I guess I have 2 questions. The first is, does anyone have any suggestions for how to handle the query to display the desired individual since there is no consistent event? The second would be, has anyone really successfully got a full-screen (ie equivalent to maximized) background form to work? If so, how?

    Thanks

    Les

    #2
    Re: Popup and Normal Forms - OnActivate

    Les, in working with normal forms you might use the script that opens the form to run the query instead of having an event in the called form trigger the query. I assume this would work with popups, too, though I have almost no experience with them.

    It's also possible to embed a filter expression in the called form that uses a global variable to define which record to display. The calling form can set that variable just before the form opens. The form opens filtered. No reason to query the underlying table separately.

    Have you considered forms opened as dialogs?

    -- tom

    Comment


      #3
      Re: Popup and Normal Forms - OnActivate

      Tom,

      Thanks for your reply. I have tested your first suggestion and got some encouraging results, plus some unexpected behavior. I'll have to think through the process some more. I found the article on 'Opening a Filtered Browse on another Form' in Alpha help and will test that too. I've run out of time for today and will work on this tomorrow.

      I haven't considered the dialog option. I coded them as popups because of a thread on making the background form static. I'll check that out as well.

      Thanks again. I'll post again when done the testing.

      Les

      Comment


        #4
        Re: Popup and Normal Forms - OnActivate

        I don't think you should have to restrict yourself to popup or dialog forms.

        I would have as few events in the background form as possible. You may need a "this.maximize()" in the on init. The only other code I would have is a "This.restore()" to the OnActivate event of the background form.
        Finian

        Comment


          #5
          Re: Popup and Normal Forms - OnActivate

          Tom,

          I wasn't getting very far with your suggestions with popup forms, so I reverted to normal forms. And then I wasn't getting your suggestions to work there either, so I figure I'm just plain doing something wrong.

          Your first suggestion was to use the script that opens the form to run the query instead of having an event in the called form trigger the query.

          The Calling Form is FamilyInfoDisplay. The embedded browse in the form is based on the personinfo table. The following is part of the code for the OnRowDblClick event:
          Code:
          flag = table.isopen("personinfo")
          if flag = .T.	then
          	tbl = table.get("personinfo")
          else
          	tbl = table.open("personinfo")
          end if
          fld = tbl.field_get("idperson")
          vcPersonID = fld.value_get()
          query.filter = "Idperson = \"" + vcPersonID+ "\" "
          query.order = "Idperson"
          tbl.query_create()
          The code then views/shows the PersonalInfoDisplay form:
          Code:
          if is_object("PersonInfoDisplay") then
          PersonInfoDisplay.show()
          PersonInfoDisplay.activate()
          else
          form.view("PersonInfoDisplay")
          end if
          The record displayed is not what is called by the variable vcPersonID, but is the first record in the table. So I would assume that somehow the query is not working.

          Your second suggestion was to embed a filter expression in the called form that uses a global variable to define which record to display. The calling form can set that variable just before the form opens. The form opens filtered. I went to Alpha help and found the article on 'Opening a Filtered Browse on another Form'. That illustration shows putting code in the button on the calling form which then opens a called form with an embedded browse. So I modified their code and inserted it in the OnRowDblClick event.
          Code:
          dim vpPID as p
          vpPID = Form.load("PersonInfoDisplay")
          vpPID:tables:Personinfo.filter_expression = "Idperson = \"" + vcPersonID+ "\" "
          vpPID:tables:Personinfo.query()
          vpPID.show()
          vpPID.activate()
          Again when the form opened the record displayed is not what is called by the variable vcPersonID, but is the first record in the table.

          I then reread your suggestions (well actually several times) and wondered what you meant by embedding a filter expression in the called form. Where in the called form would you embed the expression?

          Well that's as far as I have gotten so far. I look forward to your next directions with gratitude.

          Les

          Comment


            #6
            Re: Popup and Normal Forms - OnActivate

            Before spending time debugging these, check out the Action Scripting "Zoom to record" action. It should do what you need. You'll find it in the Form/Browse category of action scripting statements. -- tom

            Comment

            Working...
            X