X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b5f62a0b2db198609b45dec622a018dae37008e..2ad50cc75b44bdb79c3c1a031e1a548d0fa5bfb9:/src/mac/listbox.cpp?ds=sidebyside diff --git a/src/mac/listbox.cpp b/src/mac/listbox.cpp index 343420363c..be7155a4d0 100644 --- a/src/mac/listbox.cpp +++ b/src/mac/listbox.cpp @@ -181,7 +181,9 @@ static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect } extern "C" void MacDrawStringCell(Rect *cellRect, Cell lCell, ListHandle theList, long refCon) ; +// resources ldef ids const short kwxMacListWithVerticalScrollbar = 128 ; +const short kwxMacListWithVerticalAndHorizontalScrollbar = 129 ; // ============================================================================ // list box control implementation @@ -238,7 +240,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, Size asize; - CreateListBoxControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, false, 0, 1, false, true, + CreateListBoxControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, false, 0, 1, (style & wxLB_HSCROLL), true, kwxMacListItemHeight, kwxMacListItemHeight, false, &listDef, (ControlRef *)&m_macControl ); GetControlData( (ControlHandle) m_macControl, kControlNoPart, kControlListBoxListHandleTag, @@ -252,8 +254,8 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, long result ; wxStAppResource resload ; m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , - kwxMacListWithVerticalScrollbar , 0 , 0, - kControlListBoxProc , (long) this ) ; + (style & wxLB_HSCROLL) ? kwxMacListWithVerticalAndHorizontalScrollbar : kwxMacListWithVerticalScrollbar , + 0 , 0, kControlListBoxProc , (long) this ) ; ::GetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlListBoxListHandleTag , sizeof( ListHandle ) , (char*) &m_macList , &result ) ; @@ -650,7 +652,6 @@ wxSize wxListBox::DoGetBestSize() const { wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef) MacGetRootWindow() ) ) ; - Rect drawRect ; wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ; @@ -939,7 +940,7 @@ void wxListBox::MacDoDoubleClick() void wxListBox::OnChar(wxKeyEvent& event) { - if ( event.KeyCode() == WXK_RETURN || event.KeyCode() == WXK_NUMPAD_ENTER) + if ( event.GetKeyCode() == WXK_RETURN || event.GetKeyCode() == WXK_NUMPAD_ENTER) { wxWindow* parent = GetParent() ; while( parent && !parent->IsTopLevel() && parent->GetDefaultItem() == NULL ) @@ -960,14 +961,14 @@ void wxListBox::OnChar(wxKeyEvent& event) event.Skip() ; } /* generate wxID_CANCEL if command-. or has been pressed (typically in dialogs) */ - else if (event.KeyCode() == WXK_ESCAPE || (event.KeyCode() == '.' && event.MetaDown() ) ) + else if (event.GetKeyCode() == WXK_ESCAPE || (event.GetKeyCode() == '.' && event.MetaDown() ) ) { wxWindow* win = GetParent()->FindWindow( wxID_CANCEL ) ; wxCommandEvent new_event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL); new_event.SetEventObject( win ); win->GetEventHandler()->ProcessEvent( new_event ); } - else if ( event.KeyCode() == WXK_TAB ) + else if ( event.GetKeyCode() == WXK_TAB ) { wxNavigationKeyEvent new_event; new_event.SetEventObject( this ); @@ -978,7 +979,7 @@ void wxListBox::OnChar(wxKeyEvent& event) if ( !GetEventHandler()->ProcessEvent( new_event ) ) event.Skip() ; } - else if ( event.KeyCode() == WXK_DOWN || event.KeyCode() == WXK_UP ) + else if ( event.GetKeyCode() == WXK_DOWN || event.GetKeyCode() == WXK_UP ) { // perform the default key handling first wxControl::OnKeyDown( event ) ; @@ -1013,7 +1014,7 @@ void wxListBox::OnChar(wxKeyEvent& event) m_typeIn = "" ; } m_lastTypeIn = event.GetTimestamp() ; - m_typeIn += (char) event.KeyCode() ; + m_typeIn += (char) event.GetKeyCode() ; int line = FindString("*"+m_typeIn+"*") ; if ( line >= 0 ) {