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

Dynamic Buttons on Form

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

    #16
    Re: Dynamic Buttons on Form

    Thank you both for the info. Robin, I think your's is what I was looking for. I will have to play around with it a bit when I get some time. Keith, thanks for the offer, but with Robin's example above I might get it to do what I want. If I need more help, then I know at least 2 people here who know how to help me with my idea.
    I'll keep everyone posted on how it works out.

    Thanks,

    Greg

    Comment


      #17
      Re: Dynamic Buttons on Form

      Ok I got the buttons to work as I wanted, to a degree, It will not create them as I had hoped, but it does hide unused buttons, and names the ones shown accordingly. Now I need to figure out how to pass the current record for the selected button to the next form.
      Example would be I have 5 buttons, and 10 records - 5 of which are inactive; causing the 5 buttons to be shown. Each button is a different record. Button 1 could reference record 3, button 2 could reference record 4, button 3 could reference record 7, etc..... So if I click button 2, the info from record 4 would be passed to the new form.
      I appreciate all help and suggestions.

      Greg

      Comment


        #18
        Re: Dynamic Buttons on Form

        Greg,
        You need to be a bit more specific - what is in the record and what is the form you are passing it to? I thought you were opening up an event for a volunteer to sign up for.
        Robin

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

        Comment


          #19
          Re: Dynamic Buttons on Form

          Yes I am, the record is the event information and the form will display the corresponding record from the button selected. This is a more info button for the event. The main button is to sign up for the event, but if you don't know what the event is or you need to see details about the event before you sign up you click on the info button. I have the buttons getting the event title from the event table.
          The event table has active and inactive events. The buttons are dynamically set to the active events. Say events in the table are as follows.

          event 1 - active ---> button 1
          event 2 - active ---> button 2
          event 3 - inactive
          event 4 - active ---> button 3
          event 5 - active ---> button 4

          the buttons change according to the event status, so if the event table contained different active events, the buttons would change like this

          event 1 - inactive
          event 2 - active ---> button 1
          event 3 - active ---> button 2
          event 4 - inactive
          event 5 - active ---> button 3

          The buttons need to take the correct record and pass it to the next form. The form I am working on right now displays the event info from the event table.
          Event table contains all info about the event. The buttons read the records from the table and fill in the name based on if it is active or not. I got that from your code Robin. I have seen some possible options on how to do this, but I am either not seeing how to get it to work or I am looking at the wrong code to try and do this. One thought was to have it create an array with the selected records then somehow determine which button was pressed and select the appropriate record from the array.
          This would also have to apply to the signup button, so it can post the correct information to the link table.
          My DB contains 4 tables right now, the events table, the person table, signup table (user entered information) and a link table.
          The event table, self explanatory, person table is the names of people signing up, signup table is for users to enter things like if they need to bring something, what they are bringing. The link table is where all the info comes together, the person who signed up, the event they signed up for and if they have submitted info on say what they are bringing to the event. This is all grouped under a link SET.
          I hope this clarifies what I am trying to do.

          Comment


            #20
            Re: Dynamic Buttons on Form

            Originally posted by yagabu View Post
            Ok I got the buttons to work as I wanted, to a degree, It will not create them as I had hoped, but it does hide unused buttons
            , yes but only you know that - to the user it appears to be created
            Originally posted by yagabu View Post
            and names the ones shown accordingly. Now I need to figure out how to pass the current record for the selected button to the next form.
            and for that you use the on push code on each button to select the related record.
            Surely that covers it?

            Comment


              #21
              Re: Dynamic Buttons on Form

              I see that the discussion has turned in the direction suggested in post #2, above, with a fixed number of buttons which are then shown or hidden.

              May I suggest the use of another table to solve the problem of linking each button to a different event ?

              Imagine for a moment that each button runs a short script that retrieves the same record from this "new" table. Btn1 reads record 1, Btn2 reads record 2, etc. Every time a button is pushed it reads the same record from this "new" table. Now, imagine that in this "new" table there's information about the event, or an event number that could be used to lookup event details... All that would be required then would be to update this "new" table when the events table itself is changed. A new event, a reclassification, whatever, could trigger a script that updates the "new" table.

              If the events table is not updated often you might even solve this without using a "new" table, just arrange to "sort" the events table records so that the "active" records correspond to the available buttons whenever any of the records in that table are changed, deleted, or entered.

              -- tom

              Comment


                #22
                Re: Dynamic Buttons on Form

                Hi Greg,
                The script for each button's OnPush event can be the same once the button text has been populated - using the Go_Frm() function I sent you. I modified a table and form I have for a different application, but the SORTKEY field is the unique key for each event record. So once you have the event name (My Ex: menu_grp2) you can lookup the sortkey and open the form to that record. To use the function you will need an index on the event name field. Then you can match the name and get the sortkey with lookupc().

                If I didn't sent the function already - here it is: just import it into the Code tab on the Control Panel.
                Attached Files
                Last edited by MoGrace; 04-14-2013, 07:25 PM.
                Robin

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

                Comment


                  #23
                  Re: Dynamic Buttons on Form

                  Ok, I entered the code and I am coming up with some errors. I attached the code I used with some table info. Also the picture of the error I am getting. I did get it to work once, but it did not pull the correct record. I changed something and I am back to getting the error again. I can not remember what I changed to get it to pull up a form.

                  One other thing, next to each event button is a info button. The info button will pull up the info for the corresponding event. If I can get the button to work on the event button, then I can probably modify it to be the info button like I want it to be.

                  I'm tired, I think I am not making sense anymore :)

                  I hope someone can make sense of what I tried to say.

                  Greg
                  Attached Files

                  Comment


                    #24
                    Re: Dynamic Buttons on Form

                    Greg,
                    I think its time to zip up your database and upload it here so we can see what you've attempted so far. Just add the tables that are relevant to this form and any scripts you are using.
                    Robin

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

                    Comment


                      #25
                      Re: Dynamic Buttons on Form

                      This is still very basic to what I want to do and has very little code (actualy all that you supplied Robin :) ). It has a few events for testing purposes obviously, nothing else has been done. Once I get this hard part done, I think I can manage the rest.

                      Ignore the browse that is in there. I was just playing around with different scenarios, and that didn't work out for what I want.


                      Thanks

                      Greg
                      Attached Files

                      Comment


                        #26
                        Re: Dynamic Buttons on Form

                        Greg,
                        I use dynamic button lists extensively for menus, user choices and selections. The attached is an example that might have something you might use.
                        Attached Files
                        Mike W
                        __________________________
                        "I rebel in at least small things to express to the world that I have not completely surrendered"

                        Comment


                          #27
                          Re: Dynamic Buttons on Form

                          Boy some guys are such show offs! hee hee. So, Mike, how is he going to keep that XD up on screen - and show it as a full screen display with much larger buttons? Unless of course he turns it into a custom toolbar that docks on the left of the screen - which was going to be my next offering....when I get it to work!

                          But I am interested in what you are doing in the event_buttons() with the z1, z1b and z2 dlgs - could you explain that a bit?
                          Robin

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

                          Comment


                            #28
                            Re: Dynamic Buttons on Form

                            Keeping it on the screen could happen with a modeless dialog (attached). Then the button push event is written in a code section. The z1, z1b is junk, from prior dialog building with more variables compiled to make the full dialog body text string,...disregard it. I pulled this code from a computer with an older code library, and am fatigued enough to have missed it while working this up. This is not designed for "full screen display" or "larger buttons", but if that is what is needed it could certainly be coded, but not by this lad this night. Good night world...
                            Attached Files
                            Mike W
                            __________________________
                            "I rebel in at least small things to express to the world that I have not completely surrendered"

                            Comment


                              #29
                              Re: Dynamic Buttons on Form

                              I've been having fun working on Greg's project and changed it a bit to include Categories, Events & Tasks. Perhaps when Greg has the time he will take a look and tell me if this is closer to what he wants to achieve.

                              The 3 shots show a full screen display that still allows for smaller popups - the first 2 are the same form using a conditional object. I made 3 UDF's to populate the buttons as selections are made and then open the 2nd form to the selected event.

                              I used 8 fixed categories but there is room for more. Also I allowed for 4 active events per category - but that also could be increased. Two variables are defined in the Menu Btns form to set the number of needed buttons for each page. However the button names will need to be adjusted as well so that if 10 categories are used then the event buttons would have to be renamed to follow the script order.

                              A global variable Timerflag is initialized in the Autoexec that is tested or reset in the forms' events to open the form filling the screen (not maximized), and which have a Timer event set.

                              I also have 2 UDF's to open the browses at a fixed size and position to use when called from the F8 key or by a script. These also use a global var brw_flag set in the OnInt event of the browse, then the bws_size() sets the size & position in the OnFetch event. This works with the F8 key. Otherwise vw_brw() is used for calling the browse in a script
                              Attached Files
                              Last edited by MoGrace; 04-22-2013, 01:34 PM. Reason: spelling of course!
                              Robin

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

                              Comment


                                #30
                                Re: Dynamic Buttons on Form

                                Hi Robin,

                                I just got a chance to play with what you have done.....I like the direction you went and all the work you have put into it. However I need to do some work to it to simplify it. The people like the KISS principle :) Also I would like it to be the person logs in before they see the events so that if it doesn't need any additional info, they just select the even and are signed up. If it does require signup info then they are prompted for that info.
                                Hopefully I will not break any of the hard work you have done on this. I'll keep you posted on how it is going, since I am on vacation this week and will have some time to work on it.


                                Greg

                                Comment

                                Working...
                                X