Color of DCTreeItem and DCSubMenu
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Color of DCTreeItem and DCSubMenu
Hi Roger,
is it possible to set the text color of DCTreeitem and DCSubmenu with OWNERDRAW ?
I can set the background color but not the item color.
Or does the color comes from windows system colors ?
is it possible to set the text color of DCTreeitem and DCSubmenu with OWNERDRAW ?
I can set the background color but not the item color.
Or does the color comes from windows system colors ?
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: Color of DCTreeItem and DCSubMenu
Sorry, but XbpTreeview and XbpTreeviewItem do not support owner drawing.
DCSUBMENU does support owner drawing.
DCSUBMENU does support owner drawing.
The eXpress train is coming - and it has more cars.
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: Color of DCTreeItem and DCSubMenu
Hello Roger,
i mean your command DCSUBMENU...OWNERDRAW...
I have initialisied this with
But the Submenu Foreground Color does not change when i try to set it to GRA_CLR_WHITE (on GRA_CLR_BLACK), so i have black on black
.
The DCMENUBAR does it in white on black.
i mean your command DCSUBMENU...OWNERDRAW...
I have initialisied this with
Code: Select all
DC_XbpMenuConfig({M->oGDL:Color_Background, ; // 1 - Sub Menu Background Color
GRA_CLR_BLACK, ; // 2 - Sub Menu Vertical Bar Foreground Color
GRA_CLR_HIGHLIGHT, ; // 3 - Sub Menu Vertical Bar Background Color
GRA_CLR_BLACK, ; // 4 - Sub Menu Outline Color
'11.Arial Fett', ; // 5 - Sub Menu Vertical Bar Font
.F., ;
'10.Marlett', ; // 6 - Sub Menu Check Character Font
'b', ; // 7 - Sub Menu Check Character
M->oGDL:Color_Foreground, ; // 8 - Menu Bar Foreground Color
M->oGDL:Color_Background, ; // 9 - Menu Bar Background Color
GRA_CLR_BLACK, ; // 10 - Sub Menu Foreground Color
'8.Arial'}) // 11 - Menu Bar Font

The DCMENUBAR does it in white on black.
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: Color of DCTreeItem and DCSubMenu
The problem appears to be that the foreground color never changes from BLACK.
I am working on this.
I was just getting ready to release build 268, and now this.
I am working on this.
I was just getting ready to release build 268, and now this.
The eXpress train is coming - and it has more cars.
Re: Color of DCTreeItem and DCSubMenu
I have a fix for you.
In the file _DCCLASS.PRG, look for the following line of code (approx. line 5803) :
Replace it with the following:
Rebuild dclipx.dll by running build20.bat
This fix will be in build 268.
In the file _DCCLASS.PRG, look for the following line of code (approx. line 5803) :
Code: Select all
aDAttrs[GRA_AS_COLOR] := GraMakeRGBColor(IIF(lEnabled,{0,0,0},{180,180,180}))
Code: Select all
nColor := ::fgColor
IF Valtype(nColor) == 'A'
nColor := GraMakeRGBColor(nColor)
ENDIF
aDAttrs[GRA_AS_COLOR] := nColor
nColor := ::bgColor
IF Valtype(nColor) == 'A'
nColor := GraMakeRGBColor(nColor)
ENDIF
aDAttrs[GRA_AS_BACKCOLOR] := ::nColor
This fix will be in build 268.
The eXpress train is coming - and it has more cars.
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: Color of DCTreeItem and DCSubMenu
Hello Roger,
thanks for this solution, works perfect for DCSUBMENU.
Is this possible to change this for DCTreeitem, too (is also Black on Black) ?
thanks for this solution, works perfect for DCSUBMENU.
Is this possible to change this for DCTreeitem, too (is also Black on Black) ?
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: Color of DCTreeItem and DCSubMenu
I still don't understand about DCTREEITEM.
Can you give me a sample program?
Can you give me a sample program?
The eXpress train is coming - and it has more cars.
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: Color of DCTreeItem and DCSubMenu
Hello Roger,
its simple, try to make a Treeview with white text on black background.
its simple, try to make a Treeview with white text on black background.
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: Color of DCTreeItem and DCSubMenu
hi Wolfgang,
https://docs.microsoft.com/de-de/window ... setbkcolor
https://docs.microsoft.com/de-de/window ... ttextcolor
remember to switch OFF "visual Style"
you can try thisWolfgang Ciriack wrote: ↑Sun Dec 05, 2021 12:52 am its simple, try to make a Treeview with white text on black background.
Code: Select all
#define TV_FIRST 0x1100
#define TVM_SETBKCOLOR (TV_FIRST + 29)
#define TVM_SETTEXTCOLOR (TV_FIRST + 30)
INLINE METHOD APISetBkColor(clrBk)
LOCAL hRet := 0
hRet := @USER32:SendMessageA(hTreeView,TVM_SETBKCOLOR, 0, clrBk )
RETURN hRet
INLINE METHOD APISetTextColor(clrText)
LOCAL hRet := 0
hRet := @USER32:SendMessageA(hTreeView,TVM_SETTEXTCOLOR, 0, clrText )
RETURN hRet
https://docs.microsoft.com/de-de/window ... ttextcolor
remember to switch OFF "visual Style"
greetings by OHR
Jimmy
Jimmy
Re: Color of DCTreeItem and DCSubMenu
It appears that this is a bug in XbpTreeView.
The :setColorFG() method will not allow any foreground color other than black.
I am surprised that nobody has reported this before now.
The :setColorFG() method will not allow any foreground color other than black.
I am surprised that nobody has reported this before now.
The eXpress train is coming - and it has more cars.