X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/395480fb228a785148aac7d9a44261a487df13b1..024f89f972a6787e82d77fc5e5dac302a56abbb0:/src/mac/carbon/textctrl.cpp diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp index b48b9bf04c..92e971a019 100644 --- a/src/mac/carbon/textctrl.cpp +++ b/src/mac/carbon/textctrl.cpp @@ -300,6 +300,7 @@ public : const wxSize& size, long style ) ; ~wxMacMLTEClassicControl() ; virtual void VisibilityChanged(bool shown) ; + virtual bool NeedsFocusRect() const; protected : OSStatus DoCreate(); public : @@ -1199,7 +1200,7 @@ wxString wxMacUnicodeTextControl::GetStringValue() const wxMacCFStringHolder cf(value) ; result = cf.AsString() ; } -#if TARGET_API_MAC_OSX +#if '\n' == 10 wxMacConvertNewlines13To10( &result ) ; #else wxMacConvertNewlines10To13( &result ) ; @@ -1377,7 +1378,7 @@ wxString wxMacMLTEControl::GetStringValue() const } #endif } -#if TARGET_API_MAC_OSX +#if '\n' == 10 wxMacConvertNewlines13To10( &result ) ; #else wxMacConvertNewlines10To13( &result ) ; @@ -1838,7 +1839,7 @@ wxString wxMacMLTEControl::GetLineText(long lineNo) const currentHeight += lineHeight; } - Point thePoint = { firstPoint.v + Fix2Long(currentHeight), firstPoint.h + Fix2Long(0) }; + Point thePoint = { firstPoint.v + (currentHeight >> 16), firstPoint.h + (0) }; TXNOffset theOffset; TXNPointToOffset(m_txn, thePoint, &theOffset); @@ -1877,7 +1878,7 @@ int wxMacMLTEControl::GetLineLength(long lineNo) const currentHeight += lineHeight; } - Point thePoint = { firstPoint.v + Fix2Long(currentHeight), firstPoint.h + Fix2Long(0) }; + Point thePoint = { firstPoint.v + (currentHeight >> 16), firstPoint.h + (0) }; TXNOffset theOffset; TXNPointToOffset(m_txn, thePoint, &theOffset); @@ -2472,6 +2473,21 @@ OSStatus wxMacMLTEClassicControl::DoCreate() return err; } +// +// HACKHACK: (RN) +// Classic controls are not initially focused and +// smaller ones are focused badly with the focus rect +// this "fixes" the above issue - but there is probably a +// a better way. +// +// Still, on smaller text controls the focus rect is off +// + +bool wxMacMLTEClassicControl::NeedsFocusRect() const +{ + return m_windowStyle & wxNO_BORDER ? false : true; +} + // ---------------------------------------------------------------------------- // MLTE control implementation (OSX part) // ----------------------------------------------------------------------------