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



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 Tree Menu System using Xdialog Supercontrol

  • Filter
  • Time
  • Show
Clear All
new posts

  • Dynamic Tree Menu System using Xdialog Supercontrol

    Hi All

    I thought I would share this with the community in case someone else might benefit from it. After reading Peter Greulich’s post about a tree menu system he has created and Bob McGraffic’s excellent post in the code archive about how to use an activex control for creating a tree menu system, I decided to try and create my own using the embedded Xdialog Supercontrol in v9. The tree control used in the xdialog allows the use of open and closed icons (something the regular form tree control cannot do). The result of my tinkering is what you see here.

    Attached are some screen shots as well as the zipped database.

    Items of note:

    1. The TreeMenuForm form shows the embedded xdialog. The menu shown is set by a global variable called gvuser in the autoexec script. In my normal apps I have a login routine that sets this variable.
    2. You can test the dynamic nature of the menu by closing the TreeMenuForm and opening the DynMenuBrws_frm and changing the “Allowf” choice from the one that is “F” (false) to true for terir. Now open the TreeMenuForm again and you will see that menu item.
    3. There is a “master menu table” that is the template for all new menus as well as to update the menus that were previously created.
    4. There is a button on the DynMenuBrws_frm to add a new menu for a user. When prompted enter the userid for the new user and a new menu system will be created for them. You can then use the dropdown to filter the browse to edit the menu choices for that user. Remember: if you want to see that menu then you need to set the value of gvuser to the new userid you just created .
    5. There is another button on the DynMenuBrws_frm that will let you update the menu for the user you are viewing in the likely event you make a change to the “Master Menu” table and now want those menu items over in the Dynamic Menu table.
    6. You will notice that the icons (see screenshot) for all the administrative level are the same. This is VERY important to get the tree to show correctly. Since the tree Xdialog is built from a string – the string value at this top menu level must be the same if you want one entry for “Administrative”. If you were to have different open and close icons for each entry for this level then the tree shows a branch for each of those because it needs a place to display the different open and closed icons. When they are the same then the tree shows them under one branch as you would expect
    7. The menu system framework I have created is 3 levels deep.
    8. The icons you see in the DynMenuBrws_frm form are embedded in the table for easy showing in the browse – this aids in setup. I know this is not “Best Practice” but for this use I think it is fine since there will be relatively a small number of icons. You will notice I also store the filename of the icon for each choice. This text is used in the creation xdialog tree string.
    9. Each menu item has control panel name and type. This tells the menu what to do with the choice if the user selects it. Pay no attention to what runs when you select the item – they are not what the items say – they are just for testing.
    10. The icons I have chosen are gotten to when you use the edit button on the DynMenuBrws_frm. You can see you will be presented with the dialog box letting you choose from the internal images (or image from your own library you attach to this database).
    11. There is not much error checking or polish with this example because everyone’s implementation is likely to be different but there is a solid core I believe to making your own dynamic menu system that is appealing to the eye.
    12. Always start form the highest level and go down. For example, do not enter level one information and then no level 2 information – but then you enter level 3 information for a menu item
    13. You DO NOT have to enter an open and closed icon for each menu choice. If you only want one icon for a menu choice then just add a “Closed Icon” for that level. The code will take care of showing the tree properly. This would be common if you did not have 3 levels and the 2nd level was the actual menu choice – obviously you don’t need an opened icon since once you click on it you will be going to the form or report you chose.

    I am probably forgetting something….hope not…..I hope this is useful for the Alpha Community.



  • #2
    Re: Dynamic Tree Menu System using Xdialog Supercontrol

    Nice, well done, and thanks for sharing.
    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.


    • #3
      Re: Dynamic Tree Menu System using Xdialog Supercontrol

      Attached is an update that does away with the user having to click a button to go to the menu choice. They will now be taken to their choice when they click on the tree item - which is more what one would expect.


      • #4
        Re: Dynamic Tree Menu System using Xdialog Supercontrol

        Jeff - thanks for the example. You mentioned the inspiration was partly from Peters thread. In that thread there was the need to expand all tree nodes. This is something I would like to do.

        When my form is first opened I want all the tree nodes to be expanded.

        Do you know how this can be achieved with your example?




        • #5
          Re: Dynamic Tree Menu System using Xdialog Supercontrol

          Sure thing Geoff....

 fully expand all the nodes you need to just add one more directive into the xdialog definition. You need to just add an "X" to the list of directives.

          An Example:

          'IMPORTANT: Do not change the dialog title.
          {font= arial, 11}

          Look at the "S" directive and the "BLRX.....". That'll get it done for you.




          • #6
            Re: Dynamic Tree Menu System using Xdialog Supercontrol

            Cheers Jeff.

            I was expecting to have to do some sort of loop to have to get them to open. Can't get any easier than just adding one letter. I need to delve deeper into using xdialog. So far I have only used the genie for a few simple things and haven't really dabbled with any of the code it produces.




            • #7
              Re: Dynamic Tree Menu System using Xdialog Supercontrol

              I am new to Alpha 5
              I like this menu system but I see 2 problems and would like to know if anyone has had this problem

              1. You can choose the same item 2 times in a row you must move another item between them
              2. When selecting a report it dispays 2 times

              I am do have enought experance yet to see where the problem has anyone had any luck fixing this?

              with that said I relay like this and would like to use it


              • #8
                Re: Dynamic Tree Menu System using Xdialog Supercontrol

                Hi Dave

                Welcome to Alpha!

                I have tweaked this menu significantly for my use since I posted this example.

                I have not looked at the code from the example in a long time.

                As far as item one of your questions, just find the code that that says "IF a_dlg_button = "menuitem_change" and replace it with the line below.

                IF a_dlg_button = "menuitem_change" .OR. a_dlg_button = "menuitem_dblclick"

                I don't understand what you are saying with your second question. Can you explain further? I am sure whatever the issue is can be resolved for you. I have approx 150 users using this menu system in various apps and I have not had any problems so I should be able to help you.




                • #9
                  Re: Dynamic Tree Menu System using Xdialog Supercontrol

                  thank you for your answer

                  on the questions # 2
                  when i setup a report and select it it displays the report then dispalys it again

                  I dont know



                  • #10
                    Re: Dynamic Tree Menu System using Xdialog Supercontrol


                    is there any updated version of your code which you can share with us?

                    Ozgur Ugur
                    Computer Eng.
                    Data Yazilim Ltd.
                    Izmir - Turkiye


                    • #11
                      Re: Dynamic Tree Menu System using Xdialog Supercontrol

                      Thanks for the share.
                      Your update in post #3 makes a big difference.
                      I just took a look through it today and well done.
                      I had looked at your previous version a while back.

                      IF a_dlg_button = "menuitem_change"
                      is found only in the listcolor test
                      Do you inherently give permisssion for use in an app?



                      • #12
                        Re: Dynamic Tree Menu System using Xdialog Supercontrol

                        Hi Ray,

                        >>Do you inherently give permisssion for use in an app?

                        Yep...for sure.


                        • #13
                          Re: Dynamic Tree Menu System using Xdialog Supercontrol

                          Thanks Jeff
                          I appreciate that.