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

Cut and paste A5V9 center window function fails

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

    Cut and paste A5V9 center window function fails

    I am trying to center a form on my Alpha Desktop using the code suggested by the A5V9 help for function UI_INFO as follows:

    Code:
    function center as L(window as C)
    	p = obj(window)
    	a5_height = UI_info(3)
    	a5_width = UI_info(0)
    	width = p.width
    	height = p.height
    	newtop = (a5_height - height)/2
    	newleft = (a5_width - width)/2
    	p.top = newtop
    	p.left = newleft
    	p.activate()
    end function
    When this cut and paste code is executed in debug mode, the following error is received:

    Code:
    An error occurred then running a script:
    Property is write only
    p.width subelement not found
    I thought the dimension statements for width, height, newtop, and newleft might be needed so I inserted them in the function, defining each as numeric.

    When I executed the function again, the same error occurred.

    Considering that I simply cut and pasted this code, I am puzzled why it doesn’t work out of the box.

    I have created two forms:
    Form1 with a button to open Form2
    Form2 with a size of 2.4 X 4.0 inches which I wish to center.

    I have defined the following:
    Form1 button on push event:
    Center("frmForm2")

    Form2 properties:
    Form name: frmForm2
    Caption: frmForm2

    Any ideas of why this Alpha Five code isn't behaving as expected?

    I am using A5V9 with the Build 1772-3208 (7-Oct-2008), the latest and greatest.

    Thanks,
    Bob McGaffic
    Pittsburgh

    #2
    Re: Cut and paste A5V9 center window function fails

    This approach is pretty old, and mostly obsolete. It was developed before you could do this:

    Code:
    form.view("Main Menu", "", "", "center", "center")
    Any reason you need the "old" method here?
    -Steve
    sigpic

    Comment


      #3
      Re: Cut and paste A5V9 center window function fails

      Steve,

      The reason I was trying to center my form the "old-fashioned" way was that the code you suggested is unstable. Occasionally it works; most often it does not work.

      I have now tried three different ways to center a form and none of them dependably work:

      1. UI_INFO() code cut and pasted from A5V9 help

      2. Xbasic code behind button:
      form.view("frmForm2", "", "", "center", "center")

      3. Action script behind button:
      Form>Open Form or browse layout>Form2
      On Options tab: (X) Override - use position specified here
      X (horizontal): Center
      Y (vertical): Center

      Screen 1: Shows UI_INFO() code aborts
      Screen 2: Shows form.view code does not work; but sometimes it does
      Screen 3: Shows Action Script does not work; but sometimes it does

      I am surprised that sometime so basic as centering a form on the desktop is so unstable. Is there something that I am overlooking here. Why is the first approach bombing out and the other two approaches behaving erractically?

      My screenprints are two large as bmp's; I'll append them later this evening.

      Bob McGaffic
      Pittsburgh

      Comment


        #4
        Re: Cut and paste A5V9 center window function fails

        Just wanted to share some more unstable behavior of A5V9.

        After reporting the problem of not centering a form properly, I had time at lunch to do the screen prints I cited above in my original post.

        Guess what?
        Screen1: UI_CODE() continues to fail
        Screen2: XBasic code with form.view command now works, but didn't work this morning
        Screen3:. Action script now works, but didn't work this morning

        Screen4: So I closed out A5V9, open it up again and executed the Action Script,
        and surprise, surprise IT FAILED. This worked three minutes ago, why is it failing now?

        This behavior is absolutely schizo!!!

        I can't reliably reproduce the error to report it as a bug.

        Is anyone else having these problems with form centering with the A5V9 batch of last week?

        Bob McGaffic
        Pittsburgh
        Last edited by rmcgaffic; 10-23-2008, 02:25 PM.

        Comment


          #5
          Re: Cut and paste A5V9 center window function fails

          hey Bob,
          Using version 8 here but have similar issues. And I did get the same error message with the "old" way but resolved it.

          In v8 both the xbasic and AS fail.....but the "old" way works great when used in the following way. I took it out of the function but would work within as well--but have to create it as the function first (see second code block). Opened hidden so as not to show the form opening first in the default or form property setting location and then opening centered--just aesthetics really...form doesn't flash in one place and then move to where it is sent is all.

          Code:
          form.load("Your_Form_Name")
          dim window as c
          window="Your_Form_Name"
              p = obj(window)
              a5_height = UI_info(3)
              a5_width = UI_info(0)
              width = p.width
              height = p.height
              newtop = (a5_height - height)/2
              newleft = (a5_width - width)/2
              p.top = newtop
              p.left = newleft
          form.Show()
              p.activate()
          Code:
          form.load("Your_Form_Name")
          
          center("Your_Form_Name")
          
          form.Show()
          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


            #6
            Re: Cut and paste A5V9 center window function fails

            This is the first time I've ever heard/seen anyone have problems with this approach. I use it on a dozen databases for a dozen clients on hundreds of forms, and never found a problem. Not sure why ya'll are getting different behavior.

            I suppose, under some circumstances, if the form is already loaded and you instruct another form.view() that you might have a problem, though even this is a stretch. A more complete syntax is more like this:

            Code:
            if is_object("MainMenu")
               MainMenu.show()    ' here's where you may want to use a centering function
            else
               form.view("MainMenu", "", "", Center", "Center")
            end if
            -Steve
            sigpic

            Comment


              #7
              Re: Cut and paste A5V9 center window function fails

              Mike,

              What a creative approach!

              I am just dismayed that A5V9 can't handle something so simple as centering a form without resorting to the wizardry of your suggestion.

              I tried my three approaches in A5V8 and found exactly the same problems.

              I am attempting to create a custom splash screen as a form (like Visual Basic), rather than a bitmap.

              Why? Because Alpha apparently is incapable of simply displaying a bitmap image and leaving it alone. Instead, it adds a white border of uneven size around the image and then requires a progress bar be displayed. In short, their bitmap approach only works well for the A5 splashscreen with its white background, not necessarily for your client's!

              I can't think of a Windows application package that takes this approach.
              Here's a sampling of applications on my laptop that allow the image to be bled (extended all the way to edge of the bitmap):

              Quicken 2007
              Microsoft Office Accounting 2008
              Any Microsoft Office 2007 producsts (Word, Excel, Access, etc)
              Adobe Photoshop Elements 6.0
              FileMaker Pro9 Advanced
              Open Office 2.0

              Notice that Visual Basic's template for a splash screen, shown below, is bled to edges. The splash screen for Windows Application 1 would look much weaker if it were surrounded by a 1/4 inch white border.

              What's especially annoying is that even when you did use a A5 splash screen in Version 8, the desktop background was gray until the application opened. In Version 9, it the desktop is gray for a few seconds, then turns white until the application opens. This looks really bad.

              I'm getting tired of making suggestions to improve this product that would be so simple to implement, but here are two more more:

              Create shortcut genie | Appearance tab
              Splash screen when Alpha Five is loading:
              ( ) Default
              ( ) No splash screen
              ( ) Custom bitmap [Filename browse]
              ( ) Omit white margin around custom bitmap image
              ( ) Omit progress bar imposed on custom bitmap image

              Keep the dark gray background until the user's application opens, it shows off your bitmap better, makes it appear brighter. A5V9's switch to a white background only washes out your bitmap image. The purpose of a splash screen is to spotlight your application, not to overwhelm it!

              Bob McGaffic
              Pittsburgh
              Last edited by rmcgaffic; 10-24-2008, 08:24 AM.

              Comment


                #8
                Re: Cut and paste A5V9 center window function fails

                Robert, may I suggest again that your ideas (which are good by the way) be posted to the wishlist forum? It's a shame to invest the time you have put into your response only to bury it at the bottom of thread that Alpha personnel may never see.

                Comment


                  #9
                  Re: Cut and paste A5V9 center window function fails

                  Bob,
                  I don't think it as much creative as it was noticing that without a form already showing or at least loaded, that any command to alter it such as loction parameters, would invariably end up in error. The documentation simply does not have the entire context stated...

                  In Version 9, it the desktop is gray for a few seconds, then turns white until the application opens.
                  Version 8 still does this sometimes as well...but not consistently.

                  I also agree with Tom's suggestion to add this idea (actually all your suggestions) to the wishlist forum to give them more of a chance to have Alpha see them.

                  =================
                  Steve,
                  I have no clue as to why Bob and I have the exact same issues across two different versions and you (everyone else??) do not. I will do a little more digging to see if something else is a party to this problem.
                  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


                    #10
                    Re: Cut and paste A5V9 center window function fails

                    For whatever it is worth I am unable to replicate the issues you are experiencing.

                    I use UI_Info() in code to load a different size form conditional upon monitor size so I often utilize the old method. But the "new method" also works for me.
                    Bill Hanigsberg

                    Comment


                      #11
                      Re: Cut and paste A5V9 center window function fails

                      Addendum to last post----In AlphaSports none of the aberrant behavior exists for me--but in 3 other sample databases/examples it does.....out of time to figure it out but something else is going on or at least different from AlphaSports.
                      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


                        #12
                        Re: Cut and paste A5V9 center window function fails

                        Just for the sake of completeness, the attached screenprints show what I am trying to accomplish.

                        Screen 1 shows commerical software splash screen.
                        Screen 2 shows what Alpha Five does with the same bitmap when it converts it to a splash screen. Ugh! And it's worse in version 9 which makes the desktop background white. Double ugh!

                        I'll post these attachments in the wish list section, but I'm not sure if I'm wasting my time. Alpha shows relatively little interest in improving the fit and finish of their product.

                        I well appreciate that a car's blemished paint job has no effect on how well it drives, but in the dealer's showroom, most buyers would prefer a mirror smooth finish.

                        Bob McGaffic
                        Pittsburgh
                        Last edited by rmcgaffic; 10-24-2008, 02:49 PM.

                        Comment


                          #13
                          Re: Cut and paste A5V9 center window function fails

                          Bob:

                          Looking at the Quicken bitmap you've posted, and I agree it's ugly, it has the appearance of a modeless xdialog with an embedded statusbar. I'm guessing that it's either the result of bad design or inherent limitations of how bitmaps can be embedded in xdialogs. I think this is one instance they should go back and code this portion of the program in C if they can't do it any better in xbasic.

                          While I could live with it, imperfect as it is, I just can't abide the white screen that appears between entering the database password and the initial form opening. That's been reported plenty of times and, as you point out, they don't seem to take the complaints seriously or be inclined to do anything about them. It makes any design look amateurish. And if first impressions are important well ...
                          Finian

                          Comment


                            #14
                            Re: Cut and paste A5V9 center window function fails

                            Finian,

                            Well said!

                            Bob McGaffic
                            Pittsburgh
                            Last edited by rmcgaffic; 10-24-2008, 03:27 PM.

                            Comment

                            Working...
                            X