+ if ( !InSetValue() && m_processedDefault )
+ {
+ // Can generate a command
+ wxCommandEvent commandEvent(wxEVT_COMMAND_TEXT_UPDATED, GetId());
+ commandEvent.SetEventObject(this);
+ ProcessCommand(commandEvent);
+ }
+
+ // do it after the (user) event handlers processed the events because
+ // otherwise GetValue() would return incorrect (not yet updated value)
+ m_tempCallbackStruct = NULL;
+}
+
+// ----------------------------------------------------------------------------
+// helpers and Motif callbacks
+// ----------------------------------------------------------------------------
+
+static void MergeChangesIntoString(wxString& value,
+ XmTextVerifyCallbackStruct *cbs)
+{
+ /* _sm_
+ * At least on my system (SunOS 4.1.3 + Motif 1.2), you need to think of
+ * every event as a replace event. cbs->text->ptr gives the replacement
+ * text, cbs->startPos gives the index of the first char affected by the
+ * replace, and cbs->endPos gives the index one more than the last char
+ * affected by the replace (startPos == endPos implies an empty range).
+ * Hence, a deletion is represented by replacing all input text with a
+ * blank string ("", *not* NULL!). A simple insertion that does not
+ * overwrite any text has startPos == endPos.
+ */
+
+ if ( !value )
+ {
+ // easy case: the ol value was empty
+ value = cbs->text->ptr;
+ }
+ else
+ {
+ // merge the changes into the value
+ const char * const passwd = value;
+ int len = value.length();
+
+ len += strlen(cbs->text->ptr) + 1; // + new text (if any) + NUL
+ len -= cbs->endPos - cbs->startPos; // - text from affected region.