Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Completely changing the color of a form

Posted on 2004-10-27
23
Medium Priority
?
816 Views
Last Modified: 2012-08-14
Hi,

In Delphi, changing the color of a form doesn't affect the colors of buttons on this form, as well as the color of its main menu. Is there any way to totally change the color of the form, with all its controls?

Vadim Smolensky,
Saint-Petersburg, Russia
0
Comment
Question by:VSmolensky
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
  • 4
  • +2
23 Comments
 
LVL 2

Expert Comment

by:DarkCore_
ID: 12419791
Directly I think not ... but you can do a cursor for all components ...

for i := 0 to ComponentCount - 1 do Begin
    Components[i].Color := FormColor;
End;
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 12419856
there is some buttons that have a property Color in the JEDI package of components (TJvImgBtn, TJvHTButton)
http://homepages.borland.com/jedi/jvcl/
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 12419876
about TJvHTButton, when the property ParentColor is True (it is as defalt True) the button gets the color from the parent Form
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Expert Comment

by:phervers
ID: 12421337
Well there's a lot of problems with changing colors of components. Most are using winApi and their color cannot be changed. There is a way to do this but it will also change colors in all other apps. I was recently writing an app for a client who insisted to have all controls green. Some controls as buttons can be changed easily, but i was forced to write scrollbar component and use xp style mainmenu to fulfill client demands. One solution to make custom look for an app you can find here -> http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_21184223.html i won't repeat myself the question was similiar...
0
 

Author Comment

by:VSmolensky
ID: 12423732
Thank you all for your comments.

Unfortunately, Components[i].Color doesn't work, which is only natural because TComponent has no Color property. Either I didn't understand something or you meant something different.

I've downloaded the JEDI package of components but can't understand what to do next. It seems to be an independent software which I have to install and use it for generating all their components. It that right? Isn't there a way of just installing the component I need?
0
 
LVL 2

Expert Comment

by:DarkCore_
ID: 12424003
As Said by esoftbg ... you can't control the back color of  most of components located in "Standard" Palette, but you can do with TMenuItems ( defining the OnDrawItem Event )

Also, all other components that have the property "Color" , as an example:
  if Components[i] is TMemo then TMemo( Components[i] ).Color := clWhite;

TButtons doesn't have the TColor Property or the OnDraw event, because are "painted" directly by windows, also the TBitButton. Of course you can use TSpeedButtons, but then you can't focus them with keyboard.

jedi is a collection of components that install into your Delphi Palette and becomes integrated with Delphi and your applications ( if you use them ). Then you can use the Jedi replacement for TButton,but this implies You must replace your buttons for this Jedi's button in all your application.

Edu
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 12424322
you have yet a directory:
....\JCL+JVCL210FullInstall
run from it:
Install.bat
and it will be apper:
Project JEDI Delphi Installer
Read carefully the check boxes to see what will be installed
Click on the button Install
and you will have JEDI - VCL Package installed
0
 

Author Comment

by:VSmolensky
ID: 12424889
> you have yet a directory:
> ....\JCL+JVCL210FullInstall

Sorry, I haven't got a directory with such a name. Install.bat lies in the root directory called jvcl. When I run it, the installation started, but stopped at the step "Choose IDE targets" with the message "No JCL 1.9 found" - and it's still there, whatever directory I choose.
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 12425043
o.k. the direct link for JEDI package version 2.10 stable is:
http://belnet.dl.sourceforge.net/sourceforge/jvcl/JCL+JVCL210FullInstall.zip
download and unzip the file and you will have  directory ....\JCL+JVCL210FullInstall
0
 

Author Comment

by:VSmolensky
ID: 12425269
I have already downloaded JVCL300BETA2Complete.zip - isn't it more or less the same?
0
 

Author Comment

by:VSmolensky
ID: 12425328
Following the advice of phervers, I've downloaded the evaluation version of ThemeEngine. It seems to be a very powerful instrument. Would it be better to use ThemeEngine for making proper buttons than JEDI?
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 12425364
I am using vrsion 2.10, but it may be doesn't matter .... I hope it is a stable version ....
Just install it and from the tab Jv Additional you could be able to use the component TJvHTButton
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 12425400
About the ThemeEngine I don't know .... I don't use it yet .... Sorry. You may try it.
0
 
LVL 1

Expert Comment

by:phervers
ID: 12427044
Theme Engine is commercial product so you have to pay for it. But it can do a lot more than changing button color you can make a completely theme'able application, here's a small example what you can make using it   http://vteam.webpark.pl/cuemaker.rar . But if you only want to change color of your buttons JVCL should make it for you. Or if u don't want to use any external components you can use bitmap buttons.
0
 

Author Comment

by:VSmolensky
ID: 12431543
I'm thingking about buying ThemeEngine but I have some difficulties with its evaluation verion (for Delphi 6). After the installation, all its components are available in the palette, but applications with them don't run. The compiler says "File not found: te_engine.dcu". Though all the .dcu files lie in the directory ...Delphi6\themeengine and finding then shouldn't be a problem. Should I configure anything else? I couln't find the answer in the attached documents.
0
 
LVL 2

Expert Comment

by:DarkCore_
ID: 12431878
Well, try to add Delphi6\themeengine into your library path, in Menu Tools\Environment Options .. tab Library.

Edu
0
 
LVL 5

Expert Comment

by:Hypoviax
ID: 12440004
I am probably misunderstanding this but isn't there a property value called parentcolor?

IF this is set to true then the component adopts the color of the form otherwise it maintains its set colour.

Regards,

Hypoviax
0
 
LVL 5

Expert Comment

by:Hypoviax
ID: 12440029
The jvhtbutton allows this parentcolor property value (jvAdditional) unlike normal buttons

Regards,

Hypoviax
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 12441685
I tested TJvHTButton, when the property ParentColor is True with the Form that contains a Panel:
  Color of the form is clBtnFace - when I drop a JvHTButton on the Form it's color is clBtnFace;
  Color of the Panel is clMaroon - when I drop a JvHTButton on the Panel it's color is clMaroon;
  Then I did change the color of the Form to clBlue - the color of the JvHTButton which Parent is Form becomes clBlue, but other JvHTButton which Parent is Panel is still clMaroon as it's Parent color ....

So, JvHTButton gets the color from it's parent Component (Form, Panel, GroupBox ....)
0
 
LVL 5

Expert Comment

by:Hypoviax
ID: 12442285
So i am right am i not?

Regards,

Hypoviax
0
 
LVL 5

Expert Comment

by:Hypoviax
ID: 12442308
Sorry, i didn't read all your previous posts, my comments are what you, esoftbg were saying ;).

Oh well, it just confirms your post

Hypoviax
0
 
LVL 1

Accepted Solution

by:
phervers earned 800 total points
ID: 12461441
About ThemeEngine.  Installation should be enough, but if it doesn't work, try adding directory containing needed .dcu files to library path (in Delphi 7) menu Tools->Environment Options->Library->Library Path.

About ParentColor you are right esoftbg button takes color from it's parent so it won't inherit form color if it's inside a panel, oe thing you can do to accomplish this is setting Panel's ParentColor:= True;
0
 

Author Comment

by:VSmolensky
ID: 12587541
Thank you, everybody, and sorry for my disappearance. I've purchased ThemeEngine. In many aspects it looks very impressive but still not free from some shortcomings. For example, the menu bar component they provide doesn't support radio items. The Theme Editor seems to be a powerful instrument but the help system is designed rather poorly and it's really difficult to understand how to use all its features. Is there any experts here who is an experienced user of ThemeEngine and especially of Theme Editor? Is there any material to read about it? Any discussions? The newsgroups on Theme Engine page are announced but closed.

V.S.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question