Public Member Functions | |
virtual void | Dispose () |
ClassInfo | GetClassInfo () |
string | GetTypeName () |
Static Public Member Functions | |
static string | _ (string format, params object[] args) |
static string | _ (Enum enumerationValue) |
static string | _ (Type t) |
static string | _ (string str) |
static string | __ (string str) |
static wxString | GetTranslation (wxString str) |
static string | GetTranslation (string str) |
static string | GetTranslation (Enum enumerationValue) |
static string | GetTranslation (Type aType) |
Protected Member Functions | |
virtual void | CallDTor () |
virtual void | DeregisterWrapper () |
virtual void | Dispose (bool disposing) |
internal void | VirtualDispose () |
Properties | |
static object | DllSync [get] |
static int | InstancesCount [get] |
bool | IsNULL [get] |
static int | SavedInstancesCount [get] |
Classes | |
class | ClassInfo |
wxWidgets
objects. This class manages pointers to C++ objects.
When wrapping C++ to be used in modern OO programming languages like C# or JAVA, the main difficulties arise from the different object model. On C++ instances are structs. In most other languages (keeping ancient things like Simula 1967 aside) instances are references to structs. C++ knows a lot of modifiers for data types without correlation in C#. One of the most problematic thing is wrapping const
wxObject &
results from selectors. Requirements:
StorageMode.VolatileObject
. In these case the C++ object usually receives a callback to be used on destruction to delete all references of the .NET wrapper to the deleted C++ object. Please keep also in mind, that using wx.Object.FindObject() usually means tha one wants to find a previous wrapper on an instance retrieved from C++. So, this instance is likely to be destroyed by the C++ implementation and not by the .NET wrapper. Consequently, you have to deactivate wx.Object.memOwn. wx-c
DLL at least if these calls create new C++ objects or delete them. wxObject
. This method may also serve as a factory for wrappers if you know the wx.NET class of this new wrapper. If you don't know the class that shall be used for the creation of wrappers, you have the option to use the interface to the wxWidgets RTTI. Refer to the remarks on wx.Object.ClassInfo.AddObject() and RemoveObject() implement a data base containing all wrappers to C++ pointers. So, methods receiving a pointer to a already wrapped object can retrieve this preexisting wrapper and reuse it by FindObject().
More elaborate classes do not wrap the original wxWidgets object but a C++ wrapper informing wx.NET on deallocating the wxWidgets object. Usually, such wrappers receive a delegate of type Virtual_Dispose() that calls VirtualDispose(). Please note whenever passing delegates to C++ objects: Load class member variables with these delegates in order to prevent undesired disposal of the delegates. This class offers member variable virtual_Dispose() to store the delegate of type Virtual_Dispose(). Please note, that some wxWidgets classes like wxString
or wxArrayString
have non-virtual destructors that, nevertheless, must run on destruction. So, adding callbacks on destruction is not applicable to all wxWidget classes. File local_events.h
in the wx-c
directory of the sources contains some support for callbacks on desctruction and some other frequent cases on wrapping.
Contributors should also not forget to initialize all callbacks to NULL on construction and to call only callbacks which are not NULL. This is important to achieve reliant code - it is important that instances with callbacks also run before these callbacks have been registered.
static string wx.Object._ | ( | string | format, | |
params object[] | args | |||
) | [static] |
This will translate format
into the currently selected locale and then paste sting versions of the arguments into the result. Refer to wx.Locale.
static string wx.Object._ | ( | Enum | enumerationValue | ) | [static] |
Returns the translation of the enumeration value. Suppose, we have an enumeration Assembly.Enumeration
containing a value Assembly.Enumeration.Value
. Then, this will look for a translation of "Assembly.Enumeration.Value" first and then, if this fails, for a translation of "Value".
Translations may also be provided by wx.Globalization.EnumValueTranslations.
static string wx.Object._ | ( | Type | t | ) | [static] |
This will return a translation of the type name. Translations of types may be useful if the type represent a notion in the real world that has a name. For instance, wx.Font represents fonts. "Font" is a human readable name. If you want to print information on an object o
- what kind of object is this - you might use wx.Object.GetTranslation(o.GetType()).
Types may either provide a human readable name as defined by a wx.Globalization.TypeNameTranslationsAttribute attribute. Or they are translated by a gettext catalogue. This method will first search for a translation of the full qualified name. Then, this will search for a translation of the short type name.
This will return a translation into the current wx.Locale.Language.
static string wx.Object._ | ( | string | str | ) | [static] |
This will translate str
into the currently selected locale. Refer to wx.Locale.
static string wx.Object.__ | ( | string | str | ) | [static] |
This is a dummy method that programmers may use to mark a text as to be translated by GETTEXT but not here. Example:
string theUntranslatedText=wx.Object.__("The untranslated text."); System.Diagnostics.Trace.WriteLine(theUntranslatedText); // this can be understood by developers. System.Console.WriteLine(wx.Object._(theUntranslatedString); // this can be understood by the user of the program.
virtual void wx.Object.CallDTor | ( | ) | [protected, virtual] |
This will be called by Dispose() to delete the C++ object. Overload this if you have to use another DTor.
Reimplemented in wx.AcceleratorEntry, wx.AcceleratorTable, wx.Aui.AuiDockArt, wx.Aui.AuiNotebookPage, wx.Aui.AuiNotebookPageArray, wx.Aui.AuiPaneInfo, wx.Aui.AuiTabArt, wx.Aui.AuiToolBarArt, wx.Aui.AuiToolBarItem, wx.Aui.AuiToolBarItemArray, wx.CalendarDateAttr, wx.Choice, wx.Colour, wx.ComboPopup, wx.Config, wx.DataFormat, wx.DataObjectCustom, wx.TextDataObject, wx.FileDataObject, wx.DC, wx.Dialog, wx.Display, wx.DropTarget, wx.FileDialog, wx.FlexGridSizer, wx.Font, wx.FontData, wx.FontDialog, wx.Gauge, wx.GDIObject, wx.GridCtrl.Editors.GridCellEditor, wx.GridCtrl.GridCellCoords, wx.GridCtrl.GridCellCoordsArray, wx.GridCtrl.Renderers.GridCellRenderer, wx.GridCtrl.Renderers.GridCellStringRenderer, wx.GridCtrl.Renderers.GridCellNumberRenderer, wx.GridCtrl.Renderers.GridCellFloatRenderer, wx.GridCtrl.Renderers.GridCellBoolRenderer, wx.GridCtrl.GridCellAttrProvider, wx.GridCtrl.Renderers.GridCellEnumRenderer, wx.GridCtrl.Editors.GridCellEnumEditor, wx.GridCtrl.Editors.GridCellAutoWrapStringEditor, wx.Html.HtmlTag, wx.Image, wx.ImageHistogram, wx.ListBox, wx.ListCtrl, wx.Palette, wx.DatePickerCtrl, wx.Region, wx.StyledText.StyledTextCtrl, wx.TaskBarIcon, wx.TextEntryDialog, wx.IntBuffer, wx.wxDateTime, and wx.wxString.
virtual void wx.Object.DeregisterWrapper | ( | ) | [protected, virtual] |
Use this to implement services that decouple the .NET wrapper from the native wxWidgets objects. Example: Remove callback function pointers. Please note that this may be called more than once.
Reimplemented in wx.GridCtrl.Editors.GridCellEditor.
virtual void wx.Object.Dispose | ( | bool | disposing | ) | [protected, virtual] |
Reimplemented in wx.CalendarCtrl, wx.FileSys.IOStreamFSHandler, wx.GridCtrl.Grid, wx.Html.Help.HtmlBookRecords, and wx.Window.
virtual void wx.Object.Dispose | ( | ) | [virtual] |
Reimplemented in wx.Archive.ArchiveOutput, wx.Archive.ArchiveInput, wx.Aui.AuiDockArt, wx.Aui.AuiNotebookPage, wx.Aui.AuiNotebookPageArray, wx.Aui.AuiPaneInfo, wx.Aui.AuiTabArt, wx.Aui.AuiToolBarArt, wx.Aui.AuiToolBarItem, wx.Aui.AuiToolBarItemArray, wx.Caret, wx.CaretSuspend, wx.ClientData, wx.StringClientData, wx.ClipboardLocker, wx.Colour, wx.DropSource, wx.FileSys.wxInputStreamWrapper, wx.FileSys.FSFile, wx.FontMapper, wx.FontEnumerator, wx.ColourDatabase, wx.PenList, wx.BrushList, wx.FontList, wx.BitmapList, wx.GridCtrl.Editors.GridCellTextEditor, wx.GridCtrl.Editors.GridCellNumberEditor, wx.GridCtrl.Editors.GridCellFloatEditor, wx.GridCtrl.Editors.GridCellBoolEditor, wx.GridCtrl.Editors.GridCellChoiceEditor, wx.GridCtrl.GridCellWorker, wx.GridCtrl.GridCellAttr, wx.GridCtrl.Renderers.GridCellDateTimeRenderer, wx.GridCtrl.Renderers.GridCellAutoWrapStringRenderer, wx.Html.HtmlRenderingInfo, wx.Html.HtmlSelection, wx.ImageHistogramEntry, wx.ListItemAttr, wx.LanguageInfo, wx.Locale, wx.ProgressDialog, wx.SashEdge, wx.TextAttr, wx.TreeItemData, wx.TreeItemAttr, wx.TreeItemId, wx.ArrayTreeItemIds, wx.WindowDisabler, wx.BusyInfo, wx.ByteBuffer, wx.ArrayInt, wx.ArrayString, wx.wxSize, wx.wxRect, wx.VisualAttributes, and wx.wxWCharBuffer.
ClassInfo wx.Object.GetClassInfo | ( | ) |
This will return a wrapper of the wxWidgets RTTI representation.
This will translate str
into the currently selected locale. Refer to wx.Locale.
static string wx.Object.GetTranslation | ( | string | str | ) | [static] |
This will translate str
into the currently selected locale. Refer to wx.Locale.
static string wx.Object.GetTranslation | ( | Enum | enumerationValue | ) | [static] |
This will translate the provided enumeration value.
You have two options to translate enumeration values. The enumeration might provide attributes of type wx.Globalization.EnumValueTranslations. If present, these will be used for translation first. However, if this fails, this will query the known gettext
catalogs for a string "namespace.enumeration_type.enumeration_value"
. If this query fails, this will simply return "enumeration_value"
. Use tool getenums.exe
to load enumeration values of an assembly into a gettext POT file.
All translations will be done into the current wx.Locale.Language
.
static string wx.Object.GetTranslation | ( | Type | aType | ) | [static] |
This will return a translation of the type name. Translations of types may be useful if the type represent a notion in the real world that has a name. For instance, wx.Font represents fonts. "Font" is a human readable name. If you want to print information on an object o
- what kind of object is this - you might use wx.Object.GetTranslation(o.GetType()).
Types may either provide a human readable name as defined by a wx.Globalization.TypeNameTranslationsAttribute attribute. Or they are translated by a gettext catalogue. This method will first search for a translation of the full qualified name. Then, this will search for a translation of the short type name.
This will return a translation into the current wx.Locale.Language.
string wx.Object.GetTypeName | ( | ) |
This will return the name of the C++ class of the wrapped pointer. Information will be derived from the wxWidgets RTTI.
internal void wx.Object.VirtualDispose | ( | ) | [protected] |
called when an C++ (wx)Object dtor gets invoked This method may be passed to native objects that can use a Virtual_Dispose method that will be called on deleting the native object.
Reimplemented in wx.Html.Help.HtmlBookRecords.
object wx.Object.DllSync [static, get] |
Use this object to synchronize calls to the wx-c
DLL. Apparently, allocation and deallocation of C++ objects using new
and delete
must be synchronized at least on Windows. It is generally a good idea, to synchronize most of calls to the DLL. Please keep in mind, that the garbage collector runs in parallel to the program. So, you typically have at least two threads running that use the wx-c
DLL.
int wx.Object.InstancesCount [static, get] |
Use this to read the number of valid instances. This will return the number of generated and undisposed instances of this class regardless whether these objects have been saved in the static container for instances or not.
Reimplemented in wx.DisposableStringBox.
bool wx.Object.IsNULL [get] |
True if this does not refer to a valid C++ object. This situation typically occurs when a wrapped C++ object gets deallocated but the wrapper has net yet been finalized.
int wx.Object.SavedInstancesCount [static, get] |
Use this to get the number of valid/undisposed instances of wxWidgets objects.