Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Transparency / Theming drives me crazy

Hello LMD team,

there isn't a single thing in the LMD Elpack library that causes me more headaches and frustration than "transparency" and "theming". I just don't understand how this is supposed to work at all. It is chaos. Every time I think I understand it, it turns out I was wrong. It is really getting to my nerves.

Performing something as dead simple as putting a tElPanel on a form, give it a pale yellow color ($00E0F7F7) and place some tElLabel and tElHtmlLabel components on it is so hard that it's almost unbelievable.

There are some properties (thememode, themeglobalmode, transparent, transparentXPThemes, parentcolor) and I completely fail to grasp how these properties interact. 

- When I set the "color" of the panel, the property "takes" but the color does not change. That is bad. Either "take" the color or refuse it, but don't pretend!

Yet when I set the panel's "transparentXPThemes" to false - it suddenly works.  Why the heck is that ?
And when I set the panel's  "transparentXPThemes" back to its original value and Thememode to ttmNone, it also works.  But... if I then put a tElLabel on it (having property "transparent=true"), the label has the wrong background color (clbtnface instead of pale yellow)... So why isn't the label "transparent" when I tell it to ? The label also has "parentcolor=true" by default, but then again, why does it not have its parent's color ? 

What I want to achieve is very simple. Put a tElPanel with some color or texture on a form and put some other Elpack components on top of it. But somehow I have to move heaven and earth in every component just to make the color of the background panel shine through. 

Delphi's standard components have NONE of these issues.  I use Delphi 2009 and my application has a manifest to indicate it supports theming (which works fine for the original vcl components). So far, my best solution has been to set "thememode=ttmNone" everywhere... 





Comments

  • 13 Comments sorted by Votes Date Added
  • Hi,

    I admitting that legacy property TransparentXPThemes might be confusing. 
    Note that ThemeMode has priority over other look&feel properties, this simplifies all.

    >>What I want to achieve is very simple. Put a tElPanel with some color or texture on a form and put some other Elpack components on top of it<<

    To achieve this you just
    1) set ThemeMode to ttmNone, then set Color or Background of the ElPanel instance.
    2) set ThemeMode to ttmNone and Transparent property to true of the component that you put on the panel.

    Best regards,
    Victor Bocharov
    LMD Innovative
    bocharov@lmd.de


  • Addendum:
    ThemeMode and GlobalThemeMode (which simply specifies whether global settings for LMDApplication.ThemeMode should be observed) were introduced with LMD 2009:

    >>Delphi's standard components have NONE of these issues.  <<
    Sure. They don't support switching between themed modes (try to set e.g. fonts with colors in TCheckBox - checkbox will be always painted themed when you use manifest and platform supports themes). 
    It is the same in ElPack. Either you use a themed mode (either platform themes (ttmPlatform) or the ElPack ThemeEngine (ttmNative)) - then control appearance is defined by themes (and control settings are ignored). Or you don't use themes, then control settings are used. 

    TElPanel is themed by default, but this is only for compatibility reasons (for previous ElPack users, so we won't change that). LMD panels for example are all non-themed by default. 
     

  • So if I have a form with just a tElPanel and put 20 tEllabels on it, everything with default settings, I have to tweak 42 properties just to give the panel a different color?  This is dreadful !  

    All I want is to be able to give a panel a certain color and then to have all components on top of it to respect that color! Surely it shouldn't be so difficult? The standard VCL works that way! 


    This has become a phenomenal p.i.t.a. if you'll forgive my saying so.  I acquired Elpack many years ago (I used Delphi 7 then) only for its unicode properties. I may now very well have to get rid of it because of the multitude of problems caused by theming. My current application has maybe 200 forms and the appearance is rather haphazard under different operating systems. I develop under XP and make sure that it looks good on my machine. When I deploy to Windows 2000 or Windows vista/7/2008  I notice that lots of tEllabels suddenly have the wrong background. I have to check, double-check and triple-check each form of my application just to make sure that I didn't forget to tweak any Elpack theming properties. This is much much much more trouble than it's worth. Now that the Delphi VCL itself supports unicode, the only Elpack controls I really cannot do without are the HTML versions.










     

  • >>So if I have a form with just a tElPanel and put 20 tEllabels on it, everything with default settings, I 
    have to tweak 42 properties just to give the panel a different color?  This is dreadful !  <<
    No. You need only set ThemeMode of Panel to ttmNone. Nothing else. 
    Again: TElPanel and other ElPacl WinControls are themed by default, but this is only for compatibility reasons (for previous ElPack users, so we won't change that). 
    LMD panels for example are all non-themed by default. 

    >> When I deploy to Windows 2000 or Windows vista/7/2008  I notice that lots of tEllabels suddenly have the wrong background<<
    This can happen only when panels mix up theme- and non-theme-modes.


  • Rafael, I'm sorry, but it is definitely NOT working.  Here are steps to reproduce:

    1) create an empty application using Delphi 2009 
    2) Link in a manifest {$R ...} to indicate the application supports theming.
    3) create an empty form
    4) put a telpanel on this form (align=alclient)
    5) put a telcheckgroup with some items on the panel, a telcheckbox (caption="test 123") and a telHtmlLabel (caption = "this is <B>bold</B> text")
    6) now set thememode to ttmNone on the panel, set color to $E08080 (purple) and compile.


    The result: 

    - The check group has the correct background, the labels have the wrong background (Windows 7)
    - Same result on Windows XP (with default Windows XP theme)
    - On XP with "classic" theme, the labels are OK but now the tElCheckGroup has the wrong background.


    I am sending you the test application (compiled + source, compressed as a RAR file) by E-mail.







  • >>Rafael, I'm sorry, but it is definitely NOT working. <<
    You spoke about ElPanel and ELLabels.
    ElCheckGroup is TWinControl descendant, not TGraphicControl descendants. Hence ThemeMode setting is required. ElHTMLLabel is not same kind of control like standard label, because it does not support "real transparency".
  • I sent you back modified DFM part which demonstrates same look in classic and themed mode. It is simply not a good idea to mix different modes in container / TWin-Controls.
  • I wasn't mixing anything ... Please try this, you needn't touch a single thememode to test it:

    Set the Windows XP theme to "legacy". 

    Take a standard Delphi tForm, give it a purple color and place a variety of Elpack components on top of it with ALL properties default. Some look purple. Some look grey. The behavior is totally confusing.   tElRadioGroup and tRadioGroup both descend from tWinControl. Yet one becomes grey, the other one becomes purple.

    I have a  "LMD VCL complete" license and I can tell you, it is utterly frustrating if different components from the same company all show different default behavior.  I am losing way too much time because of this.
     
  • >>Take a standard Delphi tForm, give it a purple color and place a variety of Elpack components on top of it with ALL properties default. Some look purple. Some look grey. The behavior is totally confusing.   tElRadioGroup and tRadioGroup both descend from tWinControl. Yet one becomes grey, the other one becomes purple.<<
    Sorry, but what is the problem here? TElRadioGroup has by default ParentColor = false. TRadioGroup has ParentColor = true. There is nothing confusing. 
    I fully understand that you don't like to set an additional property, but we can and will not simply change default settings of properties. 

    >>I can tell you, it is utterly frustrating if different components from the same company all show different default behavior.<<
    ElPack controls were not created originally by LMD, so I think it is quite normal that behaviour is a little bit different.

  • Let me make a proposal here. 

    Wouldn't it make sense if LMD components (each and every one of them) simply get a new property "ParentThemeMode" (Boolean, with default=True?)


    In such a case, if a LMD/Elpack component is placed on a parent that has themes switched off (or which knows nothing about themes)  the component would default to the "normal" behavior of Borland's VCL components (meaning parentcolor=true and transparent=true).  

    The look and feel would always be consistent, with or without theming, and the whole lot would be much easier to control (just manipulate the properties of the "bottom" tElPanel, and everything on top responds automatically). 

    Borland did exactly the same with the look-and-feel properties Parentfont, Parentcolor etcetera so I think it would make sense.

     

     

  • I guess this is something we can consider. 
    We'll discuss this internally, maybe we add this feature to the list of features for next release. 
  • I see that the "ParentThemeMode" Property is implemented in LMD 2014.

    However, it defaults to FALSE and it doesn't seem to do anything at all when I change it. Does it have any functionality yet?
Sign In or Register to comment.