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 text box and fixed-width fonts

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

    xdialog text box and fixed-width fonts

    I came across this today. I haven't seen this one before. In the code below, there has to be a character following the xdialog text box in order for the spaces after the text box be fixed-width.

    Code:
    	ui_dlg_box("test",<<%dlg%
    	{startup=init}{background=Gray-50}{xmargin=3,3}{lf};
    	{region}{background=Light Tan}{lf};{font=Arial,12,b}{sp=19}TEMPLATE QUANTITIES UPDATE{text=22};
    	{endregion};
    	{region}{background=#190+210+220}{frame=1,9};{lf};{font=arial,9,b}{sp=55}Counted{sp=8}Ord{sp=4}Rec'd{lf};
    	{font=lucida console,10,b}
    {sp=7}pickyproduce1_197_0940_L1{sp=3}[.12varz_pickyproduce1_197_0940_L1]_  14    0;
    {sp=7}pickyproduce1_197_1057_L1{sp=3}[.12varz_pickyproduce1_197_1057_L1]   10    0;
    {sp=7}pickyproduce1_220_1042_L1{sp=3}[.12varz_pickyproduce1_220_1042_L1]:   5    0;
    {sp=7}pickyproduce1_220_1396_L1{sp=3}[.12varz_pickyproduce1_220_1396_L1]'  18    0;
    {text=91};
    	{endregion};
    	{lf};
    	{justify=center}<%O={J=C}{I:'$$file.save'}{F=arial,10}   Save Counts   ;OF={J=C}{C=white}{B=black}{I:'$$file.save'}{F=Arial,10,bi}  Save Counts  %23,1.5!Save_counts> 
    	{sp=2}<%O={J=C}{I:'$$generic.edit.cancel'}{F=arial,10}  Cancel  ;OF={J=C}{C=white}{B=black}{I:'$$generic.edit.cancel'}{F=Arial,10,bi} Cancel  %23,1.5!Cancel>;
    	{lf};
    	%dlg%)
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

    #2
    Re: xdialog text box and fixed-width fonts

    It sounds like alignment is in question? I may be missing something, but look this over...

    Code:
    ui_dlg_box("test",<<%dlg%
    	{startup=init}{background=Gray-50}{xmargin=3,3}{lf};
    	{region}{background=Light Tan}{lf};{font=Arial,12,b}{sp=21}TEMPLATE QUANTITIES UPDATE{text=20};
    	{endregion};
    	{region}{background=#190+210+220}{frame=1,9};{lf};{font=arial,9,b}{sp=56}Counted{sp=7}Ord{sp=4}Rec'd{lf};
    	{font=lucida console,10,b}
    {sp=7}pickyproduce1_197_0940_L1{sp=3}[.12varz_pickyproduce1_197_0940_L1]{sp=5}14{sp=6}0;
    {sp=7}pickyproduce1_197_1057_L1{sp=3}[.12varz_pickyproduce1_197_1057_L1]{sp=5}10{sp=6}0;
    {sp=7}pickyproduce1_220_1042_L1{sp=3}[.12varz_pickyproduce1_220_1042_L1]{sp=5}05{sp=6}0;
    {sp=7}pickyproduce1_220_1396_L1{sp=3}[.12varz_pickyproduce1_220_1396_L1]{sp=5}18{sp=6}0;
    {text=91};
    	{endregion};
    	{lf};
    	{justify=center}<%O={J=C}{I:'$$file.save'}{F=arial,10}   Save Counts   ;OF={J=C}{C=white}{B=black}{I:'$$file.save'}{F=Arial,10,bi}  Save Counts  %23,1.5!Save_counts> 
    	{sp=2}<%O={J=C}{I:'$$generic.edit.cancel'}{F=arial,10}  Cancel  ;OF={J=C}{C=white}{B=black}{I:'$$generic.edit.cancel'}{F=Arial,10,bi} Cancel  %23,1.5!Cancel>;
    	{lf};
    	%dlg%)

    Comment


      #3
      Re: xdialog text box and fixed-width fonts

      Hi Craig,
      Yes, you are certainly correct and your dialog will have things aligned. However, what I provided was the end construct of a dialog string built dynamically. The templates (pickyproduce1_197_0940_L1 is a template) and the values for the Ord and Rec'd are obtained from filtering various tables and compiling the values into an xdialog string. The template names are always 25 characters in length, but the values for Ord and Rec'd vary between 1-3 characters, and spaces are added based upon the length of the value (space(6-len(vord_qnty)). I also tried making the string with the space being "{sp="+(""+len(vord_qnty))+" and that didn't work either.
      Mike W
      __________________________
      "I rebel in at least small things to express to the world that I have not completely surrendered"

      Comment


        #4
        Re: xdialog text box and fixed-width fonts

        Mike:

        I was pretty sure you were way past where I took it, and figured you would respond with either the above, or ask how to dynamically set the {sp=x}. Your first post looked like the rest of the picture was missing.

        So, did your dialog work with the above, and just not display aligned, or did it error? I'm just asking, as "{sp="+(""+len(vord_qnty))+" looks like it should be:

        Code:
        vord_qnty = 321
        
        ?"{sp="+(6+(3-len(alltrim(str(vord_qnty)))))+"}" + vord_qnty
        = "{sp=6}321"
        
        vord_qnty = 32
        
        ?"{sp="+(6+(3-len(alltrim(str(vord_qnty)))))+"}" + vord_qnty
        = "{sp=7}32"
        
        vord_qnty = 3
        
        ?"{sp="+(6+(3-len(alltrim(str(vord_qnty)))))+"}" + vord_qnty
        = "{sp=8}3"
        Where 6 is the padding constant to the left of vord_qnty, and 3 is the number of digits ord and rec'd max at.

        Also, I guess you have an array set to load vord_qnty[x], or a loop to load vord_qnty?

        Sorry if this is already tried, but without actual code samples, it's hard to know where you're at.

        Comment


          #5
          Re: xdialog text box and fixed-width fonts

          Hi Craig,
          Thanks for looking into this. All the code needed is in the code provided. The code below generates the two different dialog strings of using (sp=x) and using a character after the text box and space(x) in the xdialog text string. This shows that using {sp=x) does not work and using an inserted character after the text box is needed to keep fixed-width spacing.

          Code:
          dim dlg_body as C
          dim vbuilds as C
          dim vbuildn as C
          dim s1 as C="2"
          dim ns1 as N=2
          dim v1 as C="14    0;"
          dim vline1 as C="{sp=7}pickyproduce1_197_0940_L1{sp=3}[.12varz_pickyproduce1_197_0940_L1]"
          
          dim s2 as C="2"
          dim ns2 as N=2
          dim v2 as C="10    0;"
          dim vline2 as C="{sp=7}pickyproduce1_197_1057_L1{sp=3}[.12varz_pickyproduce1_197_1057_L1]"
          
          dim s3 as C="3"
          dim ns3 as N=3
          dim v3 as C="5    0;"
          dim vline3 as C="{sp=7}pickyproduce1_220_1042_L1{sp=3}[.12varz_pickyproduce1_220_1042_L1]"
          
          dim s4 as C="2"
          dim ns4 as N=2
          dim v4 as C="18    0;"
          dim vline4 as C="{sp=7}pickyproduce1_220_1396_L1{sp=3}[.12varz_pickyproduce1_220_1396_L1]"
          
          vbuilds=vline1+"{sp="+s1+"}"+v1+";"+crlf()
          vbuilds=vbuilds+vline2+"{sp="+s2+"}"+v2+";"+crlf()
          vbuilds=vbuilds+vline3+"{sp="+s3+"}"+v3+";"+crlf()
          vbuilds=vbuilds+vline4+"{sp="+s4+"}"+v4+";;;"+crlf()
          
          vbuildn=vline1+"'"+space(ns1)+v1+";"+crlf()
          vbuildn=vbuildn+vline2+"'"+space(ns2)+v2+";"+crlf()
          vbuildn=vbuildn+vline3+"'"+space(ns3)+v3+";"+crlf()
          vbuildn=vbuildn+vline4+"'"+space(ns4)+v4+";;;"+crlf()
          
          
          dim z1 as C
          z1=<<%z1%
          	{startup=init}{background=Gray-50}{xmargin=3,3}{lf};
          	{region}{background=Light Tan}{lf};{font=Arial,12,b}{sp=19}TEMPLATE QUANTITIES UPDATE{text=22};
          	{endregion};
          	{region}{background=#190+210+220}{frame=1,13};{lf};{font=arial,9,b}{sp=55}Counted{sp=8}Ord{sp=4}Rec'd{lf};
          	{font=lucida console,10,b}
          %z1%
          
          z2=<<%z2%
          {text=91};
          	{endregion};
          	{lf};
          	{justify=center}<%O={J=C}{I:'$$file.save'}{F=arial,10}   Save Counts   ;OF={J=C}{C=white}{B=black}{I:'$$file.save'}{F=Arial,10,bi}  Save Counts  %23,1.5!Save_counts> 
          	{sp=2}<%O={J=C}{I:'$$generic.edit.cancel'}{F=arial,10}  Cancel  ;OF={J=C}{C=white}{B=black}{I:'$$generic.edit.cancel'}{F=Arial,10,bi} Cancel  %23,1.5!Cancel>;
          	{lf};
          %z2%
          
          dim which_to_use as C
          dim vR as C
          
          dim vR as C
          vR=ui_dlg_box("WHICH",<<%dlg%
          {font=arial,10}{lf};
          <30SP_version> <30Mark and space version>
          {lf};
          %dlg%)
          
          if vR="sp_version"
          	dlg_body=z1+vbuilds+z2
          else if vR="Mark and space version"
          	dlg_body=z1+vbuildn+z2
          end if
          clipboard.Set_Data(dlg_body)
          
          ui_dlg_box("test",dlg_body)
          Mike W
          __________________________
          "I rebel in at least small things to express to the world that I have not completely surrendered"

          Comment


            #6
            Re: xdialog text box and fixed-width fonts

            While this might get you closer to your goal, it appears the rec'd column can be a hair off. You can change the ordx and recx variables to 1,2,& 3 digits numbers. I'd use it, but if this still doesn't meet your needs, you can always revert to a opening a form as a dialog.

            There's definitely something about the xdialog not staying true to the fixed width font. I tried courier new with no better results.

            My conclusion is that using {sp=x} has slightly better results than a space " ", but it's still a hair off.


            Code:
            dim dlg_body as C
            dim vbuilds as C
            dim vbuildn as C
            dim s1 as C="2"
            dim ns1 as N=2
            dim v1 as C="14    0;"
            dim vline1 as C="{sp=7}pickyproduce1_197_0940_L1{sp=3}[.12varz_pickyproduce1_197_0940_L1]"
            
            dim s2 as C="2"
            dim ns2 as N=2
            dim v2 as C="10    0;"
            dim vline2 as C="{sp=7}pickyproduce1_197_1057_L1{sp=3}[.12varz_pickyproduce1_197_1057_L1]"
            
            dim s3 as C="3"
            dim ns3 as N=3
            dim v3 as C="5    0;"
            dim vline3 as C="{sp=7}pickyproduce1_220_1042_L1{sp=3}[.12varz_pickyproduce1_220_1042_L1]"
            
            dim s4 as C="2"
            dim ns4 as N=2
            dim v4 as C="18    0;"
            dim vline4 as C="{sp=7}pickyproduce1_220_1396_L1{sp=3}[.12varz_pickyproduce1_220_1396_L1]"
            
            '  CRAIG'S CHANGES START HERE
            
            '  THE 8 VARIABLES BELOW CAN BE CHANGED TO ANY 1-3 DIGIT NUMBER AS STATED BY YOU
            
            dim ord1 as n = 14
            dim rec1 as n = 0
            dim ord2 as n = 10
            dim rec2 as n = 0
            dim ord3 as n = 5
            dim rec3 as n = 0
            dim ord4 as n = 18
            dim rec4 as n = 0
            
            '  THIS SECTION ADJUSTS THE NUMBER OF SPACES BASED ON THE NUMBER OF DIGITS IN THE NUMBERS FROM THE VARIABLES ABOVE
            
            dim new_ord1 as c = "{sp="+(4+(3-len(alltrim(str(ord1)))))+"}" + ord1
            dim new_rec1 as c = "{sp="+(0+(3-len(alltrim(str(ord1)))))+"}" + "{sp="+(3+(3-len(alltrim(str(rec1)))))+"}" +rec1
            
            dim new_ord2 as c = "{sp="+(4+(3-len(alltrim(str(ord2)))))+"}" + ord2
            dim new_rec2 as c = "{sp="+(0+(3-len(alltrim(str(ord2)))))+"}" + "{sp="+(3+(3-len(alltrim(str(rec2)))))+"}" +rec2
            
            dim new_ord3 as c = "{sp="+(4+(3-len(alltrim(str(ord3)))))+"}" + ord3
            dim new_rec3 as c = "{sp="+(0+(3-len(alltrim(str(ord3)))))+"}" + "{sp="+(3+(3-len(alltrim(str(rec3)))))+"}" +rec3
            
            dim new_ord4 as c = "{sp="+(4+(3-len(alltrim(str(ord4)))))+"}" + ord4
            dim new_rec4 as c = "{sp="+(0+(3-len(alltrim(str(ord4)))))+"}" + "{sp="+(3+(3-len(alltrim(str(rec4)))))+"}" +rec4
            
            vbuilds=vline1+new_ord1+new_rec1+";"+crlf()									
            vbuilds=vbuilds+vline2+new_ord2+new_rec2+";"+crlf()	
            vbuilds=vbuilds+vline3+new_ord3+new_rec3+";"+crlf()	
            vbuilds=vbuilds+vline4+new_ord4+new_rec4+";;;"+crlf()
            
            '  CRAIG'S CHANGES END HERE
            
            vbuildn=vline1+"'"+space(ns1)+v1+";"+crlf()
            vbuildn=vbuildn+vline2+"'"+space(ns2)+v2+";"+crlf()
            vbuildn=vbuildn+vline3+"'"+space(ns3)+v3+";"+crlf()
            vbuildn=vbuildn+vline4+"'"+space(ns4)+v4+";;;"+crlf()
            
            
            dim z1 as C
            z1=<<%z1%
            	{startup=init}{background=Gray-50}{xmargin=3,3}{lf};
            	{region}{background=Light Tan}{lf};{font=Arial,12,b}{sp=19}TEMPLATE QUANTITIES UPDATE{text=22};
            	{endregion};
            	{region}{background=#190+210+220}{frame=1,13};{lf};{font=arial,9,b}{sp=55}Counted{sp=8}Ord{sp=4}Rec'd{lf};
            	{font=lucida console,10,b}
            %z1%
            
            z2=<<%z2%
            {text=91};
            	{endregion};
            	{lf};
            	{justify=center}<%O={J=C}{I:'$$file.save'}{F=arial,10}   Save Counts   ;OF={J=C}{C=white}{B=black}{I:'$$file.save'}{F=Arial,10,bi}  Save Counts  %23,1.5!Save_counts> 
            	{sp=2}<%O={J=C}{I:'$$generic.edit.cancel'}{F=arial,10}  Cancel  ;OF={J=C}{C=white}{B=black}{I:'$$generic.edit.cancel'}{F=Arial,10,bi} Cancel  %23,1.5!Cancel>;
            	{lf};
            %z2%
            
            dim which_to_use as C
            dim vR as C
            
            dim vR as C
            vR=ui_dlg_box("WHICH",<<%dlg%
            {font=arial,10}{lf};
            <30SP_version> <30Mark and space version>
            {lf};
            %dlg%)
            
            if vR="sp_version"
            	dlg_body=z1+vbuilds+z2
            else if vR="Mark and space version"
            	dlg_body=z1+vbuildn+z2
            end if
            clipboard.Set_Data(dlg_body)
            
            ui_dlg_box("test",dlg_body)

            Comment


              #7
              Re: xdialog text box and fixed-width fonts

              Hi Craig,
              Nice approach, I like it! Thank you.
              Mike W
              __________________________
              "I rebel in at least small things to express to the world that I have not completely surrendered"

              Comment


                #8
                Re: xdialog text box and fixed-width fonts

                And a hearty thanks back to you and all for everyone's contributions. This board helps everyone.

                Comment

                Working...
                X