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

Custom colors for items in the tree

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

    Custom colors for items in the tree

    In "Learning XDialog" under "What's New in V8," there is a sample code to "Populate dynamically from a table," which works great.

    And under "What's New in V11" for Tree-Control, there is an example code to set "Custom colors for items in the tree," which works fine in the example given.

    Now trying to set custom colors in the first example '-Populate dynamically from a table' but the tree breaks.

    my questions:

    Is this a bug?

    Or is there another way to color the above "dynamically populated tree example"?


    Thank you in advance for any help.

    Ninus

    #2
    What build of V11 are you using?
    See our Hybrid Option here;
    https://hybridapps.example-software.com/


    Apologies to anyone I haven't managed to upset yet.
    You are held in a queue and I will get to you soon.

    Comment


      #3
      Hi Ted,

      I am testing on build 3623.

      But I don't think it is a build issue. It does not work on v12 as well.​

      Comment


        #4
        Aaah!
        OK, what are you hoping to achieve?
        Are you able to describe -fairly accurately- what you need to happen?
        I have read your initial post but would appreciate clarification as there are lots of ways to work within Alpha.
        See our Hybrid Option here;
        https://hybridapps.example-software.com/


        Apologies to anyone I haven't managed to upset yet.
        You are held in a queue and I will get to you soon.

        Comment


          #5
          Ted,

          Simply, I want to change the colors of each level in a dynamically generated tree list.

          Like in the example given in 'learn xdialog'

          + State_region '(this to be in blue color)
          + State '(this to be in red color)
          + City '(this to be in green color)

          /I have tried the...

          dim treecolors as c = <<%str%
          blue
          red
          green
          %str%


          tablename = "customer"
          contentExpn = "'{S=1}'+alltrim(bill_state_region)+'|{EXPAND=Expanding tree...}!expandState('+'{S=1}'+quote(alltrim(bill_state_region))+')'"
          filterExpn = "bill_state_region<> '' .and.unique_key_value()"
          orderExpn = "bill_state_region"

          and so on....\

          I do get the colors to change, but the tree fails when clicking to expand a tree level.


          I hope that I have explained the problem.​

          Comment


            #6
            Hello,

            I have created the TreeView list with "for each" loop function.
            I also applied the {S=<number>} directive to pick an entry in the list of passed in colors.

            The sample of list is....
            Code:
            {S=9}AZ.{S=2}Phoenix.{S=4}Joe Smith
            {S=9}AZ.{S=2}Phoenix.{S=4}Linda Dodds
            {S=9}AZ.{S=2}Tucson.{S=4}Dillan Macabe
            {S=9}AZ.{S=2}Tucson.{S=4}Larry Eagle
            {S=9}AZ.{S=2}Tucson.{S=4}Michael Johnson
            {S=9}CA.{S=2}Los Angeles.{S=4}Joan McAndrews
            {S=9}CA.{S=2}Los Angeles.{S=4}Leonard Burtonski
            {S=9}CA.{S=2}Los Angeles.{S=4}Peter Harrison
            {S=9}CA.{S=2}Los Angeles.{S=4}Willy Winka
            {S=9}CA.{S=2}Los Angeles.{S=4}Yvonne Harrington
            {S=9}CA.{S=2}Rancho Palos Verdes.{S=4}James Mahoney​
            I can see the color_tree view with this box

            ui_dlg_box("Tree Control - Custom Colors",<<%dlg%
            {XdialogTitleSection=100,5pHeading};
            {lf};
            [%S=BLR;C=@treecolors%.100,40item^<tree]
            %dlg%)​

            Comment


              #7
              Hi John and thanks for the reply,


              So you also confirm that {S=<number>} directive does not work with 'table.external_record_content_get()' method?

              Damn, that means I have to update a tonne of codes and hope that, unlike the above method, the "for each" loop function will work as expected.​

              Comment


                #8
                Damn it, it's too much work, I'm not going to do it.

                We have no choice but to use the Red Phone to call the 'MR. CODE' himself.

                Alpha Team,... call Selwyn to the rescue. This is something that only the man himself can resolve.


                Dear Selwyn,

                Could you please out of the corner of your eye sneak a peek at this code and explain why this tree isn't working properly? ..please!


                Code:
                'Date Created: 28-Jun-2006 09:07:04 AM
                'Last Updated: 18-Jan-2023 11:57:23 AM
                'Created By : Selwyn
                'Updated By : Ninus
                
                dim treecolors as c = <<%str%
                Blue
                Red
                Dark Green
                %str%
                
                
                dim filterExpn as c
                dim orderExpn as c
                dim contentExpn as c
                dim tablename as c
                
                tablename = "customer"
                contentExpn = "'{S=1}'+alltrim(bill_state_region)+'|{EXPAND=Expanding tree...}!expandState('+quote('{S=1}'+alltrim(bill_state_region))+')'"
                filterExpn = "bill_state_region<> '' .and.unique_key_value()"
                orderExpn = "bill_state_region"
                
                dim treeList as c
                treeList = table.external_record_content_get(tablename,contentExpn,orderExpn,filterExpn)
                dim selected as c = ""
                
                'The enable expression for the OK button looks to see if the 'selected' variable starts with 'ID:'
                'If so, then we know we are at an endpoint in the tree.
                
                dim flagOK as l = .f.
                
                ui_dlg_box("Select Customer",<<%dlg%
                [%X;S=BLR;D="|";C=@treecolors%.50,20selected^<treelist];
                [.50selected];
                {justify=right}
                <10&OK!ok?left(selected,3)="ID:"> <Cancel>;
                %dlg%,<<%code%
                if a_dlg_button ="ok" then
                flagOK = .t.
                end if
                %code%)
                
                
                if flagOK = .t. then
                ui_msg_box("","You selected customer number: " + substr(selected,4))
                
                end if
                
                
                function expandState as c (state as c )
                ui_yield()
                dim filterExpn as c
                dim orderExpn as c
                dim contentExpn as c
                dim tablename as c
                tablename = "customer"
                contentExpn = "'{S=2}'+alltrim(bill_city)+'|{EXPAND=Expanding tree...}!expandCity('+quote('{S=2}'+alltrim(bill_city))+')'"
                filterExpn = "unique_key_value() .and. '{S=1}'+bill_state_region=" + quote(state)
                orderExpn = "bill_city"
                
                expandState = table.external_record_content_get(tablename,contentExpn,orderExpn,filterExpn)
                
                if expandState = "" then
                expandState = "<None>"
                end if
                
                end function
                
                
                
                function expandCity as c (city as c )
                ui_yield()
                
                dim filterExpn as c
                dim orderExpn as c
                dim contentExpn as c
                dim tablename as c
                tablename = "customer"
                contentExpn = "'{DATA=ID:'+customer_id+'}'+'{S=3}'+alltrim(lastname)+', ' + alltrim(firstname)"
                filterExpn = "unique_key_value() .and. '{S=2}'+bill_city=" + quote(city)
                orderExpn = "lastname"
                
                expandCity = table.external_record_content_get(tablename,contentExpn,orderExpn,filterExpn)
                
                if expandCity = "" then
                expandCity = "<None>"
                end if
                
                end function


                I wish you good health and thank you in advance for your time and kindness.

                Ninus Daniels​

                Comment


                  #9
                  Hello,

                  I applied the {S=<number>} directive at here only. It will show the Colors but the tree view( display ) will be loose from "Parent tree".

                  contentExpn = " '{S=1}'+alltrim(bill_state_region)+'|{EXPAND=Expanding tree...}!expandState('+quote(alltrim(bill_state_region))+')'"

                  contentExpn = " '{S=2}'+alltrim(bill_city)+'|{EXPAND=Expanding tree...}!expandCity('+quote(alltrim(bill_city))+')'"


                  contentExpn = "'{DATA=ID:'+customer_id+'}'+ '{S=3}'+alltrim(lastname)+', ' + alltrim(firstname)"

                  Comment


                    #10
                    Hi John,

                    You have to also add a directive after the expand function ie.. !expandState('+quote('{S=2}'+alltrim(bill_state_region))+')'

                    I think it must have something to do with how Alpha handles a function call. I'm not really sure, and don't know how to resolve it.

                    That is why I'll wait to see if any guru here can figure this one out.

                    Comment


                      #11
                      Hello,


                      Code:
                       You have to also add a directive after the expand function ie.. !expandState('+quote('{S=2}'+alltrim(bill_state_region))+')'
                      It is not required to have the directive at that location. it( quote( alltrim(bill_state_region) ) ) is referred for filtering records and nothing to do with "Color".

                      If you can, create the Tree_list without "{Expand}" function and insert the {S=<number>} directive into your Tree_List.


                      Comment


                        #12
                        Do you mind if we rewind this?
                        Ninus do you HAVE to do this, WANT to do this or trying to push the boundaries of Alpha?
                        I'm not trying to be judgemental, but needs and wants and dallying are different issues.

                        I hate having to code to do simple stuff which meets a user brief. In this case, multi level Browses or, dare I say it Multi Level Tabs could work just as well.
                        I'm over "fighting myself out of corners" now, so future maintenance is paramount, hence my suggestions.

                        So I won't be investing.
                        If you want to get Selwyns attention, [email protected]
                        He tends to not haunt the Forum.
                        See our Hybrid Option here;
                        https://hybridapps.example-software.com/


                        Apologies to anyone I haven't managed to upset yet.
                        You are held in a queue and I will get to you soon.

                        Comment


                          #13
                          John,

                          You have to have that directive in that location or it won't work at all. Try it.


                          Ted,

                          I seriously don't understand what you are trying to say.

                          My question was about a specific functions of Alpha Five program called 'Tree Control' and {S=<number>} directive, and how they don't work together.

                          I never asked anyone to invest their time to code for me since I am very capable of doing that myself. I see that you have a "Certified" tag under your name; I sincerely hope you are not here officially representing Alpha Software.
                          You see, it is usually more polite to say "I don't know" or remain silent when you are unsure of the answer to a question.

                          That being said, I hope one of the forum 'Members' has a solution.​

                          Comment


                            #14
                            Apps don't always need academic examination. They work and are usually succinct and informative.
                            John is coming up with creative suggestions suggest you build on them.
                            If you are into academia, go for it.
                            Personally I dont see different colours making diddy squat of difference, but not my train set.
                            Lots of ways to satisfy users.
                            I do know the answer but not going to share it as it is irrelevant.
                            If you wish to persist with this line of enquiry, i wish you well.
                            Please post your solution to assist others.
                            See our Hybrid Option here;
                            https://hybridapps.example-software.com/


                            Apologies to anyone I haven't managed to upset yet.
                            You are held in a queue and I will get to you soon.

                            Comment


                              #15
                              Mr. Giles,

                              This is not about apps academic examination.. It's about the Alpha Five's program functionality.
                              I produce different apps for my customers and always use the table.external_record_content_get() method.
                              The use of colors in a tree list control improves clarity and user friendliness, which benefits the end user (called custome care).

                              I certainly appreciate what John and you tried to do, But I believe that you both completely misunderstood my main question.

                              "Is this a bug?" was my initial question. I didn't request an alternative way of achieving the same result.

                              I do know the answer but not going to share it as it is irrelevant.
                              Please post your solution to assist others.
                              It is not nice at all to ask someone to do what yourself are not willing to do. However, for now, the conclusion is that there is a flaw in tree list control and, I will definitely share my findings if it is otherwise.​

                              Comment

                              Working...
                              X