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_dlg_refresh()

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

  • ui_dlg_refresh()

    This is not seeming obvious to me. A button on an xdialog will change the number of radio buttons that are displayed on the xdialog. That seems to be working, but the xdialog is not refreshing to shift other objects down to make room for the new elements. Instead the new elements paint under existing elements.

    The code for the button is
    Code:
    if a_dlg_button = "counts_by_letter_button_click"
    	button_xbasic = <<%code_string%
    debug(1)
    vLetternames = get_count_by_lettername(report_list, t)
    'must add back the "all" option
    vLetternames = "All  (" +records_found +")" +crlf() +vLetternames 
    ui_dlg_refresh("Print Letters")
    %code_string%
    	evaluate_template(button_xbasic)
    	a_dlg_button = ""
    end if
    Images are before and after the button click. What am I missing in order to get the new radio buttons to not paint under existing objects?

    Bill.

  • #2
    Re: ui_dlg_refresh()

    here are the images.

    Comment


    • #3
      Re: ui_dlg_refresh()

      Hi Bill,

      There might be another way, it's late and I'd have to thing about it more clearly. But in general, just call the exact same dialog title, with a different body and the same event (I generally use a common one that has all events I could possible process for that dialog), as in ui_modeless_dlg_box(original_title, new_body, original_eventcode)
      instead of the ui_refresh()
      Regards,

      Ira J. Perlow
      Computer Systems Design


      CSDA A5 Products
      New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
      CSDA Barcode Functions

      CSDA Code Utility
      CSDA Screen Capture


      Comment


      • #4
        Re: ui_dlg_refresh()

        The problem is not in the code but rather in the body of the xdlg.
        You can overcome this in 2 different ways:
        1-Either make the part that holds the radio buttons an embedded modeless xdlg, OR
        2-Make the radio buttons horizontal instead of vertical, i.e. substitute the crlf() with space.

        Comment


        • #5
          Re: ui_dlg_refresh()

          Thanks guys,

          Ira's way does display the dlg box correctly the 2nd time, but it is a second copy of the dlg box (there are now 2).

          I pretty much need a vertical radio because I don't know how many items there will be, but should be < 10.

          Have not tried the embedded modeless dlg, but the issue is moving the original objects on the dialog that were not part of the radio. I would need to provide room for that modeless dlg to paint.

          So for now I have added {lf=10}; to provide some space for the updated radio to fit, and then ui_dlg_refresh() works fine. (I must also initially set the width of the radio to the max width it might attain.)

          I'll submit as a bug because dlg_refresh() seems to just repaint the one control. Ira's approach does rerun all the code, and that at least gets the display right.

          Bill.

          Comment


          • #6
            Re: ui_dlg_refresh()

            Hi Bill,

            Originally posted by Bill Parker View Post
            Ira's way does display the dlg box correctly the 2nd time, but it is a second copy of the dlg box (there are now 2).
            If you use the exact same dialog box title as the original, the original is replaced by the newer one. There should be no new dialog box. I do this all the time, and this is exactly how Alpha 5 does rollups. Just look at an example with rollups in Learning XDialog.
            Regards,

            Ira J. Perlow
            Computer Systems Design


            CSDA A5 Products
            New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
            CSDA Barcode Functions

            CSDA Code Utility
            CSDA Screen Capture


            Comment


            • #7
              Re: ui_dlg_refresh()

              Ira,

              I now see I was not clear in the initial post that this is a ui_dlg_box(), not a ui_modeless_dlg_box().

              Bill.

              Comment


              • #8
                Re: ui_dlg_refresh()

                Seems slow simply because I am running out of memory..

                Comment


                • #9
                  Re: ui_dlg_refresh()

                  G

                  as you can imagine, it is of no help if you don't say what you did.

                  is this a modal xdialog?

                  Bill.

                  Comment


                  • #10
                    Re: ui_dlg_refresh()

                    Bear with me.. it needs a bit of improvisation which means I need to dig out some code I wrote before to do this but can't do much during business hours.

                    Hint...
                    Best time to post a question on the board: weekends.

                    Comment


                    • #11
                      Re: ui_dlg_refresh()

                      Hi Bill,

                      A bit more help here. Some sample code that acts like a modal dialog, but is internally modeless.

                      Code:
                      dim choices as c
                      choices = "Shared" + crlf()+ "Read only" + crlf()+ "Exclusive"
                      
                      dim mode as c
                      mode = "Read only"
                      
                      dim dlgtit as c
                      dlgtit="Title"
                      
                      dim dlgbdy as c
                      dlgbdy=<<%dlg%
                      Filename: [.32filename];
                      Open as? ;
                      {region}(mode=choices){endregion};
                      <OK> <more!more>
                      %dlg%
                      
                      dim dlgevt as c
                      dlgevt=<<%code%
                      dim buttxt as c
                      ' Get button text
                      buttxt=a_dlg_button
                      ' Clear button
                      a_dlg_button=""
                      
                      if (buttxt="CLOSE").or.("CANCEL" $ UT(buttxt))
                          result=""
                          ' Close dialog box
                          IF ui_modeless_dlg_exist(dlgtit)
                              ui_modeless_dlg_close(dlgtit)
                          END IF
                          end
                      ELSE if (buttxt="MORE")
                          IF line_count(choices)>3
                              choices = "Shared" + crlf()+ "Read only" + crlf()+ "Exclusive"
                          ELSE
                              choices = "Shared" + crlf()+ "Read only" + crlf()+ "Exclusive"+crlf()+"Abc"+crlf()+"def"
                          END IF
                          ui_modeless_dlg_box(dlgtit,dlgbdy,dlgevt)
                      ELSE if (buttxt="OK")
                          result=mode
                          ' Close dialog box
                          IF ui_modeless_dlg_exist(dlgtit)
                              ui_modeless_dlg_close(dlgtit)
                          END IF
                          end
                      END IF
                      %code%
                      ui_modeless_dlg_box(dlgtit,dlgbdy,dlgevt)
                      
                      while ui_modeless_dlg_exist(dlgtit)
                          ui_yield()
                          xbasic_wait_for_idle()
                      end while
                      
                      ' show result here
                      ui_msg_box("end result",result)
                      Regards,

                      Ira J. Perlow
                      Computer Systems Design


                      CSDA A5 Products
                      New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
                      CSDA Barcode Functions

                      CSDA Code Utility
                      CSDA Screen Capture


                      Comment


                      • #12
                        Re: ui_dlg_refresh()

                        Works just fine, Ira. The CPU is at 50% while it is looping, waiting for dlg to close, but that will not be for too long.

                        Is ui_dlg_refresh() supposed to work for both modal and modeless? Using this function, the display has the same problem as with the modal dlg. No worries, the ui_modeless_dlg_box() does the job.

                        Bill.

                        Comment


                        • #13
                          Re: ui_dlg_refresh()

                          Selwyn replied that the layout of an xdialog can't be dynamically changed, just the controls repopulated. So Ira's approach is the most direct and easy to adapt for an existing dialog.

                          Selwyn also suggested an approach of putting an html window on an xdialog, since html is easily changed dynamically. That sounds like something worth investigating, but not in the heat of battle.

                          Bill.

                          Comment

                          Working...
                          X