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

text and line position in xdialog

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

    text and line position in xdialog

    Could someone please help me understand how to have the text "color" positioned closer to the text box and how to get the line above the buttons the full width of the box. The syntax of the second I have struggled with forever, usually trying every possible combination until somehow it ends up working, but I have yet to understand what makes it work and what doesn't. Thanks.

    Code:
    dim vG1 as C="Color"
    dim vcolor as C
    dim dlg_text as C
    dim dlg_title as C="Colors"
    
    dlg_text=<<%dlg%
    {on_key=enter}
    {lf};
    {region}
    {justify=center}{font=Arial,10,B}{text=vG1}{font=Arial,10}[.30vcolor];
    {endregion};
    {region}
    {line=1,0}
    {lf};
    <10&OK!ok> <10&Cancel!cancel>
    {endregion};
     %dlg%
    
    vresults=ui_dlg_box(dlg_title,dlg_text,<<%code%
    
    %code%)
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

    #2
    Re: text and line position in xdialog

    Mike

    Here is new code with comments

    Code:
    dim vG1 as C="Color"
    dim vcolor as C
    dim dlg_text as C
    dim dlg_title as C="Colors"
    
    dlg_text=<<%dlg%
    {on_key=enter}
    {lf};
    {region}
    {justify=center}{font=Arial,10,B}{text=8,vG1}{font=Arial,10}[.30vcolor]; {comment  Text takes a width parameter}
    {comment  remove this endregion};
    {comment remove this region}
    {justify=left}; {comment add a justify left here}
    {line=1,0}
    {lf};
    {justify=center} {comment  add justify center to center ok cancel}
    <10&OK!ok> <10&Cancel!cancel>
    {endregion};
     %dlg%
    
    vresults=ui_dlg_box(dlg_title,dlg_text,<<%code%
    
    %code%)
    I added a text width parameter to put the text color closer
    I removed the region and endregion to put the whole dialog together (as commented)
    I then justified the ok and cancel buttons so they are centered

    I think this is what you want

    Tom
    Last edited by Tbaker; 01-23-2010, 01:13 PM. Reason: Grammar

    Comment


      #3
      Re: text and line position in xdialog

      Tom.
      I had it solidly in my head that the text width parameter had a default to the width of the text entered. It's a "once you get it in your head" error that you nicely unclouded. Thanks.

      The line thing is still a bit murky though. The interplay of the regions, the columns, and the justifications are still blurry, but your response has lifted the vail that {line} is affected by justification and the columns fits in there too. I've pretty much got the {frame} thing understood (almost). I'm going to work through this all today until I completely get it, and I think your response has me well on my way. Thanks much.
      Mike W
      __________________________
      "I rebel in at least small things to express to the world that I have not completely surrendered"

      Comment


        #4
        Re: text and line position in xdialog

        Here's some more comments/changes for learning purposes.

        - Get rid of ALL the regions in this case. They are only need if you have MULTIPLE lines that need to have various objects line up even though the labels/objects are different lengths. Alpha's genies create LOTS of unnecessary regions but I believe that's just because the genie doesn't know how many things will be in the region when it first creates it. When creating an xdialog yourself, all those regions are not necessary. Extra regions have two downsides in my opinion: (1) they add confusion and (2) they add unnecessary extra vertical space. I don't know why they have to create all that extra space but Alpha doesn't seem to want to change it. I especially hate putting a region around the buttons at the end of an xdialog because, in my opinion, all that does is put a huge empty, wasted space below the buttons. In this case that extra space at the bottom was originally 'balanced' by using an {lf}; command before the buttons - check my result with no region and a {sp}; command using {ysize=.3} and see if you don't think it looks a little more professional.

        - It usually works better to put a ";" after the {line=} command. Otherwise vertical spacing can do strange things sometimes. Putting it after the "justify" command as it was here only adds an additional new line before the {line=} command. In this case, that new line is useful for the sake of appearance but I'd prefer to specify it with a separate {sp}; command because I think that's more understandable if I have to edit it later.

        - Note the use of {ysize=.3}. I use this to give me better control over vertical spacing. Without it a simple ";" results in a very, very small additional space and it takes many of them to get a nice appearance instead of the huge (full) line space created with "{lf};". You can simply 'stack' semi-colons like this - <end of line>;;; - but I prefer to use {sp}; because it stands out more when debugging/editing. Of course, I also have a keyboard macro to make the {sp}; easier to type; othewise I'd get tired of typing those squiggly brackets. (I tried various heights and found .3 to be the best for my taste.)

        - I changed the label to simply be the text itself rather than setting a variable and using {text=} to show it. Unless there is a need to change the actual label based on something else in the application, why not make things simpler and just put the text label right in the dlg_text? That way you don't have to worry about setting the right size in the {text=} command - it's more of a "wysiwyg" situation. (See also my method below for entering "variables" in the dlg_text. That method may be better when the text width can vary. Otherwise you might find yourself being forced to set a {text=} width that is larger than you want in most cases just to handle the one really long one.)

        I noticed right away that you put the button labels right in the buttons without setting a variable for them. Bravo! Simplicity is a good thing. Xdialogs are complex enough without adding unnecessary complexity.

        I also like the fact that you are separating the dlg_text and keeping it outside the ui_dlg_box() command. As you continue working with it you will find that the fact the dlg_text is just a character string will bring LOTS of versatility to your xdialogs. I have one unusually complex xdialog where the dlg_text itself is 15 lines long but there are 160 lines of code after it that modify the dlg_text. The changes are mostly done with stritran() commands but there are also a lot of IF statements to determine how each item needs to be changed.

        Here's a sample to give you an idea...

        This line is in the dlg_text string:
        {ysize=.3}{units=F}{sp}{wrap=[[wrap_c]]};
        I use [[...]] to identify something I want to change later. In this case, the wrap width is set based on some previous parameter. My decision to use double square brackets was basically a personal choice but it was also based on the fact that they are pretty easy to pick out and they will create a strange "field object" if I forget to make the change before running the xdialog. I tried just putting the variable name in at first but soon discovered that it was sometimes very difficult to see that I had forgotten to replace the variable with the correct string - the double square brackets fixed that.

        Also, fwiw, the text between the double brackets is the actual variable name I'll use to replace it. That isn't necessary but it makes it easier and more logical for me to work with.

        Then a line like this will be used to replace the "variable string" once the desired value has been determined. Note that the wrap width being modified here isn't really a "number"; it's character string that only represents a number. Everything inside the dlg_text is a character string.
        dlg_text = stritran( dlg_text, "[[wrap_c]]", wrap_c )

        I haven't found it as useful to keep the dlg_code section separate but maybe that's just me. Having it separate is certainly not bad.

        You might also want to take a look at the two xdialog posts I did on the v9 board for Charlie Crimmel this evening - here and here. There are lots of other comments in those. (Xdialog has been a biggie for me today - and I was intending to get some work done before hitting the sack. Oh well, so much for that - g'nite now!)
        Code:
         
        dim vG1 as C="Color" 'Not needed. At least not in this case.
        dim vcolor as C
        dim dlg_text as C
        dim dlg_title as C="Colors"
        dlg_text=<<%dlg%
        {on_key=enter}
        {ysize=.3}
        {lf};
        {justify=center}{font=Arial,10,B}Color {font=Arial,10}[.30vcolor]; {comment  Text takes a width parameter - but defaults to 10 which isn't really big enough here.}
        {sp};
        {justify=left}{line=1,0};
        {sp}; {comment Changed from lf because it was way too much space to look good once the region was removed.}
        {comment  add justify center to center ok cancel}
        {justify=center}
        <10&OK!ok> <10&Cancel!cancel>
         %dlg%
        
        vresults=ui_dlg_box(dlg_title,dlg_text,<<%code%
        %code%)
        Last edited by CALocklin; 01-28-2010, 02:41 AM.

        Comment

        Working...
        X