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

Ui_msg_box() Codes

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

    Ui_msg_box() Codes

    I made a little spreadsheet that prints to a 1/2 sheet that fits in my manual so I can lookup up the numeric code value instead of using the UI labels. These numbers were listed in the v4.5 manual but not in the later versions. I liked using the numbers, and I thought others might too.
    Robin

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

    #2
    Mo, that is terrific. I have a copy from an early Alpha book Steve Workings made for me at the convention in I think 2001. I'm used to adding the numbers together, and my copy is quite faded - this will be a very handy utility - thanks a lot!!

    for those not familiar with its use, you can say something like this:

    Code:
    response=ui_msg_box("Select","You are about to pack tables and permanently remove deleted records - Continue?",276)
    if response=6
    else
         end
    end if 
    'continue code here
    276 is ui_yes_no with a stop symbol and makes the critical system sound, with 'No' as the default button, in case they just hit the ENTER key.
    '6 is the response "yes"
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    [email protected]

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

    Comment


      #3
      Wouldn't it be nice

      Robin,

      Great reference, thank you! Gee, onebmight wonder why this isn't easily available documentation(I searched and nada). Send it to Ed at Alpha and ask him to make it available EASILY in the documentation.

      Mike W
      Mike W
      __________________________
      "I rebel in at least small things to express to the world that I have not completely surrendered"

      Comment


        #4
        Re: Ui_msg_box() Codes

        I lost my own spreadsheet and was looking for this thread so I could reprint it. But in the the meantime was playing with a new spreadsheet and realized I could just make a table - and a function with an Xdialog. I haven't really progressed too far in 4 years...

        But here is the table and function if any other oldies like me still like using the number values. I thought I'd put it in my code library.

        Edit:
        I should have line up those boxes better if I really knew what I was doing! ;)
        Robin

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

        Comment


          #5
          Re: Ui_msg_box() Codes

          Bill Parker already made one - see the code archive
          Cole Custom Programming - Terrell, Texas
          972 524 8714
          [email protected]

          ____________________
          "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

          Comment


            #6
            Re: Ui_msg_box() Codes

            Funny, I tried a search on "Bill Parker" in this archive and didn't find it. But here it is:

            http://msgboard.alphasoftware.com/al...ight=p_msg_box

            In the meantime I improved my spacing somewhat on the Xdialog.
            Robin

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

            Comment


              #7
              Re: Ui_msg_box() Codes

              FWIW - I like using the numbers (faster to type) and pretty much have them memorized. However, I quit using them about a year or so ago. I'm afraid anyone who takes over my apps in the future will have no idea what they are.

              My solution to the extra typing, again, is keyboard macros. If you write xbasic and aren't using a keyboard macro program then you are wasting a lot of your time. For my message box button/symbol macros, each button starts with "ui" and each symbol starts with "uis". I even have some combined "button/symbol" macros.

              For example:
              uisa = ui_attention_symbol
              uiss = ui_stop_symbol
              uisi = ui_information_symbol
              uisq = ui_question_symbol
              uiyn = ui_yes_no
              uioc = ui_ok_cancel
              uiqy = ui_question_symbol+ui_yes_no

              Not only are the macros shorter to type but they are also easier to type because they don't include special characters and easier to remember than numbers because there is a logic to the naming.

              And, just to give you a little more idea of what you can do with macros:

              Here's the result of my standard "starting point" xdialog macro "dlgc" and when it's done it leaves the cursor between the quotes so I can type the title. The result is that I only need 4 characters to create something like 258 (don't forget to count the keystrokes to get back to the quotes). And, yes, I used the macro to 'type' it here also:

              dlg_text = <<%dlg%
              {ysize=.3}{units=F}{font=font_face,fsize,n}{sp};

              {sp};
              {justify=center}<*15OK> <15Cancel>
              %dlg%
              dlg_text = xd_set_fonts( dlg_text, "A", 9 )
              DIM dlg_result as C
              dlg_result = ui_dlg_box( "", dlg_text, <<%code%
              %code%)


              Another thing I do with a macro (in this case a hot key) is use it to make the field labels in my xdialogs bold. Typing in the font settings manually is way too labor intensive to bother. However, I really think they look better with bold labels and with a hot key it's just one keystroke per label. I can take this:
              First Name: [.20,1fname];
              to this:
              {font=font_face,fsize,b}First Name: {font=font_face,fsize,n}[.20,1fname];
              with one keystroke.

              (In case you couldn't figure it out, I also use my "xd_set_fonts" UDF for setting the actual font so I can change them easily.)

              One developer actually saw one of my xdialogs with lots of labels and basically said, "Holy Cow! Why do you waste so much time making all those labels bold?"
              Last edited by CALocklin; 06-27-2010, 10:50 AM.

              Comment


                #8
                Re: Ui_msg_box() Codes

                Cal you really need to give us a Jing video so we can understand what you are doing! For those of us without a keyboard macro program, the Code Library is a great tool too.
                Robin

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

                Comment


                  #9
                  Re: Ui_msg_box() Codes

                  Sorry, no Jing video. Will a WMV do? It's probably longer to download (5 meg) but it's something I'm already familiar with.

                  http://www.aimsdc.net/keyboard_macro_demo.wmv

                  I'll be curious to hear some reactions - pro or con.

                  FYI: I referred at one point to using my xd_set_fonts() function in the demo then forgot to identify it. At one time I was changing fonts a lot in xdialogs because users were complaining about the size being too small. So, I decided to set up my font definitions as:
                  {font=font_face,fsize,n}
                  Then, since the xdialog definition is just a text string, create a function to actually set the font using stritran(). So, to get a font of Arial, 9 as in the demo I would just use:
                  dlg_text = xd_set_fonts( dlg_text, "A", 9 )

                  I did not include the bold, italic, or normal in that because those settings can change within the dialog text string many times.

                  If I decide that I want something a bit different, say Times Roman 14, I simply change the one command and it changes every font definition in the xdialog:
                  dlg_text = xd_set_fonts( dlg_text, "TR", 14 )

                  And if I want to use a "non-standard" font such as Garabaldi I just have to spell it out completely. My "standard" fonts are Arial, Courier New, Times Roman, Verdana, MS Sans Serif, Helvetica, and Tahoma.

                  EDIT: I also just realized I didn't show the use of the ui_msg_box() buttons but I think you will get the idea. After watching the video it should be clear what I can do with it:

                  jjmsg gives this:

                  msg = "
                  ui_msg_box( "", msg )

                  and I'm ready to type the title then press the Up arrow and type the message.

                  msg = "This is the message. I like to put it on a separate "
                  msg = msg + "line because it can get terribly long sometimes."
                  ui_msg_box( "TITLE", msg )


                  Then jjuiqy adds the buttons and question symbol at the end:

                  msg = "This is the message. I like to put it on a separate "
                  msg = msg + "line because it can get terribly long sometimes."
                  ui_msg_box( "TITLE", msg, ui_question_symbol+ui_yes_no )


                  Note: The part in blue is a hot key - Ctl_Shift-M. I use it so often that I did it here out of habit before even realizing what I was doing.
                  Last edited by CALocklin; 06-27-2010, 06:06 PM.

                  Comment


                    #10
                    Re: Ui_msg_box() Codes

                    Just taking a break from washing my car and saw your video - Wow! So often with XD especially, it seems that once I have got something going, I forget what I was doing when I want to do it again. Can you make groups / sub directories for these macros as well in the program you are using?

                    I know you have mentioned this program before - how about a link?

                    btw - nice voice...
                    Robin

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

                    Comment


                      #11
                      Re: Ui_msg_box() Codes

                      I'll be danged! As long as I've been using it I never noticed that you can, indeed, save the macros under various categories. However, I think all categories would be accessible at the same time but ...

                      It's also easy to save a group of macros as one file then create another group as another file and switch back and forth between them. For example, you could have one file that you use for Alpha and another for word processing and another for HTML. I've never bothered with more than one but it is possible. (I bet you could even create a macro to do the switch for you!)

                      And you can specify whether any given macro should play in all windows or only a specific window.

                      I think the only advantages to multiple files would be (1) you could use the same macro keystrokes to do different things in different apps (but wouldn't that be confusing?) and (2) you wouldn't have to worry about specifying which window a macro should work in. However, since all my macros are for Alpha -after all it's the only thing I do that's repetitive enough to warrant macros - neither of those things means much to me.

                      The program I use is Macro Express. I think mine is the regular (not Pro) version. And, no, I wouldn't recommend their Keyboard Express or HotKeys programs. I'm sure they work fine but Macro Express has both keyboard shortkeys and hotkeys and I use both so why buy two separate programs and pay more?

                      One last thing. You gotta see this! I was looking at their site and saw something I've never seen before. It's truly amazing. Someone created a macro that draws - it doesn't play; it draws - a Tetris game. Watch their "You did what!?" link. About 3/4 of the way through they give you some idea of what they did.

                      Comment


                        #12
                        Re: Ui_msg_box() Codes

                        Cal,

                        Is it possible to get the font style for Ui_msg_box()?


                        msg = "This is the message. I like to put it on a separate "
                        msg2 = msg + "line because it can get terribly long sometimes."
                        msg3 = "line because it can get terribly long sometimes."
                        ui_msg_box( "TITLE", msg+crlf()+msg3 )

                        vmsg = <<%text%
                        "This is the message. I like to put it on a separate "

                        and control the font
                        %text%
                        vmsg = ut(vmsg)
                        ui_msg_box( "font", vmsg )

                        vNotice =Ui_dlg_box("Notice",<<%dlg%
                        {wrap=40}
                        {font= arial, 12, b }
                        Alpha Five contains a powerful programming language called Xbasic. Xdialog is an
                        extension of Xbasic that allows you to create dialog boxes.;
                        %dlg%)

                        vResult = ui_msg_box("Msg box",vNotice)

                        Comment


                          #13
                          Re: Ui_msg_box() Codes

                          Nope - not as far as I know. The only possibility might be to set the default font somewhere in the "View / Settings" area but I've never tested it. I know there is at least one font setting somewhere in there but if I've ever used it, it was only out of curiosity when I first found out about the feature and that would have been a longgggg time ago.

                          There is another possibility - write your own replacement for ui_msg_box() using xdialog.

                          Comment


                            #14
                            Re: Ui_msg_box() Codes

                            Take a look at this thread. I believe you will find what you need there.

                            http://msgboard.alphasoftware.com/al..._msg_box%28%29
                            Mike W
                            __________________________
                            "I rebel in at least small things to express to the world that I have not completely surrendered"

                            Comment


                              #15
                              Re: Ui_msg_box() Codes

                              Another example, but not as complete as what the thread MikeW linked to, is one by Ira Perlow I gleaned from the message board a while back (have the one from the linked thread also). It may have some additional value.

                              An example of a UI_MSG_BOX() replacement code looks like this. This is a very limited version, I'm sure it can be enhanced to be more compatible.

                              Code:

                              'Date Created: 01-Aug-2008 10:47:19 AM
                              'Last Updated: 01-Aug-2008 12:37:23 PM
                              'Created By : Ira J. Perlow
                              'Updated By : Ira J. Perlow
                              FUNCTION ui_msg_box AS N (title="" as c,message="" as c,box_style=0 as n,modeless=.f. as L)

                              ' Supported box_styles
                              dim UI_OK as n=0
                              dim UI_OK_CANCEL as n=1

                              'ui_msg_box(title,message,box_style)
                              dim dlgevt as c
                              dlgevt=<<%code%
                              dim buttxtu as c
                              buttxtu=UPPER(ALLTRIM(a_dlg_button))
                              a_dlg_button=""

                              if (buttxtu=="CANCEL").or.(buttxtu=="CLOSE")
                              a_dlg_button="2"
                              IF ui_modeless_dlg_exist(title)
                              ui_modeless_dlg_close(title)
                              END IF
                              else if (buttxtu=="OK")
                              a_dlg_button="1"
                              IF ui_modeless_dlg_exist(title)
                              ui_modeless_dlg_close(title)
                              END IF
                              else if (buttxtu=="TIMER")
                              ' For demonstration, show the time in the statusbar
                              statusbar.set_text(time())
                              else if (buttxtu=="INIT")
                              ' Other init code here
                              end if
                              end
                              %code%

                              dim dlgbdy as c
                              dlgbdy=<<%dlg%
                              {startup=init}
                              {can_exit=close}
                              {timer=timer}
                              {interval=1}
                              ;;;
                              %dlg%

                              dlgbdy=dlgbdy+message+<<%dlg%
                              ;;;;;;;;;
                              {justify=center}{initial_focus}<13OK!OK>%dlg%

                              ' If UI_OK_CANCEL, add the button
                              IF (box_style .and. 1)=1
                              dlgbdy=dlgbdy+<<%dlg%
                              {sp=1.1}<13Cancel!CANCEL>%dlg%
                              END IF

                              ' trailing space
                              dlgbdy=dlgbdy+";;;"

                              ' OK, Yes, No
                              dim tmpn as n
                              IF modeless
                              ui_modeless_dlg_box(title,dlgbdy,dlgevt)
                              tmpn=0
                              ELSE
                              tmpn=ui_dlg_box(title,dlgbdy,dlgevt)
                              ' if it was closed by the X, we need to modify the value
                              IF tmpn=0
                              IF (box_style .and. 1)
                              tmpn=2
                              ELSE
                              tmpn=1
                              END IF
                              END IF
                              END IF

                              ' Return the value
                              ui_msg_box=tmpn

                              END FUNCTION

                              __________________

                              Regards,

                              Ira J. Perlow
                              Mike
                              __________________________________________
                              It is only when we forget all our learning that we begin to know.
                              It's not what you look at that matters, it's what you see.
                              Henry David Thoreau
                              __________________________________________



                              Comment

                              Working...
                              X