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

List box font and background color

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

    List box font and background color

    I have searched the forum and the alpha wiki but cannot find anything on the above -

    Here is a very simple xdialog for a list box

    Code:
    DIM SHARED vc_listing as C
    DIM SHARED varC_result as C
    dim ph_listing as c
    ph_listing=<<%list%
    Bill The Plumber
    Joe the Carpenter
    Harry the Electrician
    John the Truck Driver
    Matt the Delivery guy
    %list%
    
    varC_result = ui_dlg_box("Select Pricing sheet to view",<<%dlg%
    {background=Pale Yellow};
    {region}
    {font=arial,9,b};
    [COLOR="Red"]{color=Dark Yellow};[/COLOR]
    Select Vendor:| [.40,20vc_listing^#ph_listing];
    {endregion};
    {line=1,0};
    {region}
    <15OK!OK> <15CANCEL!CANCEL>
    {endregion};
    %dlg%)
    
    if varC_result="CANCEL" 
    	end 
    end if
    
    msgbox("Vendor Sheet",vc_listing)
    I can create a radio button list which is transparent and show the underlying background color of the dialog box , but I can not find any code that allows you to set the font color or the background color of the listbox itself. The answer probably is that it can't be done and black is the font color and white is the background color of the list box. You can set the color for the button text and the prompt with
    Code:
    {color=}
    as well as the background color of the dialog box itself.

    I am hoping someone might give me a little insight into this.

    Thanks.

    Tom Baker

    The above code works in Version 8 through 10.5

    #2
    Re: List box font and background color

    Per your request.
    Code:
    DIM SHARED x as C
    DELETE a_x		
    DIM a_x[5] as c
    dim lst as c 
    lst = <<%list%
    Joe (not Bill) the Plumber
    Bill the Carpenter
    Harry the Electrician
    John the Truck Driver
    Matt the Delivery guy
    %list%
    
    Dim format as p 
    Format.odd_row_color="#245+247+150"
    Format.even_row_color="#245+247+150"
    Format.odd_selected_color="#247+239+175"
    Format.even_selected_color="#247+239+175"
    Format.font="Arial,8"
    Format.font_color_unselected="#221+64+64"
    Format.font_color_selected="Black"
    Format.lastbutton="OK"
    Format.group_size=1
    Format.number_rows=.f.
    Format.alternating_bands=.f.
    lst = a5_owner_draw_list_fmt(lst,Format)		
    a_x.initialize(lst)
    ui_dlg_box("List Box with different background",<<%dlg%
    {Background=#217+193+57}
    {Region}
    Choices::| [%M;d;O={@@}%.40,5x^#a_x];
    {Endregion}; 
    {line=1,0};
    <OK> <Cancel>
    %dlg%)
    Last edited by G Gabriel; 05-23-2010, 01:28 AM.

    Comment


      #3
      Re: List box font and background color

      Gabe

      Thanks for the insight - and the code

      Thought I would finish this thread with an updated version of the list box code with some additions such as an Xdialog header section, some gradient fill on the background of the dialog box (not the list box), and a dynamic list box that grows or shrinks based on the number of entries in the list be presented (courtesy of Tim Kiebert).

      I have commented the code so it should be easy to understand.

      Again this code works in late version of V8 and in V9 and V10 And V10.5.

      Code:
      DIM SHARED vc_listing as C
      DIM SHARED varC_result as C
      dim ph_listing as c = ""
      delete xdialogstyle
      dim xdialogstyle as p  'use xdialog style sheet
      dim xp as p ' use xdailog header
      
      'create the header body text
      xp.bodytext=<<%text%
      Click on a pricing sheet to view
      %text%
      
      'create the header title and image
      xp.headingtext="Vendor Pricing Sheets"
      xp.image="a5_ball_red"
      
      'create the list for the list box
      ph_listing=<<%list%
      Bill The Plumber
      Joe the Carpenter
      Harry the Electrician
      John the Truck Driver
      Matt the Delivery guy
      %list%
      
      
      newlist=stritran(ph_listing," ","") 'delete spaces between words so "Bill the Plumber" becomes BillThePlumber'
      									'this is to allow the next line to get a count of the idividual records in the list
      									
      
      nrec=alltrim(str(w_count(newlist+1)))  'get the count of the number of records in the list plus 1, then convert to
      									   'a character string	
      
      'the following are format codes for the list box  (courtesty of G. Gabriel)  Thank you
      Format.even_row_color="#200+226+253"
      format.odd_row_color="#200+226+253"
      format.even_selected_color="pale yellow"
      format.odd_selected_color="pale yellow"
      format.font="arial,10,b"
      
      ph_listing=a5_owner_draw_list_fmt(ph_listing,format) 'combines the format code with the records in the list
      
      
      xdialogstyle.AccentColor="Pale blue"  'background accent color and foreground color  for xdialog box
      xdialogstyle.color="White"
      
      'this is the dlg for the dialog box
      'there is a variable in the select vendor code of "__lgth__" which will be replaced with the
      'stritran function result to dynamically enlarge or shrink the list box to the number of records in the list plus 1
      'this is courtesty of Tim Kiebert -thank you
      
      d_body=<<%dlg%
      {nocaption};
      {windowstyle=gradient horizontal};
      {xdialogtitlesection=70,4xp};
      {region}
      {font=arial,9,b};
      {color=black};
      Select Vendor:| [%d;O={@@}%.40,__lgth__vc_listing^#ph_listing!phlis_*];
      {endregion};
      {line=1,0};
      {region}
      {lf};
      {justify=center}
      <15CANCEL!CANCEL>
      {endregion};
      %dlg%
      
      'this is the code for the code section of the dialog
      
      d_code=<<%code%
      if left(a_dlg_button,6)="Phlis_" 
      		if a_dlg_button="Phlis_change" 
      		end
      		else if a_dlg_button="Plis_killfocus" 
      		a_dlg_button="CANCEL"
      		end if
      		a_dlg_button=""
      end if
      %code%
      
      d_body=stritran(d_body,"__lgth__",nrec) ' this changes the variable __lgth__ with the number of lines plus 1 in the list
      
      varC_result=ui_dlg_box("Select Pricing Sheet to View",d_body,d_code) ' this is the dialog box start
      
      
      if varC_result="CANCEL" then
          end
      end if
      
      
      msgbox("Vendor Sheet",vc_listing)  ' shows the name clicked on
      Again thanks to G Gabriel and Tim Kiebert for their solutions to the background of the list box (Gabe) and the replacement of parameters in the xdialog using stritran function (Tim).

      Tom Baker

      Comment


        #4
        Re: List box font and background color

        Tom:
        When I wrote the code, I did it in a bit of a hurry (sleep time) and had assumed that you might need to dynamically adjust the size of the list box and I figured you should be able to do that on your own particularly since the angels were calling and I had to go to sleep!
        You could replace this part of your script:
        Code:
        newlist=stritran(ph_listing," ","") 'delete spaces between words so "Bill the Plumber" becomes BillThePlumber'
        									'this is to allow the next line to get a count of the idividual records in the list
        									
        nrec=alltrim(str(w_count(newlist+1)))  'get the count of the number of records in the list plus 1, then convert to
        									   'a character string
        with:
        nrec=w_count(ph_listing,crlf())

        Comment


          #5
          Re: List box font and background color

          Gabe

          Thanks, I forgot about CRLF() as the delimeter.

          Tom Baker

          Comment

          Working...
          X