From 321267f659c2f11599269f99c151ee64b1423c74 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 2 Jan 2003 13:43:03 +0000 Subject: [PATCH] no_wrap implementation added, corrected rectangles, so that horizontal scrollbar does not have a gap at the left git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18503 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/textctrl.cpp | 7 ++++--- src/mac/textctrl.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp index cee43bf68b..f08f4e0ff7 100644 --- a/src/mac/carbon/textctrl.cpp +++ b/src/mac/carbon/textctrl.cpp @@ -216,7 +216,7 @@ static pascal void TPPaneDrawProc(ControlRef theControl, ControlPartCode thePart InvalWindowRect( GetControlOwner( theControl ) , &oldbounds ) ; SetRect(&varsp->fRFocusOutline, bounds.left, bounds.top, bounds.right, bounds.bottom); SetRect(&varsp->fRTextOutline, bounds.left, bounds.top, bounds.right, bounds.bottom); - SetRect(&varsp->fRTextArea, bounds.left + 2 , bounds.top + (varsp->fMultiline ? 0 : 2) , + SetRect(&varsp->fRTextArea, bounds.left + (varsp->fMultiline ? 0 : 2) , bounds.top + (varsp->fMultiline ? 0 : 2) , bounds.right - (varsp->fMultiline ? 0 : 2), bounds.bottom - (varsp->fMultiline ? 0 : 2)); RectRgn(varsp->fTextBackgroundRgn, &varsp->fRTextOutline); TXNSetFrameBounds( varsp->fTXNRec, varsp->fRTextArea.top, varsp->fRTextArea.left, @@ -527,7 +527,7 @@ OSStatus mUPOpenControl(ControlHandle theControl, long wxStyle ) GetControlBounds(theControl, &bounds); SetRect(&varsp->fRFocusOutline, bounds.left, bounds.top, bounds.right, bounds.bottom); SetRect(&varsp->fRTextOutline, bounds.left, bounds.top, bounds.right, bounds.bottom); - SetRect(&varsp->fRTextArea, bounds.left + 2 , bounds.top + (varsp->fMultiline ? 0 : 2) , + SetRect(&varsp->fRTextArea, bounds.left + (varsp->fMultiline ? 0 : 2) , bounds.top + (varsp->fMultiline ? 0 : 2) , bounds.right - (varsp->fMultiline ? 0 : 2), bounds.bottom - (varsp->fMultiline ? 0 : 2)); /* calculate the background region for the text. In this case, it's kindof and irregular region because we're setting the scroll bar a little ways inside @@ -550,7 +550,8 @@ OSStatus mUPOpenControl(ControlHandle theControl, long wxStyle ) frameOptions |= kTXNAlwaysWrapAtViewEdgeMask ; else { - frameOptions |= kTXNAlwaysWrapAtViewEdgeMask ; + // in case entry becomes impossible, remove the comment on the line below + // frameOptions |= kTXNAlwaysWrapAtViewEdgeMask ; frameOptions |= kTXNWantHScrollBarMask ; } diff --git a/src/mac/textctrl.cpp b/src/mac/textctrl.cpp index cee43bf68b..f08f4e0ff7 100644 --- a/src/mac/textctrl.cpp +++ b/src/mac/textctrl.cpp @@ -216,7 +216,7 @@ static pascal void TPPaneDrawProc(ControlRef theControl, ControlPartCode thePart InvalWindowRect( GetControlOwner( theControl ) , &oldbounds ) ; SetRect(&varsp->fRFocusOutline, bounds.left, bounds.top, bounds.right, bounds.bottom); SetRect(&varsp->fRTextOutline, bounds.left, bounds.top, bounds.right, bounds.bottom); - SetRect(&varsp->fRTextArea, bounds.left + 2 , bounds.top + (varsp->fMultiline ? 0 : 2) , + SetRect(&varsp->fRTextArea, bounds.left + (varsp->fMultiline ? 0 : 2) , bounds.top + (varsp->fMultiline ? 0 : 2) , bounds.right - (varsp->fMultiline ? 0 : 2), bounds.bottom - (varsp->fMultiline ? 0 : 2)); RectRgn(varsp->fTextBackgroundRgn, &varsp->fRTextOutline); TXNSetFrameBounds( varsp->fTXNRec, varsp->fRTextArea.top, varsp->fRTextArea.left, @@ -527,7 +527,7 @@ OSStatus mUPOpenControl(ControlHandle theControl, long wxStyle ) GetControlBounds(theControl, &bounds); SetRect(&varsp->fRFocusOutline, bounds.left, bounds.top, bounds.right, bounds.bottom); SetRect(&varsp->fRTextOutline, bounds.left, bounds.top, bounds.right, bounds.bottom); - SetRect(&varsp->fRTextArea, bounds.left + 2 , bounds.top + (varsp->fMultiline ? 0 : 2) , + SetRect(&varsp->fRTextArea, bounds.left + (varsp->fMultiline ? 0 : 2) , bounds.top + (varsp->fMultiline ? 0 : 2) , bounds.right - (varsp->fMultiline ? 0 : 2), bounds.bottom - (varsp->fMultiline ? 0 : 2)); /* calculate the background region for the text. In this case, it's kindof and irregular region because we're setting the scroll bar a little ways inside @@ -550,7 +550,8 @@ OSStatus mUPOpenControl(ControlHandle theControl, long wxStyle ) frameOptions |= kTXNAlwaysWrapAtViewEdgeMask ; else { - frameOptions |= kTXNAlwaysWrapAtViewEdgeMask ; + // in case entry becomes impossible, remove the comment on the line below + // frameOptions |= kTXNAlwaysWrapAtViewEdgeMask ; frameOptions |= kTXNWantHScrollBarMask ; }