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

2 buttons - text & image

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

  • 2 buttons - text & image

    I have two buttons.
    Button 1 is text only
    Button 2 is text followed by bitmap

    Results as follows:
    Code:
    ? Test_set_form:control_button2.btn_appearance 
    = "text&bitmap"
    
    
    ? Test_set_form:control_button2.text
    = "Test 2"
    
    
    ? Test_set_form:control_button2.default.hbitmap.bmplib 
    = "<ADDIN>"
    
    
    ? Test_set_form:control_button2.default.hbitmap.bmptag 
    = "$$application.alpha"
    
    
    ? Test_set_form:control_button1.btn_appearance 
    = "text"
    
    
    ? Test_set_form:control_button1.text
    = "Test 1"
    
    
    ? Test_set_form:control_button1.default.hbitmap.bmplib 
    ERROR: Property not found
    
    
    ? Test_set_form:control_button1.default.hbitmap.bmptag 
    ERROR: Property not found
    If I do this for button 2 it works:
    Code:
    Test_set_form:control_button2.btn_appearance = "bitmap&text"
    Test_set_form:control_button2.text = "Buttton 2"
    Test_set_form:control_button2.default.hbitmap.bmptag = "A5_ball_green"
    It reverses the order of text & image, changes the test & image. Good.

    If I do this to button 1 it does not work:
    Code:
    Test_set_form:control_button1.btn_appearance = "bitmap&text"
    Test_set_form:control_button1.text = "Button One"
    Test_set_form:control_button1.default.hbitmap.bmplib = "<ADDIN>"
    Test_set_form:control_button1.default.hbitmap.bmptag = "$a5_close"
    Line 3 gives me an error. It does set the text correctly. If I remove line 3, line 4 gives me an error. In any case it won't set the image.

    Issue: How can I dynamically set an image if the button is set to "text"?
    Peter
    AlphaBase Solutions, LLC

    [email protected]
    https://www.alphabasesolutions.com



  • #2
    Re: 2 buttons - text &amp; image

    Peter,

    As I feel sure you discovered, the button doesn't have a default property until you use the button properties dialog to change the Style to "bitmap&text" and then use the Define Button Bitmaps button. I don't see a way to interface with the dialog or add a property via xbasic.

    Edit: Well maybe, there is a method for objects

    formname:objectname.Property_Add()
    There can be only one.

    Comment


    • #3
      Re: 2 buttons - text &amp; image

      Right, I did see that. Thanks for the confirmation, Stan.
      Peter
      AlphaBase Solutions, LLC

      [email protected]
      https://www.alphabasesolutions.com


      Comment


      • #4
        Re: 2 buttons - text &amp; image

        Originally posted by Stan Mathews View Post

        formname:objectname.Property_Add()
        Stan

        Good call.. You find the best stuff....
        Al Buchholz
        Bookwood Systems, LTD
        Weekly QReportBuilder Webinars Thursday 1 pm CST

        Occam's Razor - KISS
        Normalize till it hurts - De-normalize till it works.
        Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
        When we triage a problem it is much easier to read sample systems than to read a mind.
        "Make it as simple as possible, but not simpler."
        Albert Einstein

        http://www.iadn.com/images/media/iadn_member.png

        Comment


        • #5
          Re: 2 buttons - text &amp; image

          So far this isn't working except for changing the text.

          abcfrm:tool_select2.btn_appearance = "bitmap&text"
          abcfrm:tool_select2.text = "Test1"
          abcfrm:tool_select2.Property_Add("default","")
          abcfrm:tool_select2.Property_Add("default.hbitmap","")
          abcfrm:tool_select2.Property_Add("default.hbitmap.bmplib","<ADDIN>")
          abcfrm:tool_select2.Property_Add("default","")
          abcfrm:tool_select2.Property_Add("default.hbitmap","")
          abcfrm:tool_select2.Property_Add("default.hbitmap.bmptag","$$application.alpha")

          Nor does it work without the optional parameter in the first two lines of both property_add()'s.
          Last edited by Stan Mathews; 10-16-2013, 12:25 PM.
          There can be only one.

          Comment


          • #6
            Re: 2 buttons - text &amp; image

            property_add() is an internal method. Don't think that's the correct syntax.

            Code:
            button1.btn_appearance = "text&bitmap"
            button1.text = "New Text"
            button1.default.hbitmap.bmplib = "<ADDIN>"
            button1.default.hbitmap.bmptag = "$a5_close"
            Works just fine for me:

            chgBttn.zip

            If you are not sure about the library, leave it out. Alpha made changes to the image libraries starting with v9. Alpha will know where the image is.

            Comment


            • #7
              Re: 2 buttons - text &amp; image

              Peter,

              You can change or remove the bitmap only after having once set it through the normal design process. You can then change the style to text (only) and save the form.

              At that point the commands work.

              f = obj("abcfrm")
              f:tool_select2.btn_appearance = "text"
              f:tool_select2.text = "Plain Text"
              f:tool_select2.default.hbitmap.bmplib = ""
              f:tool_select2.default.hbitmap.bmptag = ""

              f = obj("abcfrm")
              f:tool_select2.btn_appearance = "bitmap&text"
              f:tool_select2.text = "Bitmap and Text"
              f:tool_select2.default.hbitmap.bmplib = "<ADDIN>"
              f:tool_select2.default.hbitmap.bmptag = "$$application.alpha"
              There can be only one.

              Comment


              • #8
                Re: 2 buttons - text &amp; image

                ??
                chgBttn1.zip

                Comment


                • #9
                  Re: 2 buttons - text &amp; image

                  Not sure why you have to have the first part?
                  Whenever you place a button on a form, it will have its default settings whether you do anything to it or not.
                  What happens if you run the script with the second part only?
                  Originally posted by Stan Mathews View Post
                  f = obj("abcfrm")
                  f:tool_select2.btn_appearance = "bitmap&text"
                  f:tool_select2.text = "Bitmap and Text"
                  f:tool_select2.default.hbitmap.bmplib = "<ADDIN>"
                  f:tool_select2.default.hbitmap.bmptag = "$$application.alpha"
                  It should work just fine.

                  There are several issues here:
                  1-alpha seems to have a problem with explicit addresses in certain context. Perhaps has to do with the possibility that more than one object might have the same name or it could be a bug, not sure yet but in my version, it wouldn't matter. That's one reason the original syntax (Peter's) did not work.
                  2-Another might have to do with denoting the wrong library.
                  3-Your last script works primarily because you made a pointer to the form. I bet if Peter made a pointer to the form, that script will work. But, it's rather silly as it seems that the script is run from a form and if so, it is always better to use relative addresses.

                  Comment


                  • #10
                    Re: 2 buttons - text &amp; image

                    Not to piss in anyones' pond but I think Stan was illustrating that once set, you are free to use either scenario.

                    Comment


                    • #11
                      Re: 2 buttons - text &amp; image

                      1-If the button is there, then it DOES have some settings..any settings..whether set by you or by alpha..the settings are there
                      2-Hence the question: what's point of first setting the settings to blanks then to the new settings?
                      It's a big pond..you won't hurt anything.

                      Comment


                      • #12
                        Re: 2 buttons - text &amp; image

                        Originally posted by Ray in Capetown View Post
                        Not to piss in anyones' pond but I think Stan was illustrating that once set, you are free to use either scenario.
                        Correct, Ray. And until set once through the form dialog the bitmap can't be added or changed as Peter was encountering.

                        I have G Gabriel on my ignore list so I am unaware of his posts unless someone else quotes him or alerts me via pm of something wrong.
                        There can be only one.

                        Comment


                        • #13
                          Re: 2 buttons - text &amp; image

                          That's just like rejecting someone on facebook.
                          G, I s'pose you're getting rejection therapy.

                          Comment


                          • #14
                            Re: 2 buttons - text &amp; image

                            Fortunately, not in need of any therapy. I had Stan on my ignore list as well as a response to his happy list, but he kept on responding to my posts, I thought maybe he gained some wisdom. Evidently not. But regardless, Stan or no Stan, ignore or be courteous and respectful, this is for everyone to study and learn.

                            As you can see from the videos I submitted, you do not have to do any initial settings. It makes no sense. It works in both cases. In the first case, the button did have a text and an image. In the second video, it had neither and the outcome is the same with the same script.

                            Comment


                            • #15
                              Re: 2 buttons - text &amp; image

                              Off topic again.
                              Just still one big happy family then?
                              I thought I was the only one with an Ignore list! Still reciprocation is always a good thing.

                              It is a truism that what you think of others, they generally think the same of you.

                              That could be my theme for Sunday's sermon!
                              See our Hybrid Option here;
                              https://hybridapps.example-software.com/


                              Never ask a Barber if he thinks you need a haircut.

                              Comment

                              Working...
                              X