diff --git a/include/wx/cmdline.h b/include/wx/cmdline.h index 7e10524d01..771d9596a0 100644 --- a/include/wx/cmdline.h +++ b/include/wx/cmdline.h @@ -96,20 +96,20 @@ public: // default ctor or ctor giving the cmd line in either Unix or Win form wxCmdLineParser() { Init(); } - wxCmdLineParser(int argc, char **argv) { Init(); SetCmdLine(argc, argv); } + wxCmdLineParser(int argc, wxChar **argv) { Init(); SetCmdLine(argc, argv); } wxCmdLineParser(const wxString& cmdline) { Init(); SetCmdLine(cmdline); } // the same as above, but also gives the cmd line description - otherwise, // use AddXXX() later wxCmdLineParser(const wxCmdLineEntryDesc *desc) { Init(); SetDesc(desc); } - wxCmdLineParser(const wxCmdLineEntryDesc *desc, int argc, char **argv) + wxCmdLineParser(const wxCmdLineEntryDesc *desc, int argc, wxChar **argv) { Init(); SetCmdLine(argc, argv); SetDesc(desc); } wxCmdLineParser(const wxCmdLineEntryDesc *desc, const wxString& cmdline) { Init(); SetCmdLine(cmdline); SetDesc(desc); } // set cmd line to parse after using one of the ctors which don't do it - void SetCmdLine(int argc, char **argv); + void SetCmdLine(int argc, wxChar **argv); void SetCmdLine(const wxString& cmdline); // not virtual, don't use this class polymorphically diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index eadf625821..79623411c0 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -155,7 +155,7 @@ struct wxCmdLineParserData // methods wxCmdLineParserData(); - void SetArguments(int argc, char **argv); + void SetArguments(int argc, wxChar **argv); void SetArguments(const wxString& cmdline); int FindOption(const wxString& name); @@ -180,7 +180,7 @@ wxCmdLineParserData::wxCmdLineParserData() #endif } -void wxCmdLineParserData::SetArguments(int argc, char **argv) +void wxCmdLineParserData::SetArguments(int argc, wxChar **argv) { m_arguments.Empty(); @@ -237,7 +237,7 @@ void wxCmdLineParser::Init() m_data = new wxCmdLineParserData; } -void wxCmdLineParser::SetCmdLine(int argc, char **argv) +void wxCmdLineParser::SetCmdLine(int argc, wxChar **argv) { m_data->SetArguments(argc, argv); } diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index 7a1eae5c80..76975cd8c9 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -395,6 +395,23 @@ void wxInitializeStockObjects () wxBLUE = new wxColour ("BLUE"); wxGREEN = new wxColour ("GREEN"); wxCYAN = new wxColour ("CYAN"); + + // VZ: Here is why this colour is treated specially: normally, wxLIGHT_GREY + // is the window background colour and it is also used as the + // "transparent" colour in the bitmaps - for example, for the toolbar + // bitmaps. In particular, the mask creation code in tbar95.cpp assumes + // this - but it fails under Win2K where the system 3D colour is not + // 0xc0c0c0 (usual light grey) but 0xc6c3c6. To make everything work as + // expected there we have to define wxLIGHT_GREY accordingly - another + // solution would be to hack wxMask::Create()... +#ifdef __WIN32__ + int majOs, minOs; + if ( wxGetOsVersion(&majOs, &minOs) == wxWINDOWS_NT && (majOs == 5) ) + { + wxLIGHT_GREY = new wxColour(0xc6c3c6); + } + else +#endif // MSW wxLIGHT_GREY = new wxColour ("LIGHT GREY"); wxSTANDARD_CURSOR = new wxCursor (wxCURSOR_ARROW); diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index ff4b54afcf..dc31877957 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -36,7 +36,6 @@ #include "wx/settings.h" #include "wx/bitmap.h" #include "wx/dcmemory.h" - #include "wx/settings.h" #endif #if wxUSE_TOOLBAR && defined(__WIN95__) && wxUSE_TOOLBAR_NATIVE @@ -1055,17 +1054,17 @@ void wxMapBitmap(HBITMAP hBitmap, int width, int height) for ( j = 0; j < height; j++) { COLORREF pixel = ::GetPixel(hdcMem, i, j); -/* - BYTE red = GetRValue(pixel); - BYTE green = GetGValue(pixel); - BYTE blue = GetBValue(pixel); -*/ - for ( k = 0; k < NUM_MAPS; k ++) { - if ( ColorMap[k].from == pixel ) + int distance = 0 ; + + distance = abs( GetRValue( pixel ) - GetRValue( ColorMap[k].from )) ; + distance = max( distance , abs(GetGValue(pixel ) - GetGValue( ColorMap[k].from ))) ; + distance = max( distance , abs(GetBValue(pixel ) - GetBValue( ColorMap[k].from ))) ; + if ( distance < 0x10 ) + //if ( ColorMap[k].from == pixel ) { - /* COLORREF actualPixel = */ ::SetPixel(hdcMem, i, j, ColorMap[k].to); + ::SetPixel(hdcMem, i, j, ColorMap[k].to); break; } }