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

Center "startup" form?

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

    Center "startup" form?

    I'm guessing I've got my code in the wrong place, but I am using the code from the UI_INFO help topic to center the form that loads when starting the application. It's just a simple splash screen.

    I created a function called "center_form" that I am calling from the OnActivate event, but I noticed that I can see the form open in the default location, then relocate to the center of the screen.

    Should I be calling this function somewhere else besides the OnActivate event?

    What if I wanted to use the form.view(), where would I place this function call at? I tried putting it in the OnActivate and got a whole bunch of startup forms opened.
    John J. Fatte', CPA
    PRO-WARE, LLC
    Omaha, NE 68137

    #2
    Re: Center "startup" form?

    Hi John,

    You can also use the OnInit event. I like to use Action Script and this is the code Alpha creates to centre a form.
    Code:
    'Position window: current window.
    dim pObj as p 
    'get a pointer to the current window
    pObj = topparent.this	
    
    pObj.window_position("Center","Center")
    Hope this helps.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

    Comment


      #3
      Re: Center "startup" form?

      John,
      Keith mentions the most prevalent method used, but if wanted, your way could work by opening the form as hidden, position it, then show it. No screen flicker or form movement that way either.
      Mike
      __________________________________________
      It is only when we forget all our learning that we begin to know.
      It's not what you look at that matters, it's what you see.
      Henry David Thoreau
      __________________________________________



      Comment


        #4
        Re: Center "startup" form?

        Originally posted by Keith Hubert View Post
        Hi John,

        You can also use the OnInit event. I like to use Action Script and this is the code Alpha creates to centre a form.
        Code:
        'Position window: current window.
        dim pObj as p 
        'get a pointer to the current window
        pObj = topparent.this	
        
        pObj.window_position("Center","Center")
        Hope this helps.
        Thanks Keith. You've got all the right answers today.
        John J. Fatte', CPA
        PRO-WARE, LLC
        Omaha, NE 68137

        Comment


          #5
          Re: Center "startup" form?

          Hi

          Just to put a fly in the ointment...

          By some strange coincidence, I've been trying to center a startup form today. It all works as described when I use Action Scripting to center the window in the OnInit event, except I'm left with a partly white background on the form where it hasn't refreshed.

          Using the refresh window command doesn't help but when I open a second form from the startup form, the startup form immediately displays correctly (repaints).

          This occurs using A5v8 A5v9 under XP or Vista.

          Any thoughts? Anyone had the same problem?

          Alan
          Kind Regards
          Alan

          Comment


            #6
            Re: Center "startup" form?

            Alan,
            What else have you tried? Does activating the form do anything? using Your_Form_Name.repaint(), .refresh_layout(), other ways.....too many variations to put here.

            If you can make it repaint via a manual method, then usually you can emulate this with Alpha.
            Mike
            __________________________________________
            It is only when we forget all our learning that we begin to know.
            It's not what you look at that matters, it's what you see.
            Henry David Thoreau
            __________________________________________



            Comment


              #7
              Re: Center "startup" form?

              Hi Mike

              Yes, I've tried all three of these in the OnInit and (In desperation) the OnActivate event of the form.

              Thanks
              Alan
              Kind Regards
              Alan

              Comment


                #8
                Re: Center "startup" form?

                Originally posted by Citadel View Post
                Hi Mike

                Yes, I've tried all three of these in the OnInit and (In desperation) the OnActivate event of the form.

                Thanks
                Alan
                After the form opens, does hitting the F5 key do anything?

                Comment


                  #9
                  Re: Center "startup" form?

                  Originally posted by Keith Hubert View Post
                  Hi John,

                  You can also use the OnInit event. I like to use Action Script and this is the code Alpha creates to centre a form.
                  Code:
                  'Position window: current window.
                  dim pObj as p 
                  'get a pointer to the current window
                  pObj = topparent.this	
                  
                  pObj.window_position("Center","Center")
                  Hope this helps.
                  I tried using this code in the OnInit for my startup form and although it centered it, it also put a rather large white area around the form inside the display window. Very weird. This did not happen using the other code in the OnActivate.
                  John J. Fatte', CPA
                  PRO-WARE, LLC
                  Omaha, NE 68137

                  Comment


                    #10
                    Re: Center "startup" form?

                    Originally posted by jjfcpa View Post
                    a rather large white area around the form inside the display window.
                    Yes, that's exactly what I've been describing.

                    Originally posted by Raymond Lyons View Post
                    After the form opens, does hitting the F5 key do anything?
                    No, Raymond, F5 doesn't appear to do anything, but I have no menus or toolbars in my application (don't know if that makes a difference)

                    Thanks
                    Alan
                    Kind Regards
                    Alan

                    Comment


                      #11
                      Re: Center "startup" form?

                      John,

                      I tried the OnInit code and noticed the white area.
                      Found a solutions for that:
                      - Go to Form properties and select backdrop tab
                      - Tick the Use bitmap box
                      - Now change display mode to something else like stretch or fit.
                      - Untick the Use bitmap box.
                      You will very likely notice that the white area has disappeared.

                      Anothe thing I noticed that the centering is based on a maximized A5 window. Would be nice that the centering could partly float with the resizing of the A5 window so that the centered form will remain visible.

                      Regards,

                      Jo Hulsen
                      Jo Hulsen
                      Dommel Valley Solutions
                      The Netherlands

                      Comment


                        #12
                        Re: Center "startup" form?

                        Originally posted by DVSOL005 View Post
                        John,

                        I tried the OnInit code and noticed the white area.
                        Found a solutions for that:
                        - Go to Form properties and select backdrop tab
                        - Tick the Use bitmap box
                        - Now change display mode to something else like stretch or fit.
                        - Untick the Use bitmap box.
                        You will very likely notice that the white area has disappeared.

                        Anothe thing I noticed that the centering is based on a maximized A5 window. Would be nice that the centering could partly float with the resizing of the A5 window so that the centered form will remain visible.

                        Regards,

                        Jo Hulsen
                        Thanks Jo. Not sure how you figured that out, but it's good to know there is a fix for it.

                        Right now, I've settled on the form.view() with the "center" option and it's working pretty good.
                        John J. Fatte', CPA
                        PRO-WARE, LLC
                        Omaha, NE 68137

                        Comment


                          #13
                          Re: Center "startup" form?

                          Hi All

                          Originally posted by DVSOL005 View Post
                          - Go to Form properties and select backdrop tab
                          - Tick the Use bitmap box
                          - Now change display mode to something else like stretch or fit.
                          - Untick the Use bitmap box.
                          You will very likely notice that the white area has disappeared.
                          Jo, thank you for the 'workaround. Works in both A5v8 and A5v9, although to make it work I did have to close the 'Form Properties' dialog after selecting 'stretch' then reopen the dialog and uncheck 'use bitmap.'

                          Originally posted by jjfcpa View Post
                          Right now, I've settled on the form.view() with the "center" option and it's working pretty good.
                          John, where and how are you using the form.view() function?

                          Thank you
                          Alan
                          Kind Regards
                          Alan

                          Comment


                            #14
                            Re: Center "startup" form?

                            Here's what I've done based on the info provided earlier in this forum. I created a simple splash screen with menus set to my custom menu, dialog style frames, no popup menus, etc. and then added an Xbasic Autoexec script with the commands:

                            form.view("splash","modal","splash","center","center")
                            'Hide the Control Panel.
                            :controlpanel.hide()

                            I added the code to hide to control panel so I didn't have to set a startup form in the Database Properties in order to accomplish this.

                            Make sure that if you do this that on your custom menu that you've assigned to the Splash screen that you include an option to Unhide the controlpanel. I created a Utility menu with an option "Control Panel" that contained the following code:

                            'Unhide the control panel
                            controlpanel.show()
                            controlpanel.Activate()
                            'Close the form/browse called: Splash
                            'Close the window
                            :Splash.close(.f.)

                            This way I close the Splash screen and open the Control Panel. I based the Splash Screen on a simple table containing fields that I use for storing last login, current user, etc.
                            Brad Weaver, President
                            ComputerAid International
                            Ottawa ON Canada
                            Versailles KY USA
                            www.compuaid.com

                            Comment


                              #15
                              Re: Center "startup" form?

                              Thank you Brad.

                              That all makes perfect sense. Excellent.
                              Kind Regards
                              Alan

                              Comment

                              Working...
                              X