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

Message box location

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

    Message box location

    Is it possible to change the location of where a message box is displayed?

    It appears it always defaults to being displayed on the center of the screen.

    We have users that are fast clickers and often click through the message box prompts too quickly and end up accidentally clicking on another button underneath the message box.

    I know the logical solution would be to relocate the buttons that are behind the dialog box, but that is not an option in this case.

    Defining a position other than center for the dialog box would solve our issue.

    Thanks

    #2
    Yep.
    Research Pos.
    Loads of posts on this.
    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
      Timing is everything!!!!!!!!

      This is a simple javascript function based on javascript action to display a transient message.
      I modified it to let you pass in the text for the message, and the control you want it to drop down from.
      This means that you can easily display a message from many different events without cluttering up
      action javascript.

      Code:
      function displayTransMessage(message,control){
      var _getElement = function() {
      
      return {dialog.Object}.getPointer(control);};
      var _ele = _getElement();
      //var _html = '<div id="showmessage" style="line-height:25px; display:inline-block;"></div>';
      var _html = '<div id="showmessage" style="line-height:25px; display:inline-block;">'+message+'</div>';
      //$svs('showmessage',message);
      //document.getElementById('showmessage').innerHTML = message;
      var _options = {
          "close": {
              "show": true
          },
          "duration": 2500,
          "animation": {
              "show": {
                  "type": "none"
              },
              "hide": {
                  "type": "none"
              }
          }
      };
      {dialog.object}.transientMessage(['dropdown',_ele],_html,_options);
      }
      ​
      Gregg
      https://paiza.io is a great site to test and share sql code

      Comment


        #4
        The answer is yes, but you have to code your own. I have lots of these depending on the message and dialog flavor I want presented. This one is a derivation from one posted on the boards years ago, maybe by Raymond Lyons? Hope you can use it. You will have to change the values for the image to present and the background color in the variable - pdlg_color - to your needs. I can help further if you define your needs.

        image.png

        Code:
        FUNCTION p_msg_box_pos AS C (title AS C, message as C, buttons ="<OK>", ,horiz_vert_pos as C,image ="")
        
        <<%c%
        horiz_vert_pos format as "10-6"
        %c%
        
        if image=""
            image="img_icon_hsi"
        end if
        
        'DESCRIPTION:Message Box allows user text on buttons.  Buttons= comma or crlf() list, or full xdialog code, Image= information, question, warning, error, or full image name.  Return is button name.
        'EXAMPLES:
        'p_msg_box_pos("test","message here","OK, Cancel","question")
        'p_msg_box_pos("test","message here","button 1 text!one, button 2 text!two","a5_a5icon32")    ' returns "one" or "two"
        'p_msg_box_pos("test","message here","<Button1> <Button2>")
        'p_msg_box_pos("test","message line1"+crlf()+"message line2")
        'TAN-BROWN COLOR:  #170,195,185}
        dim vn_div_now as N
        dim vnwo_div as N
        dim vndiv as N
        dim vmsg as C
        Dim shared vReply as c
        dim pdlg_color as C="{background=hsi msg}"
        
        if len(message)>90
            vn_wo=w_count(message," ")
        
                vnwo_div=int(vn_wo/12)+1
                vndiv=int(vn_wo/vnwo_div)
        
                vmsg=word(message,1," ",vndiv)+crlf()
                vmsg=vmsg+word(message,vndiv+1," ",vndiv)+crlf()
                for i = 2 to 10    
                    vn_div_now=i*vndiv+1                                    
                    vmsg=vmsg+word(message,vn_div_now," ",vndiv)+crlf()
                next
                message=alltrim(vmsg)
        end if
        
        rows=line_count(message)+1
        cols = round_up(max_str_length(message,crlf())*1.4,0)
        
        dlg_format = <<%dlg%
        {font=Arial,10,b}{lf=.5};
        {region1}
        *image_region*
        {region2}
        {sp=3}{lf=.5};
        *msg_text*
        {endregion2}
        {endregion1};
        {lf};
        {line=1,0};
        {region3}
        {justify=center,center}
        *button_region*
        {endregion3};
        %dlg%
        
        dim vhp as C
        dim vvp as C
        vhp=word(horiz_vert_pos,1,"-")
        vvp=word(horiz_vert_pos,2,"-")
        
        dlg_format="{position="+vhp+","+vvp+"}"+dlg_format
        
        '    ***** buttons *****
        'this makes it possible to have a comma in the button text
        'BUTTONS
        if buttons<>""
        
        else
            buttons="<OK>"
            GOTO SKIP_BTN_EVAL
        end if
        
        'change the ">" and "<"
        if occurs(chr(62), buttons) > 0
            buttons = strtran(stritran(buttons,chr(62),crlf()),chr(60),"")
        end if
        
        'change  the ","
        if occurs(chr(44), buttons) > 0
            buttons = stritran(buttons,chr(44),crlf())
        end if
        
        dim vFW as C
        dim vBA as C
        dim vnBLW as N
        dim btn_length as N
        for each foo in buttons
            vFW=alltrim(foo)
            if "!" $ vFW
                vnBLW=len(word(foo,1,"!"))
            else
                vnBLW=len(foo)
            end if
            vBA=vBA+alltrim(foo)+crlf()
        
            'get button length of current button
            if vnBLW>btn_length
                btn_length=vnBLW
            end if
        next
        
            'assign button length to all buttons
            if btn_length > 10
                btn_length = int(btn_length *1.6)
            else
                btn_length = 16
            end if
        
        buttons=vBA
        vBA=""
        'build buttons
        for each foo in buttons
            vFW=alltrim(foo)
            vBA=vBA+chr(60)+btn_length+alltrim(foo)+chr(62)+" "
        next
        
        buttons="{font=arial,10}"+vBA
        
        SKIP_BTN_EVAL:
        dlg_format = stritran(dlg_format,"*button_region*", buttons)
        
        '    ***** image *****
        image_format = <<%dlg%
        {sp5}{image=*img*}
        %dlg%
        
        if image = ""
            image_format = ""
        else if lower(image) $ "question,error,warning,information"
            image_format = stritran(image_format,"*img*", "$sys_"+alltrim(image))
        else
            image_format = stritran(image_format,"*img*",alltrim(image))
        end if
        dlg_format = stritran(dlg_format,"*image_region*", image_format)
        
        '    ***** message *****
        dlg_format = stritran(dlg_format,"*msg_text*","{text=%H=R%"+cols+","+rows+"message}")
        
        vReply = ui_dlg_box(title,pdlg_color+dlg_format)
        p_msg_box_pos_internal = vReply
        
        
        END FUNCTION
        
        ​
        Last edited by Mike Wilson; 03-13-2023, 07:25 PM.
        Mike W
        __________________________
        "I rebel in at least small things to express to the world that I have not completely surrendered"

        Comment


          #5
          Mike's solution is far better for desktop than mine.
          Gregg
          https://paiza.io is a great site to test and share sql code

          Comment


            #6
            To have it be said, because it is not totally easily obtainable from the code, the variable that holds the value of the button selected is in the variable ' vreply '
            Mike W
            __________________________
            "I rebel in at least small things to express to the world that I have not completely surrendered"

            Comment


              #7
              Mike,

              This works great - thanks for sharing!



              Originally posted by Mike Wilson View Post
              The answer is yes, but you have to code your own. I have lots of these depending on the message and dialog flavor I want presented. This one is a derivation from one posted on the boards years ago, maybe by Raymond Lyons? Hope you can use it. You will have to change the values for the image to present and the background color in the variable - pdlg_color - to your needs. I can help further if you define your needs.

              image.png

              Code:
              FUNCTION p_msg_box_pos AS C (title AS C, message as C, buttons ="<OK>", ,horiz_vert_pos as C,image ="")
              
              <<%c%
              horiz_vert_pos format as "10-6"
              %c%
              
              if image=""
              image="img_icon_hsi"
              end if
              
              'DESCRIPTION:Message Box allows user text on buttons. Buttons= comma or crlf() list, or full xdialog code, Image= information, question, warning, error, or full image name. Return is button name.
              'EXAMPLES:
              'p_msg_box_pos("test","message here","OK, Cancel","question")
              'p_msg_box_pos("test","message here","button 1 text!one, button 2 text!two","a5_a5icon32") ' returns "one" or "two"
              'p_msg_box_pos("test","message here","<Button1> <Button2>")
              'p_msg_box_pos("test","message line1"+crlf()+"message line2")
              'TAN-BROWN COLOR: #170,195,185}
              dim vn_div_now as N
              dim vnwo_div as N
              dim vndiv as N
              dim vmsg as C
              Dim shared vReply as c
              dim pdlg_color as C="{background=hsi msg}"
              
              if len(message)>90
              vn_wo=w_count(message," ")
              
              vnwo_div=int(vn_wo/12)+1
              vndiv=int(vn_wo/vnwo_div)
              
              vmsg=word(message,1," ",vndiv)+crlf()
              vmsg=vmsg+word(message,vndiv+1," ",vndiv)+crlf()
              for i = 2 to 10
              vn_div_now=i*vndiv+1
              vmsg=vmsg+word(message,vn_div_now," ",vndiv)+crlf()
              next
              message=alltrim(vmsg)
              end if
              
              rows=line_count(message)+1
              cols = round_up(max_str_length(message,crlf())*1.4,0)
              
              dlg_format = <<%dlg%
              {font=Arial,10,b}{lf=.5};
              {region1}
              *image_region*
              {region2}
              {sp=3}{lf=.5};
              *msg_text*
              {endregion2}
              {endregion1};
              {lf};
              {line=1,0};
              {region3}
              {justify=center,center}
              *button_region*
              {endregion3};
              %dlg%
              
              dim vhp as C
              dim vvp as C
              vhp=word(horiz_vert_pos,1,"-")
              vvp=word(horiz_vert_pos,2,"-")
              
              dlg_format="{position="+vhp+","+vvp+"}"+dlg_format
              
              ' ***** buttons *****
              'this makes it possible to have a comma in the button text
              'BUTTONS
              if buttons<>""
              
              else
              buttons="<OK>"
              GOTO SKIP_BTN_EVAL
              end if
              
              'change the ">" and "<"
              if occurs(chr(62), buttons) > 0
              buttons = strtran(stritran(buttons,chr(62),crlf()),chr(60),"")
              end if
              
              'change the ","
              if occurs(chr(44), buttons) > 0
              buttons = stritran(buttons,chr(44),crlf())
              end if
              
              dim vFW as C
              dim vBA as C
              dim vnBLW as N
              dim btn_length as N
              for each foo in buttons
              vFW=alltrim(foo)
              if "!" $ vFW
              vnBLW=len(word(foo,1,"!"))
              else
              vnBLW=len(foo)
              end if
              vBA=vBA+alltrim(foo)+crlf()
              
              'get button length of current button
              if vnBLW>btn_length
              btn_length=vnBLW
              end if
              next
              
              'assign button length to all buttons
              if btn_length > 10
              btn_length = int(btn_length *1.6)
              else
              btn_length = 16
              end if
              
              buttons=vBA
              vBA=""
              'build buttons
              for each foo in buttons
              vFW=alltrim(foo)
              vBA=vBA+chr(60)+btn_length+alltrim(foo)+chr(62)+" "
              next
              
              buttons="{font=arial,10}"+vBA
              
              SKIP_BTN_EVAL:
              dlg_format = stritran(dlg_format,"*button_region*", buttons)
              
              ' ***** image *****
              image_format = <<%dlg%
              {sp5}{image=*img*}
              %dlg%
              
              if image = ""
              image_format = ""
              else if lower(image) $ "question,error,warning,information"
              image_format = stritran(image_format,"*img*", "$sys_"+alltrim(image))
              else
              image_format = stritran(image_format,"*img*",alltrim(image))
              end if
              dlg_format = stritran(dlg_format,"*image_region*", image_format)
              
              ' ***** message *****
              dlg_format = stritran(dlg_format,"*msg_text*","{text=%H=R%"+cols+","+rows+"message}")
              
              vReply = ui_dlg_box(title,pdlg_color+dlg_format)
              p_msg_box_pos_internal = vReply
              
              
              END FUNCTION
              
              ​

              Comment

              Working...
              X