wxMenu *wxCurrentPopupMenu = NULL;
extern wxList WXDLLEXPORT wxPendingDelete;
-extern char wxCanvasClassName[];
+extern wxChar wxCanvasClassName[];
#ifdef __WXDEBUG__
// see comments in dcclient.cpp where g_isPainting is defined
long style,
const wxString& name)
{
- wxCHECK_MSG( parent, FALSE, "can't create wxWindow without parent" );
+ wxCHECK_MSG( parent, FALSE, _T("can't create wxWindow without parent") );
CreateBase(parent, id, pos, size, style, name);
void wxWindow::SubclassWin(WXHWND hWnd)
{
- wxASSERT_MSG( !m_oldWndProc, "subclassing window twice?" );
+ wxASSERT_MSG( !m_oldWndProc, _T("subclassing window twice?") );
wxAssociateWinWithHandle((HWND)hWnd, this);
SIZE sizeRect;
TEXTMETRIC tm;
- GetTextExtentPoint(dc, (const char *)string, (int)string.Length(), &sizeRect);
+ GetTextExtentPoint(dc, (const wxChar *)string, (int)string.Length(), &sizeRect);
GetTextMetrics(dc, &tm);
if ( fontToUse && fnt && hfontOld )
void wxWindow::UnpackCtlColor(WXWPARAM wParam, WXLPARAM lParam,
WXWORD *nCtlColor, WXHDC *hdc, WXHWND *hwnd)
{
- *control = (WXHWND)LOWORD(lParam);
+ *hwnd = (WXHWND)LOWORD(lParam);
*nCtlColor = (int)HIWORD(lParam);
*hdc = (WXHDC)wParam;
}
{
// trace all messages - useful for the debugging
#ifdef __WXDEBUG__
- wxLogTrace(wxTraceMessages, "Processing %s(wParam=%8lx, lParam=%8lx)",
+ wxLogTrace(wxTraceMessages, _T("Processing %s(wParam=%8lx, lParam=%8lx)"),
wxGetMessageName(message), wParam, lParam);
#endif // __WXDEBUG__
break;
case WM_GETMINMAXINFO:
- processed = HandleGetMinMaxInfo((LPMINMAXINFO)lParam);
+ processed = HandleGetMinMaxInfo((MINMAXINFO*)lParam);
break;
case WM_SETCURSOR:
if ( !processed )
{
#ifdef __WXDEBUG__
- wxLogTrace(wxTraceMessages, "Forwarding %s to DefWindowProc.",
+ wxLogTrace(wxTraceMessages, _T("Forwarding %s to DefWindowProc."),
wxGetMessageName(message));
#endif // __WXDEBUG__
rc.result = MSWDefWindowProc(message, wParam, lParam);
// adding NULL hWnd is (first) surely a result of an error and
// (secondly) breaks menu command processing
wxCHECK_RET( hWnd != (HWND)NULL,
- "attempt to add a NULL hWnd to window list ignored" );
+ _T("attempt to add a NULL hWnd to window list ignored") );
if ( !wxWinHandleList->Find((long)hWnd) )
wxWinHandleList->Append((long)hWnd, win);
int i;
for (i = 0; i < N; i++)
{
- char buf[100];
+ wxChar buf[100];
int chars = GetMenuString(hMenu, i, buf, 100, MF_BYPOSITION);
if ( !chars )
{
- wxLogLastError("GetMenuString");
+ wxLogLastError(_T("GetMenuString"));
continue;
}
- if ( strcmp(buf, "&Window") == 0 )
+ if ( wxStrcmp(buf, _T("&Window")) == 0 )
{
RemoveMenu(hMenu, i, MF_BYPOSITION);
bool wxWindow::MSWCreate(int id,
wxWindow *parent,
- const char *wclass,
+ const wxChar *wclass,
wxWindow *wx_win,
- const char *title,
+ const wxChar *title,
int x,
int y,
int width,
int height,
WXDWORD style,
- const char *dialog_template,
+ const wxChar *dialog_template,
WXDWORD extendedStyle)
{
int x1 = CW_USEDEFAULT;
if ( !::SetWindowPos(GetHwnd(), HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE) )
{
- wxLogLastError("SetWindowPos");
+ wxLogLastError(_T("SetWindowPos"));
}
}
// move the dialog to its initial position without forcing repainting
if ( !::MoveWindow(GetHwnd(), x1, y1, width1, height1, FALSE) )
{
- wxLogLastError("MoveWindow");
+ wxLogLastError(_T("MoveWindow"));
}
}
else
m_hWnd = (WXHWND)CreateWindowEx(extendedStyle,
wclass,
- title ? title : "",
+ title ? title : _T(""),
style,
x1, y1,
width1, height1,
if ( hdr->code == TTN_NEEDTEXT && m_tooltip )
{
TOOLTIPTEXT *ttt = (TOOLTIPTEXT *)lParam;
- ttt->lpszText = (char *)m_tooltip->GetTip().c_str();
+ ttt->lpszText = (wxChar *)m_tooltip->GetTip().c_str();
// processed
return TRUE;
int wIndex;
for (wIndex=0; wIndex < (int)gwFilesDropped; wIndex++)
{
- DragQueryFile (hFilesInfo, wIndex, (LPSTR) wxBuffer, 1000);
+ DragQueryFile (hFilesInfo, wIndex, (LPTSTR) wxBuffer, 1000);
files[wIndex] = wxBuffer;
}
DragFinish (hFilesInfo);
return FALSE;
}
-#if wxUSE_OWNER_DRAWN
// ---------------------------------------------------------------------------
// owner drawn stuff
// ---------------------------------------------------------------------------
bool wxWindow::MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *itemStruct)
{
+#if wxUSE_OWNER_DRAWN
// is it a menu item?
if ( id == 0 )
{
return ((wxControl *)item)->MSWOnDraw(itemStruct);
}
else
+#endif
return FALSE;
+
}
bool wxWindow::MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *itemStruct)
{
+#if wxUSE_OWNER_DRAWN
// is it a menu item?
if ( id == 0 )
{
{
return ((wxControl *)item)->MSWOnMeasure(itemStruct);
}
-
+#endif // owner-drawn menus
return FALSE;
}
-#endif // owner-drawn menus
// ---------------------------------------------------------------------------
// colours and palettes
break;
default:
- wxFAIL_MSG("no such joystick event");
+ wxFAIL_MSG(_T("no such joystick event"));
return FALSE;
}