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

xdialog help please

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

    xdialog help please

    I need to make 2 changes to the code below.
    1. The number 6 is now hardcoded, I need it to be the variable var->vdaysleft

    2. The text Upgrade XXXXXXXXX and the text Continue to useXXXXXXX
    needs to be buttons so I can control the events.

    Thanks
    Charlie Crimmel

    'Date Created: 10-Dec-2009 08:36:06 AM
    'Last Updated: 10-Dec-2009 08:36:06 AM
    'Created By : E009933
    'Updated By : E009933
    'Create an XDialog dialog box to prompt for parameters.
    DIM vdaysleft as P
    dim vdaysleft.object as p
    dim vdaysleft.class as c
    DIM global vdaysleft as C
    var->vdaysleft="6"
    vdaysleft.class = "dhtmledit.dhtmledit"
    DIM GLOBAL varC_result as C
    DIM vdaysleft_html as c
    vdaysleft_html = <<%html%
    <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
    <html><head><title></title><link rel=stylesheet type=text/css
    href="a5res:defaultStyle\(default)" media=screen><link rel=stylesheet
    type=text/css href="a5res:defaultStyle\(default)" media=screen><link
    rel=stylesheet type=text/css href="a5res:defaultStyle\(default)" media=screen>
    <meta content="text/html; charset=unicode" http-equiv=Content-type><link
    rel=stylesheet type=text/css href="a5res:defaultStyle\(default)" media=screen>
    <meta name=GENERATOR content="MSHTML 8.00.6001.18852">
    <style>
    <!--
    p { margin-top: 0; margin-bottom: 0 }
    -->
    </style>
    </head>
    <body>
    <p align=center><font size=3 face=Arial>You have</font></p>
    <p align=center><font size=3 face=Arial></font>&nbsp;</p>
    <p align=center><font color=#ff0000 size=5
    face=Arial><strong>6</strong></font></p>
    <p align=center><font size=3 face=Arial></font>&nbsp;</p>
    <p align=center><font size=3 face=Arial>days left on your 30 - day
    subscription</font></p>
    <p align=center><font size=3 face=Arial></font>&nbsp;</p>
    <p align=center><font size=3 face=Arial>To upgrade or renew your license, please
    select the following</font></p>
    <p align=center>&nbsp;</p>
    <p align=center><font size=3 face=Arial></font>&nbsp;</p>
    <p align=center><font size=3 face=Arial>Upgrade BSE Accounting
    License</font></p><p align=center><font size=3 face=Arial></font>&nbsp;</p>
    <p align=center><font size=3 face=Arial></font>&nbsp;</p>
    <p align=center><font size=3 face=Arial></font>&nbsp;</p>
    <p align=center><font size=3 face=Arial>OR</font></p>
    <p align=center><font size=3 face=Arial></font>&nbsp;</p>
    <p align=center><font size=3 face=Arial>Continue using BSE Accounting in DEMO
    Mode.</font></p></body></html>
    %html%

    'Force the background color of the html text to be Win3D so that it blends in with the Xdialog box.
    dim win3dcolor as c
    win3dcolor = ui_color_format("win3d","#rhghbh")

    vdaysleft_html = a5_html_background(vdaysleft_html,win3dcolor)
    ok_button_label = "&OK"
    cancel_button_label = "&Cancel"
    Delete XdialogStyle
    dim XDialogStyle as p
    XDialogStyle.AccentColor = "White"
    XDialogStyle.Color = "#51+102+255"
    varC_result = ui_dlg_box("BSE Accounting",<<%dlg%
    {Windowstyle=Gradient Horizontal Bottom}
    {startup=init}
    {region}
    | {activex=80,25vdaysleft?.f.};
    {endregion};
    {line=1,0};
    {region}
    <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
    {endregion};
    %dlg%,<<%code%
    if a_dlg_button = "init" then
    a_dlg_button = ""
    vdaysleft.object.browsemode = .t.
    vdaysleft.object.appearance = 0
    vdaysleft.object.ScrollBars = .f.
    on error goto vdaysleft_error
    vdaysleft.object.documenthtml = vdaysleft_html
    on error goto 0
    vdaysleft.object.Refresh()
    a_dlg_button = ""

    end if
    end

    vdaysleft_error:
    ui_msg_box("Error","Invalid URL or HTML content.",UI_STOP_SYMBOL)
    end
    %code%)
    Last edited by crimmelcp; 12-10-2009, 09:56 AM.

    #2
    Re: xdialog help please

    Charlie,

    I realize it is really cool to use the html and all, but couldn't you just do this all in straight x_dialog? I think the issue here is how to get a variable into the HTML code. We could do this quite easily in x_dialog without all the html, even with the font sizing and colors.

    Tom

    Comment


      #3
      Re: xdialog help please

      See this; It needs some error checking, but it should do what you want...

      Code:
      'Date Created: 10-Dec-2009 08:36:06 AM
      'Last Updated: 10-Dec-2009 08:36:06 AM
      'Created By : E009933
      'Updated By : E009933
      'Create an XDialog dialog box to prompt for parameters.
      DIM global vndaysleft as C
      var->vndaysleft="1"
      dim win3dcolor as c 
      win3dcolor = ui_color_format("win3d","#rhghbh")
      'vdaysleft_html = a5_html_background(replace_parameters(vdaysleft_html,local_variables()),win3dcolor)
      ok_button_label = "Upgrade Licence"
      cancel_button_label = "Continue in DEMO Mode"
      Delete XdialogStyle
      dim XDialogStyle as p
      XDialogStyle.AccentColor = "White"
      XDialogStyle.Color = "#51+102+255"
      varC_result = ui_dlg_box("BSE Accounting",<<%dlg%
      {Windowstyle=Gradient Horizontal Bottom}
      {startup=init}
      {region}
      {font=arial,12,B}You have 
      {color=red,white}{font=arial,16,bold} {text=vndaysleft}
      {color=black,white}{font=arial,12,B} days left on; 
      your 30 day subscription ;
      To upgrade or renew your licence,;
      Please select the "Upgrade" button Below;
      {endregion};
      {line=1,0};
      {region}
      <*40,2=ok_button_label!OK>; 
      <40,2=cancel_button_label!CANCEL>
      {endregion};
      %dlg%,<<%code%
      if a_dlg_button = "init" then 
      a_dlg_button = ""
      end if
      %code%)
      end

      Comment


        #4
        Re: xdialog help please

        Thanks Tom:
        I would use Xdialod with out the HTML if I could figure out how to center the text on selected rows.

        You have

        6

        days left in your subscription

        needs to be centered within the xdialog box

        Comment


          #5
          Re: xdialog help please

          {justify=center}

          P.S.
          Didn't read your html script.

          Comment


            #6
            Re: xdialog help please

            HINTS:
            - This is one of the keys to making really fancy xdialogs... Move the "dlg_text" outside of the ui_dlg_box() function so you can really manipulate it any way you want. (Note how I handled the "1" day left - it works much better than using {text=} because the {text=} always takes up a set amount of space. By using stritran() to insert the desired text, the result will take up only whatever space is needed whether the text consists of 1 character or 50. I surround the text I want to replace with [[...]] because it was something I could easily identify at a glance. First, they are easy to see in the script itself. Second, if I forget to change them, it's really obvious during testing. (try it!) If I simply inserted some unique text such as changethis, then it wouldn't stand out if I forgot to change it.)
            - Add a {ysize=.3} so that the ";" characters will give about 1/3 line per character when there is nothing else on the line. This helps a lot with getting a nice looking dialog.
            - STOP USING UNNECESSARY REGIONS!!! (One of my pet peeves in case you couldn't guess.) Every time you use a {region}, it adds (forces) extra space at the bottom of the region. By taking out the regions (neither of which was necessary), you have more control over the spacing because YOU add the spacing as you want it. My result has less space at the bottom of the last button ONLY because I removed the {region}. There is also less space between the initial text and the horizontal 'separator' line.
            - Note that I removed the "ok_button_label" and "cancel_button_label" variables. (Another pet peeve.) They are almost never needed and, as far as I'm concerned, just add more confusion. Just put the text in the button and leave out the "=" sign.
            - {line} commands always need to be left justified. (i.e., if everything else is center justified, you will have to add a "{justify=left}" before the {line} command and another {justify=center} after it.)
            - Line spacing can get really weird sometimes. When it does, it's usually best to leave the line as one long one rather than starting new lines in the middle of a "sentence". Remember that the only thing that should be used to start a new line in an xdialog is a ";" symbol - not just adding a carriage return of your own in the input text. (When I first started editing the script, the lines started overlapping. I've run into that before and just had to play with it and, quite often, getting each output line on one line in the xdialog definition solved the problem - note that the first line was split after the "{text=vndaysleft}" even though it wasn't the actual end of the output line. (confused yet?))

            This one has everything centered, smaller horizontal spaces as noted above, and no weird spacing around the number of days. (I also take out that "create xdialog to prompt..." - more useless drivel. I often add a comment to tell what the xdialog really does but that one is virtually useless. Besides, this isn't really prompting for parameters; it's warning that the registration is about to expire.)

            Code:
             'Date Created: 10-Dec-2009 08:36:06 AM
            'Last Updated: 10-Dec-2009 08:36:06 AM
            'Created By : E009933
            'Updated By : E009933
            DIM GLOBAL vndaysleft as C
            var->vndaysleft = "1"
            DIM win3dcolor as C
            win3dcolor = ui_color_format( "win3d", "#rhghbh" )
            'vdaysleft_html = a5_html_background(replace_parameters(vdaysleft_html,local_variables()),win3dcolor)
            DELETE XdialogStyle
            DIM XDialogStyle as P
            XDialogStyle.AccentColor = "White"
            XDialogStyle.Color = "#51+102+255"
            dlg_text = <<%dlg%
            {Windowstyle=Gradient Horizontal Bottom}
            {ysize=.3}
            {startup=init}
            {justify=center}
            {font=arial,12,B}You have {color=red,white}{font=arial,16,bold}[[vndaysleft]] {color=black,white}{font=arial,12,B} days left on;
            your 30 day subscription.;
            To upgrade or renew your license,; please select the "Upgrade" button Below ;;
            {justify=left}{line=1,0};
            {justify=center}
            {sp};
            <*40,2Upgrade License!OK>;
            <40,2Continue in DEMO Mode!CANCEL>
            %dlg%
            dlg_text = stritran( dlg_text, "[[vndaysleft]]", vndaysleft )
            varC_result = ui_dlg_box( "BSE Accounting", dlg_text, <<%code%
            IF a_dlg_button = "init" THEN
                a_dlg_button = "" 'Huh? This doesn't do anything. I assume it's just a place holder for the future.
            END IF
            %code% )
            END'

            Comment

            Working...
            X