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 background color

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

    #16
    Re: xdialog background color

    HINT: (take it or leave it)

    Instead of using something like:
    {Background=__backcolor__}

    I use double square brackets:
    {Background=[[backcolor]]}

    And, yes, there is a method to my madness ==> The double square brackets will REALLY mess up the resulting xdialog and makes it hard to miss if you forget to change them with stritran - BTDT. (see attached screenshot before reading further - then go to the end)

    Here's some code to demonstrate.
    Code:
     fchc = "SomeFolder"
     qty = 9
     dlg_text = <<%dlg%
    {ysize=.3}{units=F}{font=Arial,9,n}{sp}{background=pale yellow}{wrap=75};
    {color=red}{font=Arial,11,b}THIS PROCESS CANNOT BE UNDONE!;{font=Arial,9,n}{color=black}
    {sp};
    Since this process can only be undone by moving each file manually, please verify that the PDF files in the New_Scans folder will be moved to the following destination folder after encryption.;
    {sp};
    {font=Arial,11,b}Files to be Encrypted:{font=Arial,11,b} [[qty]];
    {sp};
    {font=Arial,11,b}Destination Folder:{font=Arial,11,b}{color=red} [[fchc]];
    {color=black}
    {sp};{font=Arial,9,n}
    {justify=center}<*Yes - this above folder is correct!OK> <Oops\! Wrong folder!cancel>
    %dlg%
     'dlg_text = stritran( dlg_text, "[[qty]]", ltrim(str(qty)) )
     dlg_text = stritran( dlg_text, "[[fchc]]", alltrim( fchc ) )
     DIM dlg_result as C
     dlg_result = ui_dlg_box( "VERIFY SCAN FOLDER", dlg_text, <<%code%
    %code%)
    Now, you probably noticed right away that the "qty" wasn't corrected. However, did you notice the PDF 'variable' that wasn't fixed also? I'm sure some will catch it but it would be a lot easier to miss - especially if there were more text - than the [[]] stuff. (That's not in the code above. I added it to the screenshot for demo purposes only.)

    Edit: Actually, this screenshot is a bad example. Often the text being modified is within a paragraph (or at least a sentence or label area) of text and the error becomes even more obvious. In this example, it almost looks like there should be a data entry field where the [[]] was used.
    Last edited by CALocklin; 05-15-2010, 02:39 AM.

    Comment


      #17
      Re: xdialog background color

      I don't know... you could go crazy with this thing.
      Here is just a mundane example:

      Comment


        #18
        Re: xdialog background color

        Maybe something like this will catch your attention:

        Comment


          #19
          Re: xdialog background color

          Tom, you're welcome.

          Cal, thanks for the tip. I guess since I haven't made my first programming mistake yet I did not see the need for something like that.
          Tim Kiebert
          Eagle Creek Citrus
          A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

          Comment


            #20
            Re: xdialog background color

            Originally posted by Tim Kiebert View Post
            Tom, you're welcome.

            Cal, thanks for the tip. I guess since I haven't made my first programming mistake yet I did not see the need for something like that.
            I knew you were good!

            Comment


              #21
              Re: xdialog background color

              One more item in this madness.

              I have a dialog box where the user will be entering dates. I test the dates and if they don't "fit", I throw an error. I would like to give them an "Override" option. I have the "override" button appear when the error occurs. I wanted to get fancy and change its color. I can get the color change, but I don't quite get how to make it a raised button with a visible border. Included is my attempt at the code as well as a snapshot of the dialog. I've highlighted the button property code. As always, any and all help is greatly appreciated.

              Code:
              'Date Created: 05-May-2010 02:54:53 PM
              'Last Updated: 28-May-2010 03:14:28 PM
              'Created By  : Thomas Henkel
              'Updated By  : Thomas Henkel
              DIM clt as P
              DIM lnk as P
              DIM SHARED DLG as L
              DIM SHARED vCASENO as C = ""
              DIM SHARED vSSN as C
              DIM SHARED vFOLDER as C = ""
              DIM v65 as L
              DIM SHARED vNAME as C = ""
              DIM SHARED vPGM as C = ""
              DIM SHARED vSEGM as C = ""
              DIM SHARED vIWORKER as C = ""
              DIM SHARED vCWORKER as C = ""
              DIM SHARED vSWORKER as C = ""
              DIM SHARED vDATE1 as D = {}
              DIM SHARED vDATE2 as D = {}
              DIM SHARED vACTION2 as C = ""
              DIM SHARED vDATE3 as D = {}
              DIM SHARED vSTATUS as C = ""
              DIM SHARED vSTAT_DATE as D = {}
              DIM SHARED vFILEROOM as C = ""
              DIM SHARED vCREASON as C = ""
              DIM SHARED vDREASON as C = ""
              DIM shared vERR_TEXT as C = ""
              DIM OVER as L = .F.
              
              DIM SHARED vERROR as L
              DIM SHARED varC_result as C
              'DIM vIWORKER_rl_def as C 
              'DIM vSWORKER_rl_def as C
              'DIM vACTION2_rl_def as C 
              DIM vSTATUS_rl_def as C
              DIM vCREASON_rl_def as C 
              DIM vDREASON_rl_def as C 
              
              clt = table.open("client",FILE_RO_SHARED)
              'clt = table.current()
              
              vSSN = clt.ssn
              if clt.dob < addyears(date(),-65)
              	v65 = .T.
                else
                	v65 = .F.
              end if
              vNAME = UT(clt.fname)+" "+ut(clt.lname)
              'lets first determine if the client already has a case number
              lnk = table.open("LINK",FILE_RO_SHARED)
              lnk.index_primary_put("Ssn")
              foundit = lnk.fetch_find(vSSN)
              if foundit > 0
              	if isalpha(left(lnk.Case,1))
              		vCASENO = lnk.Case
              	  else
              	  	if left(right(trim(lnk.case),6),1)>"3"
              	  		vCASENO ="S"+right(trim(lnk.case),6)
              	  	  else
              	  	  	vCASENO = "C"+right(trim(lnk.case),6)
              	  	end if
              	end if	
                else
              	script_play_local("reg new case number")
              end if
              if vERROR
              	end
              end if
              lnk.close()
              vSTATUS_rl_def = "k=status,{keylist_build(\"H=.05,1:4,2:25\",''+Status,left(''+Status,4),left(''+Desc,25))}{}"
              vCREASON_rl_def = "ke=closerea,{keylist_build(\"H=.05,1:6,2:15,3:25\",''+Closecode,left(''+Closecode,6),left(''+Category,15),left(''+Describe,25))}{}"
              vDREASON_rl_def = "ke=denyreas,{keylist_build(\"H=.05,1:6,2:15,3:25\",''+Denycode,left(''+Denycode,6),left(''+Category,15),left(''+Describe,25))}{}"
              
              'Save the original full/unfiltered seg list in case a PRG choice ends up creating a blank seg list. A
              'blank seg list (lookup list) will create havoc and lock up the program - a Ctrl-Alt-Del will be required.
              full_seg_list = table.external_record_content_get( "segment","ut(seg)+\"  \"+trim(describe)","seg" )
              seg_list = full_seg_list
              
              PGM_list = table.external_record_content_get( "pgm", "padr(pgm,6,\" \")+trim(desc)","pgm")
              
              action_list = table.external_record_content_get("caseact","padr(ut(action),16,\" \")","ACTION")
              
              full_worker_list = table.external_record_content_get("workers","ut(WCODE)+\" \"+wname","wcode")
              filt1 = "(between(left(wcode,1),\"A\",\"B\").or.left(wcode,1)=\"E\").and.left(WCODE,3)<>\"ADM\".and.left(wcode,2)<>\"AM\".and.left(wcode,2)<>\"AP\".and.left(wcode,2)<>\"AX\".and.left(wcode,2)<>\"BD\".and.left(wcode,2)<>\"BT\""
              worker_list1 = table.external_record_content_get("workers","ut(WCODE)+\" \"+wname","wcode",filt1)
              filt2 = "left(wcode,2)=\"AM\".or.left(wcode,2)=\"AP\".or.left(wcode,2)=\"AX\".or.left(wcode,2)=\"BD\".or.left(wcode,2)=\"BT\""
              worker_list2 = table.external_record_content_get("workers","ut(WCODE)+\" \"+wname","wcode",filt2)
              heading_string = vNAME+"   -   Case No: "+vCASENO+crlf()+"Case Information Entry"
              ok_button_label = "&OK"
              cancel_button_label = "&Cancel"
              
              [COLOR="red"][B]override_button_label = "O&verride"
              button_prop = "{F=Arial,9,B}{C=White}{B=Red}{A=1}Override"[/B][/COLOR]
              varC_result = ui_dlg_box(agency+ " Customer Information",<<%dlg%
              {Background=#234+255+255}
              {region}
              {text=45,2:heading_string}{SP=3}- Information marked with "{color=red}*{color=black}" is {color=red}{font=arial,9,b}REQUIRED{font=arial,8,n}{color=black};
              {endregion};
              
              {line=1,0};
              {lf};
              {region}
              Program{color=red}*{color=black}: [%O={@@}%.25vPGM^+pgm_list!vPGM_*]{sp=5}
              Segment{color=red}*{color=black}: [%O={@@}%.25vSEGM^+seg_list!vSEGM_*];
              {lf};
              Application Date{color=red}*{color=black}: 
              [%DATE;P=popup.calendar(dtoc(vDATE1));I=popup.calendar%.15vDATE1!vDATE1_*]{sp=3}
              Registration Date{color=red}*{color=black}: 
              [%DATE;P=popup.calendar(dtoc(vDATE2));I=popup.calendar%.15vDATE2!vDATE2_*]{sp=3}
              Registration Action{color=red}*{color=black}: [%O={@@}%.25vACTION2^+action_list!vACTION2_*];
              {lf};
              Intake  Worker{color=red}*{color=black}: [%O={@@}%.20vIWORKER^+worker_list1!vIWORKER_*]{sp=3}
              Redet Worker{color=red}*{color=black}: [%O={@@}%.20vCWORKER^+worker_list1!vCWORKER_*]{sp=3}
              Service Worker: [%O={@@}%.20vSWORKER^+worker_list2!vSWORKER_*];
              {endregion};
              {lf};
              {region}
              Case Status: [%@vSTATUS_rl_def%.8vSTATUS]{sp=3}
              Status Date: 
              [%DATE;P=popup.calendar(dtoc(vSTAT_DATE));I=popup.calendar%.15vSTAT_DATE!vSTAT_DATE_*]
              {endregion}{sp=3}
              {condition=(vSTATUS="C")}
              {region=a}
              Close Reason: [%@vCREASON_rl_def%.8vCREASON]
              {sp=3}Close Date: [%DATE;P=popup.calendar(dtoc(vDATE3));I=popup.calendar%.15vDATE3!vDATE3_*]
              {condition=(vSTATUS="D")}
              {start_pos}
              {sp=3}Deny Reason: [%@vDREASON_rl_def%.8vDREASON]{endregion};
              {condition=.T.}
              {region}
              {lf};
              File Room{color=red}*{color=black}:  (vFILEROOM:3) (vFILEROOM:4)
              {endregion};
              {frame=1,2:Error Messages}
              {Region}
              {color=red}{font=arial,9,b}{text=90,3vERR_TEXT}{font=arial,8,n}{color=black};
              {endregion};
              {lf};
              {line=1,0};
              {region}
              {justify=left}<*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
              {sp=50}{condition=(over=.T.)} [B][COLOR="Red"]<%O={@@};B=T%=button_prop!OVERRIDE>[/COLOR][/B] {condition=.T.}{endregion};
              %dlg%,<<%code%
              if left(a_dlg_button,6) = "vSEGM_" then
              	trace.WriteLn( "SEG - " + a_dlg_button )
              	if a_dlg_button = "vSEGM_setfocus"
              		vPGM = word(vPGM,1)
              	END IF	
                  if a_dlg_button = "vSEGM_killfocus"
                  	vERR_TEXT=""
                  	if vSEGM = ""
                  		vERR_TEXT="Segment MUST be SELECTED"
                  		ui_dlg_ctl_goto(agency+ " Customer Information","vSEGM")
                  	end if
                  	'debug(1)
                      'determine if Medicaid,  If so, change case number to appropriate "02" number
                      if vPGM = "MED"
                      	SELECT
                              case vSEGM="CCPD".or."GO"$vSEGM.or.vSEGM="JCAD".or.vSEGM="TTW".or.vSEGM="MOCM".or.vSEGM="MOAL".or.vSEGM="JCNH".or.vSEGM="MONH"
                                   if v65
                                       vCASENO="0210"+right(trim(vCASENO),6)
                                     else
                                         vCASENO="0220"+right(trim(vCASENO),6)
                                  end if
                         		 	vFOLDER = vCASENO
                              case word( vSEGM, 1 )="MNC".or.vSEGM="MNNH"
                                   if v65
                                       vCASENO="0215"+right(trim(vCASENO),6)
                                     else
                                         vCASENO="0225"+right(trim(vCASENO),6)
                                  end if    
              				 	vFOLDER = vCASENO
                              case word( vSEGM, 1 )="FAM"
              		  		 	vFOLDER = vCASENO
                                   vCASENO="0230"+right(trim(vCASENO),6)
                              case word( vSEGM, 1 )="FCA"
              				 	vFOLDER = vCASENO
                                   vCASENO="0270"+right(trim(vCASENO),6)
                              case else
                         		 	vFOLDER = vCASENO
              '                    vCASENO = vCASENO
                          END SELECT       
                          'refresh the heading string
                          heading_string = vNAME+"   -   Case No: "+vCASENO+crlf()+"Case Information Entry"
                      end if
                  end if
                  a_dlg_button = ""
                ELSEIF left(a_dlg_button,5) = "vPGM_" then
                  trace.WriteLn( "PGM - "+a_dlg_button )
                  IF a_dlg_button = "vPGM_killfocus"
                  	vERR_TEXT = ""
                  	if vPGM = ""
                  		vERR_TEXT = "Program MUST be selected"
                  		ui_dlg_ctl_goto(agency+ " Customer Information","vPGM")
                  	end if
                  	'vPGM = word(vPGM,1)
                      filt = replace_parameters("trim(prog) = word([varC->vPGM],1)",local_variables())
                      'SAME THING:  filt = "trim(prog) = '" + vPGM + "'"
                      'The "seg_list" returned here must be formatted like the original seg_list so it MUST include
                      'the Tab stuff. Just use the original line and add the filter.
                      seg_list = table.external_record_content_get("segment","ut(seg)+\"  \"+trim(describe)","seg",filt )
                      'All "heck" breaks loose if the lookup list is blank so I added this JIC.
                      IF seg_list = ""
                          'Return it to the full list.
                          seg_list = full_seg_list
                      END IF
                  END IF
                  a_dlg_button = ""
                ELSEIF left(a_dlg_button,7) = "vDATE1_" then
                  if a_dlg_button = "vDATE1_setfocus" then
                  	vERR_TEXT=""
                  	if vSEGM = ""
                  		vERR_TEXT="Segment MUST be SELECTED"
                  		ui_dlg_ctl_goto(agency+ " Customer Information","vSEGM")
                  	  else
              	  		vSEGM = word(vSEGM,1)
                  	end if
              	end if  			
                  if a_dlg_button = "vDATE1_killfocus" then
                  	'vDATE1 = ctod(dtoc(vDATE1))
                    	vERR_TEXT = ckdates(vDATE1, "Application Date","B",60)
                      if vERR_TEXT <>""
                      	over=.T.
                          ui_dlg_ctl_goto(agency+ " Customer Information","vDATE1")
                      end if
                  end if
                  a_dlg_button = ""
                ELSEIF left(a_dlg_button,7) = "vDATE2_" then
                  if a_dlg_button = "vDATE2_killfocus" then
                      'vDATE2 = ctod(dtoc(vDATE2))
                      vERR_TEXT = ckdates(vDATE2, "Registration Date","B")
                      if vERR_TEXT <>""
                      	over= .T.
                      	ui_dlg_ctl_goto(agency+ " Customer Information","vDATE2")
                      end if
              		vERR_TEXT = ckdates(vDATE2, "Registration Date","F")
                      if vERR_TEXT <>""
                      	over=.T.
                      	ui_dlg_ctl_goto(agency+ " Customer Information","vDATE2")
                      end if
                  end if
                  a_dlg_button = ""
                ELSEIF left(a_dlg_button,4) = "vACT" then
                  trace.WriteLn( "ACTION - "+a_dlg_button )
                  IF a_dlg_button = "vACTION2_killfocus"
                  	vERR_TEXT = ""
                  	if vACTION2 = ""
                  		vERR_TEXT = "Registration Action MUST be selected"
                  		ui_dlg_ctl_goto(agency+ " Customer Information","vACTION2")
                  	end if
                 end if
                 a_dlg_button = ""
                ELSEIF left(a_dlg_button,4) = "vIWO" then
                  trace.WriteLn( "IWORKER - "+a_dlg_button )
                  IF a_dlg_button = "vIWORKER_killfocus"
                  	vERR_TEXT = ""
                  	if vIWORKER = ""
                  		vERR_TEXT = "Intake Worker MUST be selected"
                  		ui_dlg_ctl_goto(agency+ " Customer Information","vIWORKER")
                  	end if
                 end if
                 a_dlg_button = ""
                ELSEIF left(a_dlg_button,4) = "vCWO" then
                  trace.WriteLn( "CWORKER - "+a_dlg_button )
                 	if a_dlg_button = "vCWORKER_setfocus"
                 		if vIWORKER = ""
                  		vERR_TEXT = "Intake Worker MUST be selected"
                  		ui_dlg_ctl_goto(agency+ " Customer Information","vIWORKER")
                  	  else
                			vIWORKER = word(vIWORKER,1)
                  	end if
              	end if	
                  IF a_dlg_button = "vCWORKER_killfocus"
                  	vERR_TEXT = ""
                  	if vCWORKER = ""
                  		vERR_TEXT = "Redet Worker MUST be selected"
                  		ui_dlg_ctl_goto(agency+ " Customer Information","vCWORKER")
                  	  else
                			'vCWORKER = word(vCWORKER,1)
                  	end if
                 end if
                 a_dlg_button = ""
                ELSEIF left(a_dlg_button,4) = "vSWO" then
                  trace.WriteLn( "SWORKER - "+a_dlg_button )
                 	if a_dlg_button = "vSWORKER_setfocus"
                 		if vCWORKER = ""
                  		vERR_TEXT = "Redet Worker MUST be selected"
                  		ui_dlg_ctl_goto(agency+ " Customer Information","vCWORKER")
                  	  else
                			vCWORKER = word(vCWORKER,1)
                  	end if
                 end if
                 a_dlg_button = ""
                ELSEIF left(a_dlg_button,7) = "vDATE3_" then
                  if a_dlg_button = "vDATE3_killfocus" then
                      'vDATE3 = ctod(dtoc(vDATE3))
              		vERR_TEXT = ckdates(vDATE3, "Close Date","B")
                      if vERR_TEXT <>""
                      	ui_dlg_ctl_goto(agency+ " Customer Information","vDATE3")
                      end if
              		vERR_TEXT = ckdates(vDATE3, "Close Date","F",60)
                      if vERR_TEXT <>""
                      	ui_dlg_ctl_goto(agency+ " Customer Information","vDATE3")
                      end if
                  end if
                  a_dlg_button = ""
                ELSEIF left(a_dlg_button,11) = "vSTAT_DATE_" then
                  if a_dlg_button = "vSTAT_DATE_killfocus" then
                      vSTAT_DATE = ctod(dtoc(vSTAT_DATE))
                  end if
                  a_dlg_button = ""
                ELSEIF a_dlg_button ="OK"
                	if w_count(vIWORKER)>1
                		vIWORKER = word(vIWORKER,1)
                	end if
                	if w_count(vCWORKER)>1
                		vCWORKER = word(vCWORKER,1)
                	end if
                	if w_count(vSWORKER)>1
                		vSWORKER = word(vSWORKER,1)
                	end if
                	if vFILEROOM = ""
                		vERR_TEXT = "File Room MUST be selected"
                  	ui_dlg_ctl_goto(agency+ " Customer Information","vFILEROOM")
                  	a_dlg_button = ""
               	end if
              end if
              %code%)
              
              
              if varC_result <>"OK"
              	ui_msg_box(Agency+" Customer Information","Action cancelled at user request")
              	end
              end if
              end
              Tom

              Comment

              Working...
              X