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

Autosizing Messageboxes??

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

    Autosizing Messageboxes??

    Hi,

    My code :
    Code:
    dim dlg_title as C
    dlg_title = "This is a along Title"
    ui_dlg_box("@=dlg_title",<<%dlg%
    <Set Title!settitle>
    %dlg%,<<%code%
    if a_dlg_button = "settitle" then
        dlg_title = ui_get_text("","Set a new long description...",dlg_title)
         a_dlg_button = ""
    end if
    %code%)
    Problem is that the message box is small and the text in both title and desc are truncated visually. Help is of no use, so maybe someone can shed some light on this...

    Thanks,
    Stanley

    #2
    Re: Autosizing Messageboxes??

    few things:
    this seems to be a desktop question, may be it should be in that section, you will get more response.
    I do not know what you are trying, but in the dialog you have dialog title and the button to click, there is no content. the dialog is built around the content and it adjusts its size accordingly. so if you put content after the title, then title and the description will show.
    lastly, I am not an expert on desktop features like xdialog, if you want to build dynamic xdiloag you can get or set your title, content, buttons in named variables and call them to construct the xdialog, since it is only string.
    for example
    title = "something"
    content = "another thing"
    ui_dlg_box(title,content)
    like that.
    I am sure you can find examples in learning xdialog for more information.
    Last edited by GGandhi; 11-14-2014, 09:42 AM.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    [email protected]
    Skype:[email protected]
    1 914 924 5171

    Comment


      #3
      Re: Autosizing Messageboxes??

      Thanks Govindan,

      I was able to add a literal string that was longer than the title as content and it did expand the message box to fit the content string.

      If I need a long title with a short content string, then the message box gets truncated which is bad. How is that handled?

      How do I add carriage returns/line feeds inside the content?

      I found a property named Xsize and that will set the width if hardcoded as in {Xsize=50}. I tried using an expression like Xsize=len(dlg_title)+5, and that does not work, so how do I get expressions to work inside this?

      I stumbled on the Xsize property and wondering why its not documented as part of the ui_dlg_box() control.

      Also Govindan, I'm actually playing with the software and the example code I used was pasted in from somewhere, while I experimented trying this and that to mimic functionality I've used in VFP and I keep running into silly trivial issues such as the one posted where the message box size was severely truncated, no matter how long I made the title.

      Is it true that this xBasic stuff is desktop only? I'm under the impression its used in both desktop and web if you need to really get at all its power and go beyond the capability of the wizards.

      Thanks,
      Stanley

      Comment


        #4
        Re: Autosizing Messageboxes??

        lot of information in one single thread. hmmmm
        How do I add carriage returns/line feeds inside the content?
        at the end of the statement add ";" without the quotes of course.

        is it true that this xBasic stuff is desktop only? I'm under the impression its used in both desktop and web if you need to really get at all its power and go beyond the capability of the wizards.
        you got mixed up on the way.
        xbasic is both in web and desktop, it is the xdialog resides in the desktop.

        to learn more about xdialog which is what you are working with at the moment
        1> please go to desktop side there are experts who can help lot more than I.
        2> there is tutorial with samples in the samples part on the left hand side of the startup panel http://screencast.com/t/DCLt8pmq
        take a look
        3> same thing is available in alphapedia look for tutorial and then xdialog.

        If I need a long title with a short content string, then the message box gets truncated which is bad. How is that handled?
        add {size= } fill in with number of inches you desire

        Code:
        result = ui_dlg_box("this is a ve long title this is a long title",<<%dlg%
        {size=10}
        content;
        content;
        <ok><canc>
        %dlg%)
        still move to desktop ask others!
        Last edited by GGandhi; 11-15-2014, 09:03 AM.
        thanks for reading

        gandhi

        version 11 3381 - 4096
        mysql backend
        http://www.alphawebprogramming.blogspot.com
        [email protected]
        Skype:[email protected]
        1 914 924 5171

        Comment


          #5
          Re: Autosizing Messageboxes??

          Stanley,

          When I need a message box at the end of an AJAX callback, I return the following Javascript:

          A5.msgBox.show('"+vMsgTitle+"','<div style=\'height:100px;width:300px;text-align:center;\'>"+vMsgText+"</div>',[{html: 'OK', value: 'ok'}],function(button) {if(button == 'ok') {setTimeout(function() {},10)}});"

          You may be able to do something similar.
          Pat Bremkamp
          MindKicks Consulting

          Comment


            #6
            Re: Autosizing Messageboxes??

            Stanley,

            Here is a place to learn xdialog:

            http://alphafivewiki.com/Learning%20Xdialog%20Title

            That also exists in the sample app that ships w. A5.

            BTW, you can't use an expression inside of xdialog. If you want to dynamically change certain elements you may have to use stritran() or something putting the xdialog in a variable assignment first.

            As Gandhi pointed out, although xdialog is a subset of xbasic, xdialog only works on the desktop. Xbasic proper works in either mode.
            Peter
            AlphaBase Solutions, LLC

            [email protected]
            https://www.alphabasesolutions.com


            Comment


              #7
              Re: Autosizing Messageboxes??

              dialogs are constructed from text. Build the text for the dialog dynamically breaking the dialog body into parts breaking at the dynamic element and then compiling the body fixed elements with the dynamic elements into a text string that is the full body before the dialog is actually intiated. The code below is measuring the length of the title text and that is the dynamic element feed to a "bogus" text line in the body of the dialog that invisibly (because there is no value to the variable it is coded to show) and expands the dialog to the length of the title.
              Code:
              dim dlg_title as C
              dim dlg_body as C
              dim dlg_code as C
              dim z1 as C
              dim z2 as C
              dim vn_title_length as N
              dim vR as C
              
              dlg_title = "This is a a long Title"
              RESHOW_DIALOG:
              
              'acquire the length of the dialog title
              vn_title_length=int(len(dlg_title)^1.07)	'increase because base is 8 point and I am using 10 point
              
              'this is the dialog body fixed string before the dynamic element of the dialog
              z1=<<%dg1%
              {font=arial,10}{background=#135,199,199}
              {text=%dg1%
              
              'this is the dialog body fixed string after the dynamic element of the dialog
              z2=<<%dg2%
              qqq};
              <15Set Title!settitle>;
              <15Abort>
              %dg2%
              
              
              'this compiles the dialog body into a complete body string
              dlg_body=z1+(""+vn_title_length)+z2
              
              
              'dialog code
              dlg_code=<<%code%
              if a_dlg_button = "settitle" then
              	dim dlg_title_new as C=dlg_title
              	dim vR2 as C
                  vR=ui_dlg_box("TITLE",<<%dlg%
                  {font=arial,10}{lf};
              	Set a new long description:;
              	[.90dlg_title_new];
                  <OK>
                  %dlg%)
                  a_dlg_button = "close"
              end if
              %code%
              
              
              'initiate the dialog
              vR=ui_dlg_box(dlg_title,dlg_body,dlg_code)
              	if vR="abort"
              		end 
              	end if
              	
              	'reset the prior dialog title to the new title
              	dlg_title=dlg_title_new
              
              'rebuild the dialog
              GOTO RESHOW_DIALOG
              Mike W
              __________________________
              "I rebel in at least small things to express to the world that I have not completely surrendered"

              Comment


                #8
                Re: Autosizing Messageboxes??

                Mike, it displays the full title the first time you enter a long title but if you change it a 2nd time it still truncates. I suppose that is because it isn't likely to be repeated?
                Robin

                Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                Comment


                  #9
                  Re: Autosizing Messageboxes??

                  Originally posted by MoGrace View Post
                  Mike, it displays the full title the first time you enter a long title but if you change it a 2nd time it still truncates. I suppose that is because it isn't likely to be repeated?
                  Not so in my hands (see attached).
                  Attached Files
                  Mike W
                  __________________________
                  "I rebel in at least small things to express to the world that I have not completely surrendered"

                  Comment


                    #10
                    Re: Autosizing Messageboxes??

                    Set a short title again and then a longer one and you are back to truncated titles.
                    Robin

                    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                    Comment


                      #11
                      Re: Autosizing Messageboxes??

                      Mike,

                      I'm surprised to see that it took 40-50 lines of code to do what should be a default 0 lines of code behavior as shown in your attachment. The box should always be wide enough to properly display the title. One should never have a truncating issue...

                      Stanley

                      Comment


                        #12
                        Re: Autosizing Messageboxes??

                        Originally posted by stanlyn View Post
                        Mike,

                        I'm surprised to see that it took 40-50 lines of code to do what should be a default 0 lines of code behavior as shown in your attachment. The box should always be wide enough to properly display the title. One should never have a truncating issue...

                        Stanley
                        Stanley there are only 5 lines of code in Mike's code that magically widen the dialog at run time!

                        vn_title_length=int(len(dlg_title)^1.07)
                        {text=%dg1%
                        z2=<<%dg2%
                        qqq};
                        dlg_body=z1+(""+vn_title_length)+z2

                        The rest of the code builds the dialog box & displays it!!

                        And lets you modify the box title from inside the box!!

                        I just built a small box in Visual Studio and it too will truncate the title without making the box contents wide enough picture attached!
                        long title.PNG

                        This is a small Xdialog box that is wide enough for the title

                        Awidebox.txt

                        Comment


                          #13
                          Re: Autosizing Messageboxes??

                          Mike,

                          >> qqq};
                          Where did that "qqq" come from?
                          How would I know to use it, as intellisense make no mention of it?

                          Allen,

                          In your awidebox.txt code below:
                          vcdlgbody=<<%dlg%
                          short;
                          *
                          ;
                          {justify=right}<15OK>;
                          %dlg%
                          vctitle = "This is a very very long Title!!!!!!?"

                          ui_dlg_box(vctitle,vcdlgbody)
                          1. What is the "short" option? where is it documented?
                          2. What does the <150K> do, and where is it documented?

                          This is the primary source of me wanting to scrap AA and move on, as looking at the help for ui_dlg_box makes no mention of all these options people are suggesting like the 150K and short as well as others. When I'm in the editor or iw, I really expect AA to offer this help thru intellisense and/or the direct F1 help.

                          You mentioned Visual Studio, are you using the later versions, and how often do you work in it? Do you use it with AA. if so, how? I'd really would like to hear your thoughts on the two, AA and VS...

                          Thanks,
                          Stanley

                          Comment


                            #14
                            Re: Autosizing Messageboxes??

                            Stanley did you run the code?

                            'short' is static text that will display in the xdialog box body. <15OK> is a button a ';' is a new line.

                            I and others have given you links to the documentation in this thread & the other one.

                            Comment


                              #15
                              Re: Autosizing Messageboxes??

                              No Allen I have not run the code. My AA demo has expired and I'm awaiting for a reset to the eval...

                              Do you have a link to the help that discusses all the symbols such as the ;, <>, a number in front of a word such as .80Text and all that stuff.

                              Thanks,
                              Stanley

                              Comment

                              Working...
                              X