Added some missing wxTextCtrl features to to-do list in wxX11's readme.txt
Made the wxTipDialog fonts all Swiss (TODO: use current GUI setting for the font family) Worked around focus anomaly by suppressing parent's FocusIn event when child's focus is being set by clicking on it (TODO: move some of this to SetFocus() to make it work programmatically) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15237 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -55,9 +55,11 @@ Many of the samples are running.
|
|||||||
Some remaining issues:
|
Some remaining issues:
|
||||||
|
|
||||||
- some refresh efficiency issues
|
- some refresh efficiency issues
|
||||||
- progress dialog not working (see dialogs sample)
|
|
||||||
- clipboard implementation missing
|
- clipboard implementation missing
|
||||||
- drag and drop implementation missing
|
- drag and drop implementation missing
|
||||||
|
- wxX11's wxTextCtrl (separate from wxUniv version)
|
||||||
|
needs some work, for example to remove vertical scrollbar,
|
||||||
|
and to provide wordwrap
|
||||||
- wxToggleButton implementation missing
|
- wxToggleButton implementation missing
|
||||||
- wxSpinCtrl implementation missing
|
- wxSpinCtrl implementation missing
|
||||||
- tooltips implementation missing
|
- tooltips implementation missing
|
||||||
|
@@ -218,6 +218,7 @@ bool WidgetsApp::OnInit()
|
|||||||
|
|
||||||
//wxLog::AddTraceMask(_T("listbox"));
|
//wxLog::AddTraceMask(_T("listbox"));
|
||||||
//wxLog::AddTraceMask(_T("scrollbar"));
|
//wxLog::AddTraceMask(_T("scrollbar"));
|
||||||
|
//wxLog::AddTraceMask(_T("focus"));
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@@ -188,12 +188,13 @@ wxTipDialog::wxTipDialog(wxWindow *parent,
|
|||||||
wxDefaultPosition, wxSize(200, 160),
|
wxDefaultPosition, wxSize(200, 160),
|
||||||
wxTE_MULTILINE |
|
wxTE_MULTILINE |
|
||||||
wxTE_READONLY |
|
wxTE_READONLY |
|
||||||
|
wxTE_NO_VSCROLL |
|
||||||
wxTE_RICH | // a hack to get rid of vert scrollbar
|
wxTE_RICH | // a hack to get rid of vert scrollbar
|
||||||
wxSUNKEN_BORDER);
|
wxSUNKEN_BORDER);
|
||||||
#if defined(__WXMSW__)
|
#if defined(__WXMSW__)
|
||||||
m_text->SetFont(wxFont(12, wxROMAN, wxNORMAL, wxNORMAL));
|
m_text->SetFont(wxFont(12, wxSWISS, wxNORMAL, wxNORMAL));
|
||||||
#else
|
#else
|
||||||
m_text->SetFont(wxFont(14, wxROMAN, wxNORMAL, wxNORMAL));
|
m_text->SetFont(wxFont(14, wxSWISS, wxNORMAL, wxNORMAL));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxIcon icon = wxArtProvider::GetIcon(wxART_TIP, wxART_CMN_DIALOG);
|
wxIcon icon = wxArtProvider::GetIcon(wxART_TIP, wxART_CMN_DIALOG);
|
||||||
|
@@ -568,9 +568,9 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
|
|||||||
{
|
{
|
||||||
printf( "GraphicExpose event\n" );
|
printf( "GraphicExpose event\n" );
|
||||||
|
|
||||||
// wxLogDebug( "GraphicsExpose from %s", win->GetName().c_str(),
|
wxLogTrace( _T("expose"), _T("GraphicsExpose from %s"), win->GetName().c_str(),
|
||||||
// event->xgraphicsexpose.x, event->xgraphicsexpose.y,
|
event->xgraphicsexpose.x, event->xgraphicsexpose.y,
|
||||||
// event->xgraphicsexpose.width, event->xgraphicsexpose.height);
|
event->xgraphicsexpose.width, event->xgraphicsexpose.height);
|
||||||
|
|
||||||
win->GetUpdateRegion().Union( event->xgraphicsexpose.x, event->xgraphicsexpose.y,
|
win->GetUpdateRegion().Union( event->xgraphicsexpose.x, event->xgraphicsexpose.y,
|
||||||
event->xgraphicsexpose.width, event->xgraphicsexpose.height);
|
event->xgraphicsexpose.width, event->xgraphicsexpose.height);
|
||||||
@@ -758,6 +758,15 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
|
|||||||
g_prevFocus = wxWindow::FindFocus();
|
g_prevFocus = wxWindow::FindFocus();
|
||||||
g_nextFocus = win;
|
g_nextFocus = win;
|
||||||
|
|
||||||
|
wxLogTrace( _T("focus"), _T("About to call SetFocus on %s of type %s due to button press"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
|
||||||
|
|
||||||
|
// Record the fact that this window is
|
||||||
|
// getting the focus, because we'll need to
|
||||||
|
// check if its parent is getting a bogus
|
||||||
|
// focus and duly ignore it.
|
||||||
|
// TODO: may need to have this code in SetFocus, too.
|
||||||
|
extern wxWindow* g_GettingFocus;
|
||||||
|
g_GettingFocus = win;
|
||||||
win->SetFocus();
|
win->SetFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -781,19 +790,26 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
|
|||||||
(event->xfocus.mode == NotifyNormal))
|
(event->xfocus.mode == NotifyNormal))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
// wxLogDebug( "FocusIn from %s of type %s", win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
|
wxLogTrace( _T("focus"), _T("FocusIn from %s of type %s"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
|
||||||
#if 0
|
|
||||||
wxString msg;
|
|
||||||
msg.Printf( "FocusIn from %s of type %s\n", win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
|
|
||||||
printf(msg.c_str());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
wxFocusEvent focusEvent(wxEVT_SET_FOCUS, win->GetId());
|
extern wxWindow* g_GettingFocus;
|
||||||
focusEvent.SetEventObject(win);
|
if (g_GettingFocus && g_GettingFocus->GetParent() == win)
|
||||||
focusEvent.SetWindow( g_prevFocus );
|
{
|
||||||
g_prevFocus = NULL;
|
// Ignore this, this can be a spurious FocusIn
|
||||||
|
// caused by a child having its focus set.
|
||||||
|
g_GettingFocus = NULL;
|
||||||
|
wxLogTrace( _T("focus"), _T("FocusIn from %s of type %s being deliberately ignored"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wxFocusEvent focusEvent(wxEVT_SET_FOCUS, win->GetId());
|
||||||
|
focusEvent.SetEventObject(win);
|
||||||
|
focusEvent.SetWindow( g_prevFocus );
|
||||||
|
g_prevFocus = NULL;
|
||||||
|
|
||||||
return win->GetEventHandler()->ProcessEvent(focusEvent);
|
return win->GetEventHandler()->ProcessEvent(focusEvent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
break;
|
break;
|
||||||
@@ -805,7 +821,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
|
|||||||
(event->xfocus.mode == NotifyNormal))
|
(event->xfocus.mode == NotifyNormal))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
// wxLogDebug( "FocusOut from %s of type %s", win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
|
wxLogTrace( _T("focus"), _T("FocusOut from %s of type %s"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
|
||||||
|
|
||||||
wxFocusEvent focusEvent(wxEVT_KILL_FOCUS, win->GetId());
|
wxFocusEvent focusEvent(wxEVT_KILL_FOCUS, win->GetId());
|
||||||
focusEvent.SetEventObject(win);
|
focusEvent.SetEventObject(win);
|
||||||
|
@@ -386,18 +386,15 @@ void wxWindowX11::SetFocus()
|
|||||||
|
|
||||||
if (wxWindowIsVisible(xwindow))
|
if (wxWindowIsVisible(xwindow))
|
||||||
{
|
{
|
||||||
XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToParent, CurrentTime );
|
wxLogTrace( _T("focus"), _T("wxWindowX11::SetFocus: %s"), GetClassInfo()->GetClassName());
|
||||||
|
// XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToParent, CurrentTime );
|
||||||
|
XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToNone, CurrentTime );
|
||||||
m_needsInputFocus = FALSE;
|
m_needsInputFocus = FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_needsInputFocus = TRUE;
|
m_needsInputFocus = TRUE;
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
wxString msg;
|
|
||||||
msg.Printf("SetFocus: %s\n", GetClassInfo()->GetClassName());
|
|
||||||
printf(msg.c_str());
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the window with the focus
|
// Get the window with the focus
|
||||||
@@ -1225,6 +1222,9 @@ void wxWindowX11::OnSysColourChanged(wxSysColourChangedEvent& event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// See handler for InFocus case in app.cpp for details.
|
||||||
|
wxWindow* g_GettingFocus = NULL;
|
||||||
|
|
||||||
void wxWindowX11::OnInternalIdle()
|
void wxWindowX11::OnInternalIdle()
|
||||||
{
|
{
|
||||||
// Update invalidated regions.
|
// Update invalidated regions.
|
||||||
@@ -1247,6 +1247,7 @@ void wxWindowX11::OnInternalIdle()
|
|||||||
// no point in trying again.
|
// no point in trying again.
|
||||||
m_needsInputFocus = FALSE;
|
m_needsInputFocus = FALSE;
|
||||||
}
|
}
|
||||||
|
g_GettingFocus = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user