const wxSize& size, long style ) ;
~wxMacMLTEClassicControl() ;
virtual void VisibilityChanged(bool shown) ;
+ virtual bool NeedsFocusRect() const;
protected :
OSStatus DoCreate();
public :
return ;
GetPeer()->SetStringValue(str) ;
+
+ wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId);
+ event.SetString( GetValue() ) ;
+ event.SetEventObject( this );
+ GetEventHandler()->ProcessEvent(event);
}
void wxTextCtrl::SetMaxLength(unsigned long len)
GetPeer()->Cut() ;
wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId);
- event.SetString( GetValue() ) ;
event.SetEventObject( this );
GetEventHandler()->ProcessEvent(event);
}
// eventually we should add setting the default style again
wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId);
- event.SetString( GetValue() ) ;
event.SetEventObject( this );
GetEventHandler()->ProcessEvent(event);
}
return ;
}
+ // Check if we have reached the max # of chars, but still allow navigation and deletion
+ if ( !IsMultiLine() && GetValue().Length() >= m_maxLength &&
+ key != WXK_LEFT && key != WXK_RIGHT && key != WXK_TAB &&
+ key != WXK_BACK && !( key == WXK_RETURN && (m_windowStyle & wxPROCESS_ENTER) )
+ )
+ {
+ // eat it, we don't want to add more than allowed # of characters
+ return;
+ }
+
// assume that any key not processed yet is going to modify the control
m_dirty = true;
key == WXK_BACK)
{
wxCommandEvent event1(wxEVT_COMMAND_TEXT_UPDATED, m_windowId);
- event1.SetString( GetValue() ) ;
event1.SetEventObject( this );
wxPostEvent(GetEventHandler(),event1);
}
fontStyle |= bold ;
if ( font.GetStyle() == wxITALIC )
fontStyle |= italic ;
-
+
typeAttr[attrCounter].tag = kTXNQDFontNameAttribute ;
typeAttr[attrCounter].size = kTXNQDFontNameAttributeSize ;
typeAttr[attrCounter].data.dataPtr = (void*) fontName ;
OSStatus MLTESetObjectVisibility( STPTextPaneVars *varsp, Boolean vis , long wxStyle)
{
OSStatus err = noErr ;
-#if TARGET_API_MAC_OSX
- TXNControlTag iControlTags[1] = { kTXNVisibilityTag };
- TXNControlData iControlData[1] = {{ vis }};
- err = ::TXNSetTXNObjectControls( varsp->fTXNRec, false, 1, iControlTags, iControlData );
-#endif
wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(varsp->fUserPaneRec);
- if ( vis && textctrl )
+ if ( textctrl )
{
+#if TARGET_API_MAC_OSX
+ TXNControlTag iControlTags[1] = { kTXNVisibilityTag };
+ TXNControlData iControlData[1] = {{ vis }};
+ err = ::TXNSetTXNObjectControls( varsp->fTXNRec, false, 1, iControlTags, iControlData );
+#endif
Rect bounds ;
UMAGetControlBoundsInWindowCoords( varsp->fUserPaneRec, &bounds);
TPCalculateBounds( varsp , bounds ) ;
- wxMacWindowClipper cl(textctrl) ;
- TXNSetFrameBounds( varsp->fTXNRec, varsp->fRTextArea.top, varsp->fRTextArea.left,
- varsp->fRTextArea.bottom, varsp->fRTextArea.right, varsp->fTXNFrame);
- TXNShowSelection( varsp->fTXNRec, kTXNShowStart);
+ if ( vis )
+ {
+ wxMacWindowClipper cl(textctrl) ;
+ TXNSetFrameBounds( varsp->fTXNRec, varsp->fRTextArea.top, varsp->fRTextArea.left,
+ varsp->fRTextArea.bottom, varsp->fRTextArea.right, varsp->fTXNFrame);
+ TXNShowSelection( varsp->fTXNRec, kTXNShowStart);
+ }
+ else
+ {
+#if TARGET_API_MAC_OSX
+ // in 10.2 the scrollbars are still actively redrawn when using only the code above
+ if ( UMAGetSystemVersion() < 0x1030 )
+ {
+ TXNSetFrameBounds( varsp->fTXNRec, varsp->fRTextArea.top + 20000 , varsp->fRTextArea.left + 20000 ,
+ varsp->fRTextArea.bottom + 20000 , varsp->fRTextArea.right + 20000 , varsp->fTXNFrame);
+
+ }
+#endif
+ }
}
return err ;
}
if (varsp->fFocusDrawState != (varsp->fIsActive && varsp->fInFocus))
{
varsp->fFocusDrawState = (varsp->fIsActive && varsp->fInFocus);
- DrawThemeFocusRect(&varsp->fRFocusOutline, varsp->fFocusDrawState);
+ // DrawThemeFocusRect(&varsp->fRFocusOutline, varsp->fFocusDrawState);
}
}
InvalWindowRect( GetControlOwner( m_controlRef ) , &((STPTextPaneVars *)m_macTXNvars)->fRBounds ) ;
}
+bool wxMacMLTEClassicControl::NeedsFocusRect() const
+{
+ return true;
+}
+
OSStatus wxMacMLTEClassicControl::DoCreate()
{
Rect bounds;