Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1:/tmp/cvs-serv18907/src/gui
Modified Files:
wxBrowseButton.cpp
Log Message:
try to show colour nams in the options dialog even if the initial string was in RGB
Index: wxBrowseButton.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxBrowseButton.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -b -u -2 -r1.29 -r1.30
--- wxBrowseButton.cpp 6 Nov 2002 00:28:24 -0000 1.29
+++ wxBrowseButton.cpp 19 Jul 2003 12:26:10 -0000 1.30
@@ -319,7 +319,14 @@
void wxColorBrowseButton::SetValue(const wxString& text)
{
+ // we might be given "RGB(r,g,b)" string but if it corresponds to a known
+ // colour, we want to show the colour name to the user, not RGB values
+ wxString nameCol;
+
if ( !text.empty() )
{
- (void)ParseColourString(text, &m_color);
+ if ( !ParseColourString(text, &m_color) )
+ {
+ nameCol = text;
+ }
}
else // no valid colour, use default one
@@ -330,5 +337,10 @@
UpdateColor();
- SetText(text);
+ if ( nameCol.empty() && m_color.Ok() )
+ {
+ nameCol = GetColourName(m_color);
+ }
+
+ SetText(nameCol);
}
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates