git-svn-id: svn://10.65.10.50/branches/R_10_00@23289 c028cbd2-c16b-5b4b-a496-9718f37d4682
347 lines
20 KiB
HTML
347 lines
20 KiB
HTML
<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<title>wxPropertyGrid: wxCustomProperty Class Reference</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javaScript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body onload='searchBox.OnSelectItem(0);'>
|
|
<!-- Generated by Doxygen 1.6.3 -->
|
|
<script type="text/javascript"><!--
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
--></script>
|
|
<div class="navigation" id="top">
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="index.htm"><span>Main Page</span></a></li>
|
|
<li><a href="pages.htm"><span>Related Pages</span></a></li>
|
|
<li><a href="modules.htm"><span>Modules</span></a></li>
|
|
<li class="current"><a href="annotated.htm"><span>Classes</span></a></li>
|
|
<li>
|
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
|
<img id="MSearchSelect" src="search/search.png"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
alt=""/>
|
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="annotated.htm"><span>Class List</span></a></li>
|
|
<li><a href="classes.htm"><span>Class Index</span></a></li>
|
|
<li><a href="hierarchy.htm"><span>Class Hierarchy</span></a></li>
|
|
<li><a href="functions.htm"><span>Class Members</span></a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="contents">
|
|
<h1>wxCustomProperty Class Reference</h1><!-- doxytag: class="wxCustomProperty" --><!-- doxytag: inherits="wxPGProperty" -->
|
|
<p>This is a somewhat inefficient but versatile property class.
|
|
<a href="#_details">More...</a></p>
|
|
|
|
<p><code>#include <props.h></code></p>
|
|
<div class="dynheader">
|
|
Inheritance diagram for wxCustomProperty:</div>
|
|
<div class="dynsection">
|
|
<div class="center">
|
|
<img src="classwxCustomProperty.png" usemap="#wxCustomProperty_map" alt=""/>
|
|
<map id="wxCustomProperty_map" name="wxCustomProperty_map">
|
|
<area href="classwxPGProperty.htm" alt="wxPGProperty" shape="rect" coords="0,0,117,24"/>
|
|
</map>
|
|
</div>
|
|
</div>
|
|
|
|
<p><a href="classwxCustomProperty-members.htm">List of all members.</a></p>
|
|
<table border="0" cellpadding="0" cellspacing="0">
|
|
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwxCustomProperty.htm#adb6fb5bfa9463eb64f60d07e82755267">ChildChanged</a> (wxVariant &a1, int a2, wxVariant &a3) const </td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Called after value of a child property has been altered. <a href="#adb6fb5bfa9463eb64f60d07e82755267"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="classwxCustomProperty.htm#a64a86a19a3d57a76684d7b8c7fdd2236">GetChoiceInfo</a> (<a class="el" href="structwxPGChoiceInfo.htm">wxPGChoiceInfo</a> *choiceinfo)</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns current value's index to the choice control. <a href="#a64a86a19a3d57a76684d7b8c7fdd2236"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">virtual wxString </td><td class="memItemRight" valign="bottom"><a class="el" href="classwxCustomProperty.htm#acfe4b715d33c4108540f61e43528256d">GetValueAsString</a> (int argFlags) const </td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns text representation of property's value. <a href="#acfe4b715d33c4108540f61e43528256d"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwxCustomProperty.htm#a0d314fe9f58e64c3e84114affb56d707">IntToValue</a> (wxVariant &variant, int number, int argFlags) const </td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Converts 'number' (including choice selection) into proper value 'variant'. <a href="#a0d314fe9f58e64c3e84114affb56d707"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwxCustomProperty.htm#a1e7ad5e3a61dfb4a8671b68b32f7292c">StringToValue</a> (wxVariant &variant, const wxString &text, int argFlags=0) const </td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Converts 'text' into proper value 'variant'. <a href="#a1e7ad5e3a61dfb4a8671b68b32f7292c"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aba1587f510bd6e20e52828c293235801"></a><!-- doxytag: member="wxCustomProperty::wxCustomProperty" ref="aba1587f510bd6e20e52828c293235801" args="(const wxString &label=wxPG_LABEL, const wxString &name=wxPG_LABEL)" -->
|
|
</td><td class="memItemRight" valign="bottom"><b>wxCustomProperty</b> (const wxString &label=wxPG_LABEL, const wxString &name=wxPG_LABEL)</td></tr>
|
|
<tr><td colspan="2"><h2>Protected Attributes</h2></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af6823ca35dc2d365013b7c2eedd1aa75"></a><!-- doxytag: member="wxCustomProperty::m_choices" ref="af6823ca35dc2d365013b7c2eedd1aa75" args="" -->
|
|
<a class="el" href="classwxPGChoices.htm">wxPGChoices</a> </td><td class="memItemRight" valign="bottom"><b>m_choices</b></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6869d245b7cfdde04d7d582c43e086cf"></a><!-- doxytag: member="wxCustomProperty::m_paintCallback" ref="a6869d245b7cfdde04d7d582c43e086cf" args="" -->
|
|
<a class="el" href="group__miscellaneous.htm#ga21937a843330941d01d8ed7d9f8902de">wxPGPaintCallback</a> </td><td class="memItemRight" valign="bottom"><b>m_paintCallback</b></td></tr>
|
|
</table>
|
|
<hr/><a name="_details"></a><h2>Detailed Description</h2>
|
|
<p>This is a somewhat inefficient but versatile property class. </p>
|
|
<p>Base class offers the following:</p>
|
|
<ul>
|
|
<li>By default has string value type.</li>
|
|
<li>Has capacity to have choices.</li>
|
|
<li>Can have custom-paint bitmap. </li>
|
|
</ul>
|
|
<hr/><h2>Member Function Documentation</h2>
|
|
<a class="anchor" id="adb6fb5bfa9463eb64f60d07e82755267"></a><!-- doxytag: member="wxCustomProperty::ChildChanged" ref="adb6fb5bfa9463eb64f60d07e82755267" args="(wxVariant &a1, int a2, wxVariant &a3) const " -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">virtual void wxCustomProperty::ChildChanged </td>
|
|
<td>(</td>
|
|
<td class="paramtype">wxVariant & </td>
|
|
<td class="paramname"> <em>thisValue</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>childIndex</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">wxVariant & </td>
|
|
<td class="paramname"> <em>childValue</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td> const<code> [virtual]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Called after value of a child property has been altered. </p>
|
|
<p>Note that this function is usually called at the time that value of this property, or given child property, is still pending for change.</p>
|
|
<p>Sample pseudo-code implementation:</p>
|
|
<div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> <a class="code" href="classwxCustomProperty.htm#adb6fb5bfa9463eb64f60d07e82755267" title="Called after value of a child property has been altered.">MyProperty::ChildChanged</a>( wxVariant& thisValue, <span class="keywordtype">int</span> childIndex, wxVariant& childValue )<span class="keyword"> const</span>
|
|
<span class="keyword"> </span>{
|
|
<span class="comment">// Acquire reference to actual type of data stored in variant</span>
|
|
<span class="comment">// (TFromVariant only exists if wxPropertyGrid's wxVariant-macros were used to create</span>
|
|
<span class="comment">// the variant class).</span>
|
|
T& data = TFromVariant(thisValue);
|
|
|
|
<span class="comment">// Copy childValue into data.</span>
|
|
<span class="keywordflow">switch</span> ( childIndex )
|
|
{
|
|
<span class="keywordflow">case</span> 0:
|
|
data.SetSubProp1( childvalue.GetLong() );
|
|
<span class="keywordflow">break</span>;
|
|
<span class="keywordflow">case</span> 1:
|
|
data.SetSubProp2( childvalue.GetString() );
|
|
<span class="keywordflow">break</span>;
|
|
...
|
|
}
|
|
}
|
|
</pre></div><dl><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>thisValue</em> </td><td>Value of this property, that should be altered. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>childIndex</em> </td><td>Index of child changed (you can use Item(childIndex) to get). </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>childValue</em> </td><td>Value of the child property. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p>Reimplemented from <a class="el" href="classwxPGProperty.htm#ace7a9dc69fdf8185cff04c1604cb4fbd">wxPGProperty</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a64a86a19a3d57a76684d7b8c7fdd2236"></a><!-- doxytag: member="wxCustomProperty::GetChoiceInfo" ref="a64a86a19a3d57a76684d7b8c7fdd2236" args="(wxPGChoiceInfo *choiceinfo)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">virtual int wxCustomProperty::GetChoiceInfo </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="structwxPGChoiceInfo.htm">wxPGChoiceInfo</a> * </td>
|
|
<td class="paramname"> <em>choiceinfo</em></td>
|
|
<td> ) </td>
|
|
<td><code> [virtual]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Returns current value's index to the choice control. </p>
|
|
<p>May also return, through pointer arguments, strings that should be inserted to that control. Irrelevant to classes which do not employ wxPG_EDITOR(Choice) or similar. </p>
|
|
<dl class="remark"><dt><b>Remarks:</b></dt><dd><ul>
|
|
<li>If returns NULL in choices, then this class must be derived from <a class="el" href="classwxBaseEnumProperty.htm" title="Derive dynamic custom properties with choices from this class.">wxBaseEnumProperty</a>.</li>
|
|
<li>Must not crash even if property's set of choices is uninitialized (i.e. it points to wxPGGlobalVars->m_emptyConstants). </li>
|
|
</ul>
|
|
</dd></dl>
|
|
|
|
<p>Reimplemented from <a class="el" href="classwxPGProperty.htm#a805b98f7d147782079bb9a48915a949f">wxPGProperty</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="acfe4b715d33c4108540f61e43528256d"></a><!-- doxytag: member="wxCustomProperty::GetValueAsString" ref="acfe4b715d33c4108540f61e43528256d" args="(int argFlags) const " -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">virtual wxString wxCustomProperty::GetValueAsString </td>
|
|
<td>(</td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>argFlags</em></td>
|
|
<td> ) </td>
|
|
<td> const<code> [virtual]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Returns text representation of property's value. </p>
|
|
<p>Generally this function should not be called from the application code. Instead, call <a class="el" href="classwxPGProperty.htm#a9133d43d6e539e2814ed28d2f37d953e" title="Same as GetValueAsString, except takes common value into account.">GetValueString()</a>.</p>
|
|
<dl><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>argFlags</em> </td><td>If wxPG_FULL_VALUE is set, returns complete, storable string value instead of displayable. If wxPG_EDITABLE_VALUE is set, returns string value that must be editable in textctrl. If wxPG_COMPOSITE_FRAGMENT is set, returns text that is appropriate to display as a part of composite property string value.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="remark"><dt><b>Remarks:</b></dt><dd><ul>
|
|
<li>Default implementation returns string composed from text representations of child properties.</li>
|
|
<li>Implementations are never called with m_value being null variant (ie. unspecified value), so you don't need to check for that. Naturally this means that unspecified value is always displayed as an empty string.</li>
|
|
</ul>
|
|
</dd></dl>
|
|
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classwxPGProperty.htm#a9133d43d6e539e2814ed28d2f37d953e" title="Same as GetValueAsString, except takes common value into account.">GetValueString()</a> </dd></dl>
|
|
|
|
<p>Reimplemented from <a class="el" href="classwxPGProperty.htm#a29f70a60e4844efbebc140270e1a4358">wxPGProperty</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a0d314fe9f58e64c3e84114affb56d707"></a><!-- doxytag: member="wxCustomProperty::IntToValue" ref="a0d314fe9f58e64c3e84114affb56d707" args="(wxVariant &variant, int number, int argFlags) const " -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">virtual bool wxCustomProperty::IntToValue </td>
|
|
<td>(</td>
|
|
<td class="paramtype">wxVariant & </td>
|
|
<td class="paramname"> <em>value</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>number</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>argFlags</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td> const<code> [virtual]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Converts 'number' (including choice selection) into proper value 'variant'. </p>
|
|
<p>Returns true if new (different than m_value) value could be interpreted from the integer. </p>
|
|
<dl><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>argFlags</em> </td><td>If wxPG_FULL_VALUE is set, returns complete, storable value instead of displayable</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="remark"><dt><b>Remarks:</b></dt><dd><ul>
|
|
<li>Default implementation may work correctly if used value type is int.</li>
|
|
<li>If property is not supposed to use choice or spinctrl or other editor with int-based value, it is not necessary to implement this method.</li>
|
|
<li>If property uses choice control, and displays a dialog on some choice items, then it is preferred to display that dialog in IntToValue instead of OnEvent.</li>
|
|
<li>You might want to take into account that m_value is Null variant if property value is unspecified (which is usually only case if you explicitly enabled that sort behavior). </li>
|
|
</ul>
|
|
</dd></dl>
|
|
|
|
<p>Reimplemented from <a class="el" href="classwxPGProperty.htm#ad0a8e61a356e1366170967d56af66231">wxPGProperty</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a1e7ad5e3a61dfb4a8671b68b32f7292c"></a><!-- doxytag: member="wxCustomProperty::StringToValue" ref="a1e7ad5e3a61dfb4a8671b68b32f7292c" args="(wxVariant &variant, const wxString &text, int argFlags=0) const " -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">virtual bool wxCustomProperty::StringToValue </td>
|
|
<td>(</td>
|
|
<td class="paramtype">wxVariant & </td>
|
|
<td class="paramname"> <em>variant</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const wxString & </td>
|
|
<td class="paramname"> <em>text</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>argFlags</em> = <code>0</code></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td> const<code> [virtual]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Converts 'text' into proper value 'variant'. </p>
|
|
<p>Returns true if new (different than m_value) value could be interpreted from the text. </p>
|
|
<dl><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>argFlags</em> </td><td>If wxPG_FULL_VALUE is set, returns complete, storable value instead of displayable one (they may be different). If wxPG_COMPOSITE_FRAGMENT is set, text is interpreted as a part of composite property string value (as generated by <a class="el" href="classwxCustomProperty.htm#acfe4b715d33c4108540f61e43528256d" title="Returns text representation of property's value.">GetValueAsString()</a> called with this same flag).</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="remark"><dt><b>Remarks:</b></dt><dd><ul>
|
|
<li>Default implementation converts semicolon delimited tokens into child values. Only works for properties with children.</li>
|
|
<li>You might want to take into account that m_value is Null variant if property value is unspecified (which is usually only case if you explicitly enabled that sort behavior). </li>
|
|
</ul>
|
|
</dd></dl>
|
|
|
|
<p>Reimplemented from <a class="el" href="classwxPGProperty.htm#a974a9b01c1f88cf4db630b6895453db8">wxPGProperty</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
|
<li>props.h</li>
|
|
</ul>
|
|
</div>
|
|
<!--- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Enumerator</a></div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<hr class="footer"/><address style="text-align: right;"><small>Generated on Sun Aug 22 12:42:14 2010 for wxPropertyGrid by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
|
|
</body>
|
|
</html>
|