X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1dfb6ff0af7b4fb902350e6d649f3768e4f4ce81..7dbb435338bce3b3747dcef615e13f80fbff5389:/docs/doxygen/mainpages/devtips.h?ds=sidebyside diff --git a/docs/doxygen/mainpages/devtips.h b/docs/doxygen/mainpages/devtips.h index 02acccbb3e..ac8f0bce37 100644 --- a/docs/doxygen/mainpages/devtips.h +++ b/docs/doxygen/mainpages/devtips.h @@ -2,32 +2,17 @@ // Name: devtips.h // Purpose: Cross-platform development page of the Doxygen manual // Author: wxWidgets team -// RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @page page_multiplatform General Cross-Platform Development Tips -This chapter describes some tips related to cross-platform development. - -@li @ref page_multiplatform_includefiles -@li @ref page_multiplatform_libraries -@li @ref page_multiplatform_configuration -@li @ref page_multiplatform_makefiles -@li @ref page_multiplatform_winresources -@li @ref page_multiplatform_allocatingobjects -@li @ref page_multiplatform_architecturedependency -@li @ref page_multiplatform_conditionalcompilation -@li @ref page_multiplatform_cpp -@li @ref page_multiplatform_filehandling -@li @ref page_multiplatform_reducingerr -@li @ref page_multiplatform_gui -@li @ref page_multiplatform_debug +@tableofcontents +This chapter describes some tips related to cross-platform development. -
@section page_multiplatform_includefiles Include Files @@ -199,8 +184,15 @@ the wxWidgets delayed deletion can take effect. This waits until idle time (when all messages have been processed) to actually delete the window, to avoid problems associated with the GUI sending events to deleted windows. -Don't create a window on the stack, because this will interfere with delayed -deletion. +In general wxWindow-derived objects should always be allocated on the heap +as wxWidgets will destroy them itself. The only, but important, exception to +this rule are the modal dialogs, i.e. wxDialog objects which are shown using +wxDialog::ShowModal() method. They may be allocated on the stack and, indeed, +usually are local variables to ensure that they are destroyed on scope exit as +wxWidgets does not destroy them unlike with all the other windows. So while it +is still possible to allocate modal dialogs on the heap, you should still +destroy or delete them explicitly in this case instead of relying on wxWidgets +doing it. If you decide to allocate a C++ array of objects (such as wxBitmap) that may be cleaned up by wxWidgets, make sure you delete the array explicitly before @@ -266,19 +258,6 @@ switched off by default) since it is a notoriously unportable feature. wxWidgets does not use C++ run-time type information since wxWidgets provides its own run-time type information system, implemented using macros. -@subsection page_multiplatform_cpp_null Type of NULL - -Some compilers (e.g. the native IRIX cc) define @NULL to be 0L so that no -conversion to pointers is allowed. Because of that, all these occurrences of -@NULL in the GTK+ port use an explicit conversion such as - -@code -wxWindow *my_window = (wxWindow*) NULL; -@endcode - -It is recommended to adhere to this in all code using wxWidgets as this make -the code (a bit) more portable. - @subsection page_multiplatform_cpp_precompiledheaders Precompiled Headers Some compilers, such as Borland C++ and Microsoft C++, support precompiled