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

How to save the default bitmap for a button when changed?

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

  • How to save the default bitmap for a button when changed?

    I know its a long title... I have a form using buttons that I change the bitmap when the action is completed. This change is lost when the form is closed and reopened as it reverts back to the initial bitmap specified. So my question is - how can I save the last state of this "default" bitmap so I can initiate the form buttons with that property?

    Thanks in advance.

    Here is my screenshot:

    stepmenu.jpg

    Notice the orange ball shows a completed action on the left, and blue on the right. In this case the previous steps have been done but the payroll has not been submitted yet. I want the orange and blue (initially green) to stay like that so when I open the form again I know where I left off.
    Last edited by MoGrace; 06-26-2014, 08:52 PM. Reason: add a screenshot
    Robin

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

  • #2
    Re: How to save the default bitmap for a button when changed?

    You can't.

    You can save the current setting as the form is closed to a (table field, text file, etc), retrieve it when the form is opened, and apply it then.
    There can be only one.

    Comment


    • #3
      Re: How to save the default bitmap for a button when changed?

      Stan the man. I have been thinking I needed to put the values in a text file or something I don't know how to do. But a table, I can do that! Thanks.
      Robin

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

      Comment


      • #4
        Re: How to save the default bitmap for a button when changed?

        put the values in a text file or something I don't know how to do
        dim somevar as C
        somevar = "blue"
        save_to_file(somevar,"c:\temp\settings.txt",.F.)

        later

        dim somevar as C
        somevar = get_from_file("c:\temp\settings.txt")
        There can be only one.

        Comment


        • #5
          Re: How to save the default bitmap for a button when changed?

          I was looking into that but there are 12 buttons and so I was looking at getting a list.
          Robin

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

          Comment


          • #6
            Re: How to save the default bitmap for a button when changed?

            Robin, this a bit like tracking the process through a Workflow programme.
            The STATUS at any point can be held against the record, so you can have stuff like Viewed, Pending, Verification, Posted etc.
            I use Logical fieds to identify the status of invoices and change the colours of the item, but once you have a status, you can do anything.
            See our Hybrid Option here;
            https://hybridapps.example-software.com/


            In fairness to alcohol, I have done some stupid things when I was sober too!

            Comment


            • #7
              Re: How to save the default bitmap for a button when changed?

              I have a form using buttons that I change the bitmap when the action is completed
              alternatively, is it possible to add a logical field say completed and mark that completed when the action is completed and on the form onInit event can look at that field and place a checkmark or change the color of the bitmap circle?
              I am not conversant in desktop methods, so I could be in a far off land.
              thanks for reading

              gandhi

              version 11 3381 - 4096
              mysql backend
              http://www.alphawebprogramming.blogspot.com
              [email protected]
              Skype:[email protected]
              1 914 924 5171

              Comment


              • #8
                Re: How to save the default bitmap for a button when changed?

                Not far off at all G, that is how it works, or can be made to work.
                See our Hybrid Option here;
                https://hybridapps.example-software.com/


                In fairness to alcohol, I have done some stupid things when I was sober too!

                Comment


                • #9
                  Re: How to save the default bitmap for a button when changed?

                  This might be simpler than a text file or a table.

                  Code:
                  dim myform as P
                  myform.Button1 = "Blue"
                  myform.Button2 = "Green"
                  myform.Button3 = "Blue"
                  myform.Button4 = "Blue"
                  myform.Button5 = "Blue"
                  myform.Button6 = "Red"
                  myform.Button7 = "Green"
                  myform.Button8 = "Blue"
                  'Save settings in Registry
                  :registry.save_settings("FormBtns", myform)
                  
                  
                  dim btnsettings as P
                  registry.load_settings("formBtns",btnsettings)
                  ? btnsettings.Button1
                  = "Blue"
                  ? btnsettings.Button2
                  = "Green"
                  There can be only one.

                  Comment


                  • #10
                    Re: How to save the default bitmap for a button when changed?

                    @Gandhi,
                    A checkbox was my first choice as well, but I didn't like the look of it. That and checkboxes cannot be sized. Also the color coding allows me to depict 3 stages of completion.

                    @Ted,
                    The status idea is not bad either, but I would need a status field for each button...

                    @Stan,
                    I have not tried this method of saving registry settings and will look into it. My thought is it could be saved in the CanExit event of the form, And loaded in the OnInit event?
                    Robin

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

                    Comment


                    • #11
                      Re: How to save the default bitmap for a button when changed?

                      Agreed concerning the canexit.

                      Hope the oninit will work but not sure if the form objects exist when you want to set the colors. You might have to define a variable for the form, logical (.F.), and check that in the onactivare event. If false, retrieve and set the colors, then set the variable to true. That way if the form is deactivated and then reactivated the colors won't return to the unsaved current setting.

                      Might be overkill but the registry methods perform pretty quickly. You could save in the ondeactivate and set in the onactivate.
                      There can be only one.

                      Comment


                      • #12
                        Re: How to save the default bitmap for a button when changed?

                        If you want to automate saving the settings.

                        Code:
                        lst = parentform.Child_Enum("button")
                        dim btncolors as P
                        for each foo in lst
                        eval("btncolors."+foo.value) = eval("parentform."+foo.value+".fill.color")
                        next
                        registry.save_settings("formname_buttons",btncolors)
                        Retrieving them would just be the reverse.
                        There can be only one.

                        Comment


                        • #13
                          Re: How to save the default bitmap for a button when changed?

                          Originally posted by Stan Mathews View Post
                          If you want to automate saving the settings.

                          Code:
                          lst = parentform.Child_Enum("button")
                          dim btncolors as P
                          for each foo in lst
                          eval("btncolors."+foo.value) = eval("parentform."+foo.value+".fill.color")
                          next
                          registry.save_settings("formname_buttons",btncolors)
                          Retrieving them would just be the reverse.
                          That looks promising! Except I am changing the button bit maps not the button color. I will give it a go and let you all know what worked or not this afternoon. And again thanks to all who responded.
                          Robin

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

                          Comment


                          • #14
                            Re: How to save the default bitmap for a button when changed?

                            I was reminded off forum that this is likely not a good approach if the db is networked and more than one person would be relying on the bitmaps. The system registry is local to the machine opening and closing the form. The suggested code would error, if error handling were not added, when the form was opened elsewhere.

                            If that is the case than you can still use the code but instead of registry.save_settings() use

                            str = property_to_string(btncolors)
                            'save the string to a file
                            save_TO_FILE(str,"c:\mydata\dot_variables.txt") 'replace txt file location with networked location

                            then later

                            str = GET_FROM_FILE("c:\mydata\dot_variables.txt") 'replace txt file location with networked location
                            dim btncolors as P
                            btncolors.dummy = ""
                            property_from_string(btncolors, str)
                            Last edited by Stan Mathews; 06-27-2014, 01:15 PM.
                            There can be only one.

                            Comment


                            • #15
                              Re: How to save the default bitmap for a button when changed?

                              Robin, status could also be a 1char field.
                              Button could be conditional object. There are many levels you could go to. I think Mike went to about 28!!
                              See our Hybrid Option here;
                              https://hybridapps.example-software.com/


                              In fairness to alcohol, I have done some stupid things when I was sober too!

                              Comment

                              Working...
                              X