1. Unicode fix for wxCmdLineParser

2. fixed toolbar buttons problem for W2K


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@8071 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-08-13 11:07:46 +00:00
parent aafdc5a46c
commit daf91c018c
4 changed files with 31 additions and 15 deletions

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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;
}
}