Alpha DevCon 2018
Page 2 of 2 FirstFirst 12
Results 31 to 52 of 52

Thread: Row color properties w. xbasic?

  1. #31
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,907

    Default Re: Row color properties w. xbasic?

    Here is the combination of Tim's and a variation of what G illustrated with the right click menu (changes the text for the entire row instead of a single column of a row).


    Attachment 22074
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  2. #32
    "Certified" Alphaholic Tim Kiebert's Avatar
    Real Name
    Tim Kiebert
    Join Date
    Jul 2004
    Location
    Geelong, Victoria, Australia
    Posts
    2,784

    Default Re: Row color properties w. xbasic?

    Quote Originally Posted by Keith Hubert View Post

    OK. You got me beat, how have you split the last column into the three colours?
    I have just added three buttons. Each button returns/triggeres an event that is passed into the function in browse->events->events. I used the corresponding colour name as the event name. The value of 'event' is written to the browse column object value.

    I like Gabe's idea of a right click menu. I think it would give the browse a cleaner presentation. Maybe a narrow column that displays the colour. Having the rows varying colours I find hard to read.
    Tim Kiebert
    Geelong Citrus Packers
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

  3. #33
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,190

    Default Re: Row color properties w. xbasic?

    Quote Originally Posted by Keith Hubert View Post
    Also, apart from changing the colour of the text on the browse, did your code set a field value to enable conditional colour printing?
    Keith:
    Are you deliberately ignoring what I say? I thought maybe I misunderstood the question. Obviously not. You just ignored my last post!

    There is NOTHING in the video that I didn't already mention in that post.

  4. #34
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: Row color properties w. xbasic?

    Tim,

    I have been looking at this with V10 beta and there seems to be a problem as the buttons and code are not visible.

    See attached, this is from V8. The buttons in red boxes are not visible in V10 beta. I shall report it as a bug.

    Gabe,

    I never ignore what you say, we are just a bit on the slow side over here.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  5. #35
    Member
    Real Name
    Geoff Meredith
    Join Date
    Aug 2006
    Posts
    637

    Default Re: Row color properties w. xbasic?

    Keith,

    I was away from my computer yesterday so I didn't get a chance to respond. Looks like others have given you some options but I have attached a sample of one that uses a look up like you first requested and also a right hand menu as you seemed interested in Gabes solution. They both use Peter and Tim's idea of the colour equation, in fact I just cut and pasted from Tim's example and replaced his field name for mine.

    Hope it helps.

    Geoff

  6. #36
    Member
    Real Name
    Geoff Meredith
    Join Date
    Aug 2006
    Posts
    637

    Default Re: Row color properties w. xbasic?

    The buttons in red boxes are not visible in V10 beta. I shall report it as a bug.
    Not a bug. Tim has just set a background colour rather than use a bitmap.

  7. #37
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,190

    Default Re: Row color properties w. xbasic?

    Alright, let's think about this logically:
    1-If you need to print the same colors you see in the browse in a report, this means you have to save them (or some flag) in the table
    2-To save a flag in the table, I suggested a one character-field
    3-If you have a one-character field, then you do not need a right-click a left click or any click or anything for that matter.
    4-All you need is a lookup where the user could choose one of these options, then
    5-In the browse properties, use the conditional expression to change the font, or background or whatever it is you would like to change based on the value in that field.
    6-In the report, you make the font also based on the value in that field.

    No code is needed, no clicks no buttons, nothing.

  8. #38
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,907

    Default Re: Row color properties w. xbasic?

    FWIW:

    Geoff,
    Quote:
    The buttons in red boxes are not visible in V10 beta. I shall report it as a bug.
    Not a bug. Tim has just set a background colour rather than use a bitmap.
    Keith cannot see the buttons in the preview of Edit Display in design mode OR even any buttons at all in design mode---in his v9-v10 amended version.

    G,
    No code is needed, no clicks no buttons, nothing.
    Simplistic is fine but not when it will not do as requested---Keith needs a way to change the color as well--if hard coded then I would agree with the above.

    Peter,
    Now you have to choose a method---nice when so many here show various ways to do something isn't it!
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  9. #39
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,190

    Default Re: Row color properties w. xbasic?

    This is simple basic bread & butter. In the Browse Properties you set the font color as an expression based on the field value.
    No wonder Keith ignores me. I feel like I am speaking Gibberish. It's all there, just open the browse properties, column, then set the font with an expression.

  10. #40
    Member
    Real Name
    Geoff Meredith
    Join Date
    Aug 2006
    Posts
    637

    Default Re: Row color properties w. xbasic?

    The buttons in red boxes are not visible in V10 beta. I shall report it as a bug.
    Not a bug. Tim has just set a background colour rather than use a bitmap.
    Cheers Mike. I missed the bit that stated the pic was from V8.

    G, I guess when Keith gets a chance he can let us know the method that best worked for him.

  11. #41
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,190

    Default Re: Row color properties w. xbasic?

    I don't know what other methods were suggested. I haven't opened any of the zip files. This seemed from the beginning as basic stuff. In fact, my initial instinct was to do my favorite thing: unsubscribe from a thread to stop all the emails. But when a vet like Keith asks the question, you would think there is more to it and when you find that there is no more to it and state that this is basic stuff, what else, you get ignored!
    So, don't look for anything I suggested to be implemented, but it might help somebody else or give others ideas of alternative ways of doing things.

    I have been coloring text in browses since Moses! not sure what the issue is?

  12. #42
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,190

    Default Re: Row color properties w. xbasic?

    Like this..

  13. #43
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: Row color properties w. xbasic?

    Hi Gabe,

    You are not being ignored, so please dont start to get a complex about it.

    Your video is as always very interesting, but it would be of far more value if you would post the sample application instead.

    To see the trick the magician has performed is all very well, on the forum we are more interested in how it was done.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  14. #44
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,190

    Default Re: Row color properties w. xbasic?

    Keith:
    I already said it, twice... maybe there is some justification for my "complex".
    OK, one more time:
    1-Add one more field to your table to hold whatever status you want: Very important, important...etc
    2-Use a simple lookup (or if you want to get fancy with images and color etc, you could create your own lookup menu) with the desired choices.
    3-In the design mode of Browse (or form with embedded browse), right-click the browse, highlight the desired column, go to the "Other" tab, check the box "color Equation", use the expression to say:
    case(fieldx="very Important", "red on white", fieldx=Important", "green on white....etc)

    And that's all there is to it.

  15. #45
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,404

    Default Re: Row color properties w. xbasic?

    Interesting thread - and the only one apparently; too bad all the links are gone.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  16. #46
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,907

    Default Re: Row color properties w. xbasic?

    Robin,

    I saw your post and found a couple of the examples in my Help file...I believe they were from Geoff Meredith and for sure Tim Kiebert. I combined what they did and what I had done into one....I also added a color picker for custom colors but it is not done really--it changes all the column text to the same color but gives the idea anyway. When opening check out the form called browse_text based on Browse_1 table. Dunno what Alpha did but even my attachment is not available in this post.

    Have fun! Any questions you know how to reach me! :-)


    Browse_Row_Column_Colors.zip
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  17. #47
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,404

    Default Re: Row color properties w. xbasic?

    Thanks Mike for the example. What I am working on is to change the row color dynamically based on a related group of records in the browse.

    stylecomp.jpg

    This is the code I put in the OnInit event for the form and browse and in the form's OnFetch event:

    Code:
    dim rw1 as c
    dim rw2 as c
    dim n1 as n
    dim n2 as n
    rw1 = style_key.value+"-1"
    n1 = tablecount("compyarn","compkey = "+quote(rw1))
    browse1.cell[1].count = n1
    
    rw2 = style_key.value+"-2"
    n2 = tablecount("compyarn","compkey = "+quote(rw2))
    browse1.cell[2].count = n2
    browse1.repaint()
    I am getting a bit of a color flash in the browse from the OnFetch event, but so far it seems to be working well. I enabled 2 row colors in the browse properties and set the colors and default count (1) there. I only needed 2 alternating colors to set off the groups regardless of how many yarns there may be in the group (one stripe pattern has 5 - and could be more).

    The script still needs work since adding a 3rd composition (unlikely...) would probably screw it up. Still testing... I probably need to use the mod() function (where is Stan?) to make this work for odd or even composition #'s instead of the way I did it.
    Last edited by MoGrace; 03-23-2017 at 01:48 PM.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  18. #48
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,005

    Default Re: Row color properties w. xbasic?

    I would have to see a sample table before commenting on whether a third composition would mess things up and if mod() could be used to alternate the row colors. You can probably eliminate the flashing issue by adding or utilizing an existing index (on compkey) and changing to dbcount.

    dbcount("compyarn","indextagname",rw1)
    There can be only one.

  19. #49
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,404

    Default Re: Row color properties w. xbasic?

    I thought of using dbcount() but didn't have the index. I don't know if a stripped down sample would work - there are a lot of tables linked into this form, but I'll give it a try... the compositions are added using vars in a script; you can't add them directly in the browse.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  20. #50
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,005

    Default Re: Row color properties w. xbasic?

    If you want the color equation for odd and even rows based on the comp key field it looks like it would be

    Odd rows
    mod(val(right(alltrim(Comp),1)),2)=1
    Even rows
    mod(val(right(alltrim(Comp),1)),2)=0

    Where Comp is the field represented in the comp key column.

    Of course you have to set the same color equation for each column as opposed to the row but you can use the right-click, Advanced, Copy selected properties and paste to the rest once one is set..
    Last edited by Stan Mathews; 03-23-2017 at 04:33 PM. Reason: Al corrected my mod() = comparison
    There can be only one.

  21. #51
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,404

    Default Re: Row color properties w. xbasic?

    Here's a zip to play with: (I used Mike's adb without his tables)

    browserow.zip
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  22. #52
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,404

    Default Re: Row color properties w. xbasic?

    Thanks Stan, the color equation method works much better as there is now no flash as when the color changed with the OnFetch event.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

Similar Threads

  1. Row markers-Can you set the properties?
    By richardurban in forum Web Application Server v7
    Replies: 1
    Last Post: 06-15-2008, 01:41 AM
  2. Browse row color
    By Bill Parker in forum Archived Wishlist
    Replies: 3
    Last Post: 09-16-2006, 07:26 AM
  3. Browse Row color
    By trackmanpete in forum Archived Wishlist
    Replies: 1
    Last Post: 03-10-2006, 06:40 AM
  4. How do I set Row Properties->Row Label?
    By Wanda Tucker in forum Web Application Server v6
    Replies: 1
    Last Post: 08-10-2005, 04:42 AM
  5. Browse Row color
    By John Burke in forum Alpha Five Version 5
    Replies: 7
    Last Post: 02-09-2005, 10:52 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •