[1231183] 'cleanup: mismatched indentation' and other cleanings.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34917 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-07-22 18:01:46 +00:00
parent bfd84575a2
commit 0a164d4c4e
18 changed files with 456 additions and 468 deletions

View File

@@ -115,16 +115,16 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
int n, const wxString choices[], int n, const wxString choices[],
long style, const wxValidator& validator, const wxString &name ) long style, const wxValidator& validator, const wxString &name )
{ {
m_needParent = TRUE; m_needParent = true;
#if (GTK_MINOR_VERSION > 0) #if (GTK_MINOR_VERSION > 0)
m_acceptsFocus = TRUE; m_acceptsFocus = true;
#endif #endif
if (!PreCreation( parent, pos, size ) || if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name )) !CreateBase( parent, id, pos, size, style, validator, name ))
{ {
wxFAIL_MSG( wxT("wxChoice creation failed") ); wxFAIL_MSG( wxT("wxChoice creation failed") );
return FALSE; return false;
} }
m_widget = gtk_option_menu_new(); m_widget = gtk_option_menu_new();
@@ -153,7 +153,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
PostCreation(size); PostCreation(size);
SetBestSize(size); // need this too because this is a wxControlWithItems SetBestSize(size); // need this too because this is a wxControlWithItems
return TRUE; return true;
} }
wxChoice::~wxChoice() wxChoice::~wxChoice()
@@ -247,7 +247,7 @@ void wxChoice::Clear()
{ {
// destroy the data (due to Robert's idea of using wxList<wxObject> // destroy the data (due to Robert's idea of using wxList<wxObject>
// and not wxList<wxClientData> we can't just say // and not wxList<wxClientData> we can't just say
// m_clientList.DeleteContents(TRUE) - this would crash! // m_clientList.DeleteContents(true) - this would crash!
wxList::compatibility_iterator node = m_clientList.GetFirst(); wxList::compatibility_iterator node = m_clientList.GetFirst();
while ( node ) while ( node )
{ {
@@ -372,7 +372,7 @@ int wxChoice::FindString( const wxString &string ) const
count++; count++;
} }
return -1; return wxNOT_FOUND;
} }
int wxChoice::GetSelection() const int wxChoice::GetSelection() const
@@ -414,7 +414,7 @@ void wxChoice::SetString( int n, const wxString& str )
wxString wxChoice::GetString( int n ) const wxString wxChoice::GetString( int n ) const
{ {
wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid choice") ); wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid choice") );
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0; int count = 0;
@@ -444,7 +444,7 @@ wxString wxChoice::GetString( int n ) const
wxFAIL_MSG( wxT("wxChoice: invalid index in GetString()") ); wxFAIL_MSG( wxT("wxChoice: invalid index in GetString()") );
return wxT(""); return wxEmptyString;
} }
int wxChoice::GetCount() const int wxChoice::GetCount() const
@@ -643,4 +643,3 @@ wxChoice::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
#endif // wxUSE_CHOICE #endif // wxUSE_CHOICE

View File

@@ -284,5 +284,3 @@ GdkColor *wxColour::GetColor() const
return &M_COLDATA->m_color; return &M_COLDATA->m_color;
} }

View File

@@ -532,7 +532,7 @@ void wxComboBox::SetString(int n, const wxString &text)
int wxComboBox::FindString( const wxString &item ) const int wxComboBox::FindString( const wxString &item ) const
{ {
wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid combobox") ); wxCHECK_MSG( m_widget != NULL, wxNOT_FOUND, wxT("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list; GtkWidget *list = GTK_COMBO(m_widget)->list;
@@ -581,7 +581,7 @@ int wxComboBox::GetSelection() const
wxString wxComboBox::GetString( int n ) const wxString wxComboBox::GetString( int n ) const
{ {
wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid combobox") ); wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list; GtkWidget *list = GTK_COMBO(m_widget)->list;
@@ -607,7 +607,7 @@ wxString wxComboBox::GetString( int n ) const
wxString wxComboBox::GetStringSelection() const wxString wxComboBox::GetStringSelection() const
{ {
wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid combobox") ); wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list; GtkWidget *list = GTK_COMBO(m_widget)->list;
@@ -626,7 +626,7 @@ wxString wxComboBox::GetStringSelection() const
wxFAIL_MSG( wxT("wxComboBox: no selection") ); wxFAIL_MSG( wxT("wxComboBox: no selection") );
return wxT(""); return wxEmptyString;
} }
int wxComboBox::GetCount() const int wxComboBox::GetCount() const
@@ -677,7 +677,7 @@ void wxComboBox::SetValue( const wxString& value )
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry; GtkWidget *entry = GTK_COMBO(m_widget)->entry;
wxString tmp = wxT(""); wxString tmp;
if (!value.IsNull()) tmp = value; if (!value.IsNull()) tmp = value;
gtk_entry_set_text( GTK_ENTRY(entry), wxGTK_CONV( tmp ) ); gtk_entry_set_text( GTK_ENTRY(entry), wxGTK_CONV( tmp ) );
@@ -1042,4 +1042,3 @@ void wxComboBox::OnUpdateSelectAll(wxUpdateUIEvent& event)
} }
#endif #endif

View File

@@ -188,7 +188,7 @@ static void target_drag_leave( GtkWidget *WXUNUSED(widget),
drop_target->OnLeave(); drop_target->OnLeave();
/* this has to be done because GDK has no "drag_enter" event */ /* this has to be done because GDK has no "drag_enter" event */
drop_target->m_firstMotion = TRUE; drop_target->m_firstMotion = true;
/* after this, invalidate the drop_target's GdkDragContext */ /* after this, invalidate the drop_target's GdkDragContext */
drop_target->SetDragContext( (GdkDragContext*) NULL ); drop_target->SetDragContext( (GdkDragContext*) NULL );
@@ -287,7 +287,7 @@ static gboolean target_drag_motion( GtkWidget *WXUNUSED(widget),
drop_target->SetDragContext( (GdkDragContext*) NULL ); drop_target->SetDragContext( (GdkDragContext*) NULL );
/* this has to be done because GDK has no "drag_enter" event */ /* this has to be done because GDK has no "drag_enter" event */
drop_target->m_firstMotion = FALSE; drop_target->m_firstMotion = false;
return ret; return ret;
} }
@@ -338,7 +338,7 @@ static gboolean target_drag_drop( GtkWidget *widget,
/* reset the block here as someone might very well /* reset the block here as someone might very well
show a dialog as a reaction to a drop and this show a dialog as a reaction to a drop and this
wouldn't work without events */ wouldn't work without events */
g_blockEventsOnDrag = FALSE; g_blockEventsOnDrag = false;
bool ret = drop_target->OnDrop( x, y ); bool ret = drop_target->OnDrop( x, y );
@@ -388,7 +388,7 @@ static gboolean target_drag_drop( GtkWidget *widget,
drop_target->SetDragWidget( (GtkWidget*) NULL ); drop_target->SetDragWidget( (GtkWidget*) NULL );
/* this has to be done because GDK has no "drag_enter" event */ /* this has to be done because GDK has no "drag_enter" event */
drop_target->m_firstMotion = TRUE; drop_target->m_firstMotion = true;
return ret; return ret;
} }
@@ -457,7 +457,7 @@ static void target_drag_data_received( GtkWidget *WXUNUSED(widget),
wxDropTarget::wxDropTarget( wxDataObject *data ) wxDropTarget::wxDropTarget( wxDataObject *data )
: wxDropTargetBase( data ) : wxDropTargetBase( data )
{ {
m_firstMotion = TRUE; m_firstMotion = true;
m_dragContext = (GdkDragContext*) NULL; m_dragContext = (GdkDragContext*) NULL;
m_dragWidget = (GtkWidget*) NULL; m_dragWidget = (GtkWidget*) NULL;
m_dragData = (GtkSelectionData*) NULL; m_dragData = (GtkSelectionData*) NULL;
@@ -482,7 +482,7 @@ wxDragResult wxDropTarget::OnDragOver( wxCoord WXUNUSED(x),
bool wxDropTarget::OnDrop( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y) ) bool wxDropTarget::OnDrop( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y) )
{ {
if (!m_dataObject) if (!m_dataObject)
return FALSE; return false;
return (GetMatchingPair() != (GdkAtom) 0); return (GetMatchingPair() != (GdkAtom) 0);
} }
@@ -530,19 +530,19 @@ GdkAtom wxDropTarget::GetMatchingPair()
bool wxDropTarget::GetData() bool wxDropTarget::GetData()
{ {
if (!m_dragData) if (!m_dragData)
return FALSE; return false;
if (!m_dataObject) if (!m_dataObject)
return FALSE; return false;
wxDataFormat dragFormat( m_dragData->target ); wxDataFormat dragFormat( m_dragData->target );
if (!m_dataObject->IsSupportedFormat( dragFormat )) if (!m_dataObject->IsSupportedFormat( dragFormat ))
return FALSE; return false;
m_dataObject->SetData( dragFormat, (size_t)m_dragData->length, (const void*)m_dragData->data ); m_dataObject->SetData( dragFormat, (size_t)m_dragData->length, (const void*)m_dragData->data );
return TRUE; return true;
} }
void wxDropTarget::UnregisterWidget( GtkWidget *widget ) void wxDropTarget::UnregisterWidget( GtkWidget *widget )
@@ -714,7 +714,7 @@ static void source_drag_end( GtkWidget *WXUNUSED(widget),
// printf( "Drag source: drag_end.\n" ); // printf( "Drag source: drag_end.\n" );
drop_source->m_waiting = FALSE; drop_source->m_waiting = false;
} }
} }
@@ -744,7 +744,7 @@ wxDropSource::wxDropSource(wxWindow *win,
const wxIcon &iconMove, const wxIcon &iconMove,
const wxIcon &iconNone) const wxIcon &iconNone)
{ {
m_waiting = TRUE; m_waiting = true;
m_iconWindow = (GtkWidget*) NULL; m_iconWindow = (GtkWidget*) NULL;
@@ -763,7 +763,7 @@ wxDropSource::wxDropSource(wxDataObject& data,
const wxIcon &iconMove, const wxIcon &iconMove,
const wxIcon &iconNone) const wxIcon &iconNone)
{ {
m_waiting = TRUE; m_waiting = true;
SetData( data ); SetData( data );
@@ -859,11 +859,11 @@ wxDragResult wxDropSource::DoDragDrop(int flags)
return wxDragNone; return wxDragNone;
// disabled for now // disabled for now
g_blockEventsOnDrag = TRUE; g_blockEventsOnDrag = true;
RegisterWindow(); RegisterWindow();
m_waiting = TRUE; m_waiting = true;
GtkTargetList *target_list = gtk_target_list_new( (GtkTargetEntry*) NULL, 0 ); GtkTargetList *target_list = gtk_target_list_new( (GtkTargetEntry*) NULL, 0 );
@@ -933,7 +933,7 @@ wxDragResult wxDropSource::DoDragDrop(int flags)
/* re-enable GUI threads */ /* re-enable GUI threads */
#endif #endif
g_blockEventsOnDrag = FALSE; g_blockEventsOnDrag = false;
UnregisterWindow(); UnregisterWindow();

View File

@@ -714,4 +714,3 @@ void wxFrame::PositionStatusBar()
GtkUpdateSize(); GtkUpdateSize();
} }
#endif // wxUSE_STATUSBAR #endif // wxUSE_STATUSBAR

View File

@@ -111,7 +111,7 @@ static gint gtk_frame_focus_in_callback( GtkWidget *widget,
// wxPrintf( wxT("active: %s\n"), win->GetTitle().c_str() ); // wxPrintf( wxT("active: %s\n"), win->GetTitle().c_str() );
wxLogTrace(wxT("activate"), wxT("Activating frame %p (from focus_in)"), g_activeFrame); wxLogTrace(wxT("activate"), wxT("Activating frame %p (from focus_in)"), g_activeFrame);
wxActivateEvent event(wxEVT_ACTIVATE, TRUE, g_activeFrame->GetId()); wxActivateEvent event(wxEVT_ACTIVATE, true, g_activeFrame->GetId());
event.SetEventObject(g_activeFrame); event.SetEventObject(g_activeFrame);
g_activeFrame->GetEventHandler()->ProcessEvent(event); g_activeFrame->GetEventHandler()->ProcessEvent(event);
@@ -143,7 +143,7 @@ static gint gtk_frame_focus_out_callback( GtkWidget *widget,
if (g_activeFrame) if (g_activeFrame)
{ {
wxLogTrace(wxT("activate"), wxT("Activating frame %p (from focus_in)"), g_activeFrame); wxLogTrace(wxT("activate"), wxT("Activating frame %p (from focus_in)"), g_activeFrame);
wxActivateEvent event(wxEVT_ACTIVATE, FALSE, g_activeFrame->GetId()); wxActivateEvent event(wxEVT_ACTIVATE, false, g_activeFrame->GetId());
event.SetEventObject(g_activeFrame); event.SetEventObject(g_activeFrame);
g_activeFrame->GetEventHandler()->ProcessEvent(event); g_activeFrame->GetEventHandler()->ProcessEvent(event);
@@ -299,7 +299,7 @@ gtk_frame_map_callback( GtkWidget * WXUNUSED(widget),
GdkEvent * WXUNUSED(event), GdkEvent * WXUNUSED(event),
wxTopLevelWindow *win ) wxTopLevelWindow *win )
{ {
win->SetIconizeState(FALSE); win->SetIconizeState(false);
} }
} }
@@ -410,16 +410,16 @@ static void wxInsertChildInTopLevelWindow( wxTopLevelWindowGTK* parent, wxWindow
void wxTopLevelWindowGTK::Init() void wxTopLevelWindowGTK::Init()
{ {
m_sizeSet = FALSE; m_sizeSet = false;
m_miniEdge = 0; m_miniEdge = 0;
m_miniTitle = 0; m_miniTitle = 0;
m_mainWidget = (GtkWidget*) NULL; m_mainWidget = (GtkWidget*) NULL;
m_insertInClientArea = TRUE; m_insertInClientArea = true;
m_isIconized = FALSE; m_isIconized = false;
m_fsIsShowing = FALSE; m_fsIsShowing = false;
m_themeEnabled = TRUE; m_themeEnabled = true;
m_gdkDecor = m_gdkFunc = 0; m_gdkDecor = m_gdkFunc = 0;
m_grabbed = FALSE; m_grabbed = false;
} }
bool wxTopLevelWindowGTK::Create( wxWindow *parent, bool wxTopLevelWindowGTK::Create( wxWindow *parent,
@@ -438,13 +438,13 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
wxTopLevelWindows.Append( this ); wxTopLevelWindows.Append( this );
m_needParent = FALSE; m_needParent = false;
if (!PreCreation( parent, pos, size ) || if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{ {
wxFAIL_MSG( wxT("wxTopLevelWindowGTK creation failed") ); wxFAIL_MSG( wxT("wxTopLevelWindowGTK creation failed") );
return FALSE; return false;
} }
m_title = title; m_title = title;
@@ -522,7 +522,7 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
} }
#endif #endif
if (!name.IsEmpty()) if (!name.empty())
gtk_window_set_wmclass( GTK_WINDOW(m_widget), wxGTK_CONV( name ), wxGTK_CONV( name ) ); gtk_window_set_wmclass( GTK_WINDOW(m_widget), wxGTK_CONV( name ), wxGTK_CONV( name ) );
gtk_window_set_title( GTK_WINDOW(m_widget), wxGTK_CONV( title ) ); gtk_window_set_title( GTK_WINDOW(m_widget), wxGTK_CONV( title ) );
@@ -641,7 +641,7 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
} }
} }
return TRUE; return true;
} }
wxTopLevelWindowGTK::~wxTopLevelWindowGTK() wxTopLevelWindowGTK::~wxTopLevelWindowGTK()
@@ -652,7 +652,7 @@ wxTopLevelWindowGTK::~wxTopLevelWindowGTK()
RemoveGrab(); RemoveGrab();
} }
m_isBeingDeleted = TRUE; m_isBeingDeleted = true;
// it may also be GtkScrolledWindow in the case of an MDI child // it may also be GtkScrolledWindow in the case of an MDI child
if (GTK_IS_WINDOW(m_widget)) if (GTK_IS_WINDOW(m_widget))
@@ -671,7 +671,7 @@ wxTopLevelWindowGTK::~wxTopLevelWindowGTK()
bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style ) bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style )
{ {
if (show == m_fsIsShowing) if (show == m_fsIsShowing)
return FALSE; // return what? return false; // return what?
m_fsIsShowing = show; m_fsIsShowing = show;
@@ -691,7 +691,7 @@ bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style )
else else
gtk_window_unfullscreen( GTK_WINDOW( m_widget ) ); gtk_window_unfullscreen( GTK_WINDOW( m_widget ) );
return TRUE; return true;
} }
else else
#endif // GTK+ >= 2.2.0 #endif // GTK+ >= 2.2.0
@@ -753,7 +753,7 @@ bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style )
} }
} }
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -804,7 +804,7 @@ void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int si
// avoid recursions // avoid recursions
if (m_resizing) if (m_resizing)
return; return;
m_resizing = TRUE; m_resizing = true;
int old_x = m_x; int old_x = m_x;
int old_y = m_y; int old_y = m_y;
@@ -875,10 +875,10 @@ void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int si
/* we set the size in GtkOnSize, i.e. mostly the actual resizing is /* we set the size in GtkOnSize, i.e. mostly the actual resizing is
done either directly before the frame is shown or in idle time done either directly before the frame is shown or in idle time
so that different calls to SetSize() don't lead to flicker. */ so that different calls to SetSize() don't lead to flicker. */
m_sizeSet = FALSE; m_sizeSet = false;
} }
m_resizing = FALSE; m_resizing = false;
} }
void wxTopLevelWindowGTK::DoGetClientSize( int *width, int *height ) const void wxTopLevelWindowGTK::DoGetClientSize( int *width, int *height ) const
@@ -914,7 +914,7 @@ void wxTopLevelWindowGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
// avoid recursions // avoid recursions
if (m_resizing) return; if (m_resizing) return;
m_resizing = TRUE; m_resizing = true;
if ( m_wxwindow == NULL ) return; if ( m_wxwindow == NULL ) return;
@@ -1008,14 +1008,14 @@ void wxTopLevelWindowGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
// is no need to set the size or position of m_wxwindow. // is no need to set the size or position of m_wxwindow.
} }
m_sizeSet = TRUE; m_sizeSet = true;
// send size event to frame // send size event to frame
wxSizeEvent event( wxSize(m_width,m_height), GetId() ); wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this ); event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event ); GetEventHandler()->ProcessEvent( event );
m_resizing = FALSE; m_resizing = false;
} }
void wxTopLevelWindowGTK::OnInternalIdle() void wxTopLevelWindowGTK::OnInternalIdle()
@@ -1147,7 +1147,7 @@ bool wxTopLevelWindowGTK::IsMaximized() const
// wxFAIL_MSG( _T("not implemented") ); // wxFAIL_MSG( _T("not implemented") );
// This is an approximation // This is an approximation
return FALSE; return false;
#endif #endif
} }
@@ -1201,7 +1201,7 @@ void wxTopLevelWindowGTK::AddGrab()
{ {
if (!m_grabbed) if (!m_grabbed)
{ {
m_grabbed = TRUE; m_grabbed = true;
gtk_grab_add( m_widget ); gtk_grab_add( m_widget );
wxEventLoop().Run(); wxEventLoop().Run();
gtk_grab_remove( m_widget ); gtk_grab_remove( m_widget );
@@ -1213,7 +1213,7 @@ void wxTopLevelWindowGTK::RemoveGrab()
if (m_grabbed) if (m_grabbed)
{ {
gtk_main_quit(); gtk_main_quit();
m_grabbed = FALSE; m_grabbed = false;
} }
} }
@@ -1237,16 +1237,16 @@ static bool do_shape_combine_region(GdkWindow* window, const wxRegion& region)
GdkBitmap* mask = bmp.GetMask()->GetBitmap(); GdkBitmap* mask = bmp.GetMask()->GetBitmap();
gdk_window_shape_combine_mask(window, mask, 0, 0); gdk_window_shape_combine_mask(window, mask, 0, 0);
#endif #endif
return TRUE; return true;
} }
} }
return FALSE; return false;
} }
bool wxTopLevelWindowGTK::SetShape(const wxRegion& region) bool wxTopLevelWindowGTK::SetShape(const wxRegion& region)
{ {
wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), FALSE, wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false,
_T("Shaped windows must be created with the wxFRAME_SHAPED style.")); _T("Shaped windows must be created with the wxFRAME_SHAPED style."));
GdkWindow *window = NULL; GdkWindow *window = NULL;
@@ -1263,4 +1263,3 @@ bool wxTopLevelWindowGTK::IsActive()
{ {
return (this == (wxTopLevelWindowGTK*)g_activeFrame); return (this == (wxTopLevelWindowGTK*)g_activeFrame);
} }

View File

@@ -229,7 +229,7 @@ static GdkGC *g_eraseGC = NULL;
// mouse capture state: the window which has it and if the mouse is currently // mouse capture state: the window which has it and if the mouse is currently
// inside it // inside it
static wxWindowGTK *g_captureWindow = (wxWindowGTK*) NULL; static wxWindowGTK *g_captureWindow = (wxWindowGTK*) NULL;
static bool g_captureWindowHasMouse = FALSE; static bool g_captureWindowHasMouse = false;
wxWindowGTK *g_focusWindow = (wxWindowGTK*) NULL; wxWindowGTK *g_focusWindow = (wxWindowGTK*) NULL;
@@ -1048,7 +1048,7 @@ wxTranslateGTKKeyEventToWx(wxKeyEvent& event,
: _T("press"), : _T("press"),
keysym); keysym);
long key_code = wxTranslateKeySymToWXKey(keysym, FALSE /* !isChar */); long key_code = wxTranslateKeySymToWXKey(keysym, false /* !isChar */);
if ( !key_code ) if ( !key_code )
{ {
@@ -1117,14 +1117,14 @@ wxTranslateGTKKeyEventToWx(wxKeyEvent& event,
// sending unknown key events doesn't really make sense // sending unknown key events doesn't really make sense
if ( !key_code ) if ( !key_code )
return FALSE; return false;
// now fill all the other fields // now fill all the other fields
wxFillOtherKeyEventFields(event, win, gdk_event); wxFillOtherKeyEventFields(event, win, gdk_event);
event.m_keyCode = key_code; event.m_keyCode = key_code;
return TRUE; return true;
} }
@@ -1295,7 +1295,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
long key_code; long key_code;
KeySym keysym = gdk_event->keyval; KeySym keysym = gdk_event->keyval;
// Find key code for EVT_CHAR and EVT_CHAR_HOOK events // Find key code for EVT_CHAR and EVT_CHAR_HOOK events
key_code = wxTranslateKeySymToWXKey(keysym, TRUE /* isChar */); key_code = wxTranslateKeySymToWXKey(keysym, true /* isChar */);
if ( !key_code ) if ( !key_code )
{ {
if ( wxIsAsciiKeysym(keysym) ) if ( wxIsAsciiKeysym(keysym) )
@@ -2117,7 +2117,7 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget,
if ( !win->m_hasFocus ) if ( !win->m_hasFocus )
{ {
// not yet, notify it // not yet, notify it
win->m_hasFocus = TRUE; win->m_hasFocus = true;
if ( DoSendFocusEvents(win) ) if ( DoSendFocusEvents(win) )
{ {
@@ -2175,7 +2175,7 @@ static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk
// have focus already // have focus already
if ( win->m_hasFocus ) if ( win->m_hasFocus )
{ {
win->m_hasFocus = FALSE; win->m_hasFocus = false;
wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() ); wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() );
event.SetEventObject( win ); event.SetEventObject( win );
@@ -2374,7 +2374,7 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
wxapp_install_idle_handler(); wxapp_install_idle_handler();
g_blockEventsOnScroll = TRUE; g_blockEventsOnScroll = true;
// FIXME: there is no 'slider' field in GTK+ 2.0 any more // FIXME: there is no 'slider' field in GTK+ 2.0 any more
#ifndef __WXGTK20__ #ifndef __WXGTK20__
@@ -2401,7 +2401,7 @@ static gint gtk_scrollbar_button_release_callback( GtkRange *widget,
// //
// if (gdk_event->window != widget->slider) return FALSE; // if (gdk_event->window != widget->slider) return FALSE;
g_blockEventsOnScroll = FALSE; g_blockEventsOnScroll = false;
if (win->m_isScrolling) if (win->m_isScrolling)
{ {
@@ -2426,7 +2426,7 @@ static gint gtk_scrollbar_button_release_callback( GtkRange *widget,
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
win->m_isScrolling = FALSE; win->m_isScrolling = false;
return FALSE; return FALSE;
} }
@@ -2700,16 +2700,16 @@ void wxWindowGTK::Init()
m_width = 0; m_width = 0;
m_height = 0; m_height = 0;
m_sizeSet = FALSE; m_sizeSet = false;
m_hasVMT = FALSE; m_hasVMT = false;
m_needParent = TRUE; m_needParent = true;
m_isBeingDeleted = FALSE; m_isBeingDeleted = false;
m_noExpose = FALSE; m_noExpose = false;
m_nativeSizeEvent = FALSE; m_nativeSizeEvent = false;
m_hasScrolling = FALSE; m_hasScrolling = false;
m_isScrolling = FALSE; m_isScrolling = false;
m_hAdjust = (GtkAdjustment*) NULL; m_hAdjust = (GtkAdjustment*) NULL;
m_vAdjust = (GtkAdjustment*) NULL; m_vAdjust = (GtkAdjustment*) NULL;
@@ -2718,14 +2718,14 @@ void wxWindowGTK::Init()
m_oldClientWidth = m_oldClientWidth =
m_oldClientHeight = 0; m_oldClientHeight = 0;
m_resizing = FALSE; m_resizing = false;
m_insertCallback = (wxInsertChildFunction) NULL; m_insertCallback = (wxInsertChildFunction) NULL;
m_acceptsFocus = FALSE; m_acceptsFocus = false;
m_hasFocus = FALSE; m_hasFocus = false;
m_clipPaintRegion = FALSE; m_clipPaintRegion = false;
m_needsStyleChange = false; m_needsStyleChange = false;
@@ -2771,7 +2771,7 @@ bool wxWindowGTK::Create( wxWindow *parent,
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{ {
wxFAIL_MSG( wxT("wxWindowGTK creation failed") ); wxFAIL_MSG( wxT("wxWindowGTK creation failed") );
return FALSE; return false;
} }
m_insertCallback = wxInsertChildInWindow; m_insertCallback = wxInsertChildInWindow;
@@ -2815,7 +2815,7 @@ bool wxWindowGTK::Create( wxWindow *parent,
gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow ); gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow );
GTK_WIDGET_SET_FLAGS( m_wxwindow, GTK_CAN_FOCUS ); GTK_WIDGET_SET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
m_acceptsFocus = TRUE; m_acceptsFocus = true;
// I _really_ don't want scrollbars in the beginning // I _really_ don't want scrollbars in the beginning
m_vAdjust->lower = 0.0; m_vAdjust->lower = 0.0;
@@ -2867,7 +2867,7 @@ bool wxWindowGTK::Create( wxWindow *parent,
PostCreation(); PostCreation();
return TRUE; return true;
} }
wxWindowGTK::~wxWindowGTK() wxWindowGTK::~wxWindowGTK()
@@ -2880,11 +2880,11 @@ wxWindowGTK::~wxWindowGTK()
if ( g_delayedFocus == this ) if ( g_delayedFocus == this )
g_delayedFocus = NULL; g_delayedFocus = NULL;
m_isBeingDeleted = TRUE; m_isBeingDeleted = true;
m_hasVMT = FALSE; m_hasVMT = false;
if (m_widget) if (m_widget)
Show( FALSE ); Show( false );
DestroyChildren(); DestroyChildren();
@@ -2914,7 +2914,7 @@ wxWindowGTK::~wxWindowGTK()
bool wxWindowGTK::PreCreation( wxWindowGTK *parent, const wxPoint &pos, const wxSize &size ) bool wxWindowGTK::PreCreation( wxWindowGTK *parent, const wxPoint &pos, const wxSize &size )
{ {
wxCHECK_MSG( !m_needParent || parent, FALSE, wxT("Need complete parent.") ); wxCHECK_MSG( !m_needParent || parent, false, wxT("Need complete parent.") );
// Use either the given size, or the default if -1 is given. // Use either the given size, or the default if -1 is given.
// See wxWindowBase for these functions. // See wxWindowBase for these functions.
@@ -2924,7 +2924,7 @@ bool wxWindowGTK::PreCreation( wxWindowGTK *parent, const wxPoint &pos, const w
m_x = (int)pos.x; m_x = (int)pos.x;
m_y = (int)pos.y; m_y = (int)pos.y;
return TRUE; return true;
} }
void wxWindowGTK::PostCreation() void wxWindowGTK::PostCreation()
@@ -3038,7 +3038,7 @@ void wxWindowGTK::PostCreation()
InheritAttributes(); InheritAttributes();
m_hasVMT = TRUE; m_hasVMT = true;
// unless the window was created initially hidden (i.e. Hide() had been // unless the window was created initially hidden (i.e. Hide() had been
// called before Create()), we should show it at GTK+ level as well // called before Create()), we should show it at GTK+ level as well
@@ -3081,7 +3081,7 @@ bool wxWindowGTK::Destroy()
{ {
wxASSERT_MSG( (m_widget != NULL), wxT("invalid window") ); wxASSERT_MSG( (m_widget != NULL), wxT("invalid window") );
m_hasVMT = FALSE; m_hasVMT = false;
return wxWindowBase::Destroy(); return wxWindowBase::Destroy();
} }
@@ -3101,7 +3101,7 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
*/ */
if (m_resizing) return; /* I don't like recursions */ if (m_resizing) return; /* I don't like recursions */
m_resizing = TRUE; m_resizing = true;
int currentX, currentY; int currentX, currentY;
GetPosition(&currentX, &currentY); GetPosition(&currentX, &currentY);
@@ -3217,7 +3217,7 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
GetEventHandler()->ProcessEvent( event ); GetEventHandler()->ProcessEvent( event );
} }
m_resizing = FALSE; m_resizing = false;
} }
void wxWindowGTK::OnInternalIdle() void wxWindowGTK::OnInternalIdle()
@@ -3495,12 +3495,12 @@ void wxWindowGTK::DoScreenToClient( int *x, int *y ) const
bool wxWindowGTK::Show( bool show ) bool wxWindowGTK::Show( bool show )
{ {
wxCHECK_MSG( (m_widget != NULL), FALSE, wxT("invalid window") ); wxCHECK_MSG( (m_widget != NULL), false, wxT("invalid window") );
if (!wxWindowBase::Show(show)) if (!wxWindowBase::Show(show))
{ {
// nothing to do // nothing to do
return FALSE; return false;
} }
if (show) if (show)
@@ -3513,7 +3513,7 @@ bool wxWindowGTK::Show( bool show )
GetEventHandler()->ProcessEvent(eventShow); GetEventHandler()->ProcessEvent(eventShow);
return TRUE; return true;
} }
static void wxWindowNotifyEnable(wxWindowGTK* win, bool enable) static void wxWindowNotifyEnable(wxWindowGTK* win, bool enable)
@@ -3535,12 +3535,12 @@ static void wxWindowNotifyEnable(wxWindowGTK* win, bool enable)
bool wxWindowGTK::Enable( bool enable ) bool wxWindowGTK::Enable( bool enable )
{ {
wxCHECK_MSG( (m_widget != NULL), FALSE, wxT("invalid window") ); wxCHECK_MSG( (m_widget != NULL), false, wxT("invalid window") );
if (!wxWindowBase::Enable(enable)) if (!wxWindowBase::Enable(enable))
{ {
// nothing to do // nothing to do
return FALSE; return false;
} }
gtk_widget_set_sensitive( m_widget, enable ); gtk_widget_set_sensitive( m_widget, enable );
@@ -3549,7 +3549,7 @@ bool wxWindowGTK::Enable( bool enable )
wxWindowNotifyEnable(this, enable); wxWindowNotifyEnable(this, enable);
return TRUE; return true;
} }
int wxWindowGTK::GetCharHeight() const int wxWindowGTK::GetCharHeight() const
@@ -3631,7 +3631,7 @@ void wxWindowGTK::GetTextExtent( const wxString& string,
wxCHECK_RET( fontToUse.Ok(), wxT("invalid font") ); wxCHECK_RET( fontToUse.Ok(), wxT("invalid font") );
if (string.IsEmpty()) if (string.empty())
{ {
if (x) (*x) = 0; if (x) (*x) = 0;
if (y) (*y) = 0; if (y) (*y) = 0;
@@ -3759,7 +3759,7 @@ bool wxWindowGTK::AcceptsFocus() const
bool wxWindowGTK::Reparent( wxWindowBase *newParentBase ) bool wxWindowGTK::Reparent( wxWindowBase *newParentBase )
{ {
wxCHECK_MSG( (m_widget != NULL), FALSE, wxT("invalid window") ); wxCHECK_MSG( (m_widget != NULL), false, wxT("invalid window") );
wxWindowGTK *oldParent = m_parent, wxWindowGTK *oldParent = m_parent,
*newParent = (wxWindowGTK *)newParentBase; *newParent = (wxWindowGTK *)newParentBase;
@@ -3767,7 +3767,7 @@ bool wxWindowGTK::Reparent( wxWindowBase *newParentBase )
wxASSERT( GTK_IS_WIDGET(m_widget) ); wxASSERT( GTK_IS_WIDGET(m_widget) );
if ( !wxWindowBase::Reparent(newParent) ) if ( !wxWindowBase::Reparent(newParent) )
return FALSE; return false;
wxASSERT( GTK_IS_WIDGET(m_widget) ); wxASSERT( GTK_IS_WIDGET(m_widget) );
@@ -3790,7 +3790,7 @@ bool wxWindowGTK::Reparent( wxWindowBase *newParentBase )
/* reverse: prevent GTK from deleting the widget arbitrarily */ /* reverse: prevent GTK from deleting the widget arbitrarily */
gtk_widget_unref( m_widget ); gtk_widget_unref( m_widget );
return TRUE; return true;
} }
void wxWindowGTK::DoAddChild(wxWindowGTK *child) void wxWindowGTK::DoAddChild(wxWindowGTK *child)
@@ -3894,10 +3894,10 @@ void wxWindowGTK::Lower()
bool wxWindowGTK::SetCursor( const wxCursor &cursor ) bool wxWindowGTK::SetCursor( const wxCursor &cursor )
{ {
wxCHECK_MSG( (m_widget != NULL), FALSE, wxT("invalid window") ); wxCHECK_MSG( (m_widget != NULL), false, wxT("invalid window") );
if (cursor == m_cursor) if (cursor == m_cursor)
return FALSE; return false;
if (g_isIdle) if (g_isIdle)
wxapp_install_idle_handler(); wxapp_install_idle_handler();
@@ -4060,7 +4060,7 @@ void wxWindowGTK::GtkSendPaintEvents()
} }
// Clip to paint region in wxClientDC // Clip to paint region in wxClientDC
m_clipPaintRegion = TRUE; m_clipPaintRegion = true;
// widget to draw on // widget to draw on
GtkPizza *pizza = GTK_PIZZA (m_wxwindow); GtkPizza *pizza = GTK_PIZZA (m_wxwindow);
@@ -4149,7 +4149,7 @@ void wxWindowGTK::GtkSendPaintEvents()
paint_event.SetEventObject( this ); paint_event.SetEventObject( this );
GetEventHandler()->ProcessEvent( paint_event ); GetEventHandler()->ProcessEvent( paint_event );
m_clipPaintRegion = FALSE; m_clipPaintRegion = false;
#ifndef __WXUNIVERSAL__ #ifndef __WXUNIVERSAL__
#ifndef __WXGTK20__ #ifndef __WXGTK20__
@@ -4233,7 +4233,7 @@ void wxWindowGTK::ApplyToolTip( GtkTooltips *tips, const wxChar *tip )
bool wxWindowGTK::SetBackgroundColour( const wxColour &colour ) bool wxWindowGTK::SetBackgroundColour( const wxColour &colour )
{ {
wxCHECK_MSG( m_widget != NULL, FALSE, wxT("invalid window") ); wxCHECK_MSG( m_widget != NULL, false, wxT("invalid window") );
if (!wxWindowBase::SetBackgroundColour(colour)) if (!wxWindowBase::SetBackgroundColour(colour))
return false; return false;
@@ -4254,7 +4254,7 @@ bool wxWindowGTK::SetBackgroundColour( const wxColour &colour )
bool wxWindowGTK::SetForegroundColour( const wxColour &colour ) bool wxWindowGTK::SetForegroundColour( const wxColour &colour )
{ {
wxCHECK_MSG( m_widget != NULL, FALSE, wxT("invalid window") ); wxCHECK_MSG( m_widget != NULL, false, wxT("invalid window") );
if (!wxWindowBase::SetForegroundColour(colour)) if (!wxWindowBase::SetForegroundColour(colour))
{ {
@@ -4562,7 +4562,7 @@ bool wxWindowGTK::IsOwnGtkWindow( GdkWindow *window )
bool wxWindowGTK::SetFont( const wxFont &font ) bool wxWindowGTK::SetFont( const wxFont &font )
{ {
wxCHECK_MSG( m_widget != NULL, FALSE, wxT("invalid window") ); wxCHECK_MSG( m_widget != NULL, false, wxT("invalid window") );
if (!wxWindowBase::SetFont(font)) if (!wxWindowBase::SetFont(font))
return false; return false;
@@ -4600,7 +4600,7 @@ void wxWindowGTK::DoCaptureMouse()
cursor->GetCursor(), cursor->GetCursor(),
(guint32)GDK_CURRENT_TIME ); (guint32)GDK_CURRENT_TIME );
g_captureWindow = this; g_captureWindow = this;
g_captureWindowHasMouse = TRUE; g_captureWindowHasMouse = true;
} }
void wxWindowGTK::DoReleaseMouse() void wxWindowGTK::DoReleaseMouse()
@@ -4631,7 +4631,7 @@ wxWindow *wxWindowBase::GetCapture()
bool wxWindowGTK::IsRetained() const bool wxWindowGTK::IsRetained() const
{ {
return FALSE; return false;
} }
void wxWindowGTK::SetScrollbar( int orient, int pos, int thumbVisible, void wxWindowGTK::SetScrollbar( int orient, int pos, int thumbVisible,
@@ -4641,7 +4641,7 @@ void wxWindowGTK::SetScrollbar( int orient, int pos, int thumbVisible,
wxCHECK_RET( m_wxwindow != NULL, wxT("window needs client area for scrolling") ); wxCHECK_RET( m_wxwindow != NULL, wxT("window needs client area for scrolling") );
m_hasScrolling = TRUE; m_hasScrolling = true;
if (orient == wxHORIZONTAL) if (orient == wxHORIZONTAL)
{ {
@@ -4817,11 +4817,11 @@ void wxWindowGTK::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
} }
#endif #endif
m_clipPaintRegion = TRUE; m_clipPaintRegion = true;
gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy ); gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy );
m_clipPaintRegion = FALSE; m_clipPaintRegion = false;
} }
@@ -4885,7 +4885,7 @@ bool wxWinModule::OnInit()
// g_eraseGC = gdk_gc_new( GDK_ROOT_PARENT() ); // g_eraseGC = gdk_gc_new( GDK_ROOT_PARENT() );
// gdk_gc_set_fill( g_eraseGC, GDK_SOLID ); // gdk_gc_set_fill( g_eraseGC, GDK_SOLID );
return TRUE; return true;
} }
void wxWinModule::OnExit() void wxWinModule::OnExit()

View File

@@ -115,16 +115,16 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
int n, const wxString choices[], int n, const wxString choices[],
long style, const wxValidator& validator, const wxString &name ) long style, const wxValidator& validator, const wxString &name )
{ {
m_needParent = TRUE; m_needParent = true;
#if (GTK_MINOR_VERSION > 0) #if (GTK_MINOR_VERSION > 0)
m_acceptsFocus = TRUE; m_acceptsFocus = true;
#endif #endif
if (!PreCreation( parent, pos, size ) || if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name )) !CreateBase( parent, id, pos, size, style, validator, name ))
{ {
wxFAIL_MSG( wxT("wxChoice creation failed") ); wxFAIL_MSG( wxT("wxChoice creation failed") );
return FALSE; return false;
} }
m_widget = gtk_option_menu_new(); m_widget = gtk_option_menu_new();
@@ -153,7 +153,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
PostCreation(size); PostCreation(size);
SetBestSize(size); // need this too because this is a wxControlWithItems SetBestSize(size); // need this too because this is a wxControlWithItems
return TRUE; return true;
} }
wxChoice::~wxChoice() wxChoice::~wxChoice()
@@ -247,7 +247,7 @@ void wxChoice::Clear()
{ {
// destroy the data (due to Robert's idea of using wxList<wxObject> // destroy the data (due to Robert's idea of using wxList<wxObject>
// and not wxList<wxClientData> we can't just say // and not wxList<wxClientData> we can't just say
// m_clientList.DeleteContents(TRUE) - this would crash! // m_clientList.DeleteContents(true) - this would crash!
wxList::compatibility_iterator node = m_clientList.GetFirst(); wxList::compatibility_iterator node = m_clientList.GetFirst();
while ( node ) while ( node )
{ {
@@ -372,7 +372,7 @@ int wxChoice::FindString( const wxString &string ) const
count++; count++;
} }
return -1; return wxNOT_FOUND;
} }
int wxChoice::GetSelection() const int wxChoice::GetSelection() const
@@ -414,7 +414,7 @@ void wxChoice::SetString( int n, const wxString& str )
wxString wxChoice::GetString( int n ) const wxString wxChoice::GetString( int n ) const
{ {
wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid choice") ); wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid choice") );
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0; int count = 0;
@@ -444,7 +444,7 @@ wxString wxChoice::GetString( int n ) const
wxFAIL_MSG( wxT("wxChoice: invalid index in GetString()") ); wxFAIL_MSG( wxT("wxChoice: invalid index in GetString()") );
return wxT(""); return wxEmptyString;
} }
int wxChoice::GetCount() const int wxChoice::GetCount() const
@@ -643,4 +643,3 @@ wxChoice::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
#endif // wxUSE_CHOICE #endif // wxUSE_CHOICE

View File

@@ -284,5 +284,3 @@ GdkColor *wxColour::GetColor() const
return &M_COLDATA->m_color; return &M_COLDATA->m_color;
} }

View File

@@ -532,7 +532,7 @@ void wxComboBox::SetString(int n, const wxString &text)
int wxComboBox::FindString( const wxString &item ) const int wxComboBox::FindString( const wxString &item ) const
{ {
wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid combobox") ); wxCHECK_MSG( m_widget != NULL, wxNOT_FOUND, wxT("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list; GtkWidget *list = GTK_COMBO(m_widget)->list;
@@ -581,7 +581,7 @@ int wxComboBox::GetSelection() const
wxString wxComboBox::GetString( int n ) const wxString wxComboBox::GetString( int n ) const
{ {
wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid combobox") ); wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list; GtkWidget *list = GTK_COMBO(m_widget)->list;
@@ -607,7 +607,7 @@ wxString wxComboBox::GetString( int n ) const
wxString wxComboBox::GetStringSelection() const wxString wxComboBox::GetStringSelection() const
{ {
wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid combobox") ); wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list; GtkWidget *list = GTK_COMBO(m_widget)->list;
@@ -626,7 +626,7 @@ wxString wxComboBox::GetStringSelection() const
wxFAIL_MSG( wxT("wxComboBox: no selection") ); wxFAIL_MSG( wxT("wxComboBox: no selection") );
return wxT(""); return wxEmptyString;
} }
int wxComboBox::GetCount() const int wxComboBox::GetCount() const
@@ -677,7 +677,7 @@ void wxComboBox::SetValue( const wxString& value )
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry; GtkWidget *entry = GTK_COMBO(m_widget)->entry;
wxString tmp = wxT(""); wxString tmp;
if (!value.IsNull()) tmp = value; if (!value.IsNull()) tmp = value;
gtk_entry_set_text( GTK_ENTRY(entry), wxGTK_CONV( tmp ) ); gtk_entry_set_text( GTK_ENTRY(entry), wxGTK_CONV( tmp ) );
@@ -1042,4 +1042,3 @@ void wxComboBox::OnUpdateSelectAll(wxUpdateUIEvent& event)
} }
#endif #endif

View File

@@ -188,7 +188,7 @@ static void target_drag_leave( GtkWidget *WXUNUSED(widget),
drop_target->OnLeave(); drop_target->OnLeave();
/* this has to be done because GDK has no "drag_enter" event */ /* this has to be done because GDK has no "drag_enter" event */
drop_target->m_firstMotion = TRUE; drop_target->m_firstMotion = true;
/* after this, invalidate the drop_target's GdkDragContext */ /* after this, invalidate the drop_target's GdkDragContext */
drop_target->SetDragContext( (GdkDragContext*) NULL ); drop_target->SetDragContext( (GdkDragContext*) NULL );
@@ -287,7 +287,7 @@ static gboolean target_drag_motion( GtkWidget *WXUNUSED(widget),
drop_target->SetDragContext( (GdkDragContext*) NULL ); drop_target->SetDragContext( (GdkDragContext*) NULL );
/* this has to be done because GDK has no "drag_enter" event */ /* this has to be done because GDK has no "drag_enter" event */
drop_target->m_firstMotion = FALSE; drop_target->m_firstMotion = false;
return ret; return ret;
} }
@@ -338,7 +338,7 @@ static gboolean target_drag_drop( GtkWidget *widget,
/* reset the block here as someone might very well /* reset the block here as someone might very well
show a dialog as a reaction to a drop and this show a dialog as a reaction to a drop and this
wouldn't work without events */ wouldn't work without events */
g_blockEventsOnDrag = FALSE; g_blockEventsOnDrag = false;
bool ret = drop_target->OnDrop( x, y ); bool ret = drop_target->OnDrop( x, y );
@@ -388,7 +388,7 @@ static gboolean target_drag_drop( GtkWidget *widget,
drop_target->SetDragWidget( (GtkWidget*) NULL ); drop_target->SetDragWidget( (GtkWidget*) NULL );
/* this has to be done because GDK has no "drag_enter" event */ /* this has to be done because GDK has no "drag_enter" event */
drop_target->m_firstMotion = TRUE; drop_target->m_firstMotion = true;
return ret; return ret;
} }
@@ -457,7 +457,7 @@ static void target_drag_data_received( GtkWidget *WXUNUSED(widget),
wxDropTarget::wxDropTarget( wxDataObject *data ) wxDropTarget::wxDropTarget( wxDataObject *data )
: wxDropTargetBase( data ) : wxDropTargetBase( data )
{ {
m_firstMotion = TRUE; m_firstMotion = true;
m_dragContext = (GdkDragContext*) NULL; m_dragContext = (GdkDragContext*) NULL;
m_dragWidget = (GtkWidget*) NULL; m_dragWidget = (GtkWidget*) NULL;
m_dragData = (GtkSelectionData*) NULL; m_dragData = (GtkSelectionData*) NULL;
@@ -482,7 +482,7 @@ wxDragResult wxDropTarget::OnDragOver( wxCoord WXUNUSED(x),
bool wxDropTarget::OnDrop( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y) ) bool wxDropTarget::OnDrop( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y) )
{ {
if (!m_dataObject) if (!m_dataObject)
return FALSE; return false;
return (GetMatchingPair() != (GdkAtom) 0); return (GetMatchingPair() != (GdkAtom) 0);
} }
@@ -530,19 +530,19 @@ GdkAtom wxDropTarget::GetMatchingPair()
bool wxDropTarget::GetData() bool wxDropTarget::GetData()
{ {
if (!m_dragData) if (!m_dragData)
return FALSE; return false;
if (!m_dataObject) if (!m_dataObject)
return FALSE; return false;
wxDataFormat dragFormat( m_dragData->target ); wxDataFormat dragFormat( m_dragData->target );
if (!m_dataObject->IsSupportedFormat( dragFormat )) if (!m_dataObject->IsSupportedFormat( dragFormat ))
return FALSE; return false;
m_dataObject->SetData( dragFormat, (size_t)m_dragData->length, (const void*)m_dragData->data ); m_dataObject->SetData( dragFormat, (size_t)m_dragData->length, (const void*)m_dragData->data );
return TRUE; return true;
} }
void wxDropTarget::UnregisterWidget( GtkWidget *widget ) void wxDropTarget::UnregisterWidget( GtkWidget *widget )
@@ -714,7 +714,7 @@ static void source_drag_end( GtkWidget *WXUNUSED(widget),
// printf( "Drag source: drag_end.\n" ); // printf( "Drag source: drag_end.\n" );
drop_source->m_waiting = FALSE; drop_source->m_waiting = false;
} }
} }
@@ -744,7 +744,7 @@ wxDropSource::wxDropSource(wxWindow *win,
const wxIcon &iconMove, const wxIcon &iconMove,
const wxIcon &iconNone) const wxIcon &iconNone)
{ {
m_waiting = TRUE; m_waiting = true;
m_iconWindow = (GtkWidget*) NULL; m_iconWindow = (GtkWidget*) NULL;
@@ -763,7 +763,7 @@ wxDropSource::wxDropSource(wxDataObject& data,
const wxIcon &iconMove, const wxIcon &iconMove,
const wxIcon &iconNone) const wxIcon &iconNone)
{ {
m_waiting = TRUE; m_waiting = true;
SetData( data ); SetData( data );
@@ -859,11 +859,11 @@ wxDragResult wxDropSource::DoDragDrop(int flags)
return wxDragNone; return wxDragNone;
// disabled for now // disabled for now
g_blockEventsOnDrag = TRUE; g_blockEventsOnDrag = true;
RegisterWindow(); RegisterWindow();
m_waiting = TRUE; m_waiting = true;
GtkTargetList *target_list = gtk_target_list_new( (GtkTargetEntry*) NULL, 0 ); GtkTargetList *target_list = gtk_target_list_new( (GtkTargetEntry*) NULL, 0 );
@@ -933,7 +933,7 @@ wxDragResult wxDropSource::DoDragDrop(int flags)
/* re-enable GUI threads */ /* re-enable GUI threads */
#endif #endif
g_blockEventsOnDrag = FALSE; g_blockEventsOnDrag = false;
UnregisterWindow(); UnregisterWindow();

View File

@@ -714,4 +714,3 @@ void wxFrame::PositionStatusBar()
GtkUpdateSize(); GtkUpdateSize();
} }
#endif // wxUSE_STATUSBAR #endif // wxUSE_STATUSBAR

View File

@@ -111,7 +111,7 @@ static gint gtk_frame_focus_in_callback( GtkWidget *widget,
// wxPrintf( wxT("active: %s\n"), win->GetTitle().c_str() ); // wxPrintf( wxT("active: %s\n"), win->GetTitle().c_str() );
wxLogTrace(wxT("activate"), wxT("Activating frame %p (from focus_in)"), g_activeFrame); wxLogTrace(wxT("activate"), wxT("Activating frame %p (from focus_in)"), g_activeFrame);
wxActivateEvent event(wxEVT_ACTIVATE, TRUE, g_activeFrame->GetId()); wxActivateEvent event(wxEVT_ACTIVATE, true, g_activeFrame->GetId());
event.SetEventObject(g_activeFrame); event.SetEventObject(g_activeFrame);
g_activeFrame->GetEventHandler()->ProcessEvent(event); g_activeFrame->GetEventHandler()->ProcessEvent(event);
@@ -143,7 +143,7 @@ static gint gtk_frame_focus_out_callback( GtkWidget *widget,
if (g_activeFrame) if (g_activeFrame)
{ {
wxLogTrace(wxT("activate"), wxT("Activating frame %p (from focus_in)"), g_activeFrame); wxLogTrace(wxT("activate"), wxT("Activating frame %p (from focus_in)"), g_activeFrame);
wxActivateEvent event(wxEVT_ACTIVATE, FALSE, g_activeFrame->GetId()); wxActivateEvent event(wxEVT_ACTIVATE, false, g_activeFrame->GetId());
event.SetEventObject(g_activeFrame); event.SetEventObject(g_activeFrame);
g_activeFrame->GetEventHandler()->ProcessEvent(event); g_activeFrame->GetEventHandler()->ProcessEvent(event);
@@ -299,7 +299,7 @@ gtk_frame_map_callback( GtkWidget * WXUNUSED(widget),
GdkEvent * WXUNUSED(event), GdkEvent * WXUNUSED(event),
wxTopLevelWindow *win ) wxTopLevelWindow *win )
{ {
win->SetIconizeState(FALSE); win->SetIconizeState(false);
} }
} }
@@ -410,16 +410,16 @@ static void wxInsertChildInTopLevelWindow( wxTopLevelWindowGTK* parent, wxWindow
void wxTopLevelWindowGTK::Init() void wxTopLevelWindowGTK::Init()
{ {
m_sizeSet = FALSE; m_sizeSet = false;
m_miniEdge = 0; m_miniEdge = 0;
m_miniTitle = 0; m_miniTitle = 0;
m_mainWidget = (GtkWidget*) NULL; m_mainWidget = (GtkWidget*) NULL;
m_insertInClientArea = TRUE; m_insertInClientArea = true;
m_isIconized = FALSE; m_isIconized = false;
m_fsIsShowing = FALSE; m_fsIsShowing = false;
m_themeEnabled = TRUE; m_themeEnabled = true;
m_gdkDecor = m_gdkFunc = 0; m_gdkDecor = m_gdkFunc = 0;
m_grabbed = FALSE; m_grabbed = false;
} }
bool wxTopLevelWindowGTK::Create( wxWindow *parent, bool wxTopLevelWindowGTK::Create( wxWindow *parent,
@@ -438,13 +438,13 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
wxTopLevelWindows.Append( this ); wxTopLevelWindows.Append( this );
m_needParent = FALSE; m_needParent = false;
if (!PreCreation( parent, pos, size ) || if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{ {
wxFAIL_MSG( wxT("wxTopLevelWindowGTK creation failed") ); wxFAIL_MSG( wxT("wxTopLevelWindowGTK creation failed") );
return FALSE; return false;
} }
m_title = title; m_title = title;
@@ -522,7 +522,7 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
} }
#endif #endif
if (!name.IsEmpty()) if (!name.empty())
gtk_window_set_wmclass( GTK_WINDOW(m_widget), wxGTK_CONV( name ), wxGTK_CONV( name ) ); gtk_window_set_wmclass( GTK_WINDOW(m_widget), wxGTK_CONV( name ), wxGTK_CONV( name ) );
gtk_window_set_title( GTK_WINDOW(m_widget), wxGTK_CONV( title ) ); gtk_window_set_title( GTK_WINDOW(m_widget), wxGTK_CONV( title ) );
@@ -641,7 +641,7 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
} }
} }
return TRUE; return true;
} }
wxTopLevelWindowGTK::~wxTopLevelWindowGTK() wxTopLevelWindowGTK::~wxTopLevelWindowGTK()
@@ -652,7 +652,7 @@ wxTopLevelWindowGTK::~wxTopLevelWindowGTK()
RemoveGrab(); RemoveGrab();
} }
m_isBeingDeleted = TRUE; m_isBeingDeleted = true;
// it may also be GtkScrolledWindow in the case of an MDI child // it may also be GtkScrolledWindow in the case of an MDI child
if (GTK_IS_WINDOW(m_widget)) if (GTK_IS_WINDOW(m_widget))
@@ -671,7 +671,7 @@ wxTopLevelWindowGTK::~wxTopLevelWindowGTK()
bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style ) bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style )
{ {
if (show == m_fsIsShowing) if (show == m_fsIsShowing)
return FALSE; // return what? return false; // return what?
m_fsIsShowing = show; m_fsIsShowing = show;
@@ -691,7 +691,7 @@ bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style )
else else
gtk_window_unfullscreen( GTK_WINDOW( m_widget ) ); gtk_window_unfullscreen( GTK_WINDOW( m_widget ) );
return TRUE; return true;
} }
else else
#endif // GTK+ >= 2.2.0 #endif // GTK+ >= 2.2.0
@@ -753,7 +753,7 @@ bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style )
} }
} }
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -804,7 +804,7 @@ void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int si
// avoid recursions // avoid recursions
if (m_resizing) if (m_resizing)
return; return;
m_resizing = TRUE; m_resizing = true;
int old_x = m_x; int old_x = m_x;
int old_y = m_y; int old_y = m_y;
@@ -875,10 +875,10 @@ void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int si
/* we set the size in GtkOnSize, i.e. mostly the actual resizing is /* we set the size in GtkOnSize, i.e. mostly the actual resizing is
done either directly before the frame is shown or in idle time done either directly before the frame is shown or in idle time
so that different calls to SetSize() don't lead to flicker. */ so that different calls to SetSize() don't lead to flicker. */
m_sizeSet = FALSE; m_sizeSet = false;
} }
m_resizing = FALSE; m_resizing = false;
} }
void wxTopLevelWindowGTK::DoGetClientSize( int *width, int *height ) const void wxTopLevelWindowGTK::DoGetClientSize( int *width, int *height ) const
@@ -914,7 +914,7 @@ void wxTopLevelWindowGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
// avoid recursions // avoid recursions
if (m_resizing) return; if (m_resizing) return;
m_resizing = TRUE; m_resizing = true;
if ( m_wxwindow == NULL ) return; if ( m_wxwindow == NULL ) return;
@@ -1008,14 +1008,14 @@ void wxTopLevelWindowGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
// is no need to set the size or position of m_wxwindow. // is no need to set the size or position of m_wxwindow.
} }
m_sizeSet = TRUE; m_sizeSet = true;
// send size event to frame // send size event to frame
wxSizeEvent event( wxSize(m_width,m_height), GetId() ); wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this ); event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event ); GetEventHandler()->ProcessEvent( event );
m_resizing = FALSE; m_resizing = false;
} }
void wxTopLevelWindowGTK::OnInternalIdle() void wxTopLevelWindowGTK::OnInternalIdle()
@@ -1147,7 +1147,7 @@ bool wxTopLevelWindowGTK::IsMaximized() const
// wxFAIL_MSG( _T("not implemented") ); // wxFAIL_MSG( _T("not implemented") );
// This is an approximation // This is an approximation
return FALSE; return false;
#endif #endif
} }
@@ -1201,7 +1201,7 @@ void wxTopLevelWindowGTK::AddGrab()
{ {
if (!m_grabbed) if (!m_grabbed)
{ {
m_grabbed = TRUE; m_grabbed = true;
gtk_grab_add( m_widget ); gtk_grab_add( m_widget );
wxEventLoop().Run(); wxEventLoop().Run();
gtk_grab_remove( m_widget ); gtk_grab_remove( m_widget );
@@ -1213,7 +1213,7 @@ void wxTopLevelWindowGTK::RemoveGrab()
if (m_grabbed) if (m_grabbed)
{ {
gtk_main_quit(); gtk_main_quit();
m_grabbed = FALSE; m_grabbed = false;
} }
} }
@@ -1237,16 +1237,16 @@ static bool do_shape_combine_region(GdkWindow* window, const wxRegion& region)
GdkBitmap* mask = bmp.GetMask()->GetBitmap(); GdkBitmap* mask = bmp.GetMask()->GetBitmap();
gdk_window_shape_combine_mask(window, mask, 0, 0); gdk_window_shape_combine_mask(window, mask, 0, 0);
#endif #endif
return TRUE; return true;
} }
} }
return FALSE; return false;
} }
bool wxTopLevelWindowGTK::SetShape(const wxRegion& region) bool wxTopLevelWindowGTK::SetShape(const wxRegion& region)
{ {
wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), FALSE, wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false,
_T("Shaped windows must be created with the wxFRAME_SHAPED style.")); _T("Shaped windows must be created with the wxFRAME_SHAPED style."));
GdkWindow *window = NULL; GdkWindow *window = NULL;
@@ -1263,4 +1263,3 @@ bool wxTopLevelWindowGTK::IsActive()
{ {
return (this == (wxTopLevelWindowGTK*)g_activeFrame); return (this == (wxTopLevelWindowGTK*)g_activeFrame);
} }

View File

@@ -229,7 +229,7 @@ static GdkGC *g_eraseGC = NULL;
// mouse capture state: the window which has it and if the mouse is currently // mouse capture state: the window which has it and if the mouse is currently
// inside it // inside it
static wxWindowGTK *g_captureWindow = (wxWindowGTK*) NULL; static wxWindowGTK *g_captureWindow = (wxWindowGTK*) NULL;
static bool g_captureWindowHasMouse = FALSE; static bool g_captureWindowHasMouse = false;
wxWindowGTK *g_focusWindow = (wxWindowGTK*) NULL; wxWindowGTK *g_focusWindow = (wxWindowGTK*) NULL;
@@ -1048,7 +1048,7 @@ wxTranslateGTKKeyEventToWx(wxKeyEvent& event,
: _T("press"), : _T("press"),
keysym); keysym);
long key_code = wxTranslateKeySymToWXKey(keysym, FALSE /* !isChar */); long key_code = wxTranslateKeySymToWXKey(keysym, false /* !isChar */);
if ( !key_code ) if ( !key_code )
{ {
@@ -1117,14 +1117,14 @@ wxTranslateGTKKeyEventToWx(wxKeyEvent& event,
// sending unknown key events doesn't really make sense // sending unknown key events doesn't really make sense
if ( !key_code ) if ( !key_code )
return FALSE; return false;
// now fill all the other fields // now fill all the other fields
wxFillOtherKeyEventFields(event, win, gdk_event); wxFillOtherKeyEventFields(event, win, gdk_event);
event.m_keyCode = key_code; event.m_keyCode = key_code;
return TRUE; return true;
} }
@@ -1295,7 +1295,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
long key_code; long key_code;
KeySym keysym = gdk_event->keyval; KeySym keysym = gdk_event->keyval;
// Find key code for EVT_CHAR and EVT_CHAR_HOOK events // Find key code for EVT_CHAR and EVT_CHAR_HOOK events
key_code = wxTranslateKeySymToWXKey(keysym, TRUE /* isChar */); key_code = wxTranslateKeySymToWXKey(keysym, true /* isChar */);
if ( !key_code ) if ( !key_code )
{ {
if ( wxIsAsciiKeysym(keysym) ) if ( wxIsAsciiKeysym(keysym) )
@@ -2117,7 +2117,7 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget,
if ( !win->m_hasFocus ) if ( !win->m_hasFocus )
{ {
// not yet, notify it // not yet, notify it
win->m_hasFocus = TRUE; win->m_hasFocus = true;
if ( DoSendFocusEvents(win) ) if ( DoSendFocusEvents(win) )
{ {
@@ -2175,7 +2175,7 @@ static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk
// have focus already // have focus already
if ( win->m_hasFocus ) if ( win->m_hasFocus )
{ {
win->m_hasFocus = FALSE; win->m_hasFocus = false;
wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() ); wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() );
event.SetEventObject( win ); event.SetEventObject( win );
@@ -2374,7 +2374,7 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
wxapp_install_idle_handler(); wxapp_install_idle_handler();
g_blockEventsOnScroll = TRUE; g_blockEventsOnScroll = true;
// FIXME: there is no 'slider' field in GTK+ 2.0 any more // FIXME: there is no 'slider' field in GTK+ 2.0 any more
#ifndef __WXGTK20__ #ifndef __WXGTK20__
@@ -2401,7 +2401,7 @@ static gint gtk_scrollbar_button_release_callback( GtkRange *widget,
// //
// if (gdk_event->window != widget->slider) return FALSE; // if (gdk_event->window != widget->slider) return FALSE;
g_blockEventsOnScroll = FALSE; g_blockEventsOnScroll = false;
if (win->m_isScrolling) if (win->m_isScrolling)
{ {
@@ -2426,7 +2426,7 @@ static gint gtk_scrollbar_button_release_callback( GtkRange *widget,
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
win->m_isScrolling = FALSE; win->m_isScrolling = false;
return FALSE; return FALSE;
} }
@@ -2700,16 +2700,16 @@ void wxWindowGTK::Init()
m_width = 0; m_width = 0;
m_height = 0; m_height = 0;
m_sizeSet = FALSE; m_sizeSet = false;
m_hasVMT = FALSE; m_hasVMT = false;
m_needParent = TRUE; m_needParent = true;
m_isBeingDeleted = FALSE; m_isBeingDeleted = false;
m_noExpose = FALSE; m_noExpose = false;
m_nativeSizeEvent = FALSE; m_nativeSizeEvent = false;
m_hasScrolling = FALSE; m_hasScrolling = false;
m_isScrolling = FALSE; m_isScrolling = false;
m_hAdjust = (GtkAdjustment*) NULL; m_hAdjust = (GtkAdjustment*) NULL;
m_vAdjust = (GtkAdjustment*) NULL; m_vAdjust = (GtkAdjustment*) NULL;
@@ -2718,14 +2718,14 @@ void wxWindowGTK::Init()
m_oldClientWidth = m_oldClientWidth =
m_oldClientHeight = 0; m_oldClientHeight = 0;
m_resizing = FALSE; m_resizing = false;
m_insertCallback = (wxInsertChildFunction) NULL; m_insertCallback = (wxInsertChildFunction) NULL;
m_acceptsFocus = FALSE; m_acceptsFocus = false;
m_hasFocus = FALSE; m_hasFocus = false;
m_clipPaintRegion = FALSE; m_clipPaintRegion = false;
m_needsStyleChange = false; m_needsStyleChange = false;
@@ -2771,7 +2771,7 @@ bool wxWindowGTK::Create( wxWindow *parent,
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{ {
wxFAIL_MSG( wxT("wxWindowGTK creation failed") ); wxFAIL_MSG( wxT("wxWindowGTK creation failed") );
return FALSE; return false;
} }
m_insertCallback = wxInsertChildInWindow; m_insertCallback = wxInsertChildInWindow;
@@ -2815,7 +2815,7 @@ bool wxWindowGTK::Create( wxWindow *parent,
gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow ); gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow );
GTK_WIDGET_SET_FLAGS( m_wxwindow, GTK_CAN_FOCUS ); GTK_WIDGET_SET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
m_acceptsFocus = TRUE; m_acceptsFocus = true;
// I _really_ don't want scrollbars in the beginning // I _really_ don't want scrollbars in the beginning
m_vAdjust->lower = 0.0; m_vAdjust->lower = 0.0;
@@ -2867,7 +2867,7 @@ bool wxWindowGTK::Create( wxWindow *parent,
PostCreation(); PostCreation();
return TRUE; return true;
} }
wxWindowGTK::~wxWindowGTK() wxWindowGTK::~wxWindowGTK()
@@ -2880,11 +2880,11 @@ wxWindowGTK::~wxWindowGTK()
if ( g_delayedFocus == this ) if ( g_delayedFocus == this )
g_delayedFocus = NULL; g_delayedFocus = NULL;
m_isBeingDeleted = TRUE; m_isBeingDeleted = true;
m_hasVMT = FALSE; m_hasVMT = false;
if (m_widget) if (m_widget)
Show( FALSE ); Show( false );
DestroyChildren(); DestroyChildren();
@@ -2914,7 +2914,7 @@ wxWindowGTK::~wxWindowGTK()
bool wxWindowGTK::PreCreation( wxWindowGTK *parent, const wxPoint &pos, const wxSize &size ) bool wxWindowGTK::PreCreation( wxWindowGTK *parent, const wxPoint &pos, const wxSize &size )
{ {
wxCHECK_MSG( !m_needParent || parent, FALSE, wxT("Need complete parent.") ); wxCHECK_MSG( !m_needParent || parent, false, wxT("Need complete parent.") );
// Use either the given size, or the default if -1 is given. // Use either the given size, or the default if -1 is given.
// See wxWindowBase for these functions. // See wxWindowBase for these functions.
@@ -2924,7 +2924,7 @@ bool wxWindowGTK::PreCreation( wxWindowGTK *parent, const wxPoint &pos, const w
m_x = (int)pos.x; m_x = (int)pos.x;
m_y = (int)pos.y; m_y = (int)pos.y;
return TRUE; return true;
} }
void wxWindowGTK::PostCreation() void wxWindowGTK::PostCreation()
@@ -3038,7 +3038,7 @@ void wxWindowGTK::PostCreation()
InheritAttributes(); InheritAttributes();
m_hasVMT = TRUE; m_hasVMT = true;
// unless the window was created initially hidden (i.e. Hide() had been // unless the window was created initially hidden (i.e. Hide() had been
// called before Create()), we should show it at GTK+ level as well // called before Create()), we should show it at GTK+ level as well
@@ -3081,7 +3081,7 @@ bool wxWindowGTK::Destroy()
{ {
wxASSERT_MSG( (m_widget != NULL), wxT("invalid window") ); wxASSERT_MSG( (m_widget != NULL), wxT("invalid window") );
m_hasVMT = FALSE; m_hasVMT = false;
return wxWindowBase::Destroy(); return wxWindowBase::Destroy();
} }
@@ -3101,7 +3101,7 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
*/ */
if (m_resizing) return; /* I don't like recursions */ if (m_resizing) return; /* I don't like recursions */
m_resizing = TRUE; m_resizing = true;
int currentX, currentY; int currentX, currentY;
GetPosition(&currentX, &currentY); GetPosition(&currentX, &currentY);
@@ -3217,7 +3217,7 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
GetEventHandler()->ProcessEvent( event ); GetEventHandler()->ProcessEvent( event );
} }
m_resizing = FALSE; m_resizing = false;
} }
void wxWindowGTK::OnInternalIdle() void wxWindowGTK::OnInternalIdle()
@@ -3495,12 +3495,12 @@ void wxWindowGTK::DoScreenToClient( int *x, int *y ) const
bool wxWindowGTK::Show( bool show ) bool wxWindowGTK::Show( bool show )
{ {
wxCHECK_MSG( (m_widget != NULL), FALSE, wxT("invalid window") ); wxCHECK_MSG( (m_widget != NULL), false, wxT("invalid window") );
if (!wxWindowBase::Show(show)) if (!wxWindowBase::Show(show))
{ {
// nothing to do // nothing to do
return FALSE; return false;
} }
if (show) if (show)
@@ -3513,7 +3513,7 @@ bool wxWindowGTK::Show( bool show )
GetEventHandler()->ProcessEvent(eventShow); GetEventHandler()->ProcessEvent(eventShow);
return TRUE; return true;
} }
static void wxWindowNotifyEnable(wxWindowGTK* win, bool enable) static void wxWindowNotifyEnable(wxWindowGTK* win, bool enable)
@@ -3535,12 +3535,12 @@ static void wxWindowNotifyEnable(wxWindowGTK* win, bool enable)
bool wxWindowGTK::Enable( bool enable ) bool wxWindowGTK::Enable( bool enable )
{ {
wxCHECK_MSG( (m_widget != NULL), FALSE, wxT("invalid window") ); wxCHECK_MSG( (m_widget != NULL), false, wxT("invalid window") );
if (!wxWindowBase::Enable(enable)) if (!wxWindowBase::Enable(enable))
{ {
// nothing to do // nothing to do
return FALSE; return false;
} }
gtk_widget_set_sensitive( m_widget, enable ); gtk_widget_set_sensitive( m_widget, enable );
@@ -3549,7 +3549,7 @@ bool wxWindowGTK::Enable( bool enable )
wxWindowNotifyEnable(this, enable); wxWindowNotifyEnable(this, enable);
return TRUE; return true;
} }
int wxWindowGTK::GetCharHeight() const int wxWindowGTK::GetCharHeight() const
@@ -3631,7 +3631,7 @@ void wxWindowGTK::GetTextExtent( const wxString& string,
wxCHECK_RET( fontToUse.Ok(), wxT("invalid font") ); wxCHECK_RET( fontToUse.Ok(), wxT("invalid font") );
if (string.IsEmpty()) if (string.empty())
{ {
if (x) (*x) = 0; if (x) (*x) = 0;
if (y) (*y) = 0; if (y) (*y) = 0;
@@ -3759,7 +3759,7 @@ bool wxWindowGTK::AcceptsFocus() const
bool wxWindowGTK::Reparent( wxWindowBase *newParentBase ) bool wxWindowGTK::Reparent( wxWindowBase *newParentBase )
{ {
wxCHECK_MSG( (m_widget != NULL), FALSE, wxT("invalid window") ); wxCHECK_MSG( (m_widget != NULL), false, wxT("invalid window") );
wxWindowGTK *oldParent = m_parent, wxWindowGTK *oldParent = m_parent,
*newParent = (wxWindowGTK *)newParentBase; *newParent = (wxWindowGTK *)newParentBase;
@@ -3767,7 +3767,7 @@ bool wxWindowGTK::Reparent( wxWindowBase *newParentBase )
wxASSERT( GTK_IS_WIDGET(m_widget) ); wxASSERT( GTK_IS_WIDGET(m_widget) );
if ( !wxWindowBase::Reparent(newParent) ) if ( !wxWindowBase::Reparent(newParent) )
return FALSE; return false;
wxASSERT( GTK_IS_WIDGET(m_widget) ); wxASSERT( GTK_IS_WIDGET(m_widget) );
@@ -3790,7 +3790,7 @@ bool wxWindowGTK::Reparent( wxWindowBase *newParentBase )
/* reverse: prevent GTK from deleting the widget arbitrarily */ /* reverse: prevent GTK from deleting the widget arbitrarily */
gtk_widget_unref( m_widget ); gtk_widget_unref( m_widget );
return TRUE; return true;
} }
void wxWindowGTK::DoAddChild(wxWindowGTK *child) void wxWindowGTK::DoAddChild(wxWindowGTK *child)
@@ -3894,10 +3894,10 @@ void wxWindowGTK::Lower()
bool wxWindowGTK::SetCursor( const wxCursor &cursor ) bool wxWindowGTK::SetCursor( const wxCursor &cursor )
{ {
wxCHECK_MSG( (m_widget != NULL), FALSE, wxT("invalid window") ); wxCHECK_MSG( (m_widget != NULL), false, wxT("invalid window") );
if (cursor == m_cursor) if (cursor == m_cursor)
return FALSE; return false;
if (g_isIdle) if (g_isIdle)
wxapp_install_idle_handler(); wxapp_install_idle_handler();
@@ -4060,7 +4060,7 @@ void wxWindowGTK::GtkSendPaintEvents()
} }
// Clip to paint region in wxClientDC // Clip to paint region in wxClientDC
m_clipPaintRegion = TRUE; m_clipPaintRegion = true;
// widget to draw on // widget to draw on
GtkPizza *pizza = GTK_PIZZA (m_wxwindow); GtkPizza *pizza = GTK_PIZZA (m_wxwindow);
@@ -4149,7 +4149,7 @@ void wxWindowGTK::GtkSendPaintEvents()
paint_event.SetEventObject( this ); paint_event.SetEventObject( this );
GetEventHandler()->ProcessEvent( paint_event ); GetEventHandler()->ProcessEvent( paint_event );
m_clipPaintRegion = FALSE; m_clipPaintRegion = false;
#ifndef __WXUNIVERSAL__ #ifndef __WXUNIVERSAL__
#ifndef __WXGTK20__ #ifndef __WXGTK20__
@@ -4233,7 +4233,7 @@ void wxWindowGTK::ApplyToolTip( GtkTooltips *tips, const wxChar *tip )
bool wxWindowGTK::SetBackgroundColour( const wxColour &colour ) bool wxWindowGTK::SetBackgroundColour( const wxColour &colour )
{ {
wxCHECK_MSG( m_widget != NULL, FALSE, wxT("invalid window") ); wxCHECK_MSG( m_widget != NULL, false, wxT("invalid window") );
if (!wxWindowBase::SetBackgroundColour(colour)) if (!wxWindowBase::SetBackgroundColour(colour))
return false; return false;
@@ -4254,7 +4254,7 @@ bool wxWindowGTK::SetBackgroundColour( const wxColour &colour )
bool wxWindowGTK::SetForegroundColour( const wxColour &colour ) bool wxWindowGTK::SetForegroundColour( const wxColour &colour )
{ {
wxCHECK_MSG( m_widget != NULL, FALSE, wxT("invalid window") ); wxCHECK_MSG( m_widget != NULL, false, wxT("invalid window") );
if (!wxWindowBase::SetForegroundColour(colour)) if (!wxWindowBase::SetForegroundColour(colour))
{ {
@@ -4562,7 +4562,7 @@ bool wxWindowGTK::IsOwnGtkWindow( GdkWindow *window )
bool wxWindowGTK::SetFont( const wxFont &font ) bool wxWindowGTK::SetFont( const wxFont &font )
{ {
wxCHECK_MSG( m_widget != NULL, FALSE, wxT("invalid window") ); wxCHECK_MSG( m_widget != NULL, false, wxT("invalid window") );
if (!wxWindowBase::SetFont(font)) if (!wxWindowBase::SetFont(font))
return false; return false;
@@ -4600,7 +4600,7 @@ void wxWindowGTK::DoCaptureMouse()
cursor->GetCursor(), cursor->GetCursor(),
(guint32)GDK_CURRENT_TIME ); (guint32)GDK_CURRENT_TIME );
g_captureWindow = this; g_captureWindow = this;
g_captureWindowHasMouse = TRUE; g_captureWindowHasMouse = true;
} }
void wxWindowGTK::DoReleaseMouse() void wxWindowGTK::DoReleaseMouse()
@@ -4631,7 +4631,7 @@ wxWindow *wxWindowBase::GetCapture()
bool wxWindowGTK::IsRetained() const bool wxWindowGTK::IsRetained() const
{ {
return FALSE; return false;
} }
void wxWindowGTK::SetScrollbar( int orient, int pos, int thumbVisible, void wxWindowGTK::SetScrollbar( int orient, int pos, int thumbVisible,
@@ -4641,7 +4641,7 @@ void wxWindowGTK::SetScrollbar( int orient, int pos, int thumbVisible,
wxCHECK_RET( m_wxwindow != NULL, wxT("window needs client area for scrolling") ); wxCHECK_RET( m_wxwindow != NULL, wxT("window needs client area for scrolling") );
m_hasScrolling = TRUE; m_hasScrolling = true;
if (orient == wxHORIZONTAL) if (orient == wxHORIZONTAL)
{ {
@@ -4817,11 +4817,11 @@ void wxWindowGTK::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
} }
#endif #endif
m_clipPaintRegion = TRUE; m_clipPaintRegion = true;
gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy ); gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy );
m_clipPaintRegion = FALSE; m_clipPaintRegion = false;
} }
@@ -4885,7 +4885,7 @@ bool wxWinModule::OnInit()
// g_eraseGC = gdk_gc_new( GDK_ROOT_PARENT() ); // g_eraseGC = gdk_gc_new( GDK_ROOT_PARENT() );
// gdk_gc_set_fill( g_eraseGC, GDK_SOLID ); // gdk_gc_set_fill( g_eraseGC, GDK_SOLID );
return TRUE; return true;
} }
void wxWinModule::OnExit() void wxWinModule::OnExit()