Fixed ALL CAPS text bug in wxX11
Removed compiler warning in text sample git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17922 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -58,7 +58,7 @@ extern bool wxAddClientWindowToTable(Window w, wxWindow *win);
|
|||||||
// TranslateXXXEvent() functions - translate X event to wxWindow one
|
// TranslateXXXEvent() functions - translate X event to wxWindow one
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
extern bool wxTranslateMouseEvent(wxMouseEvent& wxevent, wxWindow *win, Window window, XEvent *xevent);
|
extern bool wxTranslateMouseEvent(wxMouseEvent& wxevent, wxWindow *win, Window window, XEvent *xevent);
|
||||||
extern bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, Window window, XEvent *xevent);
|
extern bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, Window window, XEvent *xevent, bool isAscii = FALSE);
|
||||||
|
|
||||||
extern Window wxGetWindowParent(Window window);
|
extern Window wxGetWindowParent(Window window);
|
||||||
|
|
||||||
|
@@ -1183,7 +1183,7 @@ void MyFrame::OnFileSave(wxCommandEvent& event)
|
|||||||
wxLogStatus(this,
|
wxLogStatus(this,
|
||||||
_T("Successfully saved file (text len = %lu, file size = %ld)"),
|
_T("Successfully saved file (text len = %lu, file size = %ld)"),
|
||||||
(unsigned long)m_panel->m_textrich->GetValue().length(),
|
(unsigned long)m_panel->m_textrich->GetValue().length(),
|
||||||
file.Length());
|
(long) file.Length());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -593,6 +593,9 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
keyEvent.SetEventType(wxEVT_CHAR);
|
keyEvent.SetEventType(wxEVT_CHAR);
|
||||||
|
// Do the translation again, retaining the ASCII
|
||||||
|
// code.
|
||||||
|
wxTranslateKeyEvent(keyEvent, win, window, event, TRUE);
|
||||||
if (win->GetEventHandler()->ProcessEvent( keyEvent ))
|
if (win->GetEventHandler()->ProcessEvent( keyEvent ))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
@@ -1514,7 +1514,7 @@ bool wxTranslateMouseEvent(wxMouseEvent& wxevent, wxWindow *win, Window window,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, Window WXUNUSED(win), XEvent *xevent)
|
bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, Window WXUNUSED(win), XEvent *xevent, bool isAscii)
|
||||||
{
|
{
|
||||||
switch (XEventGetType(xevent))
|
switch (XEventGetType(xevent))
|
||||||
{
|
{
|
||||||
@@ -1527,8 +1527,10 @@ bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, Window WXUNUSED(win
|
|||||||
(void) XLookupString ((XKeyEvent *) xevent, buf, 20, &keySym, NULL);
|
(void) XLookupString ((XKeyEvent *) xevent, buf, 20, &keySym, NULL);
|
||||||
int id = wxCharCodeXToWX (keySym);
|
int id = wxCharCodeXToWX (keySym);
|
||||||
// id may be WXK_xxx code - these are outside ASCII range, so we
|
// id may be WXK_xxx code - these are outside ASCII range, so we
|
||||||
// can't just use toupper() on id
|
// can't just use toupper() on id.
|
||||||
if (id >= 'a' && id <= 'z')
|
// Only change this if we want the raw key that was pressed,
|
||||||
|
// and don't change it if we want an ASCII value.
|
||||||
|
if (!isAscii && (id >= 'a' && id <= 'z'))
|
||||||
{
|
{
|
||||||
id = id + 'A' - 'a';
|
id = id + 'A' - 'a';
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user