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

    xdialog background color

    I have an xdialog box thatI use for both Entry of a new client, and edit of an existing client. I would like to make it obvious to the operator which mode they are in. For Entry mode, I want to use a pale blue background, and for change mode, I want to use a pale yellow background. I have a variable "vMODE" which is set to either "E" or "C" when the script is called. I have tested with a {condition} around the background color selections, but to no avail. Does anyone have an idea on howto accomplish this?

    Code:
    varC_result = ui_dlg_box(agency+" Customer Information",<<%dlg%
    {condition=(vMODE="E")}{Background=#234+255+255}
    {condition=(vMODE="C")}{Background=#254+254+193}
    {condition=.T.}
    tried this, too!

    Code:
    if vMODE = "E"
    	backcolor = "#234+255+255"
      elseif vMODE = "C"
      	backcolor = "#254+254+193"
      else
    	backcolor = "#234+255+255"
    end if  	
    
    ok_button_label = "&OK"
    cancel_button_label = "&Cancel"
    varC_result = ui_dlg_box(agency+" Customer Information",<<%dlg%
    {Background=backcolor}

    Attached are views of the dialog as I would like for it to appear in each mode.

    Thanks,

    Tom
    Last edited by Tom Henkel; 05-12-2010, 12:42 PM.

    #2
    Re: xdialog background color

    Tom

    You can use Xdialogstyle

    The code below is from one of my menu's

    You could add "if then" coding to change the xdialogstyle.accentcolor and xdialogstyle.color to what you want.

    Code:
    ok_button_label = "&OK"
    cancel_button_label = "Close"
    Delete XdialogStyle
    dim XDialogStyle as p
    XDialogStyle.AccentColor = "pale blue"
    XDialogStyle.Color = "white"
    varC_result = ui_dlg_box("Order Entry Main Menu",<<%dlg%
    {position=remember=OEMenu}
    {Windowstyle=Gradient Horizontal Top}

    Tom Baker

    Comment


      #3
      Re: xdialog background color

      I'll give it a shot and let you know how it works out.


      Thanks

      Tom

      Comment


        #4
        Re: xdialog background color

        Got it to go, but there must be an easier way to do the definition. I tried it with only one color and using solid solid solid, but got nothing. using this code, it came out just how it should.

        Code:
        if vMODE = "E"
        	XDialogStyle.AccentColor = "aqua white"
        	XDialogStyle.Color = "aqua white"
          elseif vMODE = "C"
        	XDialogStyle.AccentColor = "Pale Yellow"
        	XDialogStyle.Color = "Pale Yellow"
          else
         	XDialogStyle.AccentColor = "pale blue"
        	XDialogStyle.Color = "white"
        end if  	
        
        ok_button_label = "&OK"
        cancel_button_label = "&Cancel"
        varC_result = ui_dlg_box(agency+" Customer Information",<<%dlg%
        {Windowstyle=Gradient Horizontal Top}
        There should be some better way than having to define a gradient using the same color for both color and accent. Is there some place where "xdialogstyle" is defined? I looked in the help file and couldn't see anything about {windowstyle}

        Tom

        Comment


          #5
          Re: xdialog background color

          Tom

          Try the format route

          Code:
          if vMODE = "E"
          	format=<<%dlg%
          	{background=#234+255+255}
          	%dlg%
            elseif vMODE = "C"
            	format=<<%dlg%
            	{background=#254+255+101}
            	%dlg%
            else
            	format=<<%dlg%
          	{background= #234+255+255}
          	%dlg%
          end if  	
          
          ok_button_label = "&OK"
          cancel_button_label = "&Cancel"
          varC_result = ui_dlg_box(agency+" Customer Information",format,<<%dlg%
          
          'no {background=} goes here the code in format takes care of it
          'the rest of your code goes here
          UI_dlg_box takes a third paramter of format

          Try this with your code

          I am in work right now, so don't have too much time to tinker with it.


          Oh I think that the xdialogstyle was introduced in Version 8. I will try to find something on it tonight.

          Hope this one help you

          Tom Baker

          Comment


            #6
            Re: xdialog background color

            That's pretty cool!

            Thanks for all your help. Now all I need is for my data entry people to test things out...

            Tom

            later...
            just pasted the code in. getting error code 1515 "too many parameters".

            Are you sure this works with v9?
            Last edited by Tom Henkel; 05-12-2010, 02:26 PM.

            Comment


              #7
              Re: xdialog background color

              Tom

              I don't normally use that parameter. As I had said I was in work and would try the code later. But I tried the code on another of my menus and got the same error.

              It seems that the format parameter is not going to work the way that I wanted it to. Unless the format has the code for the forms in it.

              In other words the code that creates your xdialog form would have to be repeated three times to get the desired results.

              Sorry about that.

              I will keep working on this this when I get home tonight. Sorry I did not work out the way I intended.

              I normally use the Xdialogstyle but knew there was another way, just have to find it.

              The problem that originally occured in your script was that the {Background=} does not take a variable. It should but it doesn't look like it does.

              The answer is there, Just have to find it.

              I'll keep plugging.

              Again sorry about the bad code.

              Tom Baker

              Comment


                #8
                Re: xdialog background color

                Thanks for trying.

                This is the problem I've been having with v9. Alpha states that things work, then when put to the test, they blow up in your face.

                I went back to the gradient code using the same color for both. It works for now, but I will try o find a better solution.

                Tom

                Comment


                  #9
                  Re: xdialog background color

                  Tom

                  You can use Xdialogstyle.color="" with xdialogstyle.accentcolor="pale blue" instead of repeating the color. You need both xdialogstyle.color and xdialogstyle.accentcolor, but only the accentcolor needs a color specified, the xdialogstyle.color can be "". The accentcolor is the background color.

                  Code:
                  if vMODE = "E"
                  	XDialogStyle.AccentColor = "sea green"
                  	XDialogStyle.Color = ""
                    elseif vMODE = "C"
                  	XDialogStyle.AccentColor = "Pale Yellow"
                  	XDialogStyle.Color = ""
                    else
                   	XDialogStyle.AccentColor = "pale blue"
                  	XDialogStyle.Color = ""
                  end if  	
                  
                  ok_button_label = "&OK"
                  cancel_button_label = "&Cancel"
                  varC_result = ui_dlg_box(agency+" Customer Information",<<%dlg%
                  {Windowstyle=gradient horizontal}
                  Also the {windowstyle=} for color can be Gradient Horizontal

                  Tom Baker

                  Comment


                    #10
                    Re: xdialog background color

                    Tom:
                    Are you looking for something like this?

                    Comment


                      #11
                      Re: xdialog background color

                      G,

                      What I am attempting to do is to use the same dialog for entry and for change. I want to make it VERY obvious to the operators which mode they are in. See my first post in this thread. I was attempting to use the {condition=} directive, but it didn't work. Tom showed me how to do it with the windowstyle parameter, but it only looked like a gradient. I just want to switch between 2 colors.

                      Tom

                      Comment


                        #12
                        Re: xdialog background color

                        I think the 'third' parameter, format, Tom B is referring to is actually the xdialog definition. First parameter is the title, second is the format(definition), and third parameter is the event code.

                        Tom H,

                        Take the dialog definition out of the actual dialog function call and assign it to a variable. Then build up this variable. Here stritran is used just before the call of the dialog to 'insert' the computed color.

                        Code:
                        dim vMODE as C = "C" 'change this value for testing
                        
                        dim backcolor as C
                        if vMODE = "E"
                            backcolor = "#234+255+255"
                          elseif vMODE = "C"
                              backcolor = "#254+254+193"
                          else
                           backcolor = "#234+255+255"
                        end if
                        
                        dim dlg_title as C
                        dim dlg_body as C
                        dim dlg_code as C
                        dim agency as C = "Tom H's"
                        
                        dlg_title = agency+" Customer Information"
                        
                        dlg_body = <<%dlg%
                        {Background=__backcolor__}
                        A whole bunch of stuff goes here.                And some more over here.;
                        {lf};
                        <OK><Cancel>
                        %dlg%
                        
                        dlg_code = <<%code%
                        If a_dlg_button = "OK" then
                            msgbox("Data is OK. Closing the dialog")
                        end if
                        %code%
                        
                        
                        
                        dlg_body = stritran(dlg_body,"__backcolor__",backcolor)
                        
                        'msgbox(dlg_body)
                        varC_result = ui_dlg_box(dlg_title,dlg_body,dlg_code)
                        This is a slightly shorter bit of logic
                        Code:
                        dim backcolor as C = "#234+255+255" 'the Enter color and default color
                        IF vMODE = "C"
                            backcolor = "#254+254+193"      'the Change color
                        END IF
                        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


                          #13
                          Re: xdialog background color

                          I'm out of the office on Thursday, but I will try this on Friday morning.


                          Thanks,

                          Tom

                          Comment


                            #14
                            Re: xdialog background color

                            Tim

                            Thanks for the code.

                            It will be going into MY code archive.

                            Tom B

                            Comment


                              #15
                              Re: xdialog background color

                              Tim,

                              That did it perfectly!


                              Thanks so much.

                              Tom:D

                              Comment

                              Working...
                              X