Applied patch [ 605592 ] Unicode patch for dirctrlg.cpp
Markus Greither just compiled the wxWindows CVS trunk using BCC5.5.1 and UNICODE. I noticed a small bug in girctrlg.cpp, that prevented compilation. There are more such glitches in the wxGrid, but as I was running out of time, I disabled this for now. Otherwise, compilation worked fine and I was able to run the minimal sample (using UNICOWS on my WIN98SE). (I also corrected some wxGrid Unicode string typos -- JACS) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@17016 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1001,7 +1001,7 @@ bool wxGenericDirCtrl::ExpandPath(const wxString& path)
|
|||||||
{
|
{
|
||||||
wxDirItemData* data = (wxDirItemData*) m_treeCtrl->GetItemData(childId);
|
wxDirItemData* data = (wxDirItemData*) m_treeCtrl->GetItemData(childId);
|
||||||
|
|
||||||
if (data && data->m_path != "" && !data->m_isDir)
|
if (data && data->m_path != wxT("") && !data->m_isDir)
|
||||||
{
|
{
|
||||||
m_treeCtrl->SelectItem(childId);
|
m_treeCtrl->SelectItem(childId);
|
||||||
m_treeCtrl->EnsureVisible(childId);
|
m_treeCtrl->EnsureVisible(childId);
|
||||||
|
@@ -722,7 +722,7 @@ void wxGridCellTextEditor::HandleReturn( wxKeyEvent&
|
|||||||
// wxMotif needs a little extra help...
|
// wxMotif needs a little extra help...
|
||||||
size_t pos = (size_t)( Text()->GetInsertionPoint() );
|
size_t pos = (size_t)( Text()->GetInsertionPoint() );
|
||||||
wxString s( Text()->GetValue() );
|
wxString s( Text()->GetValue() );
|
||||||
s = s.Left(pos) + "\n" + s.Mid(pos);
|
s = s.Left(pos) + wxT("\n") + s.Mid(pos);
|
||||||
Text()->SetValue(s);
|
Text()->SetValue(s);
|
||||||
Text()->SetInsertionPoint( pos );
|
Text()->SetInsertionPoint( pos );
|
||||||
#else
|
#else
|
||||||
@@ -1125,7 +1125,7 @@ bool wxGridCellFloatEditor::IsAcceptedKey(wxKeyEvent& event)
|
|||||||
default:
|
default:
|
||||||
// additionally accept 'e' as in '1e+6'
|
// additionally accept 'e' as in '1e+6'
|
||||||
if ( (keycode < 128) &&
|
if ( (keycode < 128) &&
|
||||||
(isdigit(keycode) || tolower(keycode) == 'e') )
|
(isdigit(keycode) || tolower(keycode) == wxT('e')) )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1217,7 +1217,7 @@ void wxGridCellBoolEditor::BeginEdit(int row, int col, wxGrid* grid)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxString cellval( grid->GetTable()->GetValue(row, col) );
|
wxString cellval( grid->GetTable()->GetValue(row, col) );
|
||||||
m_startValue = !( !cellval || (cellval == "0") );
|
m_startValue = !( !cellval || (cellval == wxT("0")) );
|
||||||
}
|
}
|
||||||
CBox()->SetValue(m_startValue);
|
CBox()->SetValue(m_startValue);
|
||||||
CBox()->SetFocus();
|
CBox()->SetFocus();
|
||||||
@@ -1863,7 +1863,7 @@ void wxGridCellBoolRenderer::Draw(wxGrid& grid,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxString cellval( grid.GetTable()->GetValue(row, col) );
|
wxString cellval( grid.GetTable()->GetValue(row, col) );
|
||||||
value = !( !cellval || (cellval == "0") );
|
value = !( !cellval || (cellval == wxT("0")) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( value )
|
if ( value )
|
||||||
@@ -3491,7 +3491,7 @@ wxGridWindow::wxGridWindow( wxGrid *parent,
|
|||||||
wxGridRowLabelWindow *rowLblWin,
|
wxGridRowLabelWindow *rowLblWin,
|
||||||
wxGridColLabelWindow *colLblWin,
|
wxGridColLabelWindow *colLblWin,
|
||||||
wxWindowID id, const wxPoint &pos, const wxSize &size )
|
wxWindowID id, const wxPoint &pos, const wxSize &size )
|
||||||
: wxWindow( parent, id, pos, size, wxWANTS_CHARS, "grid window" )
|
: wxWindow( parent, id, pos, size, wxWANTS_CHARS, wxT("grid window") )
|
||||||
{
|
{
|
||||||
m_owner = parent;
|
m_owner = parent;
|
||||||
m_rowLabelWin = rowLblWin;
|
m_rowLabelWin = rowLblWin;
|
||||||
|
@@ -340,7 +340,7 @@ wxGridCellAutoWrapStringRenderer::GetTextLines(wxGrid& grid,
|
|||||||
|
|
||||||
dc.SetFont(attr.GetFont());
|
dc.SetFont(attr.GetFont());
|
||||||
wxStringTokenizer tk(data , _T(" \n\t\r"));
|
wxStringTokenizer tk(data , _T(" \n\t\r"));
|
||||||
wxString thisline("");
|
wxString thisline(wxT(""));
|
||||||
|
|
||||||
while ( tk.HasMoreTokens() )
|
while ( tk.HasMoreTokens() )
|
||||||
{
|
{
|
||||||
@@ -381,7 +381,7 @@ wxGridCellAutoWrapStringRenderer::GetBestSize(wxGrid& grid,
|
|||||||
wxRect rect(0,0,width,10);
|
wxRect rect(0,0,width,10);
|
||||||
|
|
||||||
// M is a nice large character 'y' gives descender!.
|
// M is a nice large character 'y' gives descender!.
|
||||||
dc.GetTextExtent("My", &x, &y);
|
dc.GetTextExtent(wxT("My"), &x, &y);
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@@ -216,7 +216,7 @@ bool wxGenericGrid::Create(wxWindow *parent,
|
|||||||
m_dragRowOrCol = 0;
|
m_dragRowOrCol = 0;
|
||||||
m_dragStartPosition = 0;
|
m_dragStartPosition = 0;
|
||||||
m_dragLastPosition = 0;
|
m_dragLastPosition = 0;
|
||||||
m_divisionPen = * wxThePenList->FindOrCreatePen("LIGHT GREY", 1, wxSOLID);
|
m_divisionPen = * wxThePenList->FindOrCreatePen(wxT("LIGHT GREY"), 1, wxSOLID);
|
||||||
m_highlightPen = * wxBLACK_PEN;
|
m_highlightPen = * wxBLACK_PEN;
|
||||||
m_doubleBufferingBitmap = (wxBitmap *) NULL;
|
m_doubleBufferingBitmap = (wxBitmap *) NULL;
|
||||||
|
|
||||||
@@ -267,7 +267,7 @@ bool wxGenericGrid::Create(wxWindow *parent,
|
|||||||
|
|
||||||
m_editingPanel = new wxPanel(this);
|
m_editingPanel = new wxPanel(this);
|
||||||
|
|
||||||
m_textItem = new wxTextCtrl(m_editingPanel, wxGRID_TEXT_CTRL, "",
|
m_textItem = new wxTextCtrl(m_editingPanel, wxGRID_TEXT_CTRL, wxT(""),
|
||||||
wxPoint(m_editControlPosition.x, m_editControlPosition.y),
|
wxPoint(m_editControlPosition.x, m_editControlPosition.y),
|
||||||
wxSize(m_editControlPosition.width, -1),
|
wxSize(m_editControlPosition.width, -1),
|
||||||
wxTE_PROCESS_ENTER);
|
wxTE_PROCESS_ENTER);
|
||||||
@@ -287,7 +287,7 @@ bool wxGenericGrid::Create(wxWindow *parent,
|
|||||||
|
|
||||||
// SetSize(pos.x, pos.y, size.x, size.y);
|
// SetSize(pos.x, pos.y, size.x, size.y);
|
||||||
|
|
||||||
m_inPlaceTextItem = new wxTextCtrl( (wxPanel*)this, wxGRID_EDIT_IN_PLACE_TEXT_CTRL, "",
|
m_inPlaceTextItem = new wxTextCtrl( (wxPanel*)this, wxGRID_EDIT_IN_PLACE_TEXT_CTRL, wxT(""),
|
||||||
wxPoint( m_currentRect.x-wxIPE_ADJUST, m_currentRect.y-wxIPE_ADJUST ),
|
wxPoint( m_currentRect.x-wxIPE_ADJUST, m_currentRect.y-wxIPE_ADJUST ),
|
||||||
wxSize( m_currentRect.width+wxIPE_ADJUST*2, m_currentRect.height+wxIPE_ADJUST*2 ),
|
wxSize( m_currentRect.width+wxIPE_ADJUST*2, m_currentRect.height+wxIPE_ADJUST*2 ),
|
||||||
wxNO_BORDER | wxTE_PROCESS_ENTER );
|
wxNO_BORDER | wxTE_PROCESS_ENTER );
|
||||||
@@ -1477,7 +1477,7 @@ void wxGenericGrid::OnSelectCellImplementation(wxDC *dc, int row, int col)
|
|||||||
if (cell)
|
if (cell)
|
||||||
{
|
{
|
||||||
if ( cell->GetTextValue().IsNull() )
|
if ( cell->GetTextValue().IsNull() )
|
||||||
m_textItem->SetValue("");
|
m_textItem->SetValue(wxT(""));
|
||||||
else
|
else
|
||||||
m_textItem->SetValue(cell->GetTextValue());
|
m_textItem->SetValue(cell->GetTextValue());
|
||||||
}
|
}
|
||||||
@@ -1518,7 +1518,7 @@ void wxGenericGrid::OnSelectCellImplementation(wxDC *dc, int row, int col)
|
|||||||
m_inPlaceTextItem->SetForegroundColour(cell->GetTextColour());
|
m_inPlaceTextItem->SetForegroundColour(cell->GetTextColour());
|
||||||
|
|
||||||
if ( cell->GetTextValue().IsNull() ) {
|
if ( cell->GetTextValue().IsNull() ) {
|
||||||
m_inPlaceTextItem->SetValue( "" );
|
m_inPlaceTextItem->SetValue( wxT("") );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_inPlaceTextItem->SetValue( cell->GetTextValue() );
|
m_inPlaceTextItem->SetValue( cell->GetTextValue() );
|
||||||
@@ -1572,7 +1572,7 @@ void wxGenericGrid::OnChangeLabels()
|
|||||||
int i;
|
int i;
|
||||||
for (i = 0; i < m_totalRows; i++)
|
for (i = 0; i < m_totalRows; i++)
|
||||||
{
|
{
|
||||||
sprintf(buf, "%d", i+1);
|
sprintf(buf, wxT("%d"), i+1);
|
||||||
SetLabelValue(wxVERTICAL, buf, i);
|
SetLabelValue(wxVERTICAL, buf, i);
|
||||||
}
|
}
|
||||||
// A...Z,AA...ZZ,AAA...ZZZ, etc.
|
// A...Z,AA...ZZ,AAA...ZZZ, etc.
|
||||||
@@ -1585,7 +1585,7 @@ void wxGenericGrid::OnChangeLabels()
|
|||||||
for (j = 0; j < noTimes; j++)
|
for (j = 0; j < noTimes; j++)
|
||||||
{
|
{
|
||||||
char buf2[20];
|
char buf2[20];
|
||||||
sprintf(buf2, "%c", (char)ch);
|
sprintf(buf2, wxT("%c"), (char)ch);
|
||||||
strcat(buf, buf2);
|
strcat(buf, buf2);
|
||||||
}
|
}
|
||||||
SetLabelValue(wxHORIZONTAL, buf, i);
|
SetLabelValue(wxHORIZONTAL, buf, i);
|
||||||
@@ -1666,7 +1666,7 @@ void wxGenericGrid::DrawCellText()
|
|||||||
rect.height -= 4;
|
rect.height -= 4;
|
||||||
|
|
||||||
// FIXME: what's this string of spaces supposed to represent?
|
// FIXME: what's this string of spaces supposed to represent?
|
||||||
DrawTextRect(& dc, " ", &rect, wxLEFT);
|
DrawTextRect(& dc, wxT(" "), &rect, wxLEFT);
|
||||||
DrawTextRect(& dc, editValue, &rect, cell->GetAlignment());
|
DrawTextRect(& dc, editValue, &rect, cell->GetAlignment());
|
||||||
|
|
||||||
dc.DestroyClippingRegion();
|
dc.DestroyClippingRegion();
|
||||||
@@ -1962,7 +1962,7 @@ void wxGenericGrid::RefreshCell(int row, int col, bool setText)
|
|||||||
|
|
||||||
wxString& wxGenericGrid::GetCellValue(int row, int col) const
|
wxString& wxGenericGrid::GetCellValue(int row, int col) const
|
||||||
{
|
{
|
||||||
static wxString emptyString("");
|
static wxString emptyString(wxT(""));
|
||||||
|
|
||||||
wxGridCell *cell = GetCell(row, col);
|
wxGridCell *cell = GetCell(row, col);
|
||||||
if (cell)
|
if (cell)
|
||||||
@@ -2044,7 +2044,7 @@ void wxGenericGrid::SetLabelValue(int orientation, const wxString& val, int pos)
|
|||||||
|
|
||||||
wxString& wxGenericGrid::GetLabelValue(int orientation, int pos) const
|
wxString& wxGenericGrid::GetLabelValue(int orientation, int pos) const
|
||||||
{
|
{
|
||||||
static wxString emptyString = "";
|
static wxString emptyString = wxT("");
|
||||||
wxGridCell *cell = GetLabelCell(orientation, pos);
|
wxGridCell *cell = GetLabelCell(orientation, pos);
|
||||||
if (cell)
|
if (cell)
|
||||||
return cell->GetTextValue();
|
return cell->GetTextValue();
|
||||||
@@ -2161,7 +2161,7 @@ void wxGenericGrid::SetEditInPlace(bool edit)
|
|||||||
m_inPlaceTextItem->SetForegroundColour(cell->GetTextColour());
|
m_inPlaceTextItem->SetForegroundColour(cell->GetTextColour());
|
||||||
|
|
||||||
if ( cell->GetTextValue().IsNull() ) {
|
if ( cell->GetTextValue().IsNull() ) {
|
||||||
m_inPlaceTextItem->SetValue( "" );
|
m_inPlaceTextItem->SetValue( wxT("") );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_inPlaceTextItem->SetValue( cell->GetTextValue() );
|
m_inPlaceTextItem->SetValue( cell->GetTextValue() );
|
||||||
|
Reference in New Issue
Block a user