GRID Header Color ?

Discuss anything else that does not suite other forums.

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 1444
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 267 times
Been thanked: 415 times

GRID Header Color ?

Post by AUGE_OHR »

hi,

how can i change GRID Header Color :?:

i found out

Code: Select all

Form_1.Grid_1.HeaderDYNAMICFORECOLOR( nCol ) := {|| aFColor[1] }
Form_1.Grid_1.HeaderDYNAMICBACKCOLOR( nCol ) := {|| aFColor[2] }
but BackColor does not work :(
have fun
Jimmy

User avatar
serge_girard
Posts: 2770
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 1064 times
Been thanked: 193 times
Contact:

Post by serge_girard »

Jimmy,

Code: Select all

   FOR a = 6 to 9 // free
      SetProperty( 'Form_1','Grid_DRIVES',"ColumnDYNAMICFORECOLOR", a, {|| {255,0,255} } )  
      SetProperty( 'Form_1','Grid_DRIVES',"HeaderDYNAMICBACKCOLOR", a, {|| {255,0,255} } )
   NEXT 

   FOR a = 2 to 3  // total
      SetProperty( 'Form_1','Grid_DRIVES',"ColumnDYNAMICFORECOLOR", a, {|| {0,255,0} } )   
      SetProperty( 'Form_1','Grid_DRIVES',"HeaderDYNAMICBACKCOLOR", a, {|| {0,255,0} } )
   NEXT 
Maybe this works for you?

Serge
Serge Now Is The Happiest Time Of Your Life !

User avatar
hmgchang
Posts: 273
Joined: Tue Aug 13, 2013 4:46 am
Location: Indonesia
Has thanked: 16 times
Been thanked: 11 times

Post by hmgchang »

serge_girard wrote:
Fri Jan 10, 2020 9:03 am
Jimmy,

Code: Select all

   FOR a = 6 to 9 // free
      SetProperty( 'Form_1','Grid_DRIVES',"ColumnDYNAMICFORECOLOR", a, {|| {255,0,255} } )  
      SetProperty( 'Form_1','Grid_DRIVES',"HeaderDYNAMICBACKCOLOR", a, {|| {255,0,255} } )
   NEXT 

   FOR a = 2 to 3  // total
      SetProperty( 'Form_1','Grid_DRIVES',"ColumnDYNAMICFORECOLOR", a, {|| {0,255,0} } )   
      SetProperty( 'Form_1','Grid_DRIVES',"HeaderDYNAMICBACKCOLOR", a, {|| {0,255,0} } )
   NEXT 
Maybe this works for you?

Serge
The Grid HeaderDynamicBackColor still not working...
SetProperty( 'Form_1','Grid_DRIVES',"HeaderDYNAMICFORECOLOR", a, {|| {0,255,0} } ) -> WORKING
SetProperty( 'Form_1','Grid_DRIVES',"HeaderDYNAMICBACKCOLOR", a, {|| {0,255,0} } ) -> NOT WORKING !!!

Pls Advise on how to make it works


Thks n Rgds
Chang
Just Hmg It !

User avatar
AUGE_OHR
Posts: 1444
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 267 times
Been thanked: 415 times

Post by AUGE_OHR »

hi,
hmgchang wrote:
Wed Apr 14, 2021 2:24 am
Pls Advise on how to make it works
have not work at this "Problem" in harbour Version any more ...

when hover GRID / BROWSE Header you will "see" visual Effect which is "over" BACKCOLOR
i have "see" (in \SOURCE ) Ownerdraw for GRID / BROWSE Header but now work with it under harbour

same "Problem" with TAB(page) which is "paint" by System ... need Ownerdraw like in my Xbase++ App
Control_Background.JPG
Control_Background.JPG (100.14 KiB) Viewed 1161 times
have fun
Jimmy

User avatar
hmgchang
Posts: 273
Joined: Tue Aug 13, 2013 4:46 am
Location: Indonesia
Has thanked: 16 times
Been thanked: 11 times

Post by hmgchang »

AUGE_OHR wrote:
Wed Apr 14, 2021 3:07 am
hi,
hmgchang wrote:
Wed Apr 14, 2021 2:24 am
Pls Advise on how to make it works
have not work at this "Problem" in harbour Version any more ...

when hover GRID / BROWSE Header you will "see" visual Effect which is "over" BACKCOLOR
i have "see" (in \SOURCE ) Ownerdraw for GRID / BROWSE Header but now work with it under harbour

same "Problem" with TAB(page) which is "paint" by System ... need Ownerdraw like in my Xbase++ App
Control_Background.JPG
Hola Jimmy,
Pls share your Xbase++ App to me... tq
hmg_dynamicback.JPG
hmg_dynamicback.JPG (49.14 KiB) Viewed 1119 times
it seem that the dynamic foreColor dan backColor functions are identical, wonder why it works with
foreColor but not backColor.


Thks n Rgds
Chang
Just Hmg It !

User avatar
andyglezl
Posts: 1355
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 46 times
Been thanked: 169 times
Contact:

Post by andyglezl »

hmgchang wrote:
Wed Apr 14, 2021 2:24 am
The Grid HeaderDynamicBackColor still not working...
SetProperty( 'Form_1','Grid_DRIVES',"HeaderDYNAMICFORECOLOR", a, {|| {0,255,0} } ) -> WORKING
SetProperty( 'Form_1','Grid_DRIVES',"HeaderDYNAMICBACKCOLOR", a, {|| {0,255,0} } ) -> NOT WORKING !!!

Pls Advise on how to make it works

I think it's because of the "WINDOWS THEMES"
Andrés González López
Desde Guadalajara, Jalisco. México.

User avatar
AUGE_OHR
Posts: 1444
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 267 times
Been thanked: 415 times

Post by AUGE_OHR »

hi,
hmgchang wrote:
Wed Apr 14, 2021 11:55 pm
Pls share your Xbase++ App to me... tq
Xbase++ App (Black) need Runtime so tell me where i can upload hole Stuff
harbour App (white) Source (32/64 Bit) are on Github https://github.com/AugeOhr/HBFM

---

HMG have no Ownerdraw ( WM_MEASUREITEM / WM_DRAWITEM ) ...
it use Customdraw ( NM_CUSTOMDRAW ) for GRID / TREE

MiniGUI Extendet Version seems to have Ownerdraw for Menu and Listbox.

---

in GRID or TREE you can use "DynamicXXXcolor" while it use CustomDraw

c:\hmg.3.4.4\SOURCE\h_windows.prg

Code: Select all

FUNCTION Events( hWnd, nMsg, wParam, lParam )
   CASE nMsg == WM_NOTIFY
   ... 
      IF GetNotifyCode( lParam ) == NM_CUSTOMDRAW
else System is drawing (include visual Style/Effect)

Code: Select all

Draw Background Color
Draw Visual Style
Draw Foreground Font Color
---

Windows Background is "paint" when get one of these Windows Message

Code: Select all

#define WM_CTLCOLORMSGBOX 0x0132
#define WM_CTLCOLOREDIT 0x0133
#define WM_CTLCOLORLISTBOX 0x0134
#define WM_CTLCOLORBTN 0x0135
#define WM_CTLCOLORDLG 0x0136
#define WM_CTLCOLORSCROLLBAR 0x0137
#define WM_CTLCOLORSTATIC 0x0138
HMG use

Code: Select all

CASE nMsg == WM_CTLCOLORSTATIC
CASE nMsg == WM_CTLCOLOREDIT .OR. nMsg == WM_CTLCOLORLISTBOX
where you can change Windows Background Color

so it is not possible (without Tricks ) go get "Darkmode" on Scrollbar while WM_CTLCOLORSCROLLBAR is not support in HMG (yet)
have fun
Jimmy

Post Reply