X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0f713d485bbee9a1a13440464b4139f08599b4ab..f357c0d42c17bf5be30e65e68cd99c474678da71:/src/stc/PlatWX.cpp diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index d918eab260..54ba588dd1 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -189,6 +189,9 @@ void Font::Create(const char *faceName, int characterSet, int size, bool bold, b false, stc2wx(faceName), encoding); +#ifdef __WXMAC__ + ((wxFont*)id)->SetNoAntiAliasing( true ) ; +#endif } @@ -289,7 +292,7 @@ void SurfaceImpl::Init() { hdc = new wxMemoryDC(); hdcOwned = true; #else - // On Mac and GTK(?) the DC is not really valid until it has a bitmap + // On Mac and GTK the DC is not really valid until it has a bitmap // selected into it. So instead of just creating the DC with no bitmap, // go ahead and give it one. InitPixMap(1,1,NULL); @@ -632,8 +635,12 @@ void Window::SetCursor(Cursor curs) { cursorId = wxCURSOR_ARROW; break; } - - GETWIN(id)->SetCursor(wxCursor(cursorId)); +#ifdef __WXMOTIF__ + wxCursor wc = wxStockCursor(cursorId) ; +#else + wxCursor wc = wxCursor(cursorId) ; +#endif + GETWIN(id)->SetCursor(wc); } @@ -646,16 +653,42 @@ void Window::SetTitle(const char *s) { // Helper classes for ListBox -// #undef wxSTC_USE_POPUP -// #define wxSTC_USE_POPUP 0 +#if 1 // defined(__WXMAC__) +class wxSTCListBoxWin : public wxListBox { +public: + wxSTCListBoxWin(wxWindow* parent, wxWindowID id) + : wxListBox(parent, id, wxDefaultPosition, wxSize(0,0), + 0, NULL, wxLB_SINGLE | wxSIMPLE_BORDER) { + SetCursor(wxCursor(wxCURSOR_ARROW)); + Hide(); + } + + void OnFocus(wxFocusEvent& event) { + GetParent()->SetFocus(); + event.Skip(); + } + + wxListBox* GetLB() { return this; } + +private: + DECLARE_EVENT_TABLE() +}; + + +BEGIN_EVENT_TABLE(wxSTCListBoxWin, wxListBox) + EVT_SET_FOCUS(wxSTCListBoxWin::OnFocus) +END_EVENT_TABLE() + + + +#else -// A wxListBox that gives focus back to its parent if it gets it. class wxSTCListBox : public wxListBox { public: wxSTCListBox(wxWindow* parent, wxWindowID id) : wxListBox(parent, id, wxDefaultPosition, wxDefaultSize, - 0, NULL, wxLB_SINGLE | wxSIMPLE_BORDER) + 0, NULL, wxLB_SINGLE | wxSIMPLE_BORDER | wxWANTS_CHARS) {} void OnKeyDown(wxKeyEvent& event) { @@ -675,6 +708,9 @@ END_EVENT_TABLE() +#undef wxSTC_USE_POPUP +#define wxSTC_USE_POPUP 0 // wxPopupWindow just doesn't work well in this case... + // A window to place the listbox upon. If wxPopupWindow is supported then // that will be used so the listbox can extend beyond the client area of the // wxSTC if needed. @@ -694,7 +730,7 @@ public: lb = new wxSTCListBox(this, id); lb->SetCursor(wxCursor(wxCURSOR_ARROW)); lb->SetFocus(); - } + } void OnSize(wxSizeEvent& event) { lb->SetSize(GetSize()); @@ -722,7 +758,7 @@ private: BEGIN_EVENT_TABLE(wxSTCListBoxWin, wxSTCListBoxWinBase) EVT_SIZE(wxSTCListBoxWin::OnSize) END_EVENT_TABLE() - +#endif inline wxListBox* GETLB(WindowID win) { return (((wxSTCListBoxWin*)win)->GetLB()); @@ -771,7 +807,7 @@ void ListBox::Clear() { } void ListBox::Append(char *s) { - GETLB(id)->Append(s); + GETLB(id)->Append(stc2wx(s)); } int ListBox::Length() { @@ -784,7 +820,7 @@ void ListBox::Select(int n) { if (n > 4) n = n - 4; else - n = 1; + n = 0; GETLB(id)->SetFirstItem(n); #endif } @@ -873,6 +909,15 @@ long Platform::SendScintilla(WindowID w, return stc->SendMsg(msg, wParam, lParam); } +long Platform::SendScintillaPointer(WindowID w, + unsigned int msg, + unsigned long wParam, + void *lParam) { + + wxStyledTextCtrl* stc = (wxStyledTextCtrl*)w; + return stc->SendMsg(msg, wParam, (long)lParam); +} + // These are utility functions not really tied to a platform