Page 2 of 3

Re: Row BackColor in inactive BROWSE control

Posted: Fri Mar 11, 2022 6:50 pm
by mol
But grid is very slow with dbfs.
I'm only using virtual grid for arrays.
CellNavigAtionColor works only if you set CellNavigatio to .T.

Re: Row BackColor in inactive BROWSE control

Posted: Fri Mar 11, 2022 7:04 pm
by andyglezl
mol wrote: Fri Mar 11, 2022 6:50 pm But grid is very slow with dbfs.
.............

https://hmgforum.com/viewtopic.php?f=10 ... 242#p68242

Re: Row BackColor in inactive BROWSE control

Posted: Fri Mar 11, 2022 7:22 pm
by SALINETAS24
mol wrote: Fri Mar 11, 2022 6:50 pm But grid is very slow with dbfs.
I'm only using virtual grid for arrays.
CellNavigAtionColor works only if you set CellNavigatio to .T.
Hola, mira este modelo. Yo utilizo tambien VIRTUAL GRID, y lo unico que tienes que ajustar es que cuando cargas

Code: Select all

Local i := Form_1.Grid_1.Value 
El valor te viene en un Array de dos posiciones i[1]= la Fila i[2]=la Columna

Por lo demas.., queda bastante bien.

Una cervecita bien fresquita a todos los hombre de buena voluntad

Re: Row BackColor in inactive BROWSE control

Posted: Sat Mar 12, 2022 1:46 pm
by edk
mol wrote: Fri Mar 11, 2022 6:50 pm But grid is very slow with dbfs.
I'm only using virtual grid for arrays.
CellNavigAtionColor works only if you set CellNavigatio to .T.
Marku patrzyłeś na KSeF, który Ci przysłałem? Tam jest virtual grid dla dbf bez ładowania do pamięci/tablicy, querydata w locie nawiguje po dbf.

Re: Row BackColor in inactive BROWSE control

Posted: Sun Mar 13, 2022 2:17 pm
by mol
Dzięki Edward, byłem na feriach i nie miałem kiedy zajmować się tym.
Jutro popatrzę

Re: Row BackColor in inactive BROWSE control

Posted: Tue Mar 15, 2022 6:14 pm
by mol
Hi Edward!
Your solution is OK.
But, I want to find universal solution for BROWSE. I don't want to rebuild my whole old application changing every BROWSE to GRID.

Cześć Edwa, przepraszam, że po angielsku, ale może ktoś jeszcze śledzi ten temat.
Straciłem już trzy popołudnia, wydaje mi się, że jestem bardzo blisko, ale brak znajomości wewnętrznych zależności HMG nie pozwala mi osiągnąć efektu.
Myślę, że Claudio lub Grigorij mogliby o zrobić, ale nie chcą i już

Re: Row BackColor in inactive BROWSE control

Posted: Wed Mar 16, 2022 3:04 am
by edk
Dobrze Cię rozumiem, nieraz wkurza mnie moja bezradność i niewiedza.

Re: Row BackColor in inactive BROWSE control

Posted: Wed Mar 16, 2022 5:55 am
by AUGE_OHR
hi Mol,

it is "by Design" of Windows that "active" Color switch when "lost Focus"

open 2 x Explorer Windows and use "Detail" for "Report" Design -> GRID / BROWSE
now switch Windows and note "hi-light" or "low-light" Row in Explorer

---
HB_XB_Listview.JPG
HB_XB_Listview.JPG (325.19 KiB) Viewed 5397 times
on left Side it is a HMG App and on right Side my Xbase++ App

left Side have Focus (see active Titlebar) but only 1 GRID are "active"

my Xbase++ App use "own" WC_LISTVIEW Control and "Owner Draw"
both GRID have "hilight" ROW even Window / Control are not active

so you need "Owner Draw" to get that "Look"

---

possible Workaroud

under

Code: Select all

Computer\HKEY_CURRENT_USER\Control Panel\Colors
you will find actual Theme Color which are used

there are some "active/inactive" Color like

Code: Select all

#define COLOR_ACTIVECAPTION     2
#define COLOR_INACTIVECAPTION   3
#define COLOR_CAPTIONTEXT       9
COLOR_CH.ZIP
(443 Bytes) Downloaded 80 times
there are 2 API Function to Set/Get those Colors

https://docs.microsoft.com/en-us/window ... etsyscolor
The function returns the red, green, blue (RGB) color value of the given element.
https://docs.microsoft.com/en-us/window ... tsyscolors
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_* Constante in WinUser.H (see Attachment )

! Note : Setsyscolors() will effect on ALL Windows App (but not "Permanent")
! Note : Setsyscolors() will NOT written into Registry

so after re-Login all Color are default like before :D

Re: Row BackColor in inactive BROWSE control

Posted: Wed Mar 16, 2022 8:08 am
by mol
It is possible to change color in inactive browse, I think. But I can't find solution :-D
I don't want to change windows schema.

Re: Row BackColor in inactive BROWSE control

Posted: Wed Mar 16, 2022 9:41 pm
by AUGE_OHR
hi Mol,
mol wrote: Wed Mar 16, 2022 8:08 am It is possible to change color in inactive browse
look into \SOURCE\h_windows.PRG and search for WM_ACTIVATE
you will find something like WINDOW_LOSTFOCUS ... so search for it

Code: Select all

   IF _HMG_SYSDATA[ 232 ] == 'WINDOW_LOSTFOCUS'
      MsgHMGError( "ACTIVATE WINDOW / Activate(): Not allowed in window's LOSTFOCUS event procedure. Program terminated" )
   ENDIF
so i guess it is not possible without "Owner Draw" to "overule" draw "by System"