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

Turning Bubble Help for a Form on and off

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

    #16
    Re: Turning Bubble Help for a Form on and off

    A bit late into this discussion, but what about the exceptions? I mean, to my thinking, it would be rare that someone would want ALL the bubblehelp turned off on a form. I have used bubblehelp as an aid to first time users of an application and also as part of the information of a button's or field's function. The latter I would not want the user to turn off normally, especially if the field or button is not going to be used very often. This is why I have a preferences form in which logical fields are placed that indicate various bubblehelp that can be turned off--but only the ones that I have actually scripted to do this on each form, leaving the ones wanted to be permanent alone....and yes it can be a whole lot of extra script but all are so similar that it is not that hard to incorporate--just tedious. I also do this for warning dialogs--some to remain on and others that can be turned off by the user via the preferences form.

    I suppose Selwyn's script could be modified somewhat to accommodate this also...sort of like how you can leave some windows open when closing all the rest during a backup routine. Some crlf list perhaps of the fields wanted to still have the bubblehelp.

    Not as generic I guess as when you would simply use the function to turn off all the bubblehelp.

    Just thought I'd throw out the idea / exception.
    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


      #17
      Re: Turning Bubble Help for a Form on and off

      Here is a revised version of the script that is now easier to use and completely generic.

      There are now only two functions.

      1. No code has to be added to the form's OnInit event.
      2. There are only two functions now: toggleBubbleHelp() and bubbleHelpState()

      To use these functions, you just call them and pass in a pointer to the form.

      e.g.

      Code:
      toggleBubbleHelp(topparent.this)
      or

      Code:
      dim helpstate as c 
      helpstate = bubbleHelpState(topparent.this)
      helpstate will be set to 'on' or 'off'

      you can easily incorporate the toggleBubbleHelp(topparent.this) command in the form's right click menu.

      Here is the code for the toggleBubbleHelp function:

      Code:
      function toggleBubbleHelp as v (obj as p)
      
      dim sh as n 
      dim sv as p 
      sh = obj.SessionHandle()
      sv = session_variables(sh)
      if eval_valid("sv.__bubbleHelp") = .f. then 
      	dim sv.__bubbleHelp[0] as p 
      end if 
      
      dim BubbleHelpState as c 
      if obj.Child_Enum("r;e=this.bubble_help") = "" then 
      	'if no controls has bubble help, then the state is 'off'
      	BubbleHelpState = "Off"
      else
      	BubbleHelpState = "ON"
      end if 
      
      if BubbleHelpState = "ON" then 
      	turnBubbleHelpOff(obj)
      else
      	turnBubbleHelpOn(obj)
      end if 
      	
      	
      end function 
      
      
      
      
      function turnBubbleHelpOff as v (obj as p )
      
      dim sh as n 
      dim sv as p 
      sh = obj.SessionHandle()
      sv = session_variables(sh)
      dim a as p 
      a = sv.__bubbleHelp
      
      dim BubbleHelpState as c 
      if obj.Child_Enum("r;e=this.bubble_help") = "" then 
      	'if no controls has bubble help, then the state is 'off'
      	BubbleHelpState = "Off"
      else
      	BubbleHelpState = "ON"
      end if 
      
      if BubbleHelpState = "off" then 
      	'if bubble help is already off then just do nothing.
      	exit function 
      end if 
      
      'first, capture the existing bubble help
      a.resize(0)
      captureBubbleHelp(obj)
      
      
      'then, set bubble help for all controls to nothing
      dim count as n 
      count = a.first_empty("name")-1
      dim i as n
      dim c as p  
      for i = 1 to count 
      	c = obj.child(a[i].name)
      	c.bubble_help = ""
      next i 
      end function
      
      
      function turnBubbleHelpOn as v (obj as p )
      
      
      dim sh as n 
      dim sv as p 
      sh = obj.SessionHandle()
      sv = session_variables(sh)
      dim a as p 
      a = sv.__bubbleHelp
      
      dim BubbleHelpState as c 
      if obj.Child_Enum("r;e=this.bubble_help") = "" then 
      	'if no controls has bubble help, then the state is 'off'
      	BubbleHelpState = "Off"
      else
      	BubbleHelpState = "ON"
      end if 
      
      
      if BubbleHelpState = "ON" then 
      	exit function 
      end if 
      
      dim count as n 
      count = a.first_empty("name")-1
      
      dim i as n
      dim c as p  
      for i = 1 to count 
      	c = obj.child(a[i].name)
      	c.bubble_help = a[i].bubble_help
      next i 
      
      
      
      end function
      
      
      
      function captureBubbleHelp as v (obj as p)
      	
      dim sh as n 
      dim sv as p 
      sh = obj.SessionHandle()
      sv = session_variables(sh)
      dim a as p 
      a = sv.__bubbleHelp
      	
      	
      dim controls as c 
      'need to take into account that bubble help can not include crlf. so this turns crlf into spaces.
      controls = obj.child_enum("r;e=this.name() + '|' + stritran(this.bubble_help,crlf(),' ')")
      controls = *for_each(x,word(x,1,"|"),controls)
      dim count as n 
      count = line_count(controls)
      a.resize(count)
      a.clear()
      dim i as n 
      for i = 1 to count 
      	a[i].name = word(controls,i,crlf())
      	a[i].bubble_help = obj.child(a[i].name).bubble_help
      next i 
      end function


      here is the code for the bubbleHelpState() function:

      Code:
      function bubbleHelpState as c (obj as p)
      	
      
      dim sh as n 
      dim sv as p 
      sh = obj.SessionHandle()
      sv = session_variables(sh)
      if eval_valid("sv.__bubbleHelp") = .f. then 
      	dim sv.__bubbleHelp[0] as p 
      end if 
      
      dim BubbleHelpState as c 
      if obj.Child_Enum("r;e=this.bubble_help") = "" then 
      	'if no controls has bubble help, then the state is 'off'
      	BubbleHelpState = "Off"
      else
      	BubbleHelpState = "ON"
      end if 	
      	
      end function

      Comment


        #18
        Re: Turning Bubble Help for a Form on and off

        Selwyn,
        Thanks so much for making this adaptation. When I first saw these functions a year ago, I knew it could be a menu item, just didn't know how. As I have been working on it myself lately, it occurred to me that once the bubble help was off there was nothing to capture again. Even though the bubble help comes back when the form is re-loaded, which in itself seems curious. I guess that's why you write programs and I just use 'em!
        Robin

        Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

        Comment


          #19
          Re: Turning Bubble Help for a Form on and off

          To use this in the right click menu, I wanted the Bubble Help menu item to appear checked when it is "ON". But the BubbleHelpState appears to be ON only if bubble help exists for the form, otherwise it is OFF even tho the menu item is selected. I tried making the dim statements for BubbleHelpState global in the functions so I could test this for the check mark - but the result is inconsistent. If I dim and initiate the global variable on startup to ON it appears unchecked (until I use it), whereas when it is set to OFF in the menu definition, it appears checked. Other than that though the functions are working great. I suppose I don't actually need the menu item to appear checked - it just seemed like a good idea.

          Oh and for some reason dimming BubbleHelpState as global and intializing it at startup, causes that variable to appear twice in the variable list. Haven't figured out why yet - no typo that I can see, and I deleted the previous functions so only these two are in use. I often dim global variables again and only one instance of them appears in the list with their current value, so this is curious. Since it is actually a function too, perhaps that makes a difference?

          Edit: Well it is obvious by now I am not the brightest bulb in here. To get the menuitem to appear checked, all I need to do is use the FUNCTION BubbleHelpState() and not the value of the variable I have been playing with. I checked the Window Bar menu syntax and that is what it does, so I tried it and it works! So I am guessing I can get rid of the global dim statements since they are not needed for this feature to work as a menu item.
          Last edited by MoGrace; 05-17-2008, 11:00 PM.
          Robin

          Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

          Comment


            #20
            Re: Turning Bubble Help for a Form on and off

            Robin,

            I was able to get the right click menu to show the check mark for the menu item. See attached. The attached was redone in V7 as this is the v7 forum and believe that is what you are still using. The form in Selwyn's sample did not seem seem to paint properly in v7. He probably made the sample in v11. :)

            Form 'Customer Information2' does not have any bubble help. That is why the menu never gets a check mark.

            I hope this is what you were trying to accomplish.

            EDIT: Big Woops. :o I had started to respond just after lunch and got interupted and forgot to see if the thread had been updated. Oh well, looks like you had already figured it out.
            Last edited by Tim Kiebert; 05-18-2008, 01:59 AM. Reason: Being behind the times.
            Tim Kiebert
            Eagle Creek Citrus
            A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

            Comment


              #21
              Re: Turning Bubble Help for a Form on and off

              Hi Tim,
              Glad to see you tried it too, I think it is a great little feature to have.
              Robin

              Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

              Comment


                #22
                Re: Turning Bubble Help for a Form on and off

                I'd like to use this function, but I get an "Object is not defined" error. I have duplicated exactly (or so I think) the functions that Selwyn provded. Any ideas??

                Comment


                  #23
                  Re: Turning Bubble Help for a Form on and off

                  UPDATE: The problem is that I am using a form based on a set. When I figure out the solution, I will post it back here.

                  Don

                  Originally posted by djldc View Post
                  I'd like to use this function, but I get an "Object is not defined" error. I have duplicated exactly (or so I think) the functions that Selwyn provded. Any ideas??

                  Comment


                    #24
                    Re: Turning Bubble Help for a Form on and off

                    Originally posted by djldc View Post
                    I'd like to use this function, but I get an "Object is not defined" error. I have duplicated exactly (or so I think) the functions that Selwyn provded. Any ideas??
                    Was just looking into this again to see if I could use it in AA 12.

                    This error is coming from the line
                    obj.child_enum(a[i].name)

                    if you check the functions you will see that 'a' was never defined as an array - this should fix it:

                    dim a[0] as p

                    and in the other line, try setting a var to the array name instead:

                    dim nm as c
                    nm = a[i].name
                    obj.child_enum(nm)

                    When using the 'r' parameter in child_enum() it looks into every control on the form and this causes errors too. So I tried setting it to "f=field;e=this.button_help" but this returned nothing. However if r is set to f without specifying the class, you will at least only get objects that actually have button_help.

                    In the IW, although I can get a list of bubble help into an array, I cannot get these scripts to actually turn the bubble help on or off anymore.

                    Has anyone else got a working script?
                    Robin

                    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                    Comment

                    Working...
                    X