[64] White back of read-only edits in packed files props
Moderators: Hacker, petermad, Stefan2, white
[64] White back of read-only edits in packed files props
Win7x64, classic style theme.
TCx64 displays edit fields in packed file properties dialog with white background instead of usual dialog colour background.
Image
TCx64 displays edit fields in packed file properties dialog with white background instead of usual dialog colour background.
Image
- ghisler(Author)
- Site Admin
- Posts: 50475
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
This isn't a bug, that's how tabs should actually look! It was a bug that Delphi 2 couldn't show them like this in 32-bit. I couldn't find a way to make that work in 32-bit.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
It looks just like a bug for classic themes, looks very unpleasant. Maybe you should explicitly set background colour of edit fields from tab page background one? 
BTW you may look onto my VirtualPanel's configuration dialog. It have themed tabs and background of read-only items is the same as tab background on both Aero and classic themes.
I don't think it is a bug in Delphi 2, it seems that it just doesn't support this. I was need to load additional API function to enable themes for tabs (I load it dynamically because it is Windows XP only function):
All I need is to call this function once for dialog handle (on WM_INITDIALOG message) with second parameter ETDT_ENABLE and for every tab page handle with parameter ETDT_ENABLETAB.

BTW you may look onto my VirtualPanel's configuration dialog. It have themed tabs and background of read-only items is the same as tab background on both Aero and classic themes.
I don't think it is a bug in Delphi 2, it seems that it just doesn't support this. I was need to load additional API function to enable themes for tabs (I load it dynamically because it is Windows XP only function):
Code: Select all
HRESULT EnableThemeDialogTextureStub(HWND hWnd, DWORD dwFlags) {
typedef HRESULT (WINAPI* HR__HW_DW)(HWND hWnd, DWORD dwFlags);
HMODULE uxtheme=GetModuleHandleA("uxtheme.dll");
HR__HW_DW EnableThemeDialogTexture=uxtheme ? (HR__HW_DW)GetProcAddress(uxtheme, "EnableThemeDialogTexture") : 0;
return EnableThemeDialogTexture ? EnableThemeDialogTexture(hWnd, dwFlags) : S_FALSE;
}
- ghisler(Author)
- Site Admin
- Posts: 50475
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
As I wrote, this behaviour is intentional. I will not change it.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Isn't this just some misunderstanding? I can indeed see wrong tab body background in 32-bit TC with Aero theme. 64-bit TC uses correct white color. And all those read-only edits also have correct white background.ghisler(Author) wrote:This isn't a bug, that's how tabs should actually look! It was a bug that Delphi 2 couldn't show them like this in 32-bit. I couldn't find a way to make that work in 32-bit.
But with Classic theme, tab body has grey (or some other user-selected color) background, but read-only edits are still white, which is not correct here. If you check other system dialogs, e.g. file properties, all read-only edits (with file name, size, etc...) have the same color as the main background.
- ghisler(Author)
- Site Admin
- Posts: 50475
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Hmm, I didn't know that the page isn't white in classic theme, that makes it very complicated. 
I will try to find out more.

I will try to find out more.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50475
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
What about other themes? The problem is that the text color in the edit controls needs to be readable too. In an extreme case, the tab background could be white, and the dialog background could be black.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
We can't guess which colors user will use. So we should follow Windows standards: read-only controls have same background color as their parent. Just open properties of any device in Device Manager - device state field have same background as tab page has in any theme.
BTW edits have property ParentColor - you may try to set it to True and Lazarus will fill them using same brush as tab page has (I think so).
BTW edits have property ParentColor - you may try to set it to True and Lazarus will fill them using same brush as tab page has (I think so).
I tried it, but it doesn't work as expected. Themed tab control has main background color which is usual COLOR_3DFACE and different color for panel background. ParentColor takes the first one...MVV wrote:BTW edits have property ParentColor - you may try to set it to True and Lazarus will fill them using same brush as tab page has (I think so).
But in theory it should be easy:
if(ThemesEnabled)
PanelBgColor = GetThemeColor( right parameters ;) )
else
PanelBgColor = COLOR_3DFACE
After reading the docs, I'd say that among the right parameters should be TABP_PANE and TMT_FILLCOLOR, but unfortunately it doesn't seem to work for me at all. But I never worked with themes before, so it's probably the reason for that.
- ghisler(Author)
- Site Admin
- Posts: 50475
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Indeed parent color doesn't work, that's why I'm struggling to find a solution working with and without themes...
I will try this EnableThemeDialogTexture with Lazarus. Of course that doesn't work without themes, but then the color is known.
I will try this EnableThemeDialogTexture with Lazarus. Of course that doesn't work without themes, but then the color is known.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50475
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
This should be fixed in beta 3, please check! However, I couldn't find a solution when a theme created for XP was used on Windows Vista/7. The reported background color is wrong in this case.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com