#include <fstream.h>
#include "wx/app.h"
+#include "wx/dc.h"
#include "wx/button.h"
#include "wx/panel.h"
#include "wx/textctrl.h"
+#include "wx/notebook.h"
+#include "wx/tabctrl.h"
#include "wx/settings.h"
#include "wx/filefn.h"
#include "wx/utils.h"
MacPreControlCreate( parent , id , "" , pos , mySize ,style, validator , name , &bounds , title ) ;
- m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , "\p" , true , 0 , 0 , 1,
+ m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , "\p" , false , 0 , 0 , 1,
( style & wxTE_PASSWORD ) ? kControlEditTextPasswordProc : kControlEditTextProc , (long) this ) ;
MacPostControlCreate() ;
else
value = st ;
UMASetControlData( m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , value.Length() , (char*) ((const char*)value) ) ;
- UMADrawControl( m_macControl ) ;
+ WindowRef window = GetMacRootWindow() ;
+ if ( window )
+ {
+ wxWindow* win = wxFindWinFromMacWindow( window ) ;
+ if ( win )
+ {
+ wxMacDrawingHelper help( win ) ;
+ // the mac control manager always assumes to have the origin at 0,0
+ SetOrigin( 0 , 0 ) ;
+
+ bool hasTabBehind = false ;
+ wxWindow* parent = GetParent() ;
+ while ( parent )
+ {
+ if( parent->MacGetWindowData() )
+ {
+ UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
+ break ;
+ }
+
+ if( parent->IsKindOf( CLASSINFO( wxNotebook ) ) || parent->IsKindOf( CLASSINFO( wxTabCtrl ) ))
+ {
+ if ( ((wxControl*)parent)->GetMacControl() )
+ SetUpControlBackground( ((wxControl*)parent)->GetMacControl() , -1 , true ) ;
+ break ;
+ }
+
+ parent = parent->GetParent() ;
+ }
+
+ UMADrawControl( m_macControl ) ;
+ UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
+ }
+ }
}
// Clipboard operations
UMAGetControlData( m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*) &teH , &size ) ;
TEFromScrap() ;
TEPaste( teH ) ;
- UMADrawControl( m_macControl ) ;
+ WindowRef window = GetMacRootWindow() ;
+ if ( window )
+ {
+ wxWindow* win = wxFindWinFromMacWindow( window ) ;
+ if ( win )
+ {
+ wxMacDrawingHelper help( win ) ;
+ // the mac control manager always assumes to have the origin at 0,0
+ SetOrigin( 0 , 0 ) ;
+
+ bool hasTabBehind = false ;
+ wxWindow* parent = GetParent() ;
+ while ( parent )
+ {
+ if( parent->MacGetWindowData() )
+ {
+ UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
+ break ;
+ }
+
+ if( parent->IsKindOf( CLASSINFO( wxNotebook ) ) || parent->IsKindOf( CLASSINFO( wxTabCtrl ) ))
+ {
+ if ( ((wxControl*)parent)->GetMacControl() )
+ SetUpControlBackground( ((wxControl*)parent)->GetMacControl() , -1 , true ) ;
+ break ;
+ }
+
+ parent = parent->GetParent() ;
+ }
+
+ UMADrawControl( m_macControl ) ;
+ UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
+ }
+ }
}
}
TESetSelect( from , to , teH ) ;
TEDelete( teH ) ;
TEInsert( value , value.Length() , teH ) ;
-// MacInvalidateControl() ;
+ Refresh() ;
}
void wxTextCtrl::Remove(long from, long to)
UMASetControlData( m_macControl , 0, kControlEditTextSelectionTag , sizeof( selection ) , (char*) &selection ) ;
UMAGetControlData( m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*) &teH , &size ) ;
TEDelete( teH ) ;
-// MacInvalidateControl() ;
+ Refresh() ;
}
void wxTextCtrl::SetSelection(long from, long to)