How about a dark GUI for TC?

English support forum

Moderators: Stefan2, white, sheep, Hacker

Thany
Senior Member
Senior Member
Posts: 247
Joined: 2003-09-30, 09:20 UTC
Location: Netherlands

Re: How about a dark GUI for TC?

Post by *Thany » 2019-02-27, 08:44 UTC

Usher wrote:
2019-02-20, 13:16 UTC
Windows XP is still supported by MS Visual Studio (after installing XP toolset).
So? There's loads of software that supports XP. Fact of the matter is that XP is deprecated. Obsolete. Microsoft has ended support for it completely. We must not try to make things work on XP. If it just so happens to work on XP, grats. But please stop putting effort in an OS that is almost 17 years old.

User avatar
Usher
Senior Member
Senior Member
Posts: 347
Joined: 2011-03-11, 10:11 UTC

Re: How about a dark GUI for TC?

Post by *Usher » 2019-02-27, 13:35 UTC

I don' understand your aggression. I'm talking about facts rather than about biased opinions and Microsoft FUD:
  1. If anything is still in (common) use, it means that it's still useful, no matter how you call it.
    MS-DOS is still in use. Disgusting, isn't it? ;-P
  2. If you want to present consistent opinions, you should mention that Total (Windows) Commander is as old as MD-DOS and is also still in use.
    It's complete madness, right?
  3. (My opinion) I'm pretty sure you will soon start to seed similar FUD about Windows 7 like MS marketing stuff or paid MS advocates do…
    (Fact) But if it ain't broke don't fix it.
  4. Most people don't need a laser gun to kill mosquitoes. They don't start to build laser fences because you said so.
  5. If you don't like Windows XP, just make your own way and let other people live on their own.
    The former is your own choice, the latter is none of your business.
Now I'm giving up. Do you really must have the last word?
Regards from Poland
Andrzej P. Wozniak

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37264
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How about a dark GUI for TC?

Post by *ghisler(Author) » 2019-02-27, 13:46 UTC

Microsoft still keeps XP patched for paying business customers by the end of 2019. Furthermore, XP isn't a security risk if the computer isn't connected to the Internet. I know of some companies who still run machines with DOS(!) computers. That's why I continue to support even Windows 95 and NT.
Author of Total Commander
http://www.ghisler.com

smartwork
Junior Member
Junior Member
Posts: 5
Joined: 2010-11-07, 09:38 UTC

Re: How about a dark GUI for TC?

Post by *smartwork » 2019-03-27, 11:22 UTC

If it is of some help: I had some success in taming W10 colors by combining a tool named "Classic Color Panel" and high contrast mode. Usually high contrast mode has nearly no customizability and "Dark Mode" and "Classic Color Panel" alone are simply fully or partly ignored in many applications.

User avatar
yiuimex
Junior Member
Junior Member
Posts: 30
Joined: 2019-03-28, 08:02 UTC

Re: How about a dark GUI for TC?

Post by *yiuimex » 2019-03-28, 08:56 UTC

hi,

my Name is Jimmy.
i'm User of TC and new in this Forum.

as Xbase++ Programmer i just have play with "Classic Panel" Color and many Apps still react on it :D

hm ... how to include a Snapshot in this Forum :?:
ok found out that i have to use external link for Snapshot.

have read this Thread only so excuse if someone else have point to it before

---

there are 2 API Function

Code: Select all

https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-getsyscolor
The function returns the red, green, blue (RGB) color value of the given element.

Code: Select all

https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setsyscolors
An array of COLORREF values that contain the new red, green, blue (RGB) color values for the display elements in the array pointed to by the lpaElements parameter.
using API Function "SetSysColor" you can set those 30 COLOR_* Constant from WinUser.H which are the same used by "Classic Panel"

but new Color Value will NOT store into Registry so after re-Login all Color are default like before :D

---

TC and many other Apps will react on new Color but some Controls like WC_TOOLBAR/WC_REBAR or WC_TABCONTROL are not include in this 30 COLOR_* Constant ... simply "to new"

i have enhance my own native Control to support Ownerdraw/Customdraw.
now i got 99% on my Way to Darkmode. only Scrollbar of WC_LISTVIEW still have System Theme Color :evil:

Pawel
Junior Member
Junior Member
Posts: 4
Joined: 2018-12-18, 11:54 UTC

Re: How about a dark GUI for TC?

Post by *Pawel » 2019-03-28, 09:55 UTC

As far as I know Total Commander is built in Delphi.
Modern Delphi environment support so called VCL styles. It is very easy to add support for it and effects are very nice.

Example: http://www.meggamusic.co.uk/shup/1553766547/ddd.png

You can create own styles. You can edit existing ones.
It can be added to application build in Delphi with few lines of code. Take a look at this pseudo-code:

Code: Select all

var
   sStyleName  : string;
begin

   // Styles Manager
   sStyleName  := '';
   if OPTION_THAT_ENABLE_DARK_MODE = True then
      begin
         for sStyleName in TStyleManager.StyleNames do
         	begin
            	if sStyleName = 'Carbon' then
               	begin
                     TStyleManager.TrySetStyle('Carbon');
                     Break;
		end;
            end;
      end;
   //TStyleManager.SetStyle(TStyleManager.SystemStyle); --> this sets back standard windows style
end;
Carbon style is default Delphi style. It can be added to app using single line in .rc file for resource compiler.

Code: Select all

CARBON   VCLSTYLE "Carbon.vsf"
-Pawel

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37264
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How about a dark GUI for TC?

Post by *ghisler(Author) » 2019-03-28, 10:25 UTC

Unfortunately I'm not using modern Delphi. I use Delphi 2.0 for 32-bit (heavily modded for Unicode support) and Lazarus for 64-bit (at the time I ported to 64-bit, there was no 64-bit Delphi). I have tried to convert to a newer Delphi, but it's impossible because it handles Unicode differently.
Author of Total Commander
http://www.ghisler.com

User avatar
yiuimex
Junior Member
Junior Member
Posts: 30
Joined: 2019-03-28, 08:02 UTC

Re: How about a dark GUI for TC?

Post by *yiuimex » 2019-03-28, 11:43 UTC

hi,
ghisler(Author) wrote:
2019-03-28, 10:25 UTC
I use Delphi 2.0 for 32-bit ...
like your Delphi 2.0 for 32-bit i'm stuck on Xbase++ 32bit :x

Question : did Delphi 2.0 have Ownerdraw/Customdraw :?:

btw. Color of WC_TOOLBAR come from WC_REBAR as Parent
so i like to request a Rebar if possible.

Question : can you use SubClassing with Delphi 2.0 :?:

---

if someone want to read more about Windows Control and play with it try this
https://docs.microsoft.com/en-us/windows/desktop/controls/control-spy

! Note : Control Spy 2.0 from MSDN link seems not to work any more :evil:

User avatar
yiuimex
Junior Member
Junior Member
Posts: 30
Joined: 2019-03-28, 08:02 UTC

Re: How about a dark GUI for TC?

Post by *yiuimex » 2019-03-28, 12:24 UTC

smartwork wrote:
2019-03-27, 11:22 UTC
"Classic Color Panel" alone are simply fully or partly ignored in many applications.
i agree while many Apps using Manifest to enable visual Style so you did not see the Color :wink:

it work e.g. in Notepad Background Color and also in Menu of FF 66.02 so there are still a lot of Controls used in modern Apps

---

"DarkMode" work IMHO different from normal Windows Theme.

as i understand old Style is using GDI32 to paint Controls. next Step was GDI+ but still Desktop Technique.
now you can use a Engine like HTMLlayout ( https://terrainformatica.com/a-homepage-section/htmlayout/ ) and CCS to render Control with Hardware Acceleration.

"DarkMode" seem to use those XML which include those CCS Syntax but i do not understand it.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37264
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How about a dark GUI for TC?

Post by *ghisler(Author) » 2019-03-28, 13:48 UTC

did Delphi 2.0 have Ownerdraw/Customdraw
Yes: For Listboxes, Comboboxes etc.
No: For checkboxes, buttons, srollbars (also those in listboxes), tabs etc. For colored tabs, TC lets Windows draw it, and then draws transparent color on top.

TC uses a manifest to draw these elements with the current Windows theme. Is there a way to modify the theme colors somehow? How would you go about drawing dark mode scroll bars, tabs etc.
Author of Total Commander
http://www.ghisler.com

User avatar
yiuimex
Junior Member
Junior Member
Posts: 30
Joined: 2019-03-28, 08:02 UTC

Re: How about a dark GUI for TC?

Post by *yiuimex » 2019-03-29, 04:34 UTC

hi,
Yes: For Listboxes, Comboboxes etc.
No: For checkboxes, buttons, srollbars (also those in listboxes), tabs etc. For colored tabs, TC lets Windows draw it, and then draws transparent color on top.
funny about same with Xbase++ v1.9x (there is a Version 2.x using HTLMlayout and CCS).
i guess Listbox/Combobox Ownerdraw Sample are from Charles Petzold "Programming Windows" Microsoft Press :lol:

it is hard to enhance Original Xbase++ Controls while Alaska have its own Event Loop so many Windows Event are not available.

i have a Open Source LIB for Xbase++ called OT4XB to Subclass so i can write my own native Controls.
it also have to lot of predefine Windows Structure so i do not have to write it ;)

did Delphi v2.0 have something for SubClass :?:

---
TC uses a manifest to draw these elements with the current Windows theme
i can explain what Windows is doing but sorry i "speak" only xBase (since > 40 Years) so i do not know if my Xbase++ Code will help.
we can make a new Thread "Windows API for Developer" where i can post my Xbase++ Code and try to translate it into Delphi

---
Is there a way to modify the theme colors somehow?
as i say SetSysColor() API is to change those Theme Color
Image: https://www.xbaseforum.de/download/file.php?id=3658
How would you go about drawing dark mode scroll bars, tabs etc
2 Way :
1.) try to modify Original Control using GetWindowLongA() / SetWindowLongA() API from User32.DLL (see Sample)
2.) write own Control with SubClass

---

WC_SCROLLBAR does react on COLOR_SCROLLBAR

Image: https://www.xbaseforum.de/download/file.php?id=3641
Image: https://www.xbaseforum.de/download/file.php?id=3640

Problem of Scrollbar is that it is not always so i have to wait util it appear and try to get its Handle.
WC_SCROLLBAR have Ownerdraw using SBT_OWNERDRAW.

as i say i still work on it and search for a Event which enable Scrollbar.

---

when study those API at MSDN i notice what Controls can do but XbParts do not offer all.
e.g. Checkbox IS a Button so i can use a Button with BS_PUSHLIKE.

Code: Select all

PROCEDURE PimpMyXb(oObj,lRound)
LOCAL hWnd
LOCAL nStyle

DEFAULT lRound TO .T.

   IF VALTYPE(oObj) = "O" // is Object
      hWnd   := oObj:GetHWnd() // get Handle
      oObj:hide()
      oObj:useVisualStyle := .F.

      // get Control Style
      nStyle := @user32:GetWindowLongA(hWnd, GWL_STYLE)
      // add Style 
      nStyle := nOr(nStyle, BS_PUSHLIKE,BS_CENTER,BS_VCENTER)
      // set Style
      @user32:SetWindowLongA(hWnd , GWL_STYLE , nStyle )
      @user32:InvalidateRect(hWnd,1)

      IF lRound
         MachKreise(oObj)
      ENDIF

      oObj:show()
   ENDIF
RETURN

Andy Solo
Junior Member
Junior Member
Posts: 3
Joined: 2019-03-15, 12:56 UTC
Location: Krasnodar, Russia

Re: How about a dark GUI for TC?

Post by *Andy Solo » 2019-03-29, 08:16 UTC

ghisler(Author) wrote:
2019-03-28, 10:25 UTC
I use Delphi 2.0 for 32-bit (heavily modded for Unicode support) and Lazarus for 64-bit.
Why you do not leave from Delphi 2.0 and do not apply Lazarus/Free Pascal for Total Commander 32-bit?

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37264
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How about a dark GUI for TC?

Post by *ghisler(Author) » 2019-03-29, 11:19 UTC

TC is much larger with Lazarus. It seems to include a lot of unused libraries.
Author of Total Commander
http://www.ghisler.com

Thany
Senior Member
Senior Member
Posts: 247
Joined: 2003-09-30, 09:20 UTC
Location: Netherlands

Re: How about a dark GUI for TC?

Post by *Thany » 2019-04-13, 19:17 UTC

I don't believe the specific programming environment has anything to do with the ability to listen to certain windows API's. It probably doesn't have an easy to use interface for much modern stuff, but you're free to create hooks into "unknown" API's, right?

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37264
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How about a dark GUI for TC?

Post by *ghisler(Author) » 2019-04-15, 13:51 UTC

In principle, yes. But colors in controls can not be changed, they are part of the current theme. The only alternative would be 100% owner-drawn control like the Windows apps use.
Author of Total Commander
http://www.ghisler.com

Post Reply