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

Super control - xdialog box

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

    Super control - xdialog box

    Hi there,

    I was looking at another thread and Peter Wayne's post is something that I would like to use to solve a 'filter' for some lookups. Ideally I would like to have a combo box instead of a list box but that is not really important.

    My main question that I have is how do I use Peter Wayne's Xdialog box with all the functionality and make it modeless so that I can put this in the super control.

    OK, so I gave this a shot and came up with this code (adapted from Peter Wayne code):

    Code:
    'Put code here to DIM any variables used in your Xdialog.
    dim shop=""
    dim poolOwners=" "
    dim owner=""
    dim testdate as d=date()
    dim analysisID as c=""
    'IMPORTANT: Do not change the dialog title.
    ui_modeless_dlg_box(dlgTitle,<<%dlg%
    {background=<Transparent>}
    {region}
    {region}
    Shop: |[%O={@@}%.30,5shop^#poolShops!chosen];
    Owner: |[%O={@@}%.30,3owner^#poolOwners?shop\>""]
    {endregion}|{region}
    {sp=3}Analysis ID: |[.16analysisID];
    {sp=3}Test Date: |[%DATE%.14testdate]
    {endregion}
    {endregion};
    {lf};
    
    %dlg%,<<%code%
    
    
    %code%)
    This is Peter Wayne's code for posterity.

    Code:
    tree=table.external_record_content_get("customer","trim(Bill_State_Region)","Bill_State_Region",\
    "unique_key_value()")
    
    reslt=ui_dlg_box("Choose customer",<<%dlg%
    [%S=BLR;D="\"%.40,15node^<tree!navigate];
    
    <OK?(occurs(chr(92),node)=2)> <Cancel>;
    %dlg%,<<%code%
    if a_dlg_button="navigate" then
        a_dlg_button=""
        children=filter_string(tree,node+chr(92),crlf(),.f.)
        if children="" then  ' this node has not been expanded yet
    	    nodeLevel=occurs(chr(92),node)
    	    select
    	    	case nodeLevel=0 
    	        ' we just chose a state
    	        cities=table.external_record_content_get("customer","trim(bill_city)","bill_city",\
    	        "bill_state_region="+quote(node)+" .and. unique_key_value()")
    	        cities=*for_each(tag,node+chr(92)+tag,cities)
    	        tree=stritran(tree,node,trim(cities))
    	      case nodeLevel=1
    	        ' we have a state and a city
    	  		
    	        state=word(node,1,"\\")
    	        city=word(node,2,"\\")
    	       ' tree=stritran(tree,state,node)
    	        customers=table.external_record_content_get("customer","Lastname-', '+Firstname",\
    	        "Lastname-', '+Firstname","bill_state_region="+quote(state)+" .and. bill_city="+quote(city))
    	        customers=*for_each(tag,node+chr(92)+tag,customers)
    	        tree=stritran(tree,node,trim(customers))
        end select
        end if
    end if 
    %code%)
    
    if reslt="OK" then
    	customer=word(node,3,"\\")
        ui_msg_box("You chose",customer+crlf()+"from "+city-", "+state)
    end if
    I was able to bind the analysis ID and date but that was it. The dialog box work but the filters do not (as you can see in Peter Wayne's post.

    I am not quite sure about Xdialog, but it looks very powerful and would love to use it extensively. Any help would be most appreciated. Many thanks.

    Wei-Yen Tan
    Last edited by Tanman; 06-12-2008, 06:44 PM. Reason: Grammar changing

    #2
    Re: Super control - xdialog box

    Wei-Yen,
    You need to do something like this:
    Code:
    dlg_title="Analysis Xdialog"
    dim owner=""
    dim testdate as d=date()
    dim analysisID as c=""
    ' now, initialize poolshops with shop_name
    dim poolshops as c=\
    table.external_record_content_get("poolshops",\
    "'{DATA='+shop_id+'}'+shop_name","shop_name",".t.")
    
    
    'IMPORTANT: Do not change the dialog title.
    ui_modeless_dlg_box(dlgTitle,<<%dlg%
    {background=<Transparent>}
    {region}
    {region}
    Shop: |[%O={@@}%.30,5shop^#poolShops!chosen];
    Owner: |[%O={@@}%.30,3owner^#poolOwners?shop\>""]
    {endregion}|{region}
    {sp=3}Analysis ID: |[.16analysisID];
    {sp=3}Test Date: |[%DATE%.14testdate]
    {endregion}
    {endregion};
    {lf};
    
    %dlg%,<<%code%
    if a_dlg_button="chosen" then
     poolowners=table.external_record_content_get("pool_owners",\
    "owner_name","owner_name","shop_id="+quote(shop))
    ui_modeless_dlg_refresh(dlg_title)
    %code%)
    Of course, you have to put the actual field names from your own tables in where I wrote "shop_id","shop_name",
    and "owner_name".

    Comment


      #3
      Re: Super control - xdialog box

      Hi Peter,

      I took your advice and put in the code in the super control so that it combines what you had before in the other post into the code snippet that you put in here. I got this:

      Code:
      dlg_title="Analysis Xdialog"
      dim owner=""
      dim testdate as d=date()
      dim analysisID as c=""
      ' now, initialize poolshops with shop_name
      dim poolshops as c=\
      table.external_record_content_get("pool shops",\
      "'{DATA='+shopid+'}'+Company_name","Company_name",".t.")
      
      
      'IMPORTANT: Do not change the dialog title.
      ui_modeless_dlg_box(dlgTitle,<<%dlg%
      {background=<Transparent>}
      {region}
      {region}
      Shop: |[%O={@@}%.30,5shop^#poolShops!chosen];
      Owner: |[%O={@@}%.30,3owner^#poolOwners?shop\>""]
      {endregion}|{region}
      {sp=3}Analysis ID: |[.16analysisID];
      {sp=3}Test Date: |[%DATE%.14testdate]
      {endregion}
      {endregion};
      {lf};
      
      %dlg%,<<%code%
          a_dlg_button=""
          poolOwners=table.external_record_content_get("pool owners",\
          "'{DATA='+Poolownerid-'}'-Last_Name-','+trim(First_Name)","Last_Name+First_Name",\
          "Company_Name="+quote(shop))
      ui_modeless_dlg_refresh(dlg_title)
      %code%)
      unfortunately it comes up with a blank screen. I am kind of scratching my head as to what I have done wrong as I have defined the boxes and everything looks right.

      Your help is appreciated.

      Comment


        #4
        Re: Super control - xdialog box

        A couple of things:
        1) You have both dlg_title and dlgTitle. Make it one or the other -- dlgTitle is undefined when you launch the modeless xdialog.
        2) You should have
        dim shop as c=""
        in the initialization, otherwise the "shop" variable may not be character.
        You also may need
        dim poolOwners as c=" "
        in the initialization so that the Xdialog can properly allocated space for that listbox.
        3) check that you have all the right field names. put
        showvar(poolshops)
        in after you initialize the poolshops and make sure it was actually populated.

        You're making great progress!!

        Comment

        Working...
        X