Use wxString::t_str() in calls to Windows API functions in wxMSW.
Use t_str() instead of wx_str() to make the code work correctly in UTF-8 build in which wx_str() returns a pointer to UTF-8 buffer while we need a wchar_t pointer for Windows. Closes #14371. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71640 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -587,7 +587,7 @@ MSW:
|
||||
- Fix handling of composite windows in wxToolTip (Armel Asselin).
|
||||
- Add VT_I8 support to wxAutomationObject (PB).
|
||||
- Fix wxListbook size calculations to avoid spurious scrollbars.
|
||||
- Fix non-GUI code compilation with wxUSE_UNICODE_UTF8 (Kolya Kosenko).
|
||||
- Fix code compilation with wxUSE_UNICODE_UTF8 (Kolya Kosenko).
|
||||
|
||||
OSX:
|
||||
|
||||
|
@@ -63,7 +63,7 @@ protected:
|
||||
// the first 2 HtmlHelp() parameters
|
||||
bool CallHtmlHelp(unsigned cmd, WXWPARAM param)
|
||||
{
|
||||
return CallHtmlHelp(GetParentWindow(), GetValidFilename().wx_str(),
|
||||
return CallHtmlHelp(GetParentWindow(), GetValidFilename().t_str(),
|
||||
cmd, param);
|
||||
}
|
||||
|
||||
|
@@ -796,7 +796,7 @@ public:
|
||||
{
|
||||
if ( IsRegistered() )
|
||||
{
|
||||
if ( !::UnregisterClass(m_clsname.wx_str(), wxGetInstance()) )
|
||||
if ( !::UnregisterClass(m_clsname.t_str(), wxGetInstance()) )
|
||||
{
|
||||
wxLogLastError(wxT("UnregisterClass"));
|
||||
}
|
||||
|
@@ -89,7 +89,7 @@ wxAcceleratorTable::wxAcceleratorTable(const wxString& resource)
|
||||
{
|
||||
m_refData = new wxAcceleratorRefData;
|
||||
|
||||
HACCEL hAccel = ::LoadAccelerators(wxGetInstance(), resource.wx_str());
|
||||
HACCEL hAccel = ::LoadAccelerators(wxGetInstance(), resource.t_str());
|
||||
M_ACCELDATA->m_hAccel = hAccel;
|
||||
M_ACCELDATA->m_ok = hAccel != 0;
|
||||
}
|
||||
|
@@ -813,7 +813,7 @@ void DrawButtonText(HDC hdc,
|
||||
// first we need to compute its bounding rect
|
||||
RECT rc;
|
||||
::CopyRect(&rc, pRect);
|
||||
::DrawText(hdc, text.wx_str(), text.length(), &rc,
|
||||
::DrawText(hdc, text.t_str(), text.length(), &rc,
|
||||
DT_CENTER | DT_CALCRECT);
|
||||
|
||||
// now center this rect inside the entire button area
|
||||
@@ -824,7 +824,7 @@ void DrawButtonText(HDC hdc,
|
||||
rc.top = pRect->top + (pRect->bottom - pRect->top)/2 - h/2;
|
||||
rc.bottom = rc.top+h;
|
||||
|
||||
::DrawText(hdc, text.wx_str(), text.length(), &rc, flags);
|
||||
::DrawText(hdc, text.t_str(), text.length(), &rc, flags);
|
||||
}
|
||||
else // single line label
|
||||
{
|
||||
@@ -851,7 +851,7 @@ void DrawButtonText(HDC hdc,
|
||||
|
||||
// notice that we must have DT_SINGLELINE for vertical alignment flags
|
||||
// to work
|
||||
::DrawText(hdc, text.wx_str(), text.length(), pRect,
|
||||
::DrawText(hdc, text.t_str(), text.length(), pRect,
|
||||
flags | DT_SINGLELINE );
|
||||
}
|
||||
}
|
||||
|
@@ -557,7 +557,7 @@ bool wxConsoleStderr::Write(const wxString& text)
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( !::WriteConsole(m_hStderr, text.wx_str(), text.length(), &ret, NULL) )
|
||||
if ( !::WriteConsole(m_hStderr, text.t_str(), text.length(), &ret, NULL) )
|
||||
{
|
||||
wxLogLastError(wxT("WriteConsole"));
|
||||
return false;
|
||||
@@ -692,7 +692,7 @@ const wxChar *wxApp::GetRegisteredClassName(const wxChar *name,
|
||||
|
||||
|
||||
ClassRegInfo regClass(name);
|
||||
wndclass.lpszClassName = regClass.regname.wx_str();
|
||||
wndclass.lpszClassName = regClass.regname.t_str();
|
||||
if ( !::RegisterClass(&wndclass) )
|
||||
{
|
||||
wxLogLastError(wxString::Format(wxT("RegisterClass(%s)"),
|
||||
@@ -701,7 +701,7 @@ const wxChar *wxApp::GetRegisteredClassName(const wxChar *name,
|
||||
}
|
||||
|
||||
wndclass.style &= ~(CS_HREDRAW | CS_VREDRAW);
|
||||
wndclass.lpszClassName = regClass.regnameNR.wx_str();
|
||||
wndclass.lpszClassName = regClass.regnameNR.t_str();
|
||||
if ( !::RegisterClass(&wndclass) )
|
||||
{
|
||||
wxLogLastError(wxString::Format(wxT("RegisterClass(%s)"),
|
||||
@@ -716,7 +716,7 @@ const wxChar *wxApp::GetRegisteredClassName(const wxChar *name,
|
||||
// function returns (it could be invalidated later if new elements are
|
||||
// added to the vector and it's reallocated but this shouldn't matter as
|
||||
// this pointer should be used right now, not stored)
|
||||
return gs_regClassesInfo.back().regname.wx_str();
|
||||
return gs_regClassesInfo.back().regname.t_str();
|
||||
}
|
||||
|
||||
bool wxApp::IsRegisteredClassName(const wxString& name)
|
||||
|
@@ -109,7 +109,7 @@ wxCalendarCtrl::Create(wxWindow *parent,
|
||||
}
|
||||
|
||||
const wxChar * const clsname = s_clsMonthCal.IsRegistered()
|
||||
? s_clsMonthCal.GetName().wx_str()
|
||||
? s_clsMonthCal.GetName().t_str()
|
||||
: MONTHCAL_CLASS;
|
||||
|
||||
if ( !MSWCreateControl(clsname, wxEmptyString, pos, size) )
|
||||
|
@@ -447,7 +447,7 @@ bool wxCheckBox::MSWOnDraw(WXDRAWITEMSTRUCT *item)
|
||||
// around it
|
||||
if ( isFocused )
|
||||
{
|
||||
if ( !::DrawText(hdc, label.wx_str(), label.length(), &rectLabel,
|
||||
if ( !::DrawText(hdc, label.t_str(), label.length(), &rectLabel,
|
||||
fmt | DT_CALCRECT) )
|
||||
{
|
||||
wxLogLastError(wxT("DrawText(DT_CALCRECT)"));
|
||||
@@ -459,7 +459,7 @@ bool wxCheckBox::MSWOnDraw(WXDRAWITEMSTRUCT *item)
|
||||
::SetTextColor(hdc, ::GetSysColor(COLOR_GRAYTEXT));
|
||||
}
|
||||
|
||||
if ( !::DrawText(hdc, label.wx_str(), label.length(), &rectLabel, fmt) )
|
||||
if ( !::DrawText(hdc, label.t_str(), label.length(), &rectLabel, fmt) )
|
||||
{
|
||||
wxLogLastError(wxT("DrawText()"));
|
||||
}
|
||||
|
@@ -333,7 +333,7 @@ int wxChoice::FindString(const wxString& s, bool bCase) const
|
||||
else
|
||||
{
|
||||
int pos = (int)SendMessage(GetHwnd(), CB_FINDSTRINGEXACT,
|
||||
(WPARAM)-1, (LPARAM)s.wx_str());
|
||||
(WPARAM)-1, wxMSW_CONV_LPARAM(s));
|
||||
|
||||
return pos == LB_ERR ? wxNOT_FOUND : pos;
|
||||
}
|
||||
@@ -360,7 +360,7 @@ void wxChoice::SetString(unsigned int n, const wxString& s)
|
||||
const bool wasSelected = static_cast<int>(n) == GetSelection();
|
||||
|
||||
::SendMessage(GetHwnd(), CB_DELETESTRING, n, 0);
|
||||
::SendMessage(GetHwnd(), CB_INSERTSTRING, n, (LPARAM)s.wx_str() );
|
||||
::SendMessage(GetHwnd(), CB_INSERTSTRING, n, wxMSW_CONV_LPARAM(s) );
|
||||
|
||||
// restore the client data
|
||||
if ( oldData )
|
||||
|
@@ -79,7 +79,7 @@ wxColourDialogHookProc(HWND hwnd,
|
||||
|
||||
const wxString title = dialog->GetTitle();
|
||||
if ( !title.empty() )
|
||||
::SetWindowText(hwnd, title.wx_str());
|
||||
::SetWindowText(hwnd, title.t_str());
|
||||
|
||||
dialog->MSWOnInitDone((WXHWND)hwnd);
|
||||
}
|
||||
|
@@ -308,7 +308,7 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD id)
|
||||
// this string is going to become the new combobox value soon but
|
||||
// we need it to be done right now, otherwise the event handler
|
||||
// could get a wrong value when it calls our GetValue()
|
||||
::SetWindowText(GetHwnd(), value.wx_str());
|
||||
::SetWindowText(GetHwnd(), value.t_str());
|
||||
|
||||
{
|
||||
wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, GetId());
|
||||
|
@@ -92,7 +92,7 @@ wxCommandLinkButton::SetMainLabelAndNote(const wxString& mainLabel,
|
||||
if ( HasNativeCommandLinkButton() )
|
||||
{
|
||||
wxButton::SetLabel(mainLabel);
|
||||
::SendMessage(m_hWnd, BCM_SETNOTE, 0, (LPARAM) note.wx_str());
|
||||
::SendMessage(m_hWnd, BCM_SETNOTE, 0, wxMSW_CONV_LPARAM(note));
|
||||
|
||||
// Preserve the user-specified label for GetLabel()
|
||||
m_labelOrig = mainLabel;
|
||||
|
@@ -132,7 +132,7 @@ bool wxControl::MSWCreateControl(const wxChar *classname,
|
||||
(
|
||||
exstyle, // extended style
|
||||
classname, // the kind of control to create
|
||||
label.wx_str(), // the window name
|
||||
label.t_str(), // the window name
|
||||
style, // the window style
|
||||
x, y, w, h, // the window position and size
|
||||
GetHwndOf(GetParent()), // parent
|
||||
@@ -163,7 +163,7 @@ bool wxControl::MSWCreateControl(const wxChar *classname,
|
||||
// Notice that 0xffff is not a valid Unicode character so the problem
|
||||
// doesn't arise in Unicode build.
|
||||
if ( !label.empty() && label[0] == -1 )
|
||||
::SetWindowText(GetHwnd(), label.wx_str());
|
||||
::SetWindowText(GetHwnd(), label.t_str());
|
||||
#endif // !wxUSE_UNICODE
|
||||
|
||||
// saving the label in m_labelOrig to return it verbatim
|
||||
@@ -453,7 +453,7 @@ int wxControlWithItems::MSWInsertOrAppendItem(unsigned pos,
|
||||
unsigned wm)
|
||||
{
|
||||
LRESULT n = SendMessage((HWND)MSWGetItemsHWND(), wm, pos,
|
||||
(LPARAM)item.wx_str());
|
||||
wxMSW_CONV_LPARAM(item));
|
||||
if ( n == CB_ERR || n == CB_ERRSPACE )
|
||||
{
|
||||
wxLogLastError(wxT("SendMessage(XX_ADD/INSERTSTRING)"));
|
||||
|
@@ -1871,7 +1871,7 @@ void wxMSWDCImpl::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y
|
||||
|
||||
SIZE sizeRect;
|
||||
const size_t len = string.length();
|
||||
if ( !::GetTextExtentPoint32(GetHdc(), string.wx_str(), len, &sizeRect) )
|
||||
if ( !::GetTextExtentPoint32(GetHdc(), string.t_str(), len, &sizeRect) )
|
||||
{
|
||||
wxLogLastError(wxT("GetTextExtentPoint32()"));
|
||||
}
|
||||
|
@@ -118,8 +118,8 @@ wxPrinterDC::wxPrinterDC(const wxString& driver_name,
|
||||
{
|
||||
if ( !driver_name.empty() && !device_name.empty() && !file.empty() )
|
||||
{
|
||||
m_hDC = (WXHDC) CreateDC(driver_name.wx_str(),
|
||||
device_name.wx_str(),
|
||||
m_hDC = (WXHDC) CreateDC(driver_name.t_str(),
|
||||
device_name.t_str(),
|
||||
file.fn_str(),
|
||||
NULL);
|
||||
}
|
||||
@@ -186,14 +186,14 @@ bool wxPrinterDCImpl::StartDoc(const wxString& message)
|
||||
{
|
||||
DOCINFO docinfo;
|
||||
docinfo.cbSize = sizeof(DOCINFO);
|
||||
docinfo.lpszDocName = message.wx_str();
|
||||
docinfo.lpszDocName = message.t_str();
|
||||
|
||||
wxString filename(m_printData.GetFilename());
|
||||
|
||||
if (filename.empty())
|
||||
docinfo.lpszOutput = NULL;
|
||||
else
|
||||
docinfo.lpszOutput = filename.wx_str();
|
||||
docinfo.lpszOutput = filename.t_str();
|
||||
|
||||
docinfo.lpszDatatype = NULL;
|
||||
docinfo.fwType = 0;
|
||||
@@ -335,7 +335,7 @@ WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& printDataConst)
|
||||
HDC hDC = ::CreateDC
|
||||
(
|
||||
NULL, // no driver name as we use device name
|
||||
deviceName.wx_str(),
|
||||
deviceName.t_str(),
|
||||
NULL, // unused
|
||||
static_cast<DEVMODE *>(lockDevMode.Get())
|
||||
);
|
||||
|
@@ -263,7 +263,7 @@ int wxDirDialog::ShowSHBrowseForFolder(WXHWND owner)
|
||||
#endif
|
||||
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT;
|
||||
bi.lpfn = BrowseCallbackProc;
|
||||
bi.lParam = (LPARAM)m_path.wx_str(); // param for the callback
|
||||
bi.lParam = wxMSW_CONV_LPARAM(m_path); // param for the callback
|
||||
|
||||
static const int verComCtl32 = wxApp::GetComCtl32Version();
|
||||
|
||||
@@ -490,7 +490,7 @@ BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData)
|
||||
}
|
||||
|
||||
SendMessage(hwnd, BFFM_SETSTATUSTEXT,
|
||||
0, (LPARAM)strDir.wx_str());
|
||||
0, wxMSW_CONV_LPARAM(strDir));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@@ -431,7 +431,7 @@ bool wxDisplayMSW::ChangeMode(const wxVideoMode& mode)
|
||||
// do change the mode
|
||||
switch ( pfnChangeDisplaySettingsEx
|
||||
(
|
||||
GetName().wx_str(), // display name
|
||||
GetName().t_str(), // display name
|
||||
pDevMode, // dev mode or NULL to reset
|
||||
NULL, // reserved
|
||||
flags,
|
||||
|
@@ -59,7 +59,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxEnhMetaFile, wxObject)
|
||||
|
||||
// we must pass NULL if the string is empty to metafile functions
|
||||
static inline const wxChar *GetMetaFileName(const wxString& fn)
|
||||
{ return !fn ? (const wxChar *)NULL : (const wxChar*)fn.wx_str(); }
|
||||
{ return !fn ? NULL : wxMSW_CONV_LPCTSTR(fn); }
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
@@ -291,7 +291,7 @@ void wxEnhMetaFileDCImpl::Create(HDC hdcRef,
|
||||
}
|
||||
|
||||
m_hDC = (WXHDC)::CreateEnhMetaFile(hdcRef, GetMetaFileName(filename),
|
||||
pRect, description.wx_str());
|
||||
pRect, description.t_str());
|
||||
if ( !m_hDC )
|
||||
{
|
||||
wxLogLastError(wxT("CreateEnhMetaFile"));
|
||||
|
@@ -310,7 +310,7 @@ wxFindReplaceDialogHookProc(HWND hwnd,
|
||||
FINDREPLACE *pFR = (FINDREPLACE *)lParam;
|
||||
wxFindReplaceDialog *dialog = (wxFindReplaceDialog *)pFR->lCustData;
|
||||
|
||||
::SetWindowText(hwnd, dialog->GetTitle().wx_str());
|
||||
::SetWindowText(hwnd, dialog->GetTitle().t_str());
|
||||
|
||||
// don't return FALSE from here or the dialog won't be shown
|
||||
return TRUE;
|
||||
|
@@ -507,7 +507,7 @@ int wxFileDialog::ShowModal()
|
||||
|
||||
of.lStructSize = gs_ofStructSize;
|
||||
of.hwndOwner = hWnd;
|
||||
of.lpstrTitle = m_message.wx_str();
|
||||
of.lpstrTitle = m_message.t_str();
|
||||
of.lpstrFileTitle = titleBuffer;
|
||||
of.nMaxFileTitle = wxMAXFILE + 1 + wxMAXEXT;
|
||||
|
||||
@@ -609,7 +609,7 @@ int wxFileDialog::ShowModal()
|
||||
}
|
||||
}
|
||||
|
||||
of.lpstrFilter = (LPTSTR)filterBuffer.wx_str();
|
||||
of.lpstrFilter = filterBuffer.t_str();
|
||||
of.nFilterIndex = m_filterIndex + 1;
|
||||
|
||||
//=== Setting defaultFileName >>=========================================
|
||||
@@ -626,7 +626,7 @@ int wxFileDialog::ShowModal()
|
||||
wxString defextBuffer; // we need it to be alive until GetSaveFileName()!
|
||||
if (HasFdFlag(wxFD_SAVE))
|
||||
{
|
||||
const wxChar* extension = filterBuffer.wx_str();
|
||||
const wxChar* extension = filterBuffer.t_str();
|
||||
int maxFilter = (int)(of.nFilterIndex*2L) - 1;
|
||||
|
||||
for( int i = 0; i < maxFilter; i++ ) // get extension
|
||||
@@ -708,7 +708,7 @@ int wxFileDialog::ShowModal()
|
||||
(of.nFileExtension && fileNameBuffer[of.nFileExtension] == wxT('\0')) )
|
||||
{
|
||||
// User has typed a filename without an extension:
|
||||
const wxChar* extension = filterBuffer.wx_str();
|
||||
const wxChar* extension = filterBuffer.t_str();
|
||||
int maxFilter = (int)(of.nFilterIndex*2L) - 1;
|
||||
|
||||
for( int i = 0; i < maxFilter; i++ ) // get extension
|
||||
|
@@ -160,7 +160,7 @@ void wxFontEnumeratorHelper::DoEnumerate()
|
||||
|
||||
#ifdef __WXWINCE__
|
||||
::EnumFontFamilies(hDC,
|
||||
m_facename.empty() ? NULL : m_facename.wx_str(),
|
||||
m_facename.empty() ? NULL : wxMSW_CONV_LPCTSTR(m_facename),
|
||||
(wxFONTENUMPROC)wxFontEnumeratorProc,
|
||||
(LPARAM)this) ;
|
||||
#else // __WIN32__
|
||||
|
@@ -323,7 +323,7 @@ bool wxBMPResourceHandler::LoadFile(wxBitmap *bitmap,
|
||||
int WXUNUSED(desiredHeight))
|
||||
{
|
||||
// TODO: load colourmap.
|
||||
bitmap->SetHBITMAP((WXHBITMAP)::LoadBitmap(wxGetInstance(), name.wx_str()));
|
||||
bitmap->SetHBITMAP((WXHBITMAP)::LoadBitmap(wxGetInstance(), name.t_str()));
|
||||
|
||||
if ( !bitmap->IsOk() )
|
||||
{
|
||||
@@ -438,7 +438,7 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon,
|
||||
desiredHeight == ::GetSystemMetrics(SM_CYICON) )
|
||||
{
|
||||
// get the specified large icon from file
|
||||
if ( !::ExtractIconEx(nameReal.wx_str(), iconIndex, &hicon, NULL, 1) )
|
||||
if ( !::ExtractIconEx(nameReal.t_str(), iconIndex, &hicon, NULL, 1) )
|
||||
{
|
||||
// it is not an error, but it might still be useful to be informed
|
||||
// about it optionally
|
||||
@@ -451,7 +451,7 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon,
|
||||
desiredHeight == ::GetSystemMetrics(SM_CYSMICON) )
|
||||
{
|
||||
// get the specified small icon from file
|
||||
if ( !::ExtractIconEx(nameReal.wx_str(), iconIndex, NULL, &hicon, 1) )
|
||||
if ( !::ExtractIconEx(nameReal.t_str(), iconIndex, NULL, &hicon, 1) )
|
||||
{
|
||||
wxLogTrace(wxT("iconload"),
|
||||
wxT("No small icons found in the file '%s'."),
|
||||
@@ -464,7 +464,7 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon,
|
||||
if ( !hicon )
|
||||
{
|
||||
// take any size icon from the file by index
|
||||
hicon = ::ExtractIcon(wxGetInstance(), nameReal.wx_str(), iconIndex);
|
||||
hicon = ::ExtractIcon(wxGetInstance(), nameReal.t_str(), iconIndex);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -518,13 +518,13 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon,
|
||||
// some icon rescaling internally which results in very ugly 16x16 icons
|
||||
if ( hasSize )
|
||||
{
|
||||
hicon = (HICON)::LoadImage(wxGetInstance(), name.wx_str(), IMAGE_ICON,
|
||||
hicon = (HICON)::LoadImage(wxGetInstance(), name.t_str(), IMAGE_ICON,
|
||||
desiredWidth, desiredHeight,
|
||||
LR_DEFAULTCOLOR);
|
||||
}
|
||||
else
|
||||
{
|
||||
hicon = ::LoadIcon(wxGetInstance(), name.wx_str());
|
||||
hicon = ::LoadIcon(wxGetInstance(), name.t_str());
|
||||
}
|
||||
|
||||
// next check if it's not a standard icon
|
||||
|
@@ -268,7 +268,7 @@ void wxHeaderCtrl::DoInsertItem(const wxHeaderColumn& col, unsigned int idx)
|
||||
// notice that we need to store the string we use the pointer to until we
|
||||
// pass it to the control
|
||||
hdi.mask |= HDI_TEXT;
|
||||
wxWxCharBuffer buf = col.GetTitle().wx_str();
|
||||
wxWxCharBuffer buf = col.GetTitle().t_str();
|
||||
hdi.pszText = buf.data();
|
||||
hdi.cchTextMax = wxStrlen(buf);
|
||||
|
||||
|
@@ -127,7 +127,7 @@ bool wxCHMHelpController::DisplaySection(const wxString& section)
|
||||
if ( section.Find(wxT(".htm")) != wxNOT_FOUND )
|
||||
{
|
||||
// interpret as a file name
|
||||
return CallHtmlHelp(HH_DISPLAY_TOPIC, section.wx_str());
|
||||
return CallHtmlHelp(HH_DISPLAY_TOPIC, wxMSW_CONV_LPCTSTR(section));
|
||||
}
|
||||
|
||||
return KeywordSearch(section);
|
||||
@@ -184,7 +184,7 @@ bool wxCHMHelpController::ShowContextHelpPopup(const wxString& text,
|
||||
const wxPoint& pos,
|
||||
wxWindow *window)
|
||||
{
|
||||
return DoDisplayTextPopup(text.wx_str(), pos, 0, window);
|
||||
return DoDisplayTextPopup(text.t_str(), pos, 0, window);
|
||||
}
|
||||
|
||||
bool wxCHMHelpController::DisplayBlock(long block)
|
||||
@@ -201,7 +201,7 @@ bool wxCHMHelpController::KeywordSearch(const wxString& k,
|
||||
HH_AKLINK link;
|
||||
link.cbStruct = sizeof(HH_AKLINK);
|
||||
link.fReserved = FALSE;
|
||||
link.pszKeywords = k.wx_str();
|
||||
link.pszKeywords = k.t_str();
|
||||
link.pszUrl = NULL;
|
||||
link.pszMsgText = NULL;
|
||||
link.pszMsgTitle = NULL;
|
||||
|
@@ -63,7 +63,7 @@ bool wxWinHelpController::DisplayContents(void)
|
||||
|
||||
wxString str = GetValidFilename(m_helpFile);
|
||||
|
||||
return (WinHelp(GetSuitableHWND(this), str.wx_str(), HELP_FINDER, 0L) != 0);
|
||||
return (WinHelp(GetSuitableHWND(this), str.t_str(), HELP_FINDER, 0L) != 0);
|
||||
}
|
||||
|
||||
bool wxWinHelpController::DisplaySection(int section)
|
||||
@@ -73,7 +73,7 @@ bool wxWinHelpController::DisplaySection(int section)
|
||||
|
||||
wxString str = GetValidFilename(m_helpFile);
|
||||
|
||||
return (WinHelp(GetSuitableHWND(this), str.wx_str(), HELP_CONTEXT, (DWORD)section) != 0);
|
||||
return (WinHelp(GetSuitableHWND(this), str.t_str(), HELP_CONTEXT, (DWORD)section) != 0);
|
||||
}
|
||||
|
||||
bool wxWinHelpController::DisplayContextPopup(int contextId)
|
||||
@@ -82,7 +82,7 @@ bool wxWinHelpController::DisplayContextPopup(int contextId)
|
||||
|
||||
wxString str = GetValidFilename(m_helpFile);
|
||||
|
||||
return (WinHelp(GetSuitableHWND(this), str.wx_str(), HELP_CONTEXTPOPUP, (DWORD) contextId) != 0);
|
||||
return (WinHelp(GetSuitableHWND(this), str.t_str(), HELP_CONTEXTPOPUP, (DWORD) contextId) != 0);
|
||||
}
|
||||
|
||||
bool wxWinHelpController::DisplayBlock(long block)
|
||||
@@ -98,8 +98,8 @@ bool wxWinHelpController::KeywordSearch(const wxString& k,
|
||||
|
||||
wxString str = GetValidFilename(m_helpFile);
|
||||
|
||||
return WinHelp(GetSuitableHWND(this), str.wx_str(), HELP_PARTIALKEY,
|
||||
(ULONG_PTR)k.wx_str()) != 0;
|
||||
return WinHelp(GetSuitableHWND(this), str.t_str(), HELP_PARTIALKEY,
|
||||
(ULONG_PTR)wxMSW_CONV_LPCTSTR(k)) != 0;
|
||||
}
|
||||
|
||||
// Can't close the help window explicitly in WinHelp
|
||||
|
@@ -257,13 +257,13 @@ bool wxIniConfig::IsEmpty() const
|
||||
{
|
||||
wxChar szBuf[1024];
|
||||
|
||||
GetPrivateProfileString(m_strGroup.wx_str(), NULL, wxT(""),
|
||||
GetPrivateProfileString(m_strGroup.t_str(), NULL, wxT(""),
|
||||
szBuf, WXSIZEOF(szBuf),
|
||||
m_strLocalFilename.wx_str());
|
||||
m_strLocalFilename.t_str());
|
||||
if ( !wxIsEmpty(szBuf) )
|
||||
return false;
|
||||
|
||||
GetProfileString(m_strGroup.wx_str(), NULL, wxT(""), szBuf, WXSIZEOF(szBuf));
|
||||
GetProfileString(m_strGroup.t_str(), NULL, wxT(""), szBuf, WXSIZEOF(szBuf));
|
||||
if ( !wxIsEmpty(szBuf) )
|
||||
return false;
|
||||
|
||||
@@ -284,13 +284,13 @@ bool wxIniConfig::DoReadString(const wxString& szKey, wxString *pstr) const
|
||||
// first look in the private INI file
|
||||
|
||||
// NB: the lpDefault param to GetPrivateProfileString can't be NULL
|
||||
GetPrivateProfileString(m_strGroup.wx_str(), strKey.wx_str(), wxT(""),
|
||||
GetPrivateProfileString(m_strGroup.t_str(), strKey.t_str(), wxT(""),
|
||||
szBuf, WXSIZEOF(szBuf),
|
||||
m_strLocalFilename.wx_str());
|
||||
m_strLocalFilename.t_str());
|
||||
if ( wxIsEmpty(szBuf) ) {
|
||||
// now look in win.ini
|
||||
wxString strKey = GetKeyName(path.Name());
|
||||
GetProfileString(m_strGroup.wx_str(), strKey.wx_str(),
|
||||
GetProfileString(m_strGroup.t_str(), strKey.t_str(),
|
||||
wxT(""), szBuf, WXSIZEOF(szBuf));
|
||||
}
|
||||
|
||||
@@ -311,8 +311,8 @@ bool wxIniConfig::DoReadLong(const wxString& szKey, long *pl) const
|
||||
|
||||
static const int nMagic = 17; // 17 is some "rare" number
|
||||
static const int nMagic2 = 28; // arbitrary number != nMagic
|
||||
long lVal = GetPrivateProfileInt(m_strGroup.wx_str(), strKey.wx_str(),
|
||||
nMagic, m_strLocalFilename.wx_str());
|
||||
long lVal = GetPrivateProfileInt(m_strGroup.t_str(), strKey.t_str(),
|
||||
nMagic, m_strLocalFilename.t_str());
|
||||
if ( lVal != nMagic ) {
|
||||
// the value was read from the file
|
||||
*pl = lVal;
|
||||
@@ -320,8 +320,8 @@ bool wxIniConfig::DoReadLong(const wxString& szKey, long *pl) const
|
||||
}
|
||||
|
||||
// is it really nMagic?
|
||||
lVal = GetPrivateProfileInt(m_strGroup.wx_str(), strKey.wx_str(),
|
||||
nMagic2, m_strLocalFilename.wx_str());
|
||||
lVal = GetPrivateProfileInt(m_strGroup.t_str(), strKey.t_str(),
|
||||
nMagic2, m_strLocalFilename.t_str());
|
||||
if ( lVal != nMagic2 ) {
|
||||
// the nMagic it returned was indeed read from the file
|
||||
*pl = lVal;
|
||||
@@ -345,9 +345,9 @@ bool wxIniConfig::DoWriteString(const wxString& szKey, const wxString& szValue)
|
||||
wxConfigPathChanger path(this, szKey);
|
||||
wxString strKey = GetPrivateKeyName(path.Name());
|
||||
|
||||
bool bOk = WritePrivateProfileString(m_strGroup.wx_str(), strKey.wx_str(),
|
||||
szValue.wx_str(),
|
||||
m_strLocalFilename.wx_str()) != 0;
|
||||
bool bOk = WritePrivateProfileString(m_strGroup.t_str(), strKey.t_str(),
|
||||
szValue.t_str(),
|
||||
m_strLocalFilename.t_str()) != 0;
|
||||
|
||||
if ( !bOk )
|
||||
{
|
||||
@@ -382,7 +382,7 @@ bool wxIniConfig::Flush(bool /* bCurrentOnly */)
|
||||
{
|
||||
// this is just the way it works
|
||||
return WritePrivateProfileString(NULL, NULL, NULL,
|
||||
m_strLocalFilename.wx_str()) != 0;
|
||||
m_strLocalFilename.t_str()) != 0;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -395,16 +395,16 @@ bool wxIniConfig::DeleteEntry(const wxString& szKey, bool bGroupIfEmptyAlso)
|
||||
wxConfigPathChanger path(this, szKey);
|
||||
wxString strKey = GetPrivateKeyName(path.Name());
|
||||
|
||||
if (WritePrivateProfileString(m_strGroup.wx_str(), strKey.wx_str(),
|
||||
NULL, m_strLocalFilename.wx_str()) == 0)
|
||||
if (WritePrivateProfileString(m_strGroup.t_str(), strKey.t_str(),
|
||||
NULL, m_strLocalFilename.t_str()) == 0)
|
||||
return false;
|
||||
|
||||
if ( !bGroupIfEmptyAlso || !IsEmpty() )
|
||||
return true;
|
||||
|
||||
// delete the current group too
|
||||
bool bOk = WritePrivateProfileString(m_strGroup.wx_str(), NULL,
|
||||
NULL, m_strLocalFilename.wx_str()) != 0;
|
||||
bool bOk = WritePrivateProfileString(m_strGroup.t_str(), NULL,
|
||||
NULL, m_strLocalFilename.t_str()) != 0;
|
||||
|
||||
if ( !bOk )
|
||||
{
|
||||
@@ -420,8 +420,8 @@ bool wxIniConfig::DeleteGroup(const wxString& szKey)
|
||||
|
||||
// passing NULL as section name to WritePrivateProfileString deletes the
|
||||
// whole section according to the docs
|
||||
bool bOk = WritePrivateProfileString(path.Name().wx_str(), NULL,
|
||||
NULL, m_strLocalFilename.wx_str()) != 0;
|
||||
bool bOk = WritePrivateProfileString(path.Name().t_str(), NULL,
|
||||
NULL, m_strLocalFilename.t_str()) != 0;
|
||||
|
||||
if ( !bOk )
|
||||
{
|
||||
@@ -438,7 +438,7 @@ bool wxIniConfig::DeleteGroup(const wxString& szKey)
|
||||
bool wxIniConfig::DeleteAll()
|
||||
{
|
||||
// first delete our group in win.ini
|
||||
WriteProfileString(GetVendorName().wx_str(), NULL, NULL);
|
||||
WriteProfileString(GetVendorName().t_str(), NULL, NULL);
|
||||
|
||||
// then delete our own ini file
|
||||
wxChar szBuf[MAX_PATH];
|
||||
|
@@ -251,7 +251,7 @@ int wxListBox::FindString(const wxString& s, bool bCase) const
|
||||
if (bCase)
|
||||
return wxItemContainerImmutable::FindString( s, bCase );
|
||||
|
||||
int pos = ListBox_FindStringExact(GetHwnd(), -1, s.wx_str());
|
||||
int pos = ListBox_FindStringExact(GetHwnd(), -1, s.t_str());
|
||||
if (pos == LB_ERR)
|
||||
return wxNOT_FOUND;
|
||||
else
|
||||
@@ -473,7 +473,7 @@ void wxListBox::SetString(unsigned int n, const wxString& s)
|
||||
if ( n == (m_noItems - 1) )
|
||||
newN = -1;
|
||||
|
||||
ListBox_InsertString(GetHwnd(), newN, s.wx_str());
|
||||
ListBox_InsertString(GetHwnd(), newN, s.t_str());
|
||||
|
||||
// restore the client data
|
||||
if ( oldData )
|
||||
|
@@ -1542,7 +1542,7 @@ long wxListCtrl::FindItem(long start, const wxString& str, bool partial)
|
||||
findInfo.flags = LVFI_STRING;
|
||||
if ( partial )
|
||||
findInfo.flags |= LVFI_PARTIAL;
|
||||
findInfo.psz = str.wx_str();
|
||||
findInfo.psz = str.t_str();
|
||||
|
||||
// ListView_FindItem() excludes the first item from search and to look
|
||||
// through all the items you need to start from -1 which is unnatural and
|
||||
@@ -3279,7 +3279,7 @@ static void wxConvertToMSWListItem(const wxListCtrl *ctrl,
|
||||
else
|
||||
{
|
||||
// pszText is not const, hence the cast
|
||||
lvItem.pszText = (wxChar *)info.m_text.wx_str();
|
||||
lvItem.pszText = wxMSW_CONV_LPTSTR(info.m_text);
|
||||
if ( lvItem.pszText )
|
||||
lvItem.cchTextMax = info.m_text.length();
|
||||
else
|
||||
@@ -3300,7 +3300,7 @@ static void wxConvertToMSWListCol(HWND hwndList,
|
||||
if ( item.m_mask & wxLIST_MASK_TEXT )
|
||||
{
|
||||
lvCol.mask |= LVCF_TEXT;
|
||||
lvCol.pszText = (wxChar *)item.m_text.wx_str(); // cast is safe
|
||||
lvCol.pszText = wxMSW_CONV_LPTSTR(item.m_text);
|
||||
}
|
||||
|
||||
if ( item.m_mask & wxLIST_MASK_FORMAT )
|
||||
|
@@ -316,7 +316,7 @@ struct wxMSWCommandLineArguments
|
||||
argv = new wxChar *[argc + 1];
|
||||
for ( int i = 0; i < argc; i++ )
|
||||
{
|
||||
argv[i] = wxStrdup(args[i].wx_str());
|
||||
argv[i] = wxStrdup(args[i].t_str());
|
||||
}
|
||||
|
||||
// argv[] must be NULL-terminated
|
||||
|
@@ -190,7 +190,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
|
||||
msflags &= ~WS_HSCROLL;
|
||||
|
||||
if ( !wxWindow::MSWCreate(wxApp::GetRegisteredClassName(wxT("wxMDIFrame")),
|
||||
title.wx_str(),
|
||||
title.t_str(),
|
||||
pos, size,
|
||||
msflags,
|
||||
exflags) )
|
||||
@@ -795,8 +795,8 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
|
||||
if ( !(style & wxFULL_REPAINT_ON_RESIZE) )
|
||||
className += wxApp::GetNoRedrawClassSuffix();
|
||||
|
||||
mcs.szClass = className.wx_str();
|
||||
mcs.szTitle = title.wx_str();
|
||||
mcs.szClass = className.t_str();
|
||||
mcs.szTitle = title.t_str();
|
||||
mcs.hOwner = wxGetInstance();
|
||||
if (x != wxDefaultCoord)
|
||||
mcs.x = x;
|
||||
@@ -1473,7 +1473,7 @@ void MDIInsertWindowMenu(wxWindow *win, WXHMENU hMenu, HMENU menuWin)
|
||||
inserted = true;
|
||||
::InsertMenu(hmenu, i, MF_BYPOSITION | MF_POPUP | MF_STRING,
|
||||
(UINT_PTR)menuWin,
|
||||
wxString(wxGetTranslation(WINDOW_MENU_LABEL)).wx_str());
|
||||
wxString(wxGetTranslation(WINDOW_MENU_LABEL)).t_str());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1482,7 +1482,7 @@ void MDIInsertWindowMenu(wxWindow *win, WXHMENU hMenu, HMENU menuWin)
|
||||
{
|
||||
::AppendMenu(hmenu, MF_POPUP,
|
||||
(UINT_PTR)menuWin,
|
||||
wxString(wxGetTranslation(WINDOW_MENU_LABEL)).wx_str());
|
||||
wxString(wxGetTranslation(WINDOW_MENU_LABEL)).t_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -592,7 +592,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
|
||||
}
|
||||
|
||||
mii.cch = itemText.length();
|
||||
mii.dwTypeData = const_cast<wxChar *>(itemText.wx_str());
|
||||
mii.dwTypeData = wxMSW_CONV_LPTSTR(itemText);
|
||||
|
||||
if ( flags & MF_POPUP )
|
||||
{
|
||||
@@ -715,7 +715,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
|
||||
itemText = wxMenuItem::GetLabelText(itemText);
|
||||
#endif
|
||||
|
||||
pData = (wxChar*)itemText.wx_str();
|
||||
pData = itemText.t_str();
|
||||
}
|
||||
|
||||
// item might have already been inserted by InsertMenuItem() above
|
||||
@@ -885,7 +885,7 @@ void wxMenu::SetTitle(const wxString& label)
|
||||
if ( !label.empty() )
|
||||
{
|
||||
if ( !::InsertMenu(hMenu, 0u, MF_BYPOSITION | MF_STRING,
|
||||
(UINT_PTR)idMenuTitle, m_title.wx_str()) ||
|
||||
(UINT_PTR)idMenuTitle, m_title.t_str()) ||
|
||||
!::InsertMenu(hMenu, 1u, MF_BYPOSITION, (unsigned)-1, NULL) )
|
||||
{
|
||||
wxLogLastError(wxT("InsertMenu"));
|
||||
@@ -911,7 +911,7 @@ void wxMenu::SetTitle(const wxString& label)
|
||||
info.fMask = MIIM_TYPE;
|
||||
info.fType = MFT_STRING;
|
||||
info.cch = m_title.length();
|
||||
info.dwTypeData = const_cast<wxChar *>(m_title.wx_str());
|
||||
info.dwTypeData = wxMSW_CONV_LPTSTR(m_title);
|
||||
if ( !SetMenuItemInfo(hMenu, 0, TRUE, & info) )
|
||||
{
|
||||
wxLogLastError(wxT("SetMenuItemInfo"));
|
||||
@@ -919,7 +919,7 @@ void wxMenu::SetTitle(const wxString& label)
|
||||
#else
|
||||
if ( !ModifyMenu(hMenu, 0u,
|
||||
MF_BYPOSITION | MF_STRING,
|
||||
(UINT_PTR)idMenuTitle, m_title.wx_str()) )
|
||||
(UINT_PTR)idMenuTitle, m_title.t_str()) )
|
||||
{
|
||||
wxLogLastError(wxT("ModifyMenu"));
|
||||
}
|
||||
@@ -1127,7 +1127,7 @@ WXHMENU wxMenuBar::Create()
|
||||
HMENU hPopupMenu = (HMENU) GetMenu(i)->GetHMenu();
|
||||
tbButton.dwData = (DWORD)hPopupMenu;
|
||||
wxString label = wxStripMenuCodes(GetMenuLabel(i));
|
||||
tbButton.iString = (int) label.wx_str();
|
||||
tbButton.iString = (int) wxMSW_CONV_LPCTSTR(label);
|
||||
|
||||
tbButton.idCommand = NewControlId();
|
||||
if ( !::SendMessage(hCommandBar, TB_INSERTBUTTON, i, (LPARAM)&tbButton) )
|
||||
@@ -1156,7 +1156,7 @@ WXHMENU wxMenuBar::Create()
|
||||
{
|
||||
if ( !::AppendMenu((HMENU)m_hMenu, MF_POPUP | MF_STRING,
|
||||
(UINT_PTR)(*it)->GetHMenu(),
|
||||
(*it)->GetTitle().wx_str()) )
|
||||
(*it)->GetTitle().t_str()) )
|
||||
{
|
||||
wxLogLastError(wxT("AppendMenu"));
|
||||
}
|
||||
@@ -1265,7 +1265,7 @@ void wxMenuBar::SetMenuLabel(size_t pos, const wxString& label)
|
||||
info.fMask = MIIM_TYPE;
|
||||
info.fType = MFT_STRING;
|
||||
info.cch = label.length();
|
||||
info.dwTypeData = const_cast<wxChar *>(label.wx_str());
|
||||
info.dwTypeData = wxMSW_CONV_LPTSTR(label);
|
||||
if ( !SetMenuItemInfo(GetHmenu(), id, TRUE, &info) )
|
||||
{
|
||||
wxLogLastError(wxT("SetMenuItemInfo"));
|
||||
@@ -1273,7 +1273,7 @@ void wxMenuBar::SetMenuLabel(size_t pos, const wxString& label)
|
||||
|
||||
#else
|
||||
if ( ::ModifyMenu(GetHmenu(), mswpos, MF_BYPOSITION | MF_STRING | flagsOld,
|
||||
id, label.wx_str()) == (int)0xFFFFFFFF )
|
||||
id, label.t_str()) == (int)0xFFFFFFFF )
|
||||
{
|
||||
wxLogLastError(wxT("ModifyMenu"));
|
||||
}
|
||||
@@ -1318,7 +1318,7 @@ wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title)
|
||||
|
||||
if ( !::InsertMenu(GetHmenu(), (UINT)mswpos,
|
||||
MF_BYPOSITION | MF_POPUP | MF_STRING,
|
||||
(UINT_PTR)GetHmenuOf(menu), title.wx_str()) )
|
||||
(UINT_PTR)GetHmenuOf(menu), title.t_str()) )
|
||||
{
|
||||
wxLogLastError(wxT("InsertMenu"));
|
||||
}
|
||||
@@ -1373,7 +1373,7 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
|
||||
HMENU hPopupMenu = (HMENU) menu->GetHMenu() ;
|
||||
tbButton.dwData = (DWORD)hPopupMenu;
|
||||
wxString label = wxStripMenuCodes(title);
|
||||
tbButton.iString = (int) label.wx_str();
|
||||
tbButton.iString = (int) wxMSW_CONV_LPCTSTR(label);
|
||||
|
||||
tbButton.idCommand = NewControlId();
|
||||
if (!::SendMessage((HWND) GetToolBar()->GetHWND(), TB_INSERTBUTTON, pos, (LPARAM)&tbButton))
|
||||
@@ -1385,7 +1385,7 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
|
||||
#else
|
||||
if ( !::InsertMenu(GetHmenu(), mswpos,
|
||||
MF_BYPOSITION | MF_POPUP | MF_STRING,
|
||||
(UINT_PTR)GetHmenuOf(menu), title.wx_str()) )
|
||||
(UINT_PTR)GetHmenuOf(menu), title.t_str()) )
|
||||
{
|
||||
wxLogLastError(wxT("InsertMenu"));
|
||||
}
|
||||
@@ -1434,7 +1434,7 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title)
|
||||
HMENU hPopupMenu = (HMENU) menu->GetHMenu() ;
|
||||
tbButton.dwData = (DWORD)hPopupMenu;
|
||||
wxString label = wxStripMenuCodes(title);
|
||||
tbButton.iString = (int) label.wx_str();
|
||||
tbButton.iString = (int) wxMSW_CONV_LPCTSTR(label);
|
||||
|
||||
tbButton.idCommand = NewControlId();
|
||||
if (!::SendMessage((HWND) GetToolBar()->GetHWND(), TB_INSERTBUTTON, pos, (LPARAM)&tbButton))
|
||||
@@ -1444,7 +1444,7 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title)
|
||||
}
|
||||
#else
|
||||
if ( !::AppendMenu(GetHmenu(), MF_POPUP | MF_STRING,
|
||||
(UINT_PTR)submenu, title.wx_str()) )
|
||||
(UINT_PTR)submenu, title.t_str()) )
|
||||
{
|
||||
wxLogLastError(wxT("AppendMenu"));
|
||||
}
|
||||
|
@@ -715,7 +715,7 @@ void wxMenuItem::SetItemLabel(const wxString& txt)
|
||||
if ( isLaterThanWin95 )
|
||||
info.fMask |= MIIM_STRING;
|
||||
//else: MIIM_TYPE already specified
|
||||
info.dwTypeData = (LPTSTR)m_text.wx_str();
|
||||
info.dwTypeData = wxMSW_CONV_LPTSTR(m_text);
|
||||
info.cch = m_text.length();
|
||||
if ( !::SetMenuItemInfo(hMenu, id, FALSE, &info) )
|
||||
{
|
||||
@@ -975,7 +975,7 @@ bool wxMenuItem::OnDrawItem(wxDC& dc, const wxRect& rc,
|
||||
int x = rcText.left;
|
||||
int y = rcText.top + (rcText.bottom - rcText.top - textSize.cy) / 2;
|
||||
|
||||
::DrawState(hdc, NULL, NULL, (LPARAM)text.wx_str(),
|
||||
::DrawState(hdc, NULL, NULL, wxMSW_CONV_LPARAM(text),
|
||||
text.length(), x, y, 0, 0, flags);
|
||||
|
||||
// ::SetTextAlign(hdc, TA_RIGHT) doesn't work with DSS_DISABLED or DSS_MONO
|
||||
@@ -1005,7 +1005,7 @@ bool wxMenuItem::OnDrawItem(wxDC& dc, const wxRect& rc,
|
||||
|
||||
int y = rcText.top + (rcText.bottom - rcText.top - accelSize.cy) / 2;
|
||||
|
||||
::DrawState(hdc, NULL, NULL, (LPARAM)accel.wx_str(),
|
||||
::DrawState(hdc, NULL, NULL, wxMSW_CONV_LPARAM(accel),
|
||||
accel.length(), x, y, 0, 0, flags);
|
||||
}
|
||||
}
|
||||
|
@@ -205,7 +205,7 @@ wxMetafileDCImpl::wxMetafileDCImpl(wxDC *owner, const wxString& file,
|
||||
m_maxY = -10000;
|
||||
if ( !file.empty() && wxFileExists(file) )
|
||||
wxRemoveFile(file);
|
||||
m_hDC = (WXHDC) CreateMetaFile(file.empty() ? NULL : file.wx_str());
|
||||
m_hDC = (WXHDC) CreateMetaFile(file.empty() ? NULL : wxMSW_CONV_LPCTSTR(file));
|
||||
|
||||
m_ok = true;
|
||||
|
||||
|
@@ -271,7 +271,7 @@ void wxMessageDialog::ReplaceStaticWithEdit()
|
||||
HWND hwndEdit = ::CreateWindow
|
||||
(
|
||||
wxT("EDIT"),
|
||||
wxTextBuffer::Translate(text).wx_str(),
|
||||
wxTextBuffer::Translate(text).t_str(),
|
||||
WS_CHILD | WS_VSCROLL | WS_VISIBLE |
|
||||
ES_MULTILINE | ES_READONLY | ES_AUTOVSCROLL,
|
||||
rc.left, rc.top,
|
||||
@@ -373,7 +373,7 @@ void wxMessageDialog::AdjustButtonLabels()
|
||||
if ( widthNeeded > wBtnNew )
|
||||
wBtnNew = widthNeeded;
|
||||
|
||||
::SetWindowText(hwndBtn, label.wx_str());
|
||||
::SetWindowText(hwndBtn, label.t_str());
|
||||
}
|
||||
|
||||
if ( wBtnNew <= wBtnOld )
|
||||
@@ -584,7 +584,7 @@ int wxMessageDialog::ShowMessageBox()
|
||||
#endif // wxUSE_MSGBOX_HOOK
|
||||
|
||||
// do show the dialog
|
||||
int msAns = MessageBox(hWnd, message.wx_str(), m_caption.wx_str(), msStyle);
|
||||
int msAns = MessageBox(hWnd, message.t_str(), m_caption.t_str(), msStyle);
|
||||
|
||||
return MSWTranslateReturnCode(msAns);
|
||||
}
|
||||
@@ -696,7 +696,7 @@ void wxMSWTaskDialogConfig::MSWCommonTaskDialogInit(TASKDIALOGCONFIG &tdc)
|
||||
TDF_POSITION_RELATIVE_TO_WINDOW |
|
||||
TDF_SIZE_TO_CONTENT;
|
||||
tdc.hInstance = wxGetInstance();
|
||||
tdc.pszWindowTitle = caption.wx_str();
|
||||
tdc.pszWindowTitle = caption.t_str();
|
||||
|
||||
// use the top level window as parent if none specified
|
||||
tdc.hwndParent = parent ? GetHwndOf(parent) : NULL;
|
||||
@@ -713,12 +713,12 @@ void wxMSWTaskDialogConfig::MSWCommonTaskDialogInit(TASKDIALOGCONFIG &tdc)
|
||||
// message in our ctor, see comment there.
|
||||
if ( !extendedMessage.empty() )
|
||||
{
|
||||
tdc.pszMainInstruction = message.wx_str();
|
||||
tdc.pszContent = extendedMessage.wx_str();
|
||||
tdc.pszMainInstruction = message.t_str();
|
||||
tdc.pszContent = extendedMessage.t_str();
|
||||
}
|
||||
else
|
||||
{
|
||||
tdc.pszContent = message.wx_str();
|
||||
tdc.pszContent = message.t_str();
|
||||
}
|
||||
|
||||
// set an icon to be used, if possible
|
||||
@@ -802,7 +802,7 @@ void wxMSWTaskDialogConfig::AddTaskDialogButton(TASKDIALOGCONFIG &tdc,
|
||||
TASKDIALOG_BUTTON &tdBtn = buttons[tdc.cButtons];
|
||||
|
||||
tdBtn.nButtonID = btnCustomId;
|
||||
tdBtn.pszButtonText = customLabel.wx_str();
|
||||
tdBtn.pszButtonText = customLabel.t_str();
|
||||
tdc.cButtons++;
|
||||
|
||||
// We should never have more than 4 buttons currently as this is the
|
||||
|
@@ -412,7 +412,7 @@ bool wxNotebook::SetPageText(size_t nPage, const wxString& strText)
|
||||
|
||||
TC_ITEM tcItem;
|
||||
tcItem.mask = TCIF_TEXT;
|
||||
tcItem.pszText = (wxChar *)strText.wx_str();
|
||||
tcItem.pszText = wxMSW_CONV_LPTSTR(strText);
|
||||
|
||||
if ( !HasFlag(wxNB_MULTILINE) )
|
||||
return TabCtrl_SetItem(GetHwnd(), nPage, &tcItem) != 0;
|
||||
@@ -686,7 +686,7 @@ bool wxNotebook::InsertPage(size_t nPage,
|
||||
if ( !strText.empty() )
|
||||
{
|
||||
tcItem.mask |= TCIF_TEXT;
|
||||
tcItem.pszText = const_cast<wxChar *>(strText.wx_str());
|
||||
tcItem.pszText = wxMSW_CONV_LPTSTR(strText);
|
||||
}
|
||||
|
||||
// hide the page: unless it is selected, it shouldn't be shown (and if it
|
||||
|
@@ -154,7 +154,7 @@ private:
|
||||
|
||||
void wxDataFormat::SetId(const wxString& format)
|
||||
{
|
||||
m_format = (wxDataFormat::NativeFormat)::RegisterClipboardFormat(format.wx_str());
|
||||
m_format = (wxDataFormat::NativeFormat)::RegisterClipboardFormat(format.t_str());
|
||||
if ( !m_format )
|
||||
{
|
||||
wxLogError(_("Couldn't register clipboard format '%s'."), format);
|
||||
@@ -1152,7 +1152,7 @@ bool wxFileDataObject::GetDataHere(void *WXUNUSED_IN_WINCE(pData)) const
|
||||
#endif // wxUSE_UNICODE_MSLU
|
||||
{
|
||||
len = m_filenames[i].length();
|
||||
memcpy(pbuf, m_filenames[i].wx_str(), len*sizeOfChar);
|
||||
memcpy(pbuf, m_filenames[i].t_str(), len*sizeOfChar);
|
||||
}
|
||||
|
||||
pbuf += len*sizeOfChar;
|
||||
|
@@ -90,7 +90,7 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc, const wxRect& rc,
|
||||
int cx = rc.GetWidth() - GetMarginWidth();
|
||||
int cy = sizeRect.cy;
|
||||
|
||||
::DrawState(hdc, NULL, NULL, (LPARAM)text.wx_str(),
|
||||
::DrawState(hdc, NULL, NULL, wxMSW_CONV_LPARAM(text),
|
||||
text.length(), x, y, cx, cy, flags);
|
||||
|
||||
} // reset to default the font, colors and brush
|
||||
|
@@ -65,7 +65,7 @@ public:
|
||||
BOOL Open( const wxString& printerName, LPPRINTER_DEFAULTS pDefault=(LPPRINTER_DEFAULTS)NULL )
|
||||
{
|
||||
Close();
|
||||
return OpenPrinter( (LPTSTR)printerName.wx_str(), &m_hPrinter, pDefault );
|
||||
return OpenPrinter( wxMSW_CONV_LPTSTR(printerName), &m_hPrinter, pDefault );
|
||||
}
|
||||
|
||||
BOOL Close()
|
||||
@@ -391,7 +391,7 @@ void wxWindowsPrintNativeData::InitializeDevMode(const wxString& printerName, Wi
|
||||
if (m_devMode)
|
||||
return;
|
||||
|
||||
LPTSTR szPrinterName = (LPTSTR)printerName.wx_str();
|
||||
LPTSTR szPrinterName = wxMSW_CONV_LPTSTR(printerName);
|
||||
|
||||
// From MSDN: How To Modify Printer Settings with the DocumentProperties() Function
|
||||
// The purpose of this is to fill the DEVMODE with privdata from printer driver.
|
||||
@@ -494,7 +494,7 @@ void wxWindowsPrintNativeData::InitializeDevMode(const wxString& printerName, Wi
|
||||
bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data )
|
||||
{
|
||||
WinPrinter printer;
|
||||
LPTSTR szPrinterName = (LPTSTR)data.GetPrinterName().wx_str();
|
||||
LPTSTR szPrinterName = wxMSW_CONV_LPTSTR(data.GetPrinterName());
|
||||
|
||||
if (!m_devMode)
|
||||
InitializeDevMode(data.GetPrinterName(), &printer);
|
||||
@@ -524,7 +524,7 @@ bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data )
|
||||
// NB: the cast is needed in the ANSI build, strangely enough
|
||||
// dmDeviceName is BYTE[] and not char[] there
|
||||
wxStrlcpy(reinterpret_cast<wxChar *>(devMode->dmDeviceName),
|
||||
name.wx_str(),
|
||||
name.t_str(),
|
||||
WXSIZEOF(devMode->dmDeviceName));
|
||||
}
|
||||
|
||||
|
@@ -170,7 +170,7 @@ BOOL CALLBACK DisplayCloseButton(HWND hwnd, LPARAM lParam)
|
||||
{
|
||||
sharedData->m_labelCancel = _("Close");
|
||||
SendMessage( hwnd, WM_SETTEXT, 0,
|
||||
(LPARAM) sharedData->m_labelCancel.wx_str() );
|
||||
wxMSW_CONV_LPARAM(sharedData->m_labelCancel) );
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -212,7 +212,7 @@ void PerformNotificationUpdates(HWND hwnd,
|
||||
}
|
||||
|
||||
if ( sharedData->m_notifications & wxSPDD_TITLE_CHANGED )
|
||||
::SetWindowText( hwnd, sharedData->m_title.wx_str() );
|
||||
::SetWindowText( hwnd, sharedData->m_title.t_str() );
|
||||
|
||||
if ( sharedData->m_notifications & wxSPDD_MESSAGE_CHANGED )
|
||||
{
|
||||
@@ -245,12 +245,12 @@ void PerformNotificationUpdates(HWND hwnd,
|
||||
::SendMessage( hwnd,
|
||||
TDM_SET_ELEMENT_TEXT,
|
||||
TDE_MAIN_INSTRUCTION,
|
||||
(LPARAM) title.wx_str() );
|
||||
wxMSW_CONV_LPARAM(title) );
|
||||
|
||||
::SendMessage( hwnd,
|
||||
TDM_SET_ELEMENT_TEXT,
|
||||
TDE_CONTENT,
|
||||
(LPARAM) body.wx_str() );
|
||||
wxMSW_CONV_LPARAM(body) );
|
||||
}
|
||||
|
||||
if ( sharedData->m_notifications & wxSPDD_EXPINFO_CHANGED )
|
||||
@@ -262,7 +262,7 @@ void PerformNotificationUpdates(HWND hwnd,
|
||||
::SendMessage( hwnd,
|
||||
TDM_SET_ELEMENT_TEXT,
|
||||
TDE_EXPANDED_INFORMATION,
|
||||
(LPARAM) expandedInformation.wx_str() );
|
||||
wxMSW_CONV_LPARAM(expandedInformation) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -806,7 +806,7 @@ void* wxProgressDialogTaskRunner::Entry()
|
||||
if ( !m_sharedData.m_expandedInformation.empty() )
|
||||
{
|
||||
tdc.pszExpandedInformation =
|
||||
m_sharedData.m_expandedInformation.wx_str();
|
||||
m_sharedData.m_expandedInformation.t_str();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -203,7 +203,7 @@ bool wxRadioBox::Create(wxWindow *parent,
|
||||
wxWindowIDRef subid = NewControlId();
|
||||
|
||||
HWND hwndBtn = ::CreateWindow(wxT("BUTTON"),
|
||||
choices[i].wx_str(),
|
||||
choices[i].t_str(),
|
||||
styleBtn,
|
||||
0, 0, 0, 0, // will be set in SetSize()
|
||||
GetHwndOf(parent),
|
||||
|
@@ -33,10 +33,10 @@
|
||||
#include "wx/dynlib.h"
|
||||
#include "wx/file.h"
|
||||
#include "wx/wfstream.h"
|
||||
#include "wx/msw/private.h"
|
||||
|
||||
// Windows headers
|
||||
#ifdef __WXWINCE__
|
||||
#include "wx/msw/private.h"
|
||||
#include <winbase.h>
|
||||
#include <winreg.h>
|
||||
#endif
|
||||
|
@@ -47,14 +47,14 @@ int wxRichMessageDialog::ShowModal()
|
||||
// add a checkbox
|
||||
if ( !m_checkBoxText.empty() )
|
||||
{
|
||||
tdc.pszVerificationText = m_checkBoxText.wx_str();
|
||||
tdc.pszVerificationText = m_checkBoxText.t_str();
|
||||
if ( m_checkBoxValue )
|
||||
tdc.dwFlags |= TDF_VERIFICATION_FLAG_CHECKED;
|
||||
}
|
||||
|
||||
// add collapsible footer
|
||||
if ( !m_detailedText.empty() )
|
||||
tdc.pszExpandedInformation = m_detailedText.wx_str();
|
||||
tdc.pszExpandedInformation = m_detailedText.t_str();
|
||||
|
||||
TaskDialogIndirect_t taskDialogIndirect = GetTaskDialogIndirectFunc();
|
||||
if ( !taskDialogIndirect )
|
||||
|
@@ -583,7 +583,7 @@ void wxSlider::SetValue(int value)
|
||||
|
||||
if ( m_labels )
|
||||
{
|
||||
::SetWindowText((*m_labels)[SliderLabel_Value], Format(value).wx_str());
|
||||
::SetWindowText((*m_labels)[SliderLabel_Value], Format(value).t_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -603,9 +603,9 @@ void wxSlider::SetRange(int minValue, int maxValue)
|
||||
if ( m_labels )
|
||||
{
|
||||
::SetWindowText((*m_labels)[SliderLabel_Min],
|
||||
Format(ValueInvertOrNot(m_rangeMin)).wx_str());
|
||||
Format(ValueInvertOrNot(m_rangeMin)).t_str());
|
||||
::SetWindowText((*m_labels)[SliderLabel_Max],
|
||||
Format(ValueInvertOrNot(m_rangeMax)).wx_str());
|
||||
Format(ValueInvertOrNot(m_rangeMax)).t_str());
|
||||
}
|
||||
|
||||
// When emulating wxSL_INVERSE style in wxWidgets, we need to update the
|
||||
|
@@ -452,7 +452,7 @@ void wxSpinCtrl::SetValue(int val)
|
||||
// to leave it like this, while we really want to always show the
|
||||
// current value in the control, so do it manually
|
||||
::SetWindowText(GetBuddyHwnd(),
|
||||
wxString::Format(wxT("%d"), val).wx_str());
|
||||
wxString::Format(wxT("%d"), val).t_str());
|
||||
}
|
||||
|
||||
m_oldValue = GetValue();
|
||||
|
@@ -460,13 +460,13 @@ void wxStaticBox::PaintForeground(wxDC& dc, const RECT& rc)
|
||||
if ( !rtl )
|
||||
{
|
||||
RECT rc2 = { x, 0, x + width, y };
|
||||
::DrawText(hdc, label.wx_str(), label.length(), &rc2,
|
||||
::DrawText(hdc, label.t_str(), label.length(), &rc2,
|
||||
drawTextFlags);
|
||||
}
|
||||
else // RTL
|
||||
{
|
||||
RECT rc2 = { x, 0, x - width, y };
|
||||
::DrawText(hdc, label.wx_str(), label.length(), &rc2,
|
||||
::DrawText(hdc, label.t_str(), label.length(), &rc2,
|
||||
drawTextFlags | DT_RTLREADING);
|
||||
}
|
||||
}
|
||||
|
@@ -317,7 +317,7 @@ void wxStatusBar::DoUpdateStatusText(int nField)
|
||||
|
||||
// Set the status text in the native control passing both field number and style.
|
||||
// NOTE: MSDN library doesn't mention that nField and style have to be 'ORed'
|
||||
if ( !StatusBar_SetText(GetHwnd(), nField | style, text.wx_str()) )
|
||||
if ( !StatusBar_SetText(GetHwnd(), nField | style, text.t_str()) )
|
||||
{
|
||||
wxLogLastError("StatusBar_SetText");
|
||||
}
|
||||
@@ -563,7 +563,7 @@ void wxStatusBar::SetStatusStyles(int n, const int styles[])
|
||||
// the fields' styles.
|
||||
// NOTE: MSDN library doesn't mention that nField and style have to be 'ORed'
|
||||
wxString text = GetStatusText(i);
|
||||
if (!StatusBar_SetText(GetHwnd(), style | i, text.wx_str()))
|
||||
if (!StatusBar_SetText(GetHwnd(), style | i, text.t_str()))
|
||||
{
|
||||
wxLogLastError("StatusBar_SetText");
|
||||
}
|
||||
|
@@ -226,7 +226,7 @@ bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip)
|
||||
notifyData.uFlags |= NIF_TIP;
|
||||
if ( !tooltip.empty() )
|
||||
{
|
||||
wxStrlcpy(notifyData.szTip, tooltip.wx_str(), WXSIZEOF(notifyData.szTip));
|
||||
wxStrlcpy(notifyData.szTip, tooltip.t_str(), WXSIZEOF(notifyData.szTip));
|
||||
}
|
||||
|
||||
bool ok = wxShellNotifyIcon(m_iconAdded ? NIM_MODIFY
|
||||
@@ -271,8 +271,8 @@ wxTaskBarIcon::ShowBalloon(const wxString& title,
|
||||
notifyData = NotifyIconData(hwnd);
|
||||
notifyData.uFlags |= NIF_INFO;
|
||||
notifyData.uTimeout = msec;
|
||||
wxStrlcpy(notifyData.szInfo, text.wx_str(), WXSIZEOF(notifyData.szInfo));
|
||||
wxStrlcpy(notifyData.szInfoTitle, title.wx_str(),
|
||||
wxStrlcpy(notifyData.szInfo, text.t_str(), WXSIZEOF(notifyData.szInfo));
|
||||
wxStrlcpy(notifyData.szInfoTitle, title.t_str(),
|
||||
WXSIZEOF(notifyData.szInfoTitle));
|
||||
|
||||
if ( flags & wxICON_INFORMATION )
|
||||
|
@@ -427,7 +427,7 @@ bool wxTextCtrl::MSWCreateText(const wxString& value,
|
||||
// implementation detail
|
||||
m_updatesCount = -2;
|
||||
|
||||
if ( !MSWCreateControl(windowClass.wx_str(), msStyle, pos, size, valueWin) )
|
||||
if ( !MSWCreateControl(windowClass.t_str(), msStyle, pos, size, valueWin) )
|
||||
return false;
|
||||
|
||||
m_updatesCount = -1;
|
||||
@@ -1109,7 +1109,7 @@ void wxTextCtrl::DoWriteText(const wxString& value, int flags)
|
||||
|
||||
::SendMessage(GetHwnd(), selectionOnly ? EM_REPLACESEL : WM_SETTEXT,
|
||||
// EM_REPLACESEL takes 1 to indicate the operation should be redoable
|
||||
selectionOnly ? 1 : 0, (LPARAM)valueDos.wx_str());
|
||||
selectionOnly ? 1 : 0, wxMSW_CONV_LPARAM(valueDos));
|
||||
|
||||
if ( !ucf.GotUpdate() && (flags & SetValue_SendEvent) )
|
||||
{
|
||||
|
@@ -625,7 +625,7 @@ wxTextEntry::~wxTextEntry()
|
||||
|
||||
void wxTextEntry::WriteText(const wxString& text)
|
||||
{
|
||||
::SendMessage(GetEditHwnd(), EM_REPLACESEL, 0, (LPARAM)text.wx_str());
|
||||
::SendMessage(GetEditHwnd(), EM_REPLACESEL, 0, wxMSW_CONV_LPARAM(text));
|
||||
}
|
||||
|
||||
wxString wxTextEntry::DoGetValue() const
|
||||
|
@@ -985,7 +985,7 @@ bool wxToolBar::Realize()
|
||||
{
|
||||
const wxString& label = tool->GetLabel();
|
||||
if ( !label.empty() )
|
||||
button.iString = (INT_PTR)label.wx_str();
|
||||
button.iString = (INT_PTR) wxMSW_CONV_LPCTSTR(label);
|
||||
}
|
||||
|
||||
button.idCommand = tool->GetId();
|
||||
|
@@ -397,7 +397,7 @@ void wxToolTip::DoAddHWND(WXHWND hWnd)
|
||||
// NMTTDISPINFO struct -- and setting the tooltip here we can have tooltips
|
||||
// of any length
|
||||
ti.hwnd = hwnd;
|
||||
ti.lpszText = const_cast<wxChar *>(m_text.wx_str());
|
||||
ti.lpszText = wxMSW_CONV_LPTSTR(m_text);
|
||||
|
||||
if ( !SendTooltipMessage(GetToolTipCtrl(), TTM_ADDTOOL, &ti) )
|
||||
{
|
||||
@@ -442,7 +442,7 @@ void wxToolTip::DoAddHWND(WXHWND hWnd)
|
||||
const wxString token = tokenizer.GetNextToken();
|
||||
|
||||
SIZE sz;
|
||||
if ( !::GetTextExtentPoint32(hdc, token.wx_str(),
|
||||
if ( !::GetTextExtentPoint32(hdc, token.t_str(),
|
||||
token.length(), &sz) )
|
||||
{
|
||||
wxLogLastError(wxT("GetTextExtentPoint32"));
|
||||
@@ -484,7 +484,7 @@ void wxToolTip::DoAddHWND(WXHWND hWnd)
|
||||
// replace the '\n's with spaces because otherwise they appear as
|
||||
// unprintable characters in the tooltip string
|
||||
m_text.Replace(wxT("\n"), wxT(" "));
|
||||
ti.lpszText = const_cast<wxChar *>(m_text.wx_str());
|
||||
ti.lpszText = wxMSW_CONV_LPTSTR(m_text);
|
||||
|
||||
if ( !SendTooltipMessage(GetToolTipCtrl(), TTM_ADDTOOL, &ti) )
|
||||
{
|
||||
@@ -561,7 +561,7 @@ void wxToolTip::DoSetTip(WXHWND hWnd)
|
||||
ti.lpszText = const_cast<wxChar *>(wxT(""));
|
||||
(void)SendTooltipMessage(GetToolTipCtrl(), TTM_UPDATETIPTEXT, &ti);
|
||||
|
||||
ti.lpszText = const_cast<wxChar *>(m_text.wx_str());
|
||||
ti.lpszText = wxMSW_CONV_LPTSTR(m_text);
|
||||
(void)SendTooltipMessage(GetToolTipCtrl(), TTM_UPDATETIPTEXT, &ti);
|
||||
}
|
||||
|
||||
|
@@ -473,7 +473,7 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate,
|
||||
|
||||
if ( !title.empty() )
|
||||
{
|
||||
::SetWindowText(GetHwnd(), title.wx_str());
|
||||
::SetWindowText(GetHwnd(), title.t_str());
|
||||
}
|
||||
|
||||
SubclassWin(m_hWnd);
|
||||
@@ -523,7 +523,7 @@ bool wxTopLevelWindowMSW::CreateFrame(const wxString& title,
|
||||
#endif
|
||||
|
||||
return MSWCreate(MSWGetRegisteredClassName(),
|
||||
title.wx_str(), pos, sz, flags, exflags);
|
||||
title.t_str(), pos, sz, flags, exflags);
|
||||
}
|
||||
|
||||
bool wxTopLevelWindowMSW::Create(wxWindow *parent,
|
||||
|
@@ -959,7 +959,7 @@ void wxTreeCtrl::SetItemText(const wxTreeItemId& item, const wxString& text)
|
||||
return;
|
||||
|
||||
wxTreeViewItem tvItem(item, TVIF_TEXT);
|
||||
tvItem.pszText = (wxChar *)text.wx_str(); // conversion is ok
|
||||
tvItem.pszText = wxMSW_CONV_LPTSTR(text);
|
||||
DoSetItem(&tvItem);
|
||||
|
||||
// when setting the text of the item being edited, the text control should
|
||||
@@ -972,7 +972,7 @@ void wxTreeCtrl::SetItemText(const wxTreeItemId& item, const wxString& text)
|
||||
{
|
||||
if ( item == m_idEdited )
|
||||
{
|
||||
::SetWindowText(hwndEdit, text.wx_str());
|
||||
::SetWindowText(hwndEdit, text.t_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1476,7 +1476,7 @@ wxTreeItemId wxTreeCtrl::DoInsertAfter(const wxTreeItemId& parent,
|
||||
if ( !text.empty() )
|
||||
{
|
||||
mask |= TVIF_TEXT;
|
||||
tvIns.item.pszText = (wxChar *)text.wx_str(); // cast is ok
|
||||
tvIns.item.pszText = wxMSW_CONV_LPTSTR(text);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -141,7 +141,7 @@ bool wxGetHostName(wxChar *buf, int maxSize)
|
||||
!regKey.QueryValue(wxT("Name"), hostName) )
|
||||
return false;
|
||||
|
||||
wxStrlcpy(buf, hostName.wx_str(), maxSize);
|
||||
wxStrlcpy(buf, hostName.t_str(), maxSize);
|
||||
#else // !__WXWINCE__
|
||||
DWORD nSize = maxSize;
|
||||
if ( !::GetComputerName(buf, &nSize) )
|
||||
|
@@ -373,7 +373,7 @@ bool wxLaunchDefaultApplication(const wxString& document, int flags)
|
||||
wxUnusedVar(flags);
|
||||
|
||||
WinStruct<SHELLEXECUTEINFO> sei;
|
||||
sei.lpFile = document.wx_str();
|
||||
sei.lpFile = document.t_str();
|
||||
#ifdef __WXWINCE__
|
||||
sei.nShow = SW_SHOWNORMAL; // SW_SHOWDEFAULT not defined under CE (#10216)
|
||||
#else
|
||||
|
@@ -612,7 +612,7 @@ wxIcon wxFSVolume::GetIcon(wxFSIconType type) const
|
||||
}
|
||||
|
||||
SHFILEINFO fi;
|
||||
long rc = SHGetFileInfo(m_volName.wx_str(), 0, &fi, sizeof(fi), flags);
|
||||
long rc = SHGetFileInfo(m_volName.t_str(), 0, &fi, sizeof(fi), flags);
|
||||
m_icons[type].SetHICON((WXHICON)fi.hIcon);
|
||||
if (!rc || !fi.hIcon)
|
||||
{
|
||||
|
@@ -403,7 +403,7 @@ bool wxToolMenuBar::Realize()
|
||||
const wxString& label = tool->GetLabel();
|
||||
if ( !label.empty() )
|
||||
{
|
||||
button.iString = (int)label.wx_str();
|
||||
button.iString = (int) wxMSW_CONV_LPCTSTR(label);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2174,7 +2174,7 @@ void wxWindowMSW::DoGetTextExtent(const wxString& string,
|
||||
|
||||
SIZE sizeRect;
|
||||
TEXTMETRIC tm;
|
||||
::GetTextExtentPoint32(hdc, string.wx_str(), string.length(), &sizeRect);
|
||||
::GetTextExtentPoint32(hdc, string.t_str(), string.length(), &sizeRect);
|
||||
GetTextMetrics(hdc, &tm);
|
||||
|
||||
if ( x )
|
||||
@@ -3761,8 +3761,8 @@ bool wxWindowMSW::MSWCreate(const wxChar *wclass,
|
||||
m_hWnd = (WXHWND)::CreateWindowEx
|
||||
(
|
||||
extendedStyle,
|
||||
className.wx_str(),
|
||||
title ? title : m_windowName.wx_str(),
|
||||
className.t_str(),
|
||||
title ? title : m_windowName.t_str(),
|
||||
style,
|
||||
x, y, w, h,
|
||||
(HWND)MSWGetParent(),
|
||||
@@ -3882,7 +3882,7 @@ bool wxWindowMSW::HandleTooltipNotify(WXUINT code,
|
||||
(
|
||||
CP_ACP,
|
||||
0, // no flags
|
||||
ttip.wx_str(),
|
||||
ttip.t_str(),
|
||||
tipLength,
|
||||
buf,
|
||||
WXSIZEOF(buf) - 1
|
||||
@@ -5826,7 +5826,7 @@ int wxWindowMSW::HandleMenuChar(int WXUNUSED_IN_WINCE(chAccel),
|
||||
wxMenuItem *item = (wxMenuItem*)mii.dwItemData;
|
||||
|
||||
const wxString label(item->GetItemLabel());
|
||||
const wxChar *p = wxStrchr(label.wx_str(), wxT('&'));
|
||||
const wxChar *p = wxStrchr(label.t_str(), wxT('&'));
|
||||
while ( p++ )
|
||||
{
|
||||
if ( *p == wxT('&') )
|
||||
|
Reference in New Issue
Block a user