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

Xdialog data list not autosizing with %d

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

    Xdialog data list not autosizing with %d

    Maybe I am not using the best method for this but am now at a loss. I create a dialog to show background events relating to a cell clicked. Each record is an event. It works fine except for the number of lines displayed.
    For testing I included sample data in the example below. The %d directive should autosize but doesn't work here. The user needs to view the final event (last record) and the recent history above that. This one starts at the first record and doesn't resize - I need to either re-position to the last or display all.
    In any desktop version, paste the below to IW and run it.
    Code:
    DIM SHARED sl as C 
    DIM SHARED varC_result as C
    auto_list_sl = table.external_record_content_get("cusord3_events","Time+\"|\"+Column+\"|\"+Columnstatus+\"|\"+Columncomment","",evflt)
    'you haven't got the table for the line above, can populate the var by running block below to test
    auto_list_sl=<<%str%
    = 28/10/2014 08:58:31 57 am|proforma        |Received OK    |tryu iam
    28/10/2014 11:07:18 67 am|proforma        |Pending 1      |
    28/10/2014 11:59:42 19 am|Costings        |Rejected       |Reject1
    29/10/2014 01:13:24 42 pm|Fit Sample      |REQST   ACCEPT |ZiNJO reqsted a quote 4
    29/10/2014 01:20:03 84 pm|Costings        |RECVD   REJECTE|ZiNJO got quote 4 not accepted BINGBONG is lower
    29/10/2014 11:58:48 71 pm|Fabric          |Weight  Rejecte|too thin fabric
    30/10/2014 11:19:27 59 am|Costings        |Labels  ACCEPT |yyy7543
    30/10/2014 11:20:52 21 am|Costings        |RECVD   REJECTE|yyy7543rej
    30/10/2014 03:05:38 11 pm|Fit Sample      |2nd     Rec/Hel|Checkselves here
    01/11/2014 08:06:27 33 pm|Fit Sample      |1stFit  Rec/Fwd|
    02/11/2014 03:42:21 74 pm|ETD             |Ship    APPROVE|Chang Zen
    02/11/2014 03:43:08 30 pm|Costings        |REQST   waiting|wAN WI NFACTORY
    02/11/2014 04:38:16 21 pm|Costings        |RECVD   waiting|MUNGMIN ZHI sent qte for large quantity
    02/11/2014 04:39:49 46 pm|Costings        |RECVD   waiting|LUIS sent qte only for RED
    02/11/2014 05:22:43 26 pm|Costings        |RECVD   waiting|Selvin Best so far
    03/11/2014 02:37:23 81 pm|Fit Sample      |2ndFit  Forward|Biju consideration so far
    %str%
    
    linec=line_count(auto_list_sl) ' in case I can use this in the dlg string?
    
    Dim format as p 
    Format.tab_stops="2,3,4,5"
    Format.font="Arial,9"
    Format.group_size=1
    Format.number_rows=.t.
    
    'Apply 'owner draw' formatting information to the list
    auto_list_sl = a5_owner_draw_list_fmt(auto_list_sl,Format)
    temp_count = w_count(auto_list_sl,crlf())
    DELETE a_sl
    DIM a_sl[temp_count] as c
    a_sl.initialize(auto_list_sl)
    varC_result = ui_dlg_box("Alpha Five","| [%d;O={@@}%.140,5sl^#a_sl];")

    #2
    Re: Xdialog data list not autosizing with %d

    Ray the 'D' directive :

    Causes the line spacing in a list box to be adjusted automatically for the point size of the type being displayed.
    It does not expand the number of lines in a list box.

    change the end of your code to this:

    Code:
    'change the line count
    vclist = "[%O={@@}%.140,**lines**sl^#a_sl];"
    vclines =  alltrim(str(round_up(linec*1.1875,0)))'each line uses 1.1875 space per line at 9 points
    vcdlgbody = strtran(vclist,"**lines**",vclines)'replace **lines** with new line count
    'msgbox(vclist +crlf()+vclines)
    
    varC_result = ui_dlg_box("Alpha Five",vcdlgbody)
    to dynamically change the number of lines in the list box.
    Last edited by Allen Klimeck; 11-03-2014, 01:33 PM.

    Comment


      #3
      Re: Xdialog data list not autosizing with %d

      Allen that's terrific
      strtran() I wouldn't have got there. I really appreciate that thanks.

      Comment


        #4
        Re: Xdialog data list not autosizing with %d

        to get the list to point at the last value add 2 lines

        Code:
        linec=line_count(auto_list_sl) ' in case I can use this in the dlg string?
        [COLOR="#FF0000"]LastRow=strtran(alltrim(str(linec))-word(auto_list_sl,linec,crlf()),"|","")
        sl=LastRow[/COLOR]
        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: Xdialog data list not autosizing with %d

          And that completes the perfect solution to both dilemmas.
          Appreciate it Alan.

          I was about to try a compromise position with bottom_records() that I've not tried before...
          Code:
          auto_list_sl = table.external_record_content_get("cusord3_events","Time+\"|\"+Column+\"|\"+Columnstatus+\"|\"+Columncomment","","bottom_records(10,evflt)")
          But now the user can view all records available.

          Comment


            #6
            Re: Xdialog data list not autosizing with %d

            Originally posted by Al Buchholz View Post
            to get the list to point at the last value add 2 lines

            Code:
            linec=line_count(auto_list_sl) ' in case I can use this in the dlg string?
            [COLOR="#FF0000"]LastRow=strtran(alltrim(str(linec))-word(auto_list_sl,linec,crlf()),"|","")
            sl=LastRow[/COLOR]
            Al, I did exactly that and it worked perfectly. I tried to but didn't understand how it works and what the variable sl actually does. Its functioning is too obscure for me to follow. I just included it verbatim and moved on.

            I have had to come back to that now to add button options for further processing within in the same dialog. There are some differences and now that line no longer fetches the last record.
            Would you be able to explain how it gets applied?
            Or would I give a new sample?

            Comment


              #7
              Re: Xdialog data list not autosizing with %d

              Originally posted by Ray in Capetown View Post
              Al, I did exactly that and it worked perfectly. I tried to but didn't understand how it works and what the variable sl actually does. Its functioning is too obscure for me to follow. I just included it verbatim and moved on.

              I have had to come back to that now to add button options for further processing within in the same dialog. There are some differences and now that line no longer fetches the last record.
              Would you be able to explain how it gets applied?
              Or would I give a new sample?
              sl is the variable that you use to show the values on the xdialog.

              Code:
              varC_result = ui_dlg_box("Alpha Five","| [%d;O={@@}%.140,5[B][COLOR="#FF0000"][SIZE=5]sl[/SIZE][/COLOR][/B]^#a_sl];")
              You fill the variable choices with a_sl

              The value you pick is stored in sl

              The last_row expression calculates the exact value for the last record that are found in sl given it's choices and formatting.

              Use debug(1) or the trace window to follow the values in each variable.
              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


                #8
                Re: Xdialog data list not autosizing with %d

                So after stripping all "|" the result, stored in sl must match one of the rows (in this case the last) and the dialog will select it?
                I noticed that on subsequent opening the line it starts with "remembers" which selection was made in the previous - so that is the mechanism
                I'll try out tracing methods. Is this a general principle?
                Thank you kindly for your patience.

                Comment


                  #9
                  Re: Xdialog data list not autosizing with %d

                  Originally posted by Ray in Capetown View Post
                  So after stripping all "|" the result, stored in sl must match one of the rows (in this case the last) and the dialog will select it?
                  I noticed that on subsequent opening the line it starts with "remembers" which selection was made in the previous - so that is the mechanism
                  I'll try out tracing methods. Is this a general principle?
                  Thank you kindly for your patience.
                  The "remembers" the selection made is because you scoped that variable as shared. Sometimes I use global so it remembers even longer....

                  debug(1) and tracing are always good ways to see exactly what is happening. Saves alot of guessing and going down wrong assumption paths.

                  The LastRow calculation was based on looking at the variable SL with debug(1) and making a calculation that matched that value for the last row.

                  So if you change formatting/columns/whatever and the SL value changes the format, you need to change the calc for LastRow to match.
                  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


                    #10
                    Re: Xdialog data list not autosizing with %d

                    Got it thanks.

                    Comment


                      #11
                      Re: Xdialog data list not autosizing with %d

                      To others reading this
                      The first wrong assumption I made (before the guessing how it works assumptions) was that the solution provided already existed in Al's memory, whereas I realize now that the solution, as simple as it appears, actually came from Al trying the example, testing until it worked. There is quite a distinction.

                      Comment

                      Working...
                      X