From 93763ad5ba900aecb9220a36ebe7447313ea3e31 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Tue, 18 Apr 2006 08:11:26 +0000 Subject: [PATCH] wx/wxprec.h already includes wx/defs.h (with other minor cleaning). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38788 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/dirdlgg.cpp | 4 +- src/generic/grid.cpp | 4 +- src/generic/gridsel.cpp | 18 +- src/generic/imaglist.cpp | 10 +- src/generic/printps.cpp | 18 +- src/generic/propdlg.cpp | 13 +- src/gtk/bitmap.cpp | 5 +- src/gtk/bmpbuttn.cpp | 4 +- src/gtk/button.cpp | 15 +- src/gtk/checkbox.cpp | 24 +- src/gtk/data.cpp | 13 +- src/gtk/dataview.cpp | 494 +++++++++++++++++++-------------------- src/gtk/fontdlg.cpp | 13 +- src/gtk/frame.cpp | 10 +- src/gtk/toplevel.cpp | 8 +- src/gtk1/bmpbuttn.cpp | 5 +- src/gtk1/button.cpp | 15 +- src/gtk1/checkbox.cpp | 24 +- src/gtk1/data.cpp | 14 +- src/gtk1/fontdlg.cpp | 13 +- src/gtk1/frame.cpp | 10 +- src/gtk1/toplevel.cpp | 8 +- src/html/helpdata.cpp | 20 +- src/html/htmlcell.cpp | 12 +- src/html/htmlfilt.cpp | 9 +- src/html/htmlpars.cpp | 13 +- src/html/htmltag.cpp | 11 +- src/html/htmlwin.cpp | 9 +- src/html/htmprint.cpp | 10 +- src/html/m_dflist.cpp | 9 +- src/html/m_fonts.cpp | 9 +- src/html/m_hline.cpp | 8 +- src/html/m_image.cpp | 9 +- src/html/m_layout.cpp | 8 +- src/html/m_links.cpp | 9 +- src/html/m_list.cpp | 9 +- src/html/m_pre.cpp | 8 +- src/html/m_style.cpp | 9 +- src/html/m_tables.cpp | 12 +- src/html/winpars.cpp | 10 +- 40 files changed, 429 insertions(+), 497 deletions(-) diff --git a/src/generic/dirdlgg.cpp b/src/generic/dirdlgg.cpp index 1b9cc35764..9419cbc73f 100644 --- a/src/generic/dirdlgg.cpp +++ b/src/generic/dirdlgg.cpp @@ -13,11 +13,9 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif -#include "wx/defs.h" - #if wxUSE_DIRDLG #ifndef WX_PRECOMP diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 8c54f1eb99..9e009e5d1a 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -12,8 +12,6 @@ // For compilers that support precompilatixon, includes "wx/wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #ifdef __BORLANDC__ #pragma hdrstop #endif @@ -3180,7 +3178,7 @@ bool wxGridTableBase::DeleteCols( size_t WXUNUSED(pos), wxString wxGridTableBase::GetRowLabelValue( int row ) { wxString s; - + // RD: Starting the rows at zero confuses users, // no matter how much it makes sense to us geeks. s << row + 1; diff --git a/src/generic/gridsel.cpp b/src/generic/gridsel.cpp index c815064484..f89835df90 100644 --- a/src/generic/gridsel.cpp +++ b/src/generic/gridsel.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// Name: generic/gridsel.cpp +// Name: src/generic/gridsel.cpp // Purpose: wxGridSelection // Author: Stefan Neis // Modified by: @@ -9,6 +9,13 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + // ============================================================================ // declarations // ============================================================================ @@ -17,15 +24,6 @@ // headers // ---------------------------------------------------------------------------- -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#include "wx/defs.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - #if wxUSE_GRID #include "wx/generic/gridsel.h" diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp index 0e3d1c01bd..9ec73fa68e 100644 --- a/src/generic/imaglist.cpp +++ b/src/generic/imaglist.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: generic/imaglist.cpp +// Name: src/generic/imaglist.cpp // Purpose: // Author: Robert Roebling // Id: $id$ @@ -10,13 +10,11 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#if wxUSE_IMAGLIST - #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif -#include "wx/defs.h" +#if wxUSE_IMAGLIST #ifndef __WXPALMOS__ @@ -86,7 +84,7 @@ int wxGenericImageList::Add( const wxBitmap &bitmap ) m_width = bitmap.GetWidth(); m_height = bitmap.GetHeight(); } - + return m_images.GetCount()-1; } diff --git a/src/generic/printps.cpp b/src/generic/printps.cpp index c3fd9a8a61..6b73aab674 100644 --- a/src/generic/printps.cpp +++ b/src/generic/printps.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: printps.cpp +// Name: src/generic/printps.cpp // Purpose: Postscript print/preview framework // Author: Julian Smart // Modified by: @@ -9,14 +9,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -24,7 +16,13 @@ #pragma hdrstop #endif -#include "wx/defs.h" +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- #if wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT && (!defined(__WXMSW__) || wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW) diff --git a/src/generic/propdlg.cpp b/src/generic/propdlg.cpp index 02c23b3a8e..5b1fa5d1d5 100644 --- a/src/generic/propdlg.cpp +++ b/src/generic/propdlg.cpp @@ -13,11 +13,9 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif -#include "wx/defs.h" - #if wxUSE_BOOKCTRL #ifndef WX_PRECOMP @@ -145,7 +143,7 @@ wxBookCtrlBase* wxPropertySheetDialog::CreateBookCtrl() #endif wxBookCtrlBase* bookCtrl = NULL; - + #if wxUSE_NOTEBOOK if (GetSheetStyle() & wxPROPSHEET_NOTEBOOK) bookCtrl = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style ); @@ -169,10 +167,10 @@ wxBookCtrlBase* wxPropertySheetDialog::CreateBookCtrl() #endif if (!bookCtrl) bookCtrl = new wxBookCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style ); - + if (GetSheetStyle() & wxPROPSHEET_SHRINKTOFIT) bookCtrl->SetFitToCurrentPage(true); - + return bookCtrl; } @@ -211,7 +209,7 @@ void wxPropertySheetDialog::OnActivate(wxActivateEvent& event) void wxPropertySheetDialog::OnIdle(wxIdleEvent& event) { event.Skip(); - + if ((GetSheetStyle() & wxPROPSHEET_SHRINKTOFIT) && GetBookCtrl()) { int sel = GetBookCtrl()->GetSelection(); @@ -228,4 +226,3 @@ void wxPropertySheetDialog::OnIdle(wxIdleEvent& event) } #endif // wxUSE_BOOKCTRL - diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index cb569d3647..eb638d4944 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -10,7 +10,9 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif #include "wx/bitmap.h" #include "wx/palette.h" @@ -18,7 +20,6 @@ #include "wx/filefn.h" #include "wx/image.h" #include "wx/dcmemory.h" -#include "wx/app.h" #include "wx/rawbmp.h" // need this to get gdk_image_new_bitmap() diff --git a/src/gtk/bmpbuttn.cpp b/src/gtk/bmpbuttn.cpp index eab91a19de..656db887dc 100644 --- a/src/gtk/bmpbuttn.cpp +++ b/src/gtk/bmpbuttn.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: gtk/bmpbuttn.cpp +// Name: src/gtk/bmpbuttn.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -10,8 +10,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #if wxUSE_BMPBUTTON #include "wx/bmpbuttn.h" diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index e7d67d6e92..74281019ca 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/button.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: button.cpp +// Name: src/gtk/button.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -10,8 +10,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #if wxUSE_BUTTON #include "wx/button.h" @@ -107,14 +105,14 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, const wxPoint &pos, const wxSize &size, long style, const wxValidator& validator, const wxString &name ) { - m_needParent = TRUE; - m_acceptsFocus = TRUE; + m_needParent = true; + m_acceptsFocus = true; if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { wxFAIL_MSG( wxT("wxButton creation failed") ); - return FALSE; + return false; } m_widget = gtk_button_new_with_mnemonic(""); @@ -247,11 +245,11 @@ void wxButton::SetLabel( const wxString &lbl ) bool wxButton::Enable( bool enable ) { if ( !wxControl::Enable( enable ) ) - return FALSE; + return false; gtk_widget_set_sensitive(GTK_BIN(m_widget)->child, enable); - return TRUE; + return true; } bool wxButton::IsOwnGtkWindow( GdkWindow *window ) @@ -305,4 +303,3 @@ wxButton::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) } #endif // wxUSE_BUTTON - diff --git a/src/gtk/checkbox.cpp b/src/gtk/checkbox.cpp index 4dd5333334..4b7adcc208 100644 --- a/src/gtk/checkbox.cpp +++ b/src/gtk/checkbox.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: checkbox.cpp +// Name: src/gtk/checkbox.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -10,8 +10,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #if wxUSE_CHECKBOX #include "wx/checkbox.h" @@ -113,15 +111,15 @@ bool wxCheckBox::Create(wxWindow *parent, const wxValidator& validator, const wxString &name ) { - m_needParent = TRUE; - m_acceptsFocus = TRUE; - m_blockEvent = FALSE; + m_needParent = true; + m_acceptsFocus = true; + m_blockEvent = false; if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { wxFAIL_MSG( wxT("wxCheckBox creation failed") ); - return FALSE; + return false; } wxASSERT_MSG( (style & wxCHK_ALLOW_3RD_STATE_FOR_USER) == 0 || @@ -161,7 +159,7 @@ bool wxCheckBox::Create(wxWindow *parent, PostCreation(size); - return TRUE; + return true; } void wxCheckBox::SetValue( bool state ) @@ -171,16 +169,16 @@ void wxCheckBox::SetValue( bool state ) if (state == GetValue()) return; - m_blockEvent = TRUE; + m_blockEvent = true; gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(m_widgetCheckbox), state ); - m_blockEvent = FALSE; + m_blockEvent = false; } bool wxCheckBox::GetValue() const { - wxCHECK_MSG( m_widgetCheckbox != NULL, FALSE, wxT("invalid checkbox") ); + wxCHECK_MSG( m_widgetCheckbox != NULL, false, wxT("invalid checkbox") ); return gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_widgetCheckbox)); } @@ -214,11 +212,11 @@ void wxCheckBox::SetLabel( const wxString& label ) bool wxCheckBox::Enable( bool enable ) { if ( !wxControl::Enable( enable ) ) - return FALSE; + return false; gtk_widget_set_sensitive( m_widgetLabel, enable ); - return TRUE; + return true; } void wxCheckBox::DoApplyWidgetStyle(GtkRcStyle *style) diff --git a/src/gtk/data.cpp b/src/gtk/data.cpp index f0626d1448..a160e3ff37 100644 --- a/src/gtk/data.cpp +++ b/src/gtk/data.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: gtk/data.cpp +// Name: src/gtk/data.cpp // Purpose: Various global GTK-specific data // Author: Robert Roebling // Id: $Id$ @@ -10,7 +10,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" #include "wx/object.h" #include "wx/window.h" #include "wx/dc.h" @@ -21,15 +20,15 @@ wxCursor g_globalCursor; /* Don't allow event propagation during drag */ -bool g_blockEventsOnDrag = FALSE; +bool g_blockEventsOnDrag = false; /* Don't allow mouse event propagation during scroll */ -bool g_blockEventsOnScroll = FALSE; +bool g_blockEventsOnScroll = false; /* Don't allow window closing if there are open dialogs */ int g_openDialogs = 0; -/* TRUE when the message queue is empty. this gets set to - FALSE by all event callbacks before anything else is done */ -bool g_isIdle = FALSE; +/* true when the message queue is empty. this gets set to + false by all event callbacks before anything else is done */ +bool g_isIdle = false; diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index 55767284db..8b02377e0e 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dataview.cpp +// Name: src/gtk/dataview.cpp // Purpose: wxDataViewCtrl GTK+2 implementation // Author: Robert Roebling // Id: $Id$ @@ -10,8 +10,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #if wxUSE_DATAVIEWCTRL #include "wx/dataview.h" @@ -76,7 +74,6 @@ struct _GtkWxListStore struct _GtkWxListStoreClass { GObjectClass list_parent_class; - }; static GtkWxListStore *wxgtk_list_store_new (void); @@ -87,68 +84,68 @@ static void wxgtk_list_store_finalize (GObject *object) static GtkTreeModelFlags wxgtk_list_store_get_flags (GtkTreeModel *tree_model); static gint wxgtk_list_store_get_n_columns (GtkTreeModel *tree_model); static GType wxgtk_list_store_get_column_type (GtkTreeModel *tree_model, - gint index); + gint index); static gboolean wxgtk_list_store_get_iter (GtkTreeModel *tree_model, - GtkTreeIter *iter, - GtkTreePath *path); + GtkTreeIter *iter, + GtkTreePath *path); static GtkTreePath *wxgtk_list_store_get_path (GtkTreeModel *tree_model, - GtkTreeIter *iter); + GtkTreeIter *iter); static void wxgtk_list_store_get_value (GtkTreeModel *tree_model, - GtkTreeIter *iter, - gint column, - GValue *value); + GtkTreeIter *iter, + gint column, + GValue *value); static gboolean wxgtk_list_store_iter_next (GtkTreeModel *tree_model, - GtkTreeIter *iter); + GtkTreeIter *iter); static gboolean wxgtk_list_store_iter_children (GtkTreeModel *tree_model, - GtkTreeIter *iter, - GtkTreeIter *parent); + GtkTreeIter *iter, + GtkTreeIter *parent); static gboolean wxgtk_list_store_iter_has_child (GtkTreeModel *tree_model, - GtkTreeIter *iter); + GtkTreeIter *iter); static gint wxgtk_list_store_iter_n_children (GtkTreeModel *tree_model, - GtkTreeIter *iter); + GtkTreeIter *iter); static gboolean wxgtk_list_store_iter_nth_child (GtkTreeModel *tree_model, - GtkTreeIter *iter, - GtkTreeIter *parent, - gint n); + GtkTreeIter *iter, + GtkTreeIter *parent, + gint n); static gboolean wxgtk_list_store_iter_parent (GtkTreeModel *tree_model, - GtkTreeIter *iter, - GtkTreeIter *child); + GtkTreeIter *iter, + GtkTreeIter *child); static GObjectClass *list_parent_class = NULL; GType gtk_wx_list_store_get_type (void) { - static GType list_store_type = 0; + static GType list_store_type = 0; - if (!list_store_type) + if (!list_store_type) { - static const GTypeInfo list_store_info = - { - sizeof (GtkWxListStoreClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) wxgtk_list_store_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GtkWxListStore), - 0, - (GInstanceInitFunc) wxgtk_list_store_init, - }; + static const GTypeInfo list_store_info = + { + sizeof (GtkWxListStoreClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) wxgtk_list_store_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkWxListStore), + 0, + (GInstanceInitFunc) wxgtk_list_store_init, + }; static const GInterfaceInfo tree_model_info = { - (GInterfaceInitFunc) wxgtk_list_store_tree_model_init, - NULL, - NULL + (GInterfaceInitFunc) wxgtk_list_store_tree_model_init, + NULL, + NULL }; list_store_type = g_type_register_static (G_TYPE_OBJECT, "GtkWxListStore", - &list_store_info, (GTypeFlags)0 ); + &list_store_info, (GTypeFlags)0 ); g_type_add_interface_static (list_store_type, - GTK_TYPE_TREE_MODEL, - &tree_model_info); + GTK_TYPE_TREE_MODEL, + &tree_model_info); } return list_store_type; @@ -204,7 +201,7 @@ wxgtk_list_store_finalize (GObject *object) /* must chain up */ (* list_parent_class->finalize) (object); } - + } // extern "C" //----------------------------------------------------------------------------- @@ -238,15 +235,15 @@ wxgtk_list_store_get_n_columns (GtkTreeModel *tree_model) static GType wxgtk_list_store_get_column_type (GtkTreeModel *tree_model, - gint index) + gint index) { GtkWxListStore *list_store = (GtkWxListStore *) tree_model; g_return_val_if_fail (GTK_IS_WX_LIST_STORE (tree_model), G_TYPE_INVALID); GType gtype = G_TYPE_INVALID; - + wxString wxtype = list_store->model->GetColType( (size_t) index ); - + if (wxtype == wxT("string")) gtype = G_TYPE_STRING; @@ -255,8 +252,8 @@ wxgtk_list_store_get_column_type (GtkTreeModel *tree_model, static gboolean wxgtk_list_store_get_iter (GtkTreeModel *tree_model, - GtkTreeIter *iter, - GtkTreePath *path) + GtkTreeIter *iter, + GtkTreePath *path) { GtkWxListStore *list_store = (GtkWxListStore *) tree_model; g_return_val_if_fail (GTK_IS_WX_LIST_STORE (tree_model), FALSE); @@ -276,11 +273,11 @@ wxgtk_list_store_get_iter (GtkTreeModel *tree_model, static GtkTreePath * wxgtk_list_store_get_path (GtkTreeModel *tree_model, - GtkTreeIter *iter) + GtkTreeIter *iter) { g_return_val_if_fail (GTK_IS_WX_LIST_STORE (tree_model), NULL); g_return_val_if_fail (iter->stamp == GTK_WX_LIST_STORE (tree_model)->stamp, NULL); - + GtkTreePath *retval = gtk_tree_path_new (); // user_data is just the index int i = (wxUIntPtr) iter->user_data; @@ -290,9 +287,9 @@ wxgtk_list_store_get_path (GtkTreeModel *tree_model, static void wxgtk_list_store_get_value (GtkTreeModel *tree_model, - GtkTreeIter *iter, - gint column, - GValue *value) + GtkTreeIter *iter, + gint column, + GValue *value) { GtkWxListStore *list_store = (GtkWxListStore *) tree_model; g_return_if_fail (GTK_IS_WX_LIST_STORE (tree_model) ); @@ -309,7 +306,7 @@ wxgtk_list_store_get_value (GtkTreeModel *tree_model, else { } - + #if 0 GtkTreeDataList *list; gint tmp_column = column; @@ -326,29 +323,29 @@ wxgtk_list_store_get_value (GtkTreeModel *tree_model, g_value_init (value, GTK_LIST_STORE (tree_model)->column_headers[column]); else _gtk_tree_data_list_node_to_value (list, - GTK_LIST_STORE (tree_model)->column_headers[column], - value); + GTK_LIST_STORE (tree_model)->column_headers[column], + value); #endif } static gboolean wxgtk_list_store_iter_next (GtkTreeModel *tree_model, - GtkTreeIter *iter) + GtkTreeIter *iter) { g_return_val_if_fail (GTK_IS_WX_LIST_STORE (tree_model), FALSE); GtkWxListStore *list_store = (GtkWxListStore *) tree_model; - + g_return_val_if_fail (list_store->stamp == iter->stamp, FALSE); int n = (wxUIntPtr) iter->user_data; - + if (n == -1) return FALSE; - + if (n >= (int) list_store->model->GetNumberOfRows()-1) return FALSE; - + iter->user_data = (gpointer) ++n; return TRUE; @@ -356,72 +353,72 @@ wxgtk_list_store_iter_next (GtkTreeModel *tree_model, static gboolean wxgtk_list_store_iter_children (GtkTreeModel *tree_model, - GtkTreeIter *iter, - GtkTreeIter *parent) + GtkTreeIter *iter, + GtkTreeIter *parent) { g_return_val_if_fail (GTK_IS_WX_LIST_STORE (tree_model), FALSE); GtkWxListStore *list_store = (GtkWxListStore *) tree_model; - + // this is a list, nodes have no children if (parent) return FALSE; iter->stamp = list_store->stamp; iter->user_data = (gpointer) -1; - + return TRUE; } static gboolean wxgtk_list_store_iter_has_child (GtkTreeModel *tree_model, - GtkTreeIter *iter) + GtkTreeIter *iter) { return FALSE; } static gint wxgtk_list_store_iter_n_children (GtkTreeModel *tree_model, - GtkTreeIter *iter) + GtkTreeIter *iter) { g_return_val_if_fail (GTK_IS_WX_LIST_STORE (tree_model), -1); GtkWxListStore *list_store = (GtkWxListStore *) tree_model; - + if (iter == NULL) return (gint) list_store->model->GetNumberOfRows(); g_return_val_if_fail (list_store->stamp == iter->stamp, -1); - + return 0; } static gboolean wxgtk_list_store_iter_nth_child (GtkTreeModel *tree_model, - GtkTreeIter *iter, - GtkTreeIter *parent, - gint n) + GtkTreeIter *iter, + GtkTreeIter *parent, + gint n) { g_return_val_if_fail (GTK_IS_WX_LIST_STORE (tree_model), FALSE); GtkWxListStore *list_store = (GtkWxListStore *) tree_model; - + if (parent) return FALSE; if (n < 0) return FALSE; - + if (n >= (gint) list_store->model->GetNumberOfRows()) return FALSE; iter->stamp = list_store->stamp; iter->user_data = (gpointer) n; - + return TRUE; } static gboolean wxgtk_list_store_iter_parent (GtkTreeModel *tree_model, - GtkTreeIter *iter, - GtkTreeIter *child) + GtkTreeIter *iter, + GtkTreeIter *child) { return FALSE; } @@ -468,20 +465,20 @@ static void gtk_wx_cell_renderer_finalize ( GObject *object ); static void gtk_wx_cell_renderer_get_size ( GtkCellRenderer *cell, - GtkWidget *widget, - GdkRectangle *rectangle, - gint *x_offset, - gint *y_offset, - gint *width, - gint *height ); + GtkWidget *widget, + GdkRectangle *rectangle, + gint *x_offset, + gint *y_offset, + gint *width, + gint *height ); static void gtk_wx_cell_renderer_render ( GtkCellRenderer *cell, - GdkWindow *window, - GtkWidget *widget, - GdkRectangle *background_area, - GdkRectangle *cell_area, - GdkRectangle *expose_area, - GtkCellRendererState flags ); + GdkWindow *window, + GtkWidget *widget, + GdkRectangle *background_area, + GdkRectangle *cell_area, + GdkRectangle *expose_area, + GtkCellRendererState flags ); static gboolean gtk_wx_cell_renderer_activate( GtkCellRenderer *cell, GdkEvent *event, @@ -495,7 +492,7 @@ static GObjectClass *cell_parent_class = NULL; } // extern "C" -GType +GType gtk_wx_cell_renderer_get_type (void) { static GType cell_wx_type = 0; @@ -505,17 +502,17 @@ gtk_wx_cell_renderer_get_type (void) static const GTypeInfo cell_wx_info = { sizeof (GtkWxCellRendererClass), - NULL, /* base_init */ - NULL, /* base_finalize */ + NULL, /* base_init */ + NULL, /* base_finalize */ (GClassInitFunc) gtk_wx_cell_renderer_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ + NULL, /* class_finalize */ + NULL, /* class_data */ sizeof (GtkWxCellRenderer), 0, /* n_preallocs */ (GInstanceInitFunc) gtk_wx_cell_renderer_init, }; - cell_wx_type = g_type_register_static( GTK_TYPE_CELL_RENDERER, + cell_wx_type = g_type_register_static( GTK_TYPE_CELL_RENDERER, "GtkWxCellRenderer", &cell_wx_info, (GTypeFlags)0 ); } @@ -559,34 +556,34 @@ gtk_wx_cell_renderer_new (void) static void gtk_wx_cell_renderer_get_size (GtkCellRenderer *renderer, - GtkWidget *widget, - GdkRectangle *cell_area, - gint *x_offset, - gint *y_offset, - gint *width, - gint *height) + GtkWidget *widget, + GdkRectangle *cell_area, + gint *x_offset, + gint *y_offset, + gint *width, + gint *height) { GtkWxCellRenderer *wxrenderer = (GtkWxCellRenderer *) renderer; wxDataViewCustomCell *cell = wxrenderer->cell; - + wxSize size = cell->GetSize(); gint calc_width = (gint) renderer->xpad * 2 + size.x; gint calc_height = (gint) renderer->ypad * 2 + size.y; - - if (x_offset) + + if (x_offset) *x_offset = 0; - if (y_offset) + if (y_offset) *y_offset = 0; if (cell_area && size.x > 0 && size.y > 0) { if (x_offset) - { + { *x_offset = (gint)((renderer->xalign * (cell_area->width - calc_width - 2 * renderer->xpad))); *x_offset = MAX (*x_offset, 0) + renderer->xpad; - } + } if (y_offset) { *y_offset = (gint)((renderer->yalign * @@ -597,36 +594,36 @@ gtk_wx_cell_renderer_get_size (GtkCellRenderer *renderer, if (width) *width = calc_width; - + if (height) *height = calc_height; } static void gtk_wx_cell_renderer_render (GtkCellRenderer *renderer, - GdkWindow *window, - GtkWidget *widget, - GdkRectangle *background_area, - GdkRectangle *cell_area, - GdkRectangle *expose_area, - GtkCellRendererState flags) + GdkWindow *window, + GtkWidget *widget, + GdkRectangle *background_area, + GdkRectangle *cell_area, + GdkRectangle *expose_area, + GtkCellRendererState flags) { GtkWxCellRenderer *wxrenderer = (GtkWxCellRenderer *) renderer; wxDataViewCustomCell *cell = wxrenderer->cell; - + GdkRectangle rect; gtk_wx_cell_renderer_get_size (renderer, widget, cell_area, - &rect.x, - &rect.y, - &rect.width, - &rect.height); + &rect.x, + &rect.y, + &rect.width, + &rect.height); rect.x += cell_area->x; rect.y += cell_area->y; rect.width -= renderer->xpad * 2; rect.height -= renderer->ypad * 2; - + GdkRectangle dummy; if (gdk_rectangle_intersect (expose_area, &rect, &dummy)) { @@ -637,7 +634,7 @@ gtk_wx_cell_renderer_render (GtkCellRenderer *renderer, dc->m_window = window; dc->SetUpDC(); } - + int state = 0; if (flags & GTK_CELL_RENDERER_SELECTED) state |= wxDATAVIEW_CELL_SELECTED; @@ -650,10 +647,10 @@ gtk_wx_cell_renderer_render (GtkCellRenderer *renderer, if (flags & GTK_CELL_RENDERER_FOCUSED) state |= wxDATAVIEW_CELL_FOCUSED; cell->Render( renderrect, dc, state ); - } + } } -static gboolean +static gboolean gtk_wx_cell_renderer_activate( GtkCellRenderer *renderer, GdkEvent *event, @@ -665,35 +662,35 @@ gtk_wx_cell_renderer_activate( { GtkWxCellRenderer *wxrenderer = (GtkWxCellRenderer *) renderer; wxDataViewCustomCell *cell = wxrenderer->cell; - + GdkRectangle rect; gtk_wx_cell_renderer_get_size (renderer, widget, cell_area, - &rect.x, - &rect.y, - &rect.width, - &rect.height); + &rect.x, + &rect.y, + &rect.width, + &rect.height); rect.x += cell_area->x; rect.y += cell_area->y; rect.width -= renderer->xpad * 2; rect.height -= renderer->ypad * 2; - + wxRect renderrect( rect.x, rect.y, rect.width, rect.height ); - + wxDataViewListModel *model = cell->GetOwner()->GetOwner()->GetModel(); - + GtkTreePath *treepath = gtk_tree_path_new_from_string( path ); size_t model_row = (size_t)gtk_tree_path_get_indices (treepath)[0]; gtk_tree_path_free( treepath ); - + size_t model_col = cell->GetOwner()->GetModelColumn(); - + if (event->type == GDK_BUTTON_PRESS) { GdkEventButton *button_event = (GdkEventButton*) event; - wxPoint pt( ((int) button_event->x) - renderrect.x, + wxPoint pt( ((int) button_event->x) - renderrect.x, ((int) button_event->y) - renderrect.y ); - + bool ret = false; if (button_event->button == 1) { @@ -709,24 +706,24 @@ gtk_wx_cell_renderer_activate( if (cell->RightClick( pt, renderrect, model, model_col, model_row )) ret = true; } - + wxrenderer->last_click = button_event->time; - + return ret; } - + return false; } -// --------------------------------------------------------- +// --------------------------------------------------------- // wxGtkDataViewListModelNotifier -// --------------------------------------------------------- +// --------------------------------------------------------- class wxGtkDataViewListModelNotifier: public wxDataViewListModelNotifier { public: wxGtkDataViewListModelNotifier( GtkWxListStore* gtk_store, wxDataViewListModel *wx_model ); - + virtual bool RowAppended(); virtual bool RowPrepended(); virtual bool RowInserted( size_t before ); @@ -735,35 +732,35 @@ public: virtual bool ValueChanged( size_t col, size_t row ); virtual bool RowsReordered( size_t *new_order ); virtual bool Cleared(); - + GtkWxListStore *m_gtk_store; wxDataViewListModel *m_wx_model; }; -// --------------------------------------------------------- +// --------------------------------------------------------- // wxGtkDataViewListModelNotifier -// --------------------------------------------------------- +// --------------------------------------------------------- -wxGtkDataViewListModelNotifier::wxGtkDataViewListModelNotifier( +wxGtkDataViewListModelNotifier::wxGtkDataViewListModelNotifier( GtkWxListStore* gtk_store, wxDataViewListModel *wx_model ) { m_gtk_store = gtk_store; m_wx_model = wx_model; } - + bool wxGtkDataViewListModelNotifier::RowAppended() { size_t pos = m_wx_model->GetNumberOfRows()-1; - + GtkTreeIter iter; iter.stamp = m_gtk_store->stamp; iter.user_data = (gpointer) pos; - + GtkTreePath *path = gtk_tree_path_new (); gtk_tree_path_append_index (path, (gint) pos); gtk_tree_model_row_inserted (GTK_TREE_MODEL (m_gtk_store), path, &iter); gtk_tree_path_free (path); - + return true; } @@ -772,12 +769,12 @@ bool wxGtkDataViewListModelNotifier::RowPrepended() GtkTreeIter iter; iter.stamp = m_gtk_store->stamp; iter.user_data = (gpointer) 0; - + GtkTreePath *path = gtk_tree_path_new (); gtk_tree_path_append_index (path, (gint) 0); gtk_tree_model_row_inserted (GTK_TREE_MODEL (m_gtk_store), path, &iter); gtk_tree_path_free (path); - + return true; } @@ -820,17 +817,17 @@ bool wxGtkDataViewListModelNotifier::ValueChanged( size_t model_col, size_t mode gtk_tree_path_append_index( path, model_row ); GdkRectangle cell_area; gtk_tree_view_get_cell_area( widget, path, column, &cell_area ); - gtk_tree_path_free( path ); + gtk_tree_path_free( path ); int ydiff = column->button->allocation.height; // Redraw - gtk_widget_queue_draw_area( GTK_WIDGET(widget), + gtk_widget_queue_draw_area( GTK_WIDGET(widget), cell_area.x, ydiff + cell_area.y, cell_area.width, cell_area.height ); } node = node->GetNext(); } - + return true; } @@ -849,11 +846,11 @@ bool wxGtkDataViewListModelNotifier::RowsReordered( size_t *new_order ) wxDataViewViewingColumn* viewing_column = (wxDataViewViewingColumn*) node->GetData(); GtkTreeView *widget = GTK_TREE_VIEW(viewing_column->m_viewColumn->GetOwner()->m_treeview); // Doesn't work yet... - gtk_widget_queue_draw( GTK_WIDGET(widget) ); + gtk_widget_queue_draw( GTK_WIDGET(widget) ); node = node->GetNext(); } - + return true; } @@ -862,9 +859,9 @@ bool wxGtkDataViewListModelNotifier::Cleared() return false; } -// --------------------------------------------------------- +// --------------------------------------------------------- // wxDataViewCell -// --------------------------------------------------------- +// --------------------------------------------------------- IMPLEMENT_ABSTRACT_CLASS(wxDataViewCell, wxDataViewCellBase) @@ -874,33 +871,33 @@ wxDataViewCell::wxDataViewCell( const wxString &varianttype, wxDataViewCellMode m_renderer = NULL; } -// --------------------------------------------------------- +// --------------------------------------------------------- // wxDataViewTextCell -// --------------------------------------------------------- +// --------------------------------------------------------- extern "C" { -static void wxGtkTextRendererEditedCallback( GtkCellRendererText *renderer, +static void wxGtkTextRendererEditedCallback( GtkCellRendererText *renderer, gchar *arg1, gchar *arg2, gpointer user_data ); } -static void wxGtkTextRendererEditedCallback( GtkCellRendererText *renderer, +static void wxGtkTextRendererEditedCallback( GtkCellRendererText *renderer, gchar *arg1, gchar *arg2, gpointer user_data ) { wxDataViewTextCell *cell = (wxDataViewTextCell*) user_data; - + wxString tmp = wxGTK_CONV_BACK( arg2 ); wxVariant value = tmp; if (!cell->Validate( value )) return; - + wxDataViewListModel *model = cell->GetOwner()->GetOwner()->GetModel(); - + GtkTreePath *path = gtk_tree_path_new_from_string( arg1 ); size_t model_row = (size_t)gtk_tree_path_get_indices (path)[0]; gtk_tree_path_free( path ); - + size_t model_col = cell->GetOwner()->GetModelColumn(); - + model->SetValue( value, model_col, model_row ); model->ValueChanged( model_col, model_row ); } @@ -911,7 +908,7 @@ wxDataViewTextCell::wxDataViewTextCell( const wxString &varianttype, wxDataViewC wxDataViewCell( varianttype, mode ) { m_renderer = (void*) gtk_cell_renderer_text_new(); - + if (m_mode & wxDATAVIEW_CELL_EDITABLE) { GValue gvalue = { 0, }; @@ -919,7 +916,7 @@ wxDataViewTextCell::wxDataViewTextCell( const wxString &varianttype, wxDataViewC g_value_set_boolean( &gvalue, true ); g_object_set_property( G_OBJECT(m_renderer), "editable", &gvalue ); g_value_unset( &gvalue ); - + g_signal_connect_after( m_renderer, "edited", G_CALLBACK(wxGtkTextRendererEditedCallback), this ); } } @@ -927,13 +924,13 @@ wxDataViewTextCell::wxDataViewTextCell( const wxString &varianttype, wxDataViewC bool wxDataViewTextCell::SetValue( const wxVariant &value ) { wxString tmp = value; - + GValue gvalue = { 0, }; g_value_init( &gvalue, G_TYPE_STRING ); g_value_set_string( &gvalue, wxGTK_CONV( tmp ) ); g_object_set_property( G_OBJECT(m_renderer), "text", &gvalue ); g_value_unset( &gvalue ); - + return true; } @@ -942,61 +939,61 @@ bool wxDataViewTextCell::GetValue( wxVariant &value ) GValue gvalue = { 0, }; g_value_init( &gvalue, G_TYPE_STRING ); g_object_get_property( G_OBJECT(m_renderer), "text", &gvalue ); - wxString tmp = wxGTK_CONV_BACK( g_value_get_string( &gvalue ) ); + wxString tmp = wxGTK_CONV_BACK( g_value_get_string( &gvalue ) ); g_value_unset( &gvalue ); - + value = tmp; return true; } -// --------------------------------------------------------- +// --------------------------------------------------------- // wxDataViewToggleCell -// --------------------------------------------------------- +// --------------------------------------------------------- extern "C" { -static void wxGtkToggleRendererToggledCallback( GtkCellRendererToggle *renderer, +static void wxGtkToggleRendererToggledCallback( GtkCellRendererToggle *renderer, gchar *path, gpointer user_data ); } -static void wxGtkToggleRendererToggledCallback( GtkCellRendererToggle *renderer, +static void wxGtkToggleRendererToggledCallback( GtkCellRendererToggle *renderer, gchar *path, gpointer user_data ) { wxDataViewToggleCell *cell = (wxDataViewToggleCell*) user_data; - // get old value + // get old value GValue gvalue = { 0, }; g_value_init( &gvalue, G_TYPE_BOOLEAN ); g_object_get_property( G_OBJECT(renderer), "active", &gvalue ); - bool tmp = g_value_get_boolean( &gvalue ); + bool tmp = g_value_get_boolean( &gvalue ); g_value_unset( &gvalue ); // invert it tmp = !tmp; - + wxVariant value = tmp; if (!cell->Validate( value )) return; - + wxDataViewListModel *model = cell->GetOwner()->GetOwner()->GetModel(); - + GtkTreePath *gtk_path = gtk_tree_path_new_from_string( path ); size_t model_row = (size_t)gtk_tree_path_get_indices (gtk_path)[0]; gtk_tree_path_free( gtk_path ); - + size_t model_col = cell->GetOwner()->GetModelColumn(); - + model->SetValue( value, model_col, model_row ); model->ValueChanged( model_col, model_row ); } IMPLEMENT_ABSTRACT_CLASS(wxDataViewToggleCell, wxDataViewCell) -wxDataViewToggleCell::wxDataViewToggleCell( const wxString &varianttype, +wxDataViewToggleCell::wxDataViewToggleCell( const wxString &varianttype, wxDataViewCellMode mode ) : wxDataViewCell( varianttype, mode ) { m_renderer = (void*) gtk_cell_renderer_toggle_new(); - + if (m_mode & wxDATAVIEW_CELL_ACTIVATABLE) { g_signal_connect_after( m_renderer, "toggled", G_CALLBACK(wxGtkToggleRendererToggledCallback), this ); @@ -1022,13 +1019,13 @@ wxDataViewToggleCell::wxDataViewToggleCell( const wxString &varianttype, bool wxDataViewToggleCell::SetValue( const wxVariant &value ) { bool tmp = value; - + GValue gvalue = { 0, }; g_value_init( &gvalue, G_TYPE_BOOLEAN ); g_value_set_boolean( &gvalue, tmp ); g_object_set_property( G_OBJECT(m_renderer), "active", &gvalue ); g_value_unset( &gvalue ); - + return true; } @@ -1037,17 +1034,17 @@ bool wxDataViewToggleCell::GetValue( wxVariant &value ) GValue gvalue = { 0, }; g_value_init( &gvalue, G_TYPE_BOOLEAN ); g_object_get_property( G_OBJECT(m_renderer), "active", &gvalue ); - bool tmp = g_value_get_boolean( &gvalue ); + bool tmp = g_value_get_boolean( &gvalue ); g_value_unset( &gvalue ); - + value = tmp; return true; } - -// --------------------------------------------------------- + +// --------------------------------------------------------- // wxDataViewCustomCell -// --------------------------------------------------------- +// --------------------------------------------------------- class wxDataViewCtrlDC: public wxWindowDC { @@ -1070,18 +1067,18 @@ public: } }; -// --------------------------------------------------------- +// --------------------------------------------------------- // wxDataViewCustomCell -// --------------------------------------------------------- +// --------------------------------------------------------- IMPLEMENT_ABSTRACT_CLASS(wxDataViewCustomCell, wxDataViewCell) -wxDataViewCustomCell::wxDataViewCustomCell( const wxString &varianttype, +wxDataViewCustomCell::wxDataViewCustomCell( const wxString &varianttype, wxDataViewCellMode mode, bool no_init ) : wxDataViewCell( varianttype, mode ) { m_dc = NULL; - + if (no_init) m_renderer = NULL; else @@ -1092,9 +1089,9 @@ bool wxDataViewCustomCell::Init() { GtkWxCellRenderer *renderer = (GtkWxCellRenderer *) gtk_wx_cell_renderer_new(); renderer->cell = this; - + m_renderer = (void*) renderer; - + if (m_mode & wxDATAVIEW_CELL_ACTIVATABLE) { GValue gvalue = { 0, }; @@ -1103,7 +1100,7 @@ bool wxDataViewCustomCell::Init() g_object_set_property( G_OBJECT(m_renderer), "mode", &gvalue ); g_value_unset( &gvalue ); } - + return true; } @@ -1123,28 +1120,28 @@ wxDC *wxDataViewCustomCell::GetDC() return NULL; m_dc = new wxDataViewCtrlDC( GetOwner()->GetOwner() ); } - + return m_dc; } - -// --------------------------------------------------------- + +// --------------------------------------------------------- // wxDataViewProgressCell -// --------------------------------------------------------- +// --------------------------------------------------------- IMPLEMENT_ABSTRACT_CLASS(wxDataViewProgressCell, wxDataViewCustomCell) -wxDataViewProgressCell::wxDataViewProgressCell( const wxString &label, +wxDataViewProgressCell::wxDataViewProgressCell( const wxString &label, const wxString &varianttype, wxDataViewCellMode mode ) : - wxDataViewCustomCell( varianttype, mode, true ) + wxDataViewCustomCell( varianttype, mode, true ) { m_label = label; m_value = 0; - + #ifdef __WXGTK26__ if (!gtk_check_version(2,6,0)) { m_renderer = (void*) gtk_cell_renderer_progress_new(); - + GValue gvalue = { 0, }; g_value_init( &gvalue, G_TYPE_STRING ); g_value_set_boolean( &gvalue, wxGTK_CONV(m_label) ); @@ -1179,14 +1176,14 @@ bool wxDataViewProgressCell::SetValue( const wxVariant &value ) #endif { m_value = (long) value; - + if (m_value < 0) m_value = 0; if (m_value > 100) m_value = 100; } - + return true; } - + bool wxDataViewProgressCell::Render( wxRect cell, wxDC *dc, int state ) { double pct = (double)m_value / 100.0; @@ -1199,7 +1196,7 @@ bool wxDataViewProgressCell::Render( wxRect cell, wxDC *dc, int state ) dc->SetBrush( *wxTRANSPARENT_BRUSH ); dc->SetPen( *wxBLACK_PEN ); dc->DrawRectangle( cell ); - + return true; } @@ -1207,14 +1204,14 @@ wxSize wxDataViewProgressCell::GetSize() { return wxSize(40,12); } - -// --------------------------------------------------------- + +// --------------------------------------------------------- // wxDataViewDateCell -// --------------------------------------------------------- +// --------------------------------------------------------- class wxDataViewDateCellPopupTransient: public wxPopupTransientWindow { -public: +public: wxDataViewDateCellPopupTransient( wxWindow* parent, wxDateTime *value, wxDataViewListModel *model, size_t col, size_t row ) : wxPopupTransientWindow( parent, wxBORDER_SIMPLE ) @@ -1228,18 +1225,18 @@ public: SetSizer( sizer ); sizer->Fit( this ); } - + virtual void OnDismiss() { } - + void OnCalendar( wxCalendarEvent &event ); - + wxCalendarCtrl *m_cal; - wxDataViewListModel *m_model; + wxDataViewListModel *m_model; size_t m_col; size_t m_row; - + private: DECLARE_EVENT_TABLE() }; @@ -1264,11 +1261,11 @@ wxDataViewDateCell::wxDataViewDateCell( const wxString &varianttype, wxDataViewCustomCell( varianttype, mode ) { } - + bool wxDataViewDateCell::SetValue( const wxVariant &value ) { m_date = value.GetDateTime(); - + return true; } @@ -1296,7 +1293,7 @@ bool wxDataViewDateCell::Activate( wxRect cell, wxDataViewListModel *model, size model->GetValue( variant, col, row ); wxDateTime value = variant.GetDateTime(); - wxDataViewDateCellPopupTransient *popup = new wxDataViewDateCellPopupTransient( + wxDataViewDateCellPopupTransient *popup = new wxDataViewDateCellPopupTransient( GetOwner()->GetOwner()->GetParent(), &value, model, col, row ); wxPoint pos = wxGetMousePosition(); popup->Move( pos ); @@ -1306,9 +1303,9 @@ bool wxDataViewDateCell::Activate( wxRect cell, wxDataViewListModel *model, size return true; } -// --------------------------------------------------------- +// --------------------------------------------------------- // wxDataViewColumn -// --------------------------------------------------------- +// --------------------------------------------------------- extern "C" { static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *column, @@ -1327,37 +1324,37 @@ static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *column, { g_return_if_fail (GTK_IS_WX_LIST_STORE (model)); GtkWxListStore *list_store = (GtkWxListStore *) model; - + wxDataViewCell *cell = (wxDataViewCell*) data; size_t model_row = (size_t) iter->user_data; - + wxVariant value; list_store->model->GetValue( value, cell->GetOwner()->GetModelColumn(), model_row ); if (value.GetType() != cell->GetVariantType()) wxLogError( wxT("Wrong type\n") ); - + cell->SetValue( value ); } IMPLEMENT_ABSTRACT_CLASS(wxDataViewColumn, wxDataViewColumnBase) -wxDataViewColumn::wxDataViewColumn( const wxString &title, wxDataViewCell *cell, +wxDataViewColumn::wxDataViewColumn( const wxString &title, wxDataViewCell *cell, size_t model_column, int flags ) : wxDataViewColumnBase( title, cell, model_column, flags ) { GtkCellRenderer *renderer = (GtkCellRenderer *) cell->GetGtkHandle(); - + GtkTreeViewColumn *column = gtk_tree_view_column_new(); - + gtk_tree_view_column_set_title( column, wxGTK_CONV(title) ); - + gtk_tree_view_column_pack_start( column, renderer, TRUE ); - - gtk_tree_view_column_set_cell_data_func( column, renderer, + + gtk_tree_view_column_set_cell_data_func( column, renderer, wxGtkTreeCellDataFunc, (gpointer) cell, NULL ); - + m_column = (void*) column; } @@ -1368,7 +1365,7 @@ wxDataViewColumn::~wxDataViewColumn() void wxDataViewColumn::SetTitle( const wxString &title ) { wxDataViewColumnBase::SetTitle( title ); - + GtkTreeViewColumn *column = (GtkTreeViewColumn *)m_column; gtk_tree_view_column_set_title( column, wxGTK_CONV(title) ); } @@ -1391,19 +1388,19 @@ void wxDataViewCtrl::Init() } bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, const wxSize& size, + const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator ) { Init(); - - m_needParent = TRUE; - m_acceptsFocus = TRUE; + + m_needParent = true; + m_acceptsFocus = true; if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator )) { wxFAIL_MSG( wxT("wxDataViewCtrl creation failed") ); - return FALSE; + return false; } m_widget = gtk_scrolled_window_new (NULL, NULL); @@ -1412,11 +1409,11 @@ bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, m_treeview = gtk_tree_view_new(); gtk_container_add (GTK_CONTAINER (m_widget), m_treeview); - + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (m_widget), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); gtk_widget_show (m_treeview); - + m_parent->DoAddChild( this ); PostCreation(size); @@ -1434,11 +1431,11 @@ bool wxDataViewCtrl::AssociateModel( wxDataViewListModel *model ) m_notifier = new wxGtkDataViewListModelNotifier( gtk_store, model ); - model->AddNotifier( m_notifier ); + model->AddNotifier( m_notifier ); gtk_tree_view_set_model( GTK_TREE_VIEW(m_treeview), GTK_TREE_MODEL(gtk_store) ); g_object_unref( gtk_store ); - + return true; } @@ -1446,7 +1443,7 @@ bool wxDataViewCtrl::AppendColumn( wxDataViewColumn *col ) { if (!wxDataViewCtrlBase::AppendColumn(col)) return false; - + GtkTreeViewColumn *column = (GtkTreeViewColumn *)col->GetGtkHandle(); gtk_tree_view_append_column( GTK_TREE_VIEW(m_treeview), column ); @@ -1454,9 +1451,8 @@ bool wxDataViewCtrl::AppendColumn( wxDataViewColumn *col ) return true; } -#endif +#endif // !wxUSE_GENERICDATAVIEWCTRL -#endif +#endif // wxUSE_DATAVIEWCTRL - diff --git a/src/gtk/fontdlg.cpp b/src/gtk/fontdlg.cpp index 407c6798c6..d51b0fb949 100644 --- a/src/gtk/fontdlg.cpp +++ b/src/gtk/fontdlg.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: gtk/fontdlg.cpp +// Name: src/gtk/fontdlg.cpp // Purpose: wxFontDialog // Author: Robert Roebling // Id: $Id$ @@ -10,8 +10,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #if wxUSE_FONTDLG #ifndef __WXGPE__ @@ -45,7 +43,7 @@ bool gtk_fontdialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUN win->Close(); - return TRUE; + return true; } } @@ -98,14 +96,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog) bool wxFontDialog::DoCreate(wxWindow *parent) { - m_needParent = FALSE; + m_needParent = false; if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) || !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, wxDefaultValidator, wxT("fontdialog") )) { wxFAIL_MSG( wxT("wxFontDialog creation failed") ); - return FALSE; + return false; } wxString m_message( _("Choose font") ); @@ -144,7 +142,7 @@ bool wxFontDialog::DoCreate(wxWindow *parent) } } - return TRUE; + return true; } wxFontDialog::~wxFontDialog() @@ -159,4 +157,3 @@ void wxFontDialog::SetChosenFont(const char *fontname) #endif // wxUSE_FONTDLG #endif // GPE - diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index e35a025f7a..1612603a1e 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: frame.cpp +// Name: src/gtk/frame.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -7,6 +7,9 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + // ============================================================================ // declarations // ============================================================================ @@ -15,11 +18,6 @@ // headers // ---------------------------------------------------------------------------- -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#include "wx/defs.h" - #include "wx/frame.h" #include "wx/dialog.h" #include "wx/control.h" diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 87742cb61a..627bc9e3de 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -7,6 +7,9 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + // ============================================================================ // declarations // ============================================================================ @@ -15,15 +18,10 @@ // headers // ---------------------------------------------------------------------------- -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - #ifdef __VMS #define XIconifyWindow XICONIFYWINDOW #endif -#include "wx/defs.h" - #include "wx/toplevel.h" #include "wx/log.h" #include "wx/dialog.h" diff --git a/src/gtk1/bmpbuttn.cpp b/src/gtk1/bmpbuttn.cpp index 1a0d71c032..1d0c7ce962 100644 --- a/src/gtk1/bmpbuttn.cpp +++ b/src/gtk1/bmpbuttn.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: gtk/bmpbuttn.cpp +// Name: src/gtk1/bmpbuttn.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -10,8 +10,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #if wxUSE_BMPBUTTON #include "wx/bmpbuttn.h" @@ -275,4 +273,3 @@ void wxBitmapButton::EndSelect() } #endif // wxUSE_BMPBUTTON - diff --git a/src/gtk1/button.cpp b/src/gtk1/button.cpp index e12cd26f15..c84debc53d 100644 --- a/src/gtk1/button.cpp +++ b/src/gtk1/button.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: button.cpp +// Name: src/gtk1/button.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -10,8 +10,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #if wxUSE_BUTTON #include "wx/button.h" @@ -107,14 +105,14 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, const wxPoint &pos, const wxSize &size, long style, const wxValidator& validator, const wxString &name ) { - m_needParent = TRUE; - m_acceptsFocus = TRUE; + m_needParent = true; + m_acceptsFocus = true; if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { wxFAIL_MSG( wxT("wxButton creation failed") ); - return FALSE; + return false; } m_widget = gtk_button_new_with_label(""); @@ -193,11 +191,11 @@ void wxButton::SetLabel( const wxString &lbl ) bool wxButton::Enable( bool enable ) { if ( !wxControl::Enable( enable ) ) - return FALSE; + return false; gtk_widget_set_sensitive( BUTTON_CHILD(m_widget), enable ); - return TRUE; + return true; } bool wxButton::IsOwnGtkWindow( GdkWindow *window ) @@ -253,4 +251,3 @@ wxButton::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) } #endif // wxUSE_BUTTON - diff --git a/src/gtk1/checkbox.cpp b/src/gtk1/checkbox.cpp index c9d1c422d3..a85a9b4acf 100644 --- a/src/gtk1/checkbox.cpp +++ b/src/gtk1/checkbox.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: checkbox.cpp +// Name: src/gtk1/checkbox.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -10,8 +10,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #if wxUSE_CHECKBOX #include "wx/checkbox.h" @@ -74,15 +72,15 @@ bool wxCheckBox::Create(wxWindow *parent, const wxValidator& validator, const wxString &name ) { - m_needParent = TRUE; - m_acceptsFocus = TRUE; - m_blockEvent = FALSE; + m_needParent = true; + m_acceptsFocus = true; + m_blockEvent = false; if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { wxFAIL_MSG( wxT("wxCheckBox creation failed") ); - return FALSE; + return false; } wxASSERT_MSG( (style & wxCHK_ALLOW_3RD_STATE_FOR_USER) == 0 || @@ -124,7 +122,7 @@ bool wxCheckBox::Create(wxWindow *parent, PostCreation(size); - return TRUE; + return true; } void wxCheckBox::SetValue( bool state ) @@ -134,16 +132,16 @@ void wxCheckBox::SetValue( bool state ) if (state == GetValue()) return; - m_blockEvent = TRUE; + m_blockEvent = true; gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widgetCheckbox), state ); - m_blockEvent = FALSE; + m_blockEvent = false; } bool wxCheckBox::GetValue() const { - wxCHECK_MSG( m_widgetCheckbox != NULL, FALSE, wxT("invalid checkbox") ); + wxCHECK_MSG( m_widgetCheckbox != NULL, false, wxT("invalid checkbox") ); return GTK_TOGGLE_BUTTON(m_widgetCheckbox)->active; } @@ -158,11 +156,11 @@ void wxCheckBox::SetLabel( const wxString& label ) bool wxCheckBox::Enable( bool enable ) { if ( !wxControl::Enable( enable ) ) - return FALSE; + return false; gtk_widget_set_sensitive( m_widgetLabel, enable ); - return TRUE; + return true; } void wxCheckBox::DoApplyWidgetStyle(GtkRcStyle *style) diff --git a/src/gtk1/data.cpp b/src/gtk1/data.cpp index f0626d1448..c4a0b5dc1e 100644 --- a/src/gtk1/data.cpp +++ b/src/gtk1/data.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: gtk/data.cpp +// Name: src/gtk1/data.cpp // Purpose: Various global GTK-specific data // Author: Robert Roebling // Id: $Id$ @@ -10,7 +10,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" #include "wx/object.h" #include "wx/window.h" #include "wx/dc.h" @@ -21,15 +20,14 @@ wxCursor g_globalCursor; /* Don't allow event propagation during drag */ -bool g_blockEventsOnDrag = FALSE; +bool g_blockEventsOnDrag = false; /* Don't allow mouse event propagation during scroll */ -bool g_blockEventsOnScroll = FALSE; +bool g_blockEventsOnScroll = false; /* Don't allow window closing if there are open dialogs */ int g_openDialogs = 0; -/* TRUE when the message queue is empty. this gets set to - FALSE by all event callbacks before anything else is done */ -bool g_isIdle = FALSE; - +/* true when the message queue is empty. this gets set to + false by all event callbacks before anything else is done */ +bool g_isIdle = false; diff --git a/src/gtk1/fontdlg.cpp b/src/gtk1/fontdlg.cpp index 982850c35e..fb9b739398 100644 --- a/src/gtk1/fontdlg.cpp +++ b/src/gtk1/fontdlg.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: gtk/fontdlg.cpp +// Name: src/gtk1/fontdlg.cpp // Purpose: wxFontDialog // Author: Robert Roebling // Id: $Id$ @@ -10,8 +10,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #if wxUSE_FONTDLG #ifndef __WXGPE__ @@ -52,7 +50,7 @@ bool gtk_fontdialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUN win->Close(); - return TRUE; + return true; } } @@ -114,14 +112,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog) bool wxFontDialog::DoCreate(wxWindow *parent) { - m_needParent = FALSE; + m_needParent = false; if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) || !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, wxDefaultValidator, wxT("fontdialog") )) { wxFAIL_MSG( wxT("wxFontDialog creation failed") ); - return FALSE; + return false; } wxString m_message( _("Choose font") ); @@ -169,7 +167,7 @@ bool wxFontDialog::DoCreate(wxWindow *parent) } } - return TRUE; + return true; } wxFontDialog::~wxFontDialog() @@ -184,4 +182,3 @@ void wxFontDialog::SetChosenFont(const char *fontname) #endif // wxUSE_FONTDLG #endif // GPE - diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 9b703f28d8..7d7824daa4 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: frame.cpp +// Name: src/gtk1/frame.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -7,6 +7,9 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + // ============================================================================ // declarations // ============================================================================ @@ -15,11 +18,6 @@ // headers // ---------------------------------------------------------------------------- -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#include "wx/defs.h" - #include "wx/frame.h" #include "wx/dialog.h" #include "wx/control.h" diff --git a/src/gtk1/toplevel.cpp b/src/gtk1/toplevel.cpp index 8c521b4282..460cae59ad 100644 --- a/src/gtk1/toplevel.cpp +++ b/src/gtk1/toplevel.cpp @@ -7,6 +7,9 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + // ============================================================================ // declarations // ============================================================================ @@ -15,15 +18,10 @@ // headers // ---------------------------------------------------------------------------- -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - #ifdef __VMS #define XIconifyWindow XICONIFYWINDOW #endif -#include "wx/defs.h" - #include "wx/toplevel.h" #include "wx/log.h" #include "wx/dialog.h" diff --git a/src/html/helpdata.cpp b/src/html/helpdata.cpp index 9aa5f8d1b9..5acac76914 100644 --- a/src/html/helpdata.cpp +++ b/src/html/helpdata.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: helpdata.cpp +// Name: src/html/helpdata.cpp // Purpose: wxHtmlHelpData // Notes: Based on htmlhelp.cpp, implementing a monolithic // HTML Help controller class, by Vaclav Slavik @@ -13,11 +13,9 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif -#include "wx/defs.h" - #if wxUSE_HTML && wxUSE_STREAMS #ifndef WXPRECOMP @@ -294,7 +292,7 @@ bool wxHtmlHelpData::LoadMSProject(wxHtmlBookRecord *book, wxFileSystem& fsys, HP_TagHandler *handler = new HP_TagHandler(book); parser.AddTagHandler(handler); - f = ( contentsfile.IsEmpty() ? (wxFSFile*) NULL : fsys.OpenFile(contentsfile) ); + f = ( contentsfile.empty() ? (wxFSFile*) NULL : fsys.OpenFile(contentsfile) ); if (f) { buf.clear(); @@ -308,7 +306,7 @@ bool wxHtmlHelpData::LoadMSProject(wxHtmlBookRecord *book, wxFileSystem& fsys, wxLogError(_("Cannot open contents file: %s"), contentsfile.c_str()); } - f = ( indexfile.IsEmpty() ? (wxFSFile*) NULL : fsys.OpenFile(indexfile) ); + f = ( indexfile.empty() ? (wxFSFile*) NULL : fsys.OpenFile(indexfile) ); if (f) { buf.clear(); @@ -317,7 +315,7 @@ bool wxHtmlHelpData::LoadMSProject(wxHtmlBookRecord *book, wxFileSystem& fsys, handler->Reset(m_index); parser.Parse(buf); } - else if (!indexfile.IsEmpty()) + else if (!indexfile.empty()) { wxLogError(_("Cannot open index file: %s"), indexfile.c_str()); } @@ -488,7 +486,7 @@ void wxHtmlHelpData::SetTempDir(const wxString& path) if (wxIsAbsolutePath(path)) m_tempPath = path; else m_tempPath = wxGetCwd() + _T("/") + path; - if (m_tempPath[m_tempPath.Length() - 1] != _T('/')) + if (m_tempPath[m_tempPath.length() - 1] != _T('/')) m_tempPath << _T('/'); } } @@ -518,7 +516,7 @@ bool wxHtmlHelpData::AddBookParam(const wxFSFile& bookfile, int IndexOld = m_index.size(), ContentsOld = m_contents.size(); - if (!path.IsEmpty()) + if (!path.empty()) fsys.ChangePathTo(path, true); size_t booksCnt = m_bookRecords.GetCount(); @@ -643,7 +641,7 @@ bool wxHtmlHelpData::AddBook(const wxString& book) #endif s = fsys.FindFirst(book + wxT("#zip:*.hhp"), wxFILE); - while (!s.IsEmpty()) + while (!s.empty()) { if (AddBook(s)) rt = true; s = fsys.FindNext(); @@ -989,7 +987,7 @@ bool wxHtmlSearchEngine::Scan(const wxFSFile& file) wxASSERT_MSG(!m_Keyword.empty(), wxT("wxHtmlSearchEngine::LookFor must be called before scanning!")); int i, j; - int wrd = m_Keyword.Length(); + int wrd = m_Keyword.length(); bool found = false; wxHtmlFilterHTML filter; wxString tmp = filter.ReadFile(file); diff --git a/src/html/htmlcell.cpp b/src/html/htmlcell.cpp index d56483bf6e..8f4f0f50c0 100644 --- a/src/html/htmlcell.cpp +++ b/src/html/htmlcell.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: htmlcell.cpp +// Name: src/html/htmlcell.cpp // Purpose: wxHtmlCell - basic element of HTML output // Author: Vaclav Slavik // RCS-ID: $Id$ @@ -9,14 +9,12 @@ #include "wx/wxprec.h" -#include "wx/defs.h" - -#if wxUSE_HTML && wxUSE_STREAMS - #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_HTML && wxUSE_STREAMS + #ifndef WXPRECOMP #include "wx/brush.h" #include "wx/colour.h" @@ -1149,7 +1147,7 @@ void wxHtmlContainerCell::SetWidthFloat(const wxHtmlTag& tag, double pixel_scale int wdi; wxString wd = tag.GetParam(wxT("WIDTH")); - if (wd[wd.Length()-1] == wxT('%')) + if (wd[wd.length()-1] == wxT('%')) { wxSscanf(wd.c_str(), wxT("%i%%"), &wdi); SetWidthFloat(wdi, wxHTML_UNITS_PERCENT); diff --git a/src/html/htmlfilt.cpp b/src/html/htmlfilt.cpp index d3f951a88d..025a19e155 100644 --- a/src/html/htmlfilt.cpp +++ b/src/html/htmlfilt.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: htmlfilt.cpp +// Name: src/html/htmlfilt.cpp // Purpose: wxHtmlFilter - input filter for translating into HTML format // Author: Vaclav Slavik // RCS-ID: $Id$ @@ -9,13 +9,12 @@ #include "wx/wxprec.h" -#include "wx/defs.h" -#if wxUSE_HTML && wxUSE_STREAMS - #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_HTML && wxUSE_STREAMS + #ifndef WXPRECOMP #include "wx/log.h" #include "wx/intl.h" diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp index ea7f38d865..b5feaccbf1 100644 --- a/src/html/htmlpars.cpp +++ b/src/html/htmlpars.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: htmlpars.cpp +// Name: src/html/htmlpars.cpp // Purpose: wxHtmlParser class (generic parser) // Author: Vaclav Slavik // RCS-ID: $Id$ @@ -9,13 +9,12 @@ #include "wx/wxprec.h" -#include "wx/defs.h" -#if wxUSE_HTML && wxUSE_STREAMS - #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_HTML && wxUSE_STREAMS + #ifndef WXPRECOMP #include "wx/log.h" #include "wx/intl.h" @@ -135,7 +134,7 @@ void wxHtmlParser::CreateDOMTree() { wxHtmlTagsCache cache(m_Source); m_TextPieces = new wxHtmlTextPieces; - CreateDOMSubTree(NULL, 0, m_Source.Length(), &cache); + CreateDOMSubTree(NULL, 0, m_Source.length(), &cache); m_CurTextPiece = 0; } @@ -272,7 +271,7 @@ void wxHtmlParser::DoParsing() { m_CurTag = m_Tags; m_CurTextPiece = 0; - DoParsing(0, m_Source.Length()); + DoParsing(0, m_Source.length()); } void wxHtmlParser::DoParsing(int begin_pos, int end_pos) diff --git a/src/html/htmltag.cpp b/src/html/htmltag.cpp index 98a1ff4fba..9bae31f640 100644 --- a/src/html/htmltag.cpp +++ b/src/html/htmltag.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: htmltag.cpp +// Name: src/html/htmltag.cpp // Purpose: wxHtmlTag class (represents single tag) // Author: Vaclav Slavik // RCS-ID: $Id$ @@ -9,13 +9,12 @@ #include "wx/wxprec.h" -#include "wx/defs.h" -#if wxUSE_HTML - #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_HTML + #ifndef WXPRECOMP #endif @@ -61,7 +60,7 @@ bool wxIsCDATAElement(const wxChar *tag) wxHtmlTagsCache::wxHtmlTagsCache(const wxString& source) { const wxChar *src = source.c_str(); - int lng = source.Length(); + int lng = source.length(); wxChar tagBuffer[256]; m_Cache = NULL; diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index aad2aa3e57..9b5fc735fa 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: htmlwin.cpp +// Name: src/html/htmlwin.cpp // Purpose: wxHtmlWindow class for parsing & displaying HTML (implementation) // Author: Vaclav Slavik // RCS-ID: $Id$ @@ -9,13 +9,12 @@ #include "wx/wxprec.h" -#include "wx/defs.h" -#if wxUSE_HTML && wxUSE_STREAMS - #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_HTML && wxUSE_STREAMS + #ifndef WXPRECOMP #include "wx/log.h" #include "wx/intl.h" diff --git a/src/html/htmprint.cpp b/src/html/htmprint.cpp index 63054b2544..013ab79937 100644 --- a/src/html/htmprint.cpp +++ b/src/html/htmprint.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: htmprint.cpp +// Name: src/html/htmprint.cpp // Purpose: html printing classes // Author: Vaclav Slavik // Created: 25/09/99 @@ -11,20 +11,18 @@ // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_HTML && wxUSE_PRINTING_ARCHITECTURE && wxUSE_STREAMS + #ifndef WX_PRECOMP #include "wx/log.h" #include "wx/intl.h" #include "wx/dc.h" #endif -#if wxUSE_HTML && wxUSE_PRINTING_ARCHITECTURE && wxUSE_STREAMS - #include "wx/dc.h" #include "wx/print.h" #include "wx/printdlg.h" diff --git a/src/html/m_dflist.cpp b/src/html/m_dflist.cpp index 419a90dcc1..92ff94b1c1 100644 --- a/src/html/m_dflist.cpp +++ b/src/html/m_dflist.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: m_dflist.cpp +// Name: src/html/m_dflist.cpp // Purpose: wxHtml module for definition lists (DL,DT,DD) // Author: Vaclav Slavik // RCS-ID: $Id$ @@ -9,13 +9,12 @@ #include "wx/wxprec.h" -#include "wx/defs.h" -#if wxUSE_HTML && wxUSE_STREAMS - #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_HTML && wxUSE_STREAMS + #ifndef WXPRECOMP #endif diff --git a/src/html/m_fonts.cpp b/src/html/m_fonts.cpp index 48664c686d..917a2f0eec 100644 --- a/src/html/m_fonts.cpp +++ b/src/html/m_fonts.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: m_fonts.cpp +// Name: src/html/m_fonts.cpp // Purpose: wxHtml module for fonts & colors of fonts // Author: Vaclav Slavik // RCS-ID: $Id$ @@ -9,13 +9,12 @@ #include "wx/wxprec.h" -#include "wx/defs.h" -#if wxUSE_HTML && wxUSE_STREAMS - #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_HTML && wxUSE_STREAMS + #ifndef WXPRECOMP #endif diff --git a/src/html/m_hline.cpp b/src/html/m_hline.cpp index 80f433c441..6bf88c7732 100644 --- a/src/html/m_hline.cpp +++ b/src/html/m_hline.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: m_hline.cpp +// Name: src/html/m_hline.cpp // Purpose: wxHtml module for horizontal line (HR tag) // Author: Vaclav Slavik // RCS-ID: $Id$ @@ -9,12 +9,12 @@ #include "wx/wxprec.h" -#include "wx/defs.h" -#if wxUSE_HTML && wxUSE_STREAMS #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_HTML && wxUSE_STREAMS + #ifndef WXPRECOMP #include "wx/brush.h" #include "wx/pen.h" diff --git a/src/html/m_image.cpp b/src/html/m_image.cpp index 3182825232..59881ad023 100644 --- a/src/html/m_image.cpp +++ b/src/html/m_image.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: m_image.cpp +// Name: src/html/m_image.cpp // Purpose: wxHtml module for displaying images // Author: Vaclav Slavik // RCS-ID: $Id$ @@ -9,13 +9,12 @@ #include "wx/wxprec.h" -#include "wx/defs.h" -#if wxUSE_HTML && wxUSE_STREAMS - #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_HTML && wxUSE_STREAMS + #ifndef WXPRECOMP #include "wx/dc.h" #include "wx/scrolwin.h" diff --git a/src/html/m_layout.cpp b/src/html/m_layout.cpp index 0bc14503f7..e4242e6a66 100644 --- a/src/html/m_layout.cpp +++ b/src/html/m_layout.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: m_layout.cpp +// Name: src/html/m_layout.cpp // Purpose: wxHtml module for basic paragraphs/layout handling // Author: Vaclav Slavik // RCS-ID: $Id$ @@ -9,14 +9,12 @@ #include "wx/wxprec.h" -#include "wx/defs.h" - -#if wxUSE_HTML && wxUSE_STREAMS - #ifdef __BORLANDC__ #pragma hdrstop #endif +#if wxUSE_HTML && wxUSE_STREAMS + #ifndef WXPRECOMP #endif diff --git a/src/html/m_links.cpp b/src/html/m_links.cpp index 4c5647c4cd..ee76437084 100644 --- a/src/html/m_links.cpp +++ b/src/html/m_links.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: m_links.cpp +// Name: src/html/m_links.cpp // Purpose: wxHtml module for links & anchors // Author: Vaclav Slavik // RCS-ID: $Id$ @@ -9,13 +9,12 @@ #include "wx/wxprec.h" -#include "wx/defs.h" -#if wxUSE_HTML && wxUSE_STREAMS - #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_HTML && wxUSE_STREAMS + #ifndef WXPRECOMP #endif diff --git a/src/html/m_list.cpp b/src/html/m_list.cpp index 97864acc7c..2328b748b8 100644 --- a/src/html/m_list.cpp +++ b/src/html/m_list.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: m_list.cpp +// Name: src/html/m_list.cpp // Purpose: wxHtml module for lists // Author: Vaclav Slavik // RCS-ID: $Id$ @@ -9,13 +9,12 @@ #include "wx/wxprec.h" -#include "wx/defs.h" -#if wxUSE_HTML && wxUSE_STREAMS - #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_HTML && wxUSE_STREAMS + #ifndef WXPRECOMP #include "wx/brush.h" #include "wx/dc.h" diff --git a/src/html/m_pre.cpp b/src/html/m_pre.cpp index 4b5a71c7aa..675d916321 100644 --- a/src/html/m_pre.cpp +++ b/src/html/m_pre.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: m_pre.cpp +// Name: src/html/m_pre.cpp // Purpose: wxHtml module for
 ... 
tag (code citation) // Author: Vaclav Slavik // RCS-ID: $Id$ @@ -9,12 +9,12 @@ #include "wx/wxprec.h" -#include "wx/defs.h" -#if wxUSE_HTML && wxUSE_STREAMS #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_HTML && wxUSE_STREAMS + #ifndef WXPRECOMP #endif diff --git a/src/html/m_style.cpp b/src/html/m_style.cpp index 3934a45990..85770ae851 100644 --- a/src/html/m_style.cpp +++ b/src/html/m_style.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: m_style.cpp +// Name: src/html/m_style.cpp // Purpose: wxHtml module for parsing