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

Undepress button in tool bar

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

    Undepress button in tool bar

    I've created a customer toolbar, in which I attached a script to one of the buttons. It works fine the first time, but the button remains depresses, and it will NOT play the script a second time. If I close the form and re-open it, all is fine again.

    I tried putting PARENTFORM.RESYNCH() at the end of the script, but that didn't help.

    Any ideas??

    #2
    RE: Undepress button in tool bar

    Hi Bill,

    That's a bit odd. The only thing that occurs to me is that the process run by the button (that is, the script) doesn't finish properly so the button doesn't reset. How about putting the debugger to work on the script itself. Or have you done that?

    Bill
    Bill Hanigsberg

    Comment


      #3
      RE: Undepress button in tool bar

      Hi Bill
      A little trick I do with longer scripts that don't seem to work right is to put a ui_msg_box statement periodically through the script. Sometimes scripts will either end themselves due to an error which may not display, or loop indefinitely. Try putting a ui_msg_box("","Test") right before the parentform.resynch() to see if the script is getting that far. If not, move it up the script until it displays, then you can figure out where the script is bombing. Debugging works well too, but this just a different way to test the script. Once the script is working, remove the msg_box's.

      Mick

      Comment


        #4
        RE: Undepress button in tool bar

        Mick, I tried your suggestion, and the script runs just fine.

        Here's the script:

        obj = parentform.this
        frmname = obj.name()
        brname=substr(frmname,1,at("_",frmname)-1)+"_LIST"
        form.view(brname)

        (I've attached this to the BROWSE button on the toolbar, so the user goes to a form with an embedded browse, rather than a true browse)

        Comment


          #5
          RE: Undepress button in tool bar

          I tried one more thing, to see if this is a script problem or a button problem:

          I put a simple ui_msg_box in the script, with nothing else. Same results - it fires properly the first time, the button stays depressed, and will NOT fire again.

          BTW, this is 4.5 build 266

          Comment


            #6
            RE: Undepress button in tool bar

            Bill, I tried a simple example to see if I could duplicate your problem.

            I couldn't. My custom toolbar works repeatedly. Maybe if you compare it to yours you can spot the difference.

            This example was built with Alpha Five Version 4.03

            As usual unzip this to a separate folder. Do not mix it with your development work.

            -- tom

            Comment


              #7
              RE: Undepress button in tool bar

              Hi again Bill,

              Perhaps a context issue is causing a little hiccup.

              Your script's first line:

              obj = parentform.this

              makes me wonder because if the code were attached directly to the button the alias "parentform" would have no meaning as the context of the button is the form itself. So the line would have to read

              obj = this.this (right?)

              But in your case the line appears in a script attached to the button so to what does "parentform" refer?

              Seems to me that if the code were on the button directly you could write

              frmname = this.name() 'new element
              'everything below is unchanged
              brname=substr(frmname,1,at("_",frmname)-1)+"_LIST"
              form.view(brname)

              Whether this would work in a script attached to a button I do not know.

              Obviously I'm just thinking out loud here in the hopes of jogging somebody's thinking.

              I use scripts attached to buttons to refer to forms' properties and to avoid this issue (that is, referencing) I create pointers as I load my application's forms. The pointers are in global variables (only four) and I use them all over the place. It gives me complete control over the referencing issue and is the one feature of a complex application which has literally never failed me.

              Bill
              Bill Hanigsberg

              Comment


                #8
                RE: Undepress button in tool bar

                Bill, I follow a simpler but potentially more dangerous course and just use the absolute address for the form object, itself. -- tom

                Comment


                  #9
                  RE: Undepress button in tool bar

                  Bill, Thank you for the exhaustive reply! I believe that this is an issue that relates to the buttons in the toolbar, because I don't have these problems with normal buttons.

                  Tom, I'll give your's a look, and let you know. Thanks for the file.

                  Bill

                  Comment


                    #10
                    RE: Undepress button in tool bar

                    Bill

                    A couple more ideas. One area that I think has caught many people is that xbasic script errors do not always create an error message in all conditions. I have found this to be true in scripts on menus and toolbars and on form events on dialog forms. If an error occurs, the only hint is some sort of odd behavior, like a button "sticking", or form lockup. I always use error trapping code during developement to check for these kinds of errors. On the first line of the script place

                    on error goto err ' or whatever

                    At the end of the script, place this code

                    end
                    err:
                    ui_msg_box("Error", this.name()+" - "+error_text_get(error_code_get())+chr(10)+chr(13)+"Error occured at line "+str(error_line_number_get(),4,0))
                    end

                    This will give an error message with the name of the object that generated it, the error type, and the line. After development, I either remove the trapping entirely or comment out the on error line.

                    Another cosideration is the length of time a script takes to run. I have seen buttons on forms seem to "stick" down if the script takes some time to run as happens if there are loops in the script or untrapped errors that run for a while.

                    Jerry

                    Comment


                      #11
                      RE: Undepress button in tool bar

                      Jerry, thanks for the input. Howwever, keep in mind that, as a test, I put a single message box on the button, and got the same results. The message appeared, and the button remained depressed. All other functions remained operational.

                      Tom Cone sent me an example of opening another form from a toolbar button, and that one worked fine. So, I'm not sure what's going on.

                      Thanks again to all that responded.

                      Comment

                      Working...
                      X