Alpha DevCon 2018
Results 1 to 11 of 11

Thread: just a thought - colour schemes

  1. #1
    "Certified" Alphaholic richard2007's Avatar
    Real Name
    Richard Harris
    Join Date
    Sep 2007
    Location
    Ashford, Kent, UK
    Posts
    1,087

    Default just a thought - colour schemes

    if an application was to be used by multiple firms who might want the colour scheme of the application to match their own corporate colours, is it possible to offer a colour change option.

    im thinking objects such as buttons, frames, field labels etc.

    is this at all possible?

  2. #2
    Member mariusm's Avatar
    Real Name
    Marius M.
    Join Date
    Sep 2006
    Location
    Plymouth, UK
    Posts
    198

    Default Re: just a thought - colour schemes

    See the attached test database.

    My example is very simple, but you can set just about any property of any object on your forms and browses. You could have some global variables set depending on the user login, and then use the same code in the onInit on all the forms, so all the windows will have the same colours.

    Apparently the gradients for the windows don't work with this method, everything else works OK.
    It is easier to get older than wiser

  3. #3
    "Certified" Alphaholic richard2007's Avatar
    Real Name
    Richard Harris
    Join Date
    Sep 2007
    Location
    Ashford, Kent, UK
    Posts
    1,087

    Default Re: just a thought - colour schemes

    Thanks Marius,

    that is what i would like to achieve. i was just thinking about how the application would be more personal to end users if they could choose their own colour scheme.

    thanks again

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

    Default Re: just a thought - colour schemes

    Some time ago I started looking into this possibility but didn't have the time to continue with it. It was also just a 'I wonder if this is possible project'. Any way, attached is a sample (I butchered Marius' sample, sorry Marius) of using a little talked about feature of A5. ie custom colors.
    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.

  5. #5
    "Certified" Alphaholic
    Real Name
    Cal Locklin
    Join Date
    Mar 2000
    Location
    S.E. Michigan
    Posts
    5,754

    Default Re: just a thought - colour schemes

    I haven't looked into this so maybe this wouldn't be an issue but don't forget to consider "update" issues. If the method of changing colors isn't "update proof", your customers won't be very happy if they have to reset the colors every time you send them an updated version.

    Yes, I'm sure most people are better programmers than me and seldom have to issue updates but I end up doing that quite often so it's something I always keep in mind.;)

  6. #6
    "Certified" Alphaholic richard2007's Avatar
    Real Name
    Richard Harris
    Join Date
    Sep 2007
    Location
    Ashford, Kent, UK
    Posts
    1,087

    Default Re: just a thought - colour schemes

    i tend to have lots of updates as well. would the following idea put too much load on the forms and affect performance.

    i have a table to record each companies details. as part of this i could add additional fields with colour codes selected.

    then use the scripts to change the colour of the objects and as Marius suggested add this script to the on activate or initiate events. depending upon the colour code (ie 1, 2, 3 ,4 etc) depends upon what colours are loaded.

    nice idea i think, but no good if the code to change the colours would greatly affect performance.

    this i think would then solve the issue of updates changing the colours back to the master copies colours.

  7. #7
    "Certified" Alphaholic richard2007's Avatar
    Real Name
    Richard Harris
    Join Date
    Sep 2007
    Location
    Ashford, Kent, UK
    Posts
    1,087

    Default Re: just a thought - colour schemes

    Hi Tim,

    that is really cool. where in your code does it determine what to change. i cant see the background (its still early morning here so forgive me).

    to use this for multiple objects, would i need a duplicate of the code for each object? (ie 1 for background, 1 for buttons etc)

    thanks

    richard

  8. #8
    "Certified" Alphaholic Tom Henkel's Avatar
    Real Name
    Tom Henkel
    Join Date
    May 2002
    Location
    New Jersey, USA
    Posts
    1,831

    Default Re: just a thought - colour schemes

    First of all, Cal, I don't think you have gotten this far by not being such a good programmer.

    Thant said, what about using stylesheets? You can create custom styles as default for screens. If you play your cards right, each customer would have their own version of a standard stype sheet, and then it would be applied no matter what change you make. From what I can see, this should work, provided each site has their own stylesheet.

    Tom

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

    Default Re: just a thought - colour schemes

    Quote Originally Posted by richard2007 View Post
    Hi Tim,

    that is really cool. where in your code does it determine what to change. i cant see the background (its still early morning here so forgive me).
    The code is in the only script (aa) in the code tab. It is very roughly thrown together more as a proof of concept than a proper working model. The only thing the code does is change the definition of the color. So any object property anywhere in the application that you told to use that color will change when the color definition changes. I first set up the custom color that I cleverly called 'myColor' in the Settings area found under the view menu - settings-database-colors. If you would proceed with this method give your color names some kind of standout prefix so you can find them easy in the color picker. Create as many colors as you need to accommodate your scheme. (I don't know if there is a limit) The script loads the custom color definitions into a dot variable. Then after picking a new color the rgb values of that new color are used to alter the definition. The altered definition is then written back to the dictionary.

    to use this for multiple objects, would i need a duplicate of the code for each object? (ie 1 for background, 1 for buttons etc)

    thanks

    richard
    No, not for each object but rather for each color you have defined. I envision that you would probably have a color for each type of object. The code would not be so much duplicated as expanded. The colors are stored in a pointer array variable so you would just be adjusting as many sections of the variable as you have colors. The coding would also depend on the interface you design to manage the colors. It might be a form with a button for each color/type or maybe an xDialog.
    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.

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

    Default Re: just a thought - colour schemes

    Cal,
    I hope that one day I am as bad a programmer as you are. ;)

    Very good point about the updates. You mention in another thread that you keep user settings in text files. After a bit of investigation I found it would not be too hard to write the pointer variable to a text file and thereby keep a copy of the users color choices. Of course just because some of these things are possible does not mean they are practical. Tom Henkel's idea of using style sheets sounds like an interesting avenue to pursue as well. Like I said earlier I started looking at this a while ago when I was finding my way around A5. It was something I looked at as a learning exercise but have never put into use anywhere so I can't comment on performance or reliability.

    Maybe when Richard has a fully working solution he might share it with us. ;)
    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.

  11. #11
    "Certified" Alphaholic richard2007's Avatar
    Real Name
    Richard Harris
    Join Date
    Sep 2007
    Location
    Ashford, Kent, UK
    Posts
    1,087

    Default Re: just a thought - colour schemes

    certainly will. thanks for all the help and ideas everyone.

Similar Threads

  1. Replies: 48
    Last Post: 11-19-2006, 10:12 PM
  2. Refresh Display function not as I thought
    By Jeff Fried in forum Alpha Five Version 7
    Replies: 76
    Last Post: 09-22-2006, 05:44 PM
  3. HELP !!! AlphaSports web, I thought this was simple, (lol)
    By RobertN in forum Web Application Server v7
    Replies: 10
    Last Post: 08-18-2006, 05:14 AM
  4. A Thought for the developers
    By Bob Whitaker in forum Alpha Five Version 6
    Replies: 2
    Last Post: 10-12-2004, 11:21 PM
  5. Just a thought...
    By Jeff Snyder in forum Alpha Five Version 4
    Replies: 1
    Last Post: 08-09-2000, 12:28 PM

Posting Permissions

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