#include "wx/fontutil.h"
-#ifdef __WXDEBUG__
+#if wxDEBUG_LEVEL
#include "wx/thread.h"
#endif
// debug
//-----------------------------------------------------------------------------
-#ifdef __WXDEBUG__
-
#if wxUSE_THREADS
-# define DEBUG_MAIN_THREAD if (wxThread::IsMain() && g_mainThreadLocked) printf("gui reentrance");
+# define DEBUG_MAIN_THREAD \
+ wxASSERT_MSG( !g_mainThreadLocked || !wxThread::IsMain(), \
+ "GUI reentrancy detected" );
#else
# define DEBUG_MAIN_THREAD
#endif
-#else
-#define DEBUG_MAIN_THREAD
-#endif // Debug
// the trace mask used for the focus debugging messages
-#define TRACE_FOCUS _T("focus")
+#define TRACE_FOCUS wxT("focus")
//-----------------------------------------------------------------------------
// missing gdk functions
//-----------------------------------------------------------------------------
// set WXTRACE to this to see the key event codes on the console
-#define TRACE_KEYS _T("keyevent")
+#define TRACE_KEYS wxT("keyevent")
// translates an X key symbol to WXK_XXX value
//
event.m_controlDown = (gdk_event->state & GDK_CONTROL_MASK) != 0;
event.m_altDown = (gdk_event->state & GDK_MOD1_MASK) != 0;
event.m_metaDown = (gdk_event->state & GDK_MOD2_MASK) != 0;
- event.m_scanCode = gdk_event->keyval;
event.m_rawCode = (wxUint32) gdk_event->keyval;
event.m_rawFlags = 0;
#if wxUSE_UNICODE
KeySym keysym = gdk_event->keyval;
- wxLogTrace(TRACE_KEYS, _T("Key %s event: keysym = %ld"),
- event.GetEventType() == wxEVT_KEY_UP ? _T("release")
- : _T("press"),
+ wxLogTrace(TRACE_KEYS, wxT("Key %s event: keysym = %ld"),
+ event.GetEventType() == wxEVT_KEY_UP ? wxT("release")
+ : wxT("press"),
keysym);
long key_code = wxTranslateKeySymToWXKey(keysym, false /* !isChar */);
Display *dpy = (Display *)wxGetDisplay();
KeyCode keycode = XKeysymToKeycode(dpy, keysym);
- wxLogTrace(TRACE_KEYS, _T("\t-> keycode %d"), keycode);
+ wxLogTrace(TRACE_KEYS, wxT("\t-> keycode %d"), keycode);
KeySym keysymNormalized = XKeycodeToKeysym(dpy, keycode, 0);
}
}
- wxLogTrace(TRACE_KEYS, _T("\t-> wxKeyCode %ld"), key_code);
+ wxLogTrace(TRACE_KEYS, wxT("\t-> wxKeyCode %ld"), key_code);
// sending unknown key events doesn't really make sense
if ( !key_code )
if ( key_code )
{
- wxLogTrace(TRACE_KEYS, _T("Char event: %ld"), key_code);
+ wxLogTrace(TRACE_KEYS, wxT("Char event: %ld"), key_code);
event.m_keyCode = key_code;
g_focusWindow = win;
wxLogTrace(TRACE_FOCUS,
- _T("%s: focus in"), win->GetName().c_str());
+ wxT("%s: focus in"), win->GetName().c_str());
#ifdef HAVE_XIM
if (win->m_ic)
wxapp_install_idle_handler();
wxLogTrace( TRACE_FOCUS,
- _T("%s: focus out"), win->GetName().c_str() );
+ wxT("%s: focus out"), win->GetName().c_str() );
wxWindowGTK *winFocus = wxFindFocusedChild(win);
// method
#ifdef __WXUNIVERSAL__
IMPLEMENT_ABSTRACT_CLASS(wxWindowGTK, wxWindowBase)
-#else // __WXGTK__
- IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase)
-#endif // __WXUNIVERSAL__/__WXGTK__
+#endif // __WXUNIVERSAL__
void wxWindowGTK::Init()
{
m_sizeSet = false;
m_hasVMT = false;
m_needParent = true;
- m_isBeingDeleted = false;
m_noExpose = false;
m_nativeSizeEvent = false;
if ( g_delayedFocus == this )
g_delayedFocus = NULL;
- m_isBeingDeleted = true;
m_hasVMT = false;
// destroy children before destroying this window itself
}
}
- if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen())
- UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
+ wxWindowBase::OnInternalIdle();
}
void wxWindowGTK::DoGetSize( int *width, int *height ) const
return gdk_string_width( gfont, "g" );
}
-void wxWindowGTK::GetTextExtent( const wxString& string,
- int *x,
- int *y,
- int *descent,
- int *externalLeading,
- const wxFont *theFont ) const
+void wxWindowGTK::DoGetTextExtent(const wxString& string,
+ int *x,
+ int *y,
+ int *descent,
+ int *externalLeading,
+ const wxFont *theFont) const
{
wxFont fontToUse = theFont ? *theFont : GetFont();
// it should be focused and will do it later, during the idle
// time, as soon as we can
wxLogTrace(TRACE_FOCUS,
- _T("Delaying setting focus to %s(%s)"),
+ wxT("Delaying setting focus to %s(%s)"),
GetClassInfo()->GetClassName(), GetLabel().c_str());
g_delayedFocus = this;
else
{
wxLogTrace(TRACE_FOCUS,
- _T("Setting focus to %s(%s)"),
+ wxT("Setting focus to %s(%s)"),
GetClassInfo()->GetClassName(), GetLabel().c_str());
gtk_widget_grab_focus (m_widget);
else
{
wxLogTrace(TRACE_FOCUS,
- _T("Can't set focus to %s(%s)"),
+ wxT("Can't set focus to %s(%s)"),
GetClassInfo()->GetClassName(), GetLabel().c_str());
}
}
else
window = GetConnectWidget()->window;
- wxCHECK_RET( window, _T("CaptureMouse() failed") );
+ wxCHECK_RET( window, wxT("CaptureMouse() failed") );
const wxCursor* cursor = &m_cursor;
if (!cursor->Ok())