Re: [Rd] FR: Customize background colour of row and column headers for the View output

2024-05-28 Thread Tomas Kalibera
I think we should do more than this trivial change. The two real dialogs 
used by the data editor would then also get the new background color 
(setting the cell width, the "variable" editor). Then, the code clearly 
distinguishes between cells for names (row, column) and cells for data, 
so choosing a different color for the two types, but setting these two 
colors in the code to the same one would make the code confusing.


This could be fixed, but I also think there is a value in 
back-compatibility, people may have saved preferences with customized 
background color and have been used to how it looked like, after all the 
current behavior has been around for about 16 years and from the code, 
it was intentional. Yes, it meant that one would have to choose a 
foreground color for the data editor that would be visible on any chosen 
background color as well as on lighgray (the names), so, e.g., not 
yellow. But, maybe that was good enough as there had been no reports 
about this earlier.


So, instead of changing the behavior I've created a new setting for the 
background for the names in the data editor (dataeditnbg). Now in 
R-devel. Please let me know if you see any problems with this,


Thanks
Tomas

On 5/16/24 17:48, Ivan Krylov via R-devel wrote:

The change suggested by Iago Giné Vázquez is indeed very simple. It
sets the background colour of the row and column headers to the
background of the rest of the dataentry window. With this patch, R
passes 'make check'. As Duncan Murdoch mentions, the X11 editor already
behaves this way.

If it's not acceptable to make the row and column headers the same
colour as the rest of the text, let's make it into a separate setting.

--- src/library/utils/src/windows/dataentry.c   (revision 86557)
+++ src/library/utils/src/windows/dataentry.c   (working copy)
@@ -1474,7 +1474,7 @@
  resize(DE->de, r);
  
  DE->CellModified = DE->CellEditable = FALSE;

-bbg = dialog_bg();
+bbg = guiColors[dataeditbg];
  /* set the active cell to be the upper left one */
  DE->crow = 1;
  DE->ccol = 1;



__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] FR: Customize background colour of row and column headers for the View output

2024-05-16 Thread Ivan Krylov via R-devel
The change suggested by Iago Giné Vázquez is indeed very simple. It
sets the background colour of the row and column headers to the
background of the rest of the dataentry window. With this patch, R
passes 'make check'. As Duncan Murdoch mentions, the X11 editor already
behaves this way.

If it's not acceptable to make the row and column headers the same
colour as the rest of the text, let's make it into a separate setting.

--- src/library/utils/src/windows/dataentry.c   (revision 86557)
+++ src/library/utils/src/windows/dataentry.c   (working copy)
@@ -1474,7 +1474,7 @@
 resize(DE->de, r);
 
 DE->CellModified = DE->CellEditable = FALSE;
-bbg = dialog_bg();
+bbg = guiColors[dataeditbg];
 /* set the active cell to be the upper left one */
 DE->crow = 1;
 DE->ccol = 1;

-- 
Best regards,
Ivan

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] FR: Customize background colour of row and column headers for the View output

2024-05-15 Thread Duncan Murdoch
A criticism of your suggestion is that it is not backwards compatible. 
Does that matter?  I don't know, but probably not.  The X11 version of 
the viewer does what you suggest.


Duncan Murdoch

On 2024-05-15 2:20 a.m., Iago Giné Vázquez wrote:

About the decisions:

Actually, the same way dataedittext modifies the text colour not only
of data, but also of row and column names, and dataedituser modifies
the colour of all the borders, I think dataeditbg should modify the
background of all the window, at least that "inside" those
borders. Otherwise, any other option for the background colour on row
and column headers would allow the same set of colours and with the
same names, which are those commented in Rconsole:

## Colours for console and pager(s)
# (see rw/etc/rgb.txt for the known colours).

Regarding the code, looking to the Windows data editor [1], and taking
into account what you and lastly Ivan told previously

     This is entirely correct: the dialog uses the colour returned by
     dialog_bg(), which is GetSysColor(COLOR_BTNFACE).

(maybe a naive question from who does not know the code), could not be
used `guiColors[dataeditbg]` instead of `dialog_bg()` in the unique
place this is present?. So, instead of

     bbg = dialog_bg()

it would appear

     bbg = guiColors[dataeditbg];


Thanks!
Iago


[1] 
https://svn.r-project.org/R/trunk/src/library/utils/src/windows/dataentry.c 


*De:* Duncan Murdoch 
*Enviat el:* dimarts, 14 de maig de 2024 14:22
*Per a:* Iago Giné Vázquez ; r-devel@R-project.org 


*A/c:* Ivan Krylov 
*Tema:* Re: FR: Customize background colour of row and column headers 
for the View output

This seems like something that should be fairly easily doable.  Why
don't you work out a patch?

Some decisions to make:

- What colours are we talking about?  Would you want the labels to have
their colour set independent of the dialog colours?  If so, would you
also want to configure the dialog colours?

- What names should be used for the colours?

- Where should all of these definitions be documented?

If you don't feel comfortable with the coding, perhaps you could answer
these questions, and someone else may code it for you.  I won't (I no
longer have easy access to Windows), but I could help with the design.

Duncan Murdoch

On 2024-05-14 5:25 a.m., Iago Giné Vázquez wrote:

Thanks again Duncan and Ivan,

I forward then the email to R-devel.

Summarizing, the dataedit options (in RGui preferences or RConsole) to
colouring the View output do not have effect on the background of the row
and column names (see https://ibb.co/Dkn2pVs  >).


Could this be implemented?

Thank you!

Best regards,
Iago

*De:* Ivan Krylov 
*Enviat el:* dilluns, 13 de maig de 2024 14:34
*Per a:* Duncan Murdoch 
*A/c:* Iago Giné Vázquez ; r-h...@r-project.org 


*Tema:* Re: [R] Is there some way to customize colours for the View output?
В Mon, 13 May 2024 06:08:22 -0400
Duncan Murdoch  пишет:


The row and column names don't appear to be controllable from that
menu, they seem (on my machine) to be displayed in the same colour as
the background of a dialog box, i.e. some kind of gray.  I don't
think R tries to control that colour, but perhaps some Windows
setting would change it.


This is entirely correct: the dialog uses the colour returned by
dialog_bg(), which is GetSysColor(COLOR_BTNFACE).

I think it could be a reasonable feature request to use an adjustable
colour for the row and column headers.

--
Best regards,
Ivan




__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] FR: Customize background colour of row and column headers for the View output

2024-05-15 Thread Iago Giné Vázquez
About the decisions:

Actually, the same way dataedittext modifies the text colour not only
of data, but also of row and column names, and dataedituser modifies
the colour of all the borders, I think dataeditbg should modify the
background of all the window, at least that "inside" those
borders. Otherwise, any other option for the background colour on row
and column headers would allow the same set of colours and with the
same names, which are those commented in Rconsole:

## Colours for console and pager(s)
# (see rw/etc/rgb.txt for the known colours).

Regarding the code, looking to the Windows data editor [1], and taking
into account what you and lastly Ivan told previously

This is entirely correct: the dialog uses the colour returned by
dialog_bg(), which is GetSysColor(COLOR_BTNFACE).

(maybe a naive question from who does not know the code), could not be
used `guiColors[dataeditbg]` instead of `dialog_bg()` in the unique
place this is present?. So, instead of

bbg = dialog_bg()

it would appear

bbg = guiColors[dataeditbg];


Thanks!
Iago


[1] https://svn.r-project.org/R/trunk/src/library/utils/src/windows/dataentry.c

De: Duncan Murdoch 
Enviat el: dimarts, 14 de maig de 2024 14:22
Per a: Iago Gin�� V��zquez ; r-devel@R-project.org 

A/c: Ivan Krylov 
Tema: Re: FR: Customize background colour of row and column headers for the 
View output

This seems like something that should be fairly easily doable.  Why
don't you work out a patch?

Some decisions to make:

- What colours are we talking about?  Would you want the labels to have
their colour set independent of the dialog colours?  If so, would you
also want to configure the dialog colours?

- What names should be used for the colours?

- Where should all of these definitions be documented?

If you don't feel comfortable with the coding, perhaps you could answer
these questions, and someone else may code it for you.  I won't (I no
longer have easy access to Windows), but I could help with the design.

Duncan Murdoch

On 2024-05-14 5:25 a.m., Iago Gin�� V��zquez wrote:
> Thanks again Duncan and Ivan,
>
> I forward then the email to R-devel.
>
> Summarizing, the dataedit options (in RGui preferences or RConsole) to
> colouring the View output do not have effect on the background of the row
> and column names (see https://ibb.co/Dkn2pVs ).
>
> Could this be implemented?
>
> Thank you!
>
> Best regards,
> Iago
> 
> *De:* Ivan Krylov 
> *Enviat el:* dilluns, 13 de maig de 2024 14:34
> *Per a:* Duncan Murdoch 
> *A/c:* Iago Gin�� V��zquez ; r-h...@r-project.org
> 
> *Tema:* Re: [R] Is there some way to customize colours for the View output?
> �� Mon, 13 May 2024 06:08:22 -0400
> Duncan Murdoch  ��ڧ�֧�:
>
>> The row and column names don't appear to be controllable from that
>> menu, they seem (on my machine) to be displayed in the same colour as
>> the background of a dialog box, i.e. some kind of gray.  I don't
>> think R tries to control that colour, but perhaps some Windows
>> setting would change it.
>
> This is entirely correct: the dialog uses the colour returned by
> dialog_bg(), which is GetSysColor(COLOR_BTNFACE).
>
> I think it could be a reasonable feature request to use an adjustable
> colour for the row and column headers.
>
> --
> Best regards,
> Ivan


[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] FR: Customize background colour of row and column headers for the View output

2024-05-14 Thread Duncan Murdoch
This seems like something that should be fairly easily doable.  Why 
don't you work out a patch?


Some decisions to make:

- What colours are we talking about?  Would you want the labels to have 
their colour set independent of the dialog colours?  If so, would you 
also want to configure the dialog colours?


- What names should be used for the colours?

- Where should all of these definitions be documented?

If you don't feel comfortable with the coding, perhaps you could answer 
these questions, and someone else may code it for you.  I won't (I no 
longer have easy access to Windows), but I could help with the design.


Duncan Murdoch

On 2024-05-14 5:25 a.m., Iago Giné Vázquez wrote:

Thanks again Duncan and Ivan,

I forward then the email to R-devel.

Summarizing, the dataedit options (in RGui preferences or RConsole) to
colouring the View output do not have effect on the background of the row
and column names (see https://ibb.co/Dkn2pVs ).

Could this be implemented?

Thank you!

Best regards,
Iago

*De:* Ivan Krylov 
*Enviat el:* dilluns, 13 de maig de 2024 14:34
*Per a:* Duncan Murdoch 
*A/c:* Iago Giné Vázquez ; r-h...@r-project.org 


*Tema:* Re: [R] Is there some way to customize colours for the View output?
В Mon, 13 May 2024 06:08:22 -0400
Duncan Murdoch  пишет:


The row and column names don't appear to be controllable from that
menu, they seem (on my machine) to be displayed in the same colour as
the background of a dialog box, i.e. some kind of gray.  I don't
think R tries to control that colour, but perhaps some Windows
setting would change it.


This is entirely correct: the dialog uses the colour returned by
dialog_bg(), which is GetSysColor(COLOR_BTNFACE).

I think it could be a reasonable feature request to use an adjustable
colour for the row and column headers.

--
Best regards,
Ivan


__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] FR: Customize background colour of row and column headers for the View output

2024-05-14 Thread Iago Giné Vázquez
Thanks again Duncan and Ivan,

I forward then the email to R-devel.

Summarizing, the dataedit options (in RGui preferences or RConsole) to
colouring the View output do not have effect on the background of the row
and column names (see https://ibb.co/Dkn2pVs).

Could this be implemented?

Thank you!

Best regards,
Iago

De: Ivan Krylov 
Enviat el: dilluns, 13 de maig de 2024 14:34
Per a: Duncan Murdoch 
A/c: Iago Gin�� V��zquez ; r-h...@r-project.org 

Tema: Re: [R] Is there some way to customize colours for the View output?

�� Mon, 13 May 2024 06:08:22 -0400
Duncan Murdoch  ��ڧ�֧�:

> The row and column names don't appear to be controllable from that
> menu, they seem (on my machine) to be displayed in the same colour as
> the background of a dialog box, i.e. some kind of gray.  I don't
> think R tries to control that colour, but perhaps some Windows
> setting would change it.

This is entirely correct: the dialog uses the colour returned by
dialog_bg(), which is GetSysColor(COLOR_BTNFACE).

I think it could be a reasonable feature request to use an adjustable
colour for the row and column headers.

--
Best regards,
Ivan

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel