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_get_radio2(): cancel condition?

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

    ui_get_radio2(): cancel condition?

    ui_get_radio2() has two buttons: OK and Cancel. When a default value is set, the function will return the default value regardless of which button is pressed. I would have expected Cancel to return an empty string. Has anyone else noticed this? I don't believe I'm doing anything wrong.
    Adam Backstrom <[email protected]>

    #2
    Re: ui_get_radio2(): cancel condition?

    I have a post in here a couple of months ago on the same thing - it is a bug apparently.

    Sorry I spoke too soon - it was ui_get_list2(). Perhaps you have found another one.

    I suppose you could add Cancel as a radio button choice.
    Last edited by MoGrace; 06-02-2007, 12:30 PM.
    Robin

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

    Comment


      #3
      Re: ui_get_radio2(): cancel condition?

      Originally posted by abackstrom View Post
      ui_get_radio2() has two buttons: OK and Cancel. When a default value is set, the function will return the default value regardless of which button is pressed. I would have expected Cancel to return an empty string. Has anyone else noticed this? I don't believe I'm doing anything wrong.

      I also concur, that when clicking the Cancel button, the default string is returned instead of an empty, null or canceled string. This is not the expected behavior and I would agree a bug.

      Comment


        #4
        Re: ui_get_radio2(): cancel condition?

        The ui_get_radio2() function really does work as long as you don't show a default button.

        If you code it as follow:

        Code:
        res = ui_get_radio2("Pick a color",[COLOR="Red"]""[/COLOR],list,"Color Selection")
        Then if you pick a button and then decide to CANCEL the result will be null

        Here is the code from the help file with no default
        Code:
        dim res as C
        list = a5.Color_Enum()
        list = word(list,1,crlf() ,5)
        res = ui_get_radio2("Pick a color",[color="RED"]""[/color],list,"Color Selection")
        ui_msg_box("Color Choice",res)
        with the default as "" then you could select a button (a color is this case) and then push cancel, the message returned will be null - at least it works that way for me.

        I don't think that it is a bug in Version 7, more than likely it should have been explained better in the help file.

        FWIW

        Tom Baker

        Comment


          #5
          Re: ui_get_radio2(): cancel condition?

          If you want something that always returns <blank> when Cancel is pressed, here's an "AIMS_get_radio()" function that will do it. I left the original test routine in so you can see the slight differences with my version. (The frame title is in bold, there is no limit to the number of buttons except that it will eventually get too tall for the screen, much of that extra space around the OK/Cancel buttons is gone, and the buttons are indented a bit. Personally, I think mine looks more professional but you can easily modify it if you wish.)
          Code:
          list = a5.Color_Enum()
          list = word(list,1,crlf() ,20)
          res = ui_get_radio2("Pick a color","",list,"Color Selection")
          res = aims_get_radio("Pick a color","black",list,"Color Selection")
          ui_msg_box("Color Choice",res)
          
          FUNCTION AIMS_get_radio as C ( title as C, default as C, choices as C, frameTitle="" as C )
           DIM radio_def as C
           DIM rad_chc as C
           rad_chc = default
           dlg_text = <<%dlg%
          {ysize=.3}{units=F}{sp};
          [[frame_def]]
          [[radio_def]]
          {sp=25};
          <*10OK> <10Cancel>
          %dlg%
           btn_cnt = w_count( choices, crlf() )
           IF frameTitle <> ""
            frame_def = "{font=Tahoma,8,b}{frame=1," + ltrim( str( btn_cnt + 1 ) ) + " " + frameTitle + " }{font=Tahoma,8,n};"
           ELSE
            frame_def = ""
           END IF
           dlg_text = stritran( dlg_text, "[[frame_def]]", frame_def )
           radio_def = ""
           FOR qx = 1 to btn_cnt
            radio_def = radio_def + " (rad_chc:" + word( choices, qx, crlf() ) + ");" + crlf()
           NEXT
           dlg_text = stritran( dlg_text, "[[radio_def]]", radio_def )
           DIM dlg_result as C
           dlg_result = ui_dlg_box( Title , dlg_text )
           IF dlg_result <> "OK"
            AIMS_get_radio = ""
           ELSE
            AIMS_get_radio = rad_chc
           END IF
          END FUNCTION
          DISCLAIMER: I just whipped this out in the last few minutes so it's relatively untested. If you use strange characters in your selection list it might mess up - characters like {, }, (, ), <, >, and \ are particularly "dangerous". Initial testing seems to be OK but I can't guarantee it in all circumstances. In other words, "your results may vary."

          Alpha's:


          Mine:
          Last edited by CALocklin; 10-08-2008, 02:20 AM.

          Comment


            #6
            Re: ui_get_radio2(): cancel condition?

            Here's an improved version that adds the ability for the user to hit the "O" or "C" key to "OK" or "Cancel" it from the keyboard. (Of course, they could also OK it with the Enter key or cancel it with the Esc key.)

            If you use this, remember to make sure the list can't be so long that it's taller than your user's screen. Since each screen resolution is a different height, I didn't add any checks for this.
            Code:
            'Date Created: 08-Oct-2008 02:14:02 AM
            'Last Updated: 08-Oct-2008 11:23:02 AM
            'Created By  : Cal Locklin
            'Updated By  : Cal Locklin
             
            FUNCTION AIMS_get_radio as C ( title as C, default as C, choices as C, frameTitle="" as C )
             DIM radio_def as C
             DIM rad_chc as C
             rad_chc = default
             dlg_text = <<%dlg%
            {ysize=.3}{units=F}{sp};
            {on_char=*}
            [[frame_def]]
            [[radio_def]]
            {sp=25};
            <*10&OK> <10Cancel>
            %dlg%
             btn_cnt = w_count( choices, crlf() )
             IF frameTitle <> ""
              frame_def = "{font=Tahoma,8,b}{frame=1," + ltrim( str( btn_cnt + 1 ) ) + " " + frameTitle + " }{font=Tahoma,8,n};"
             ELSE
              frame_def = ""
             END IF
             dlg_text = stritran( dlg_text, "[[frame_def]]", frame_def )
             radio_def = ""
             FOR qx = 1 to btn_cnt
              radio_def = radio_def + "{sp}(rad_chc:" + word( choices, qx, crlf() ) + ");" + crlf()
             NEXT
             dlg_text = stritran( dlg_text, "[[radio_def]]", radio_def )
             DIM dlg_result as C
             dlg_result = ui_dlg_box( Title , dlg_text, <<%code%
            IF a_dlg_button = "o"
             a_dlg_button = "OK"
            ELSEIF a_dlg_button = "c"
             'just quit
            ELSEIF len(a_dlg_button) = 1
             a_dlg_button = ""
            END IF
            %code% )
             IF dlg_result <> "OK"
              AIMS_get_radio = ""
             ELSE
              AIMS_get_radio = rad_chc
             END IF
            END FUNCTION

            Comment

            Working...
            X