X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a236aa2058ccf3d36e9cafc20fa7375080c4be50..fc32630a5e03e60a67d4ef53fc59985ea087b451:/src/motif/combobox_native.cpp diff --git a/src/motif/combobox_native.cpp b/src/motif/combobox_native.cpp index 959b1581ae..af01743d78 100644 --- a/src/motif/combobox_native.cpp +++ b/src/motif/combobox_native.cpp @@ -169,15 +169,6 @@ void wxComboBox::DoSetSize(int x, int y, int width, int WXUNUSED(height), int si wxWindow::DoSetSize(x, y, width, DoGetBestSize().y, sizeFlags); } -wxString wxComboBox::GetValue() const -{ - char* s = XmTextGetString (GetXmText (this)); - wxString str(s); - if (s) - XtFree (s); - return str; -} - void wxComboBox::SetString(unsigned int n, const wxString& s) { wxXmString text(s); @@ -235,7 +226,7 @@ void wxComboBox::DoDeleteOneItem(unsigned int n) AdjustDropDownListSize(); } -void wxComboBox::DoClear() +void wxComboBox::Clear() { #ifdef LESSTIF_VERSION XmListDeleteAllItems (GetXmList(this)); @@ -246,9 +237,10 @@ void wxComboBox::DoClear() } #endif - wxControlWithItems::DoClear(); m_noStrings = 0; AdjustDropDownListSize(); + + wxTextEntry::Clear(); } void wxComboBox::SetSelection (int n) @@ -271,7 +263,7 @@ void wxComboBox::SetSelection (int n) m_inSetSelection = false; } -int wxComboBox::GetSelection (void) const +int wxComboBox::GetSelection() const { return wxDoGetSelectionInList( GetXmList( this ) ); } @@ -288,69 +280,6 @@ int wxComboBox::FindString(const wxString& s, bool WXUNUSED(bCase)) const return wxDoFindStringInList( GetXmList( this ), s ); } -// Clipboard operations -void wxComboBox::Copy() -{ - XmTextCopy( GetXmText(this), CurrentTime ); -} - -void wxComboBox::Cut() -{ - XmTextCut( GetXmText(this), CurrentTime ); -} - -void wxComboBox::Paste() -{ - XmTextPaste( GetXmText(this) ); -} - -void wxComboBox::SetEditable(bool WXUNUSED(editable)) -{ - // TODO -} - -void wxComboBox::SetInsertionPoint(long pos) -{ - XmTextSetInsertionPosition( GetXmText(this), (XmTextPosition)pos ); -} - -void wxComboBox::SetInsertionPointEnd() -{ - SetInsertionPoint( GetLastPosition() ); -} - -long wxComboBox::GetInsertionPoint() const -{ - return (long)XmTextGetInsertionPosition( GetXmText(this) ); -} - -wxTextPos wxComboBox::GetLastPosition() const -{ - XmTextPosition pos = XmTextGetLastPosition( GetXmText(this) ); - return (long)pos; -} - -void wxComboBox::Replace(long from, long to, const wxString& value) -{ - XmTextReplace( GetXmText(this), (XmTextPosition)from, (XmTextPosition)to, - value.char_str() ); -} - -void wxComboBox::Remove(long from, long to) -{ - SetSelection( from, to ); - XmTextRemove( GetXmText(this) ); -} - -void wxComboBox::SetSelection(long from, long to) -{ - if( to == -1 ) - to = GetLastPosition(); - - XmTextSetSelection( GetXmText(this), (XmTextPosition)from, - (XmTextPosition)to, (Time)0 ); -} - void wxComboBoxCallback (Widget WXUNUSED(w), XtPointer clientData, XmComboBoxCallbackStruct * cbs) { @@ -377,7 +306,7 @@ void wxComboBoxCallback (Widget WXUNUSED(w), XtPointer clientData, event.SetClientData( item->GetClientData(idx) ); event.SetExtraLong(true); event.SetEventObject(item); - item->GetEventHandler()->ProcessEvent(event); + item->HandleWindowEvent(event); break; } case XmCR_VALUE_CHANGED: @@ -387,7 +316,7 @@ void wxComboBoxCallback (Widget WXUNUSED(w), XtPointer clientData, event.SetString( item->GetValue() ); event.SetExtraLong(true); event.SetEventObject(item); - item->GetEventHandler()->ProcessEvent(event); + item->HandleWindowEvent(event); break; } default: @@ -446,6 +375,11 @@ wxSize wxComboBox::DoGetBestSize() const return wxWindow::DoGetBestSize(); } +WXWidget wxComboBox::GetTextWidget() const +{ + return (WXWidget)GetXmText(this); +} + #endif // XmVersion >= 2000 #endif // wxUSE_COMBOBOX