]> git.saurik.com Git - wxWidgets.git/commitdiff
textctrl cleanup
authorStefan Csomor <csomor@advancedconcepts.ch>
Mon, 23 Mar 2009 15:32:34 +0000 (15:32 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Mon, 23 Mar 2009 15:32:34 +0000 (15:32 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59779 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/osx/cocoa/private.h
src/osx/cocoa/srchctrl.mm
src/osx/cocoa/textctrl.mm

index 3fa6846c6165b16ed687f3ec6c7a90de206139b5..18b35c9076e44fb611dbd3e9ab7d8dbc39899942 100644 (file)
@@ -246,11 +246,7 @@ protected :
 
     @interface wxNSTextField : NSTextField
     {
-        wxWidgetCocoaImpl* impl;
     }
-
-    - (void) setImplementation:(wxWidgetCocoaImpl*) item;
-    - (wxWidgetCocoaImpl*) implementation;
     @end
 
     @interface wxNSMenu : NSMenu
index 32d3514b3a5807245936bcba5e4a10c5bab3aa75..6b761d7f97c4939072cbe439e52ebb454e55723f 100644 (file)
@@ -57,6 +57,7 @@
 
 - (void) searchAction: (id) sender
 {
+    (void) sender;
     wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
     if ( impl )
     {
@@ -151,13 +152,13 @@ wxNSSearchFieldControl::~wxNSSearchFieldControl()
 }
 
 wxWidgetImplType* wxWidgetImpl::CreateSearchControl( wxTextCtrl* wxpeer, 
-                                    wxWindowMac* parent
-                                    wxWindowID id
+                                    wxWindowMac* WXUNUSED(parent)
+                                    wxWindowID WXUNUSED(id)
                                     const wxString& str,
                                     const wxPoint& pos, 
                                     const wxSize& size,
-                                    long style
-                                    long extraStyle)
+                                    long WXUNUSED(style)
+                                    long WXUNUSED(extraStyle))
 {
     NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
     wxNSSearchField* v = [[wxNSSearchField alloc] initWithFrame:r];
index fc2169099e6afa0ebdf4d8a0279ff42a26bb26c5..8ad2937d9771ee41ee3b8403a6ca9ba63ea2b47b 100644 (file)
 
 @interface wxNSSecureTextField : NSSecureTextField
 {
-    wxWidgetCocoaImpl* impl;
 }
-
-- (void) setImplementation:(wxWidgetCocoaImpl*) item;
-- (wxWidgetCocoaImpl*) implementation;
 @end
 
 @implementation wxNSSecureTextField 
     }
 }
 
-- (wxWidgetCocoaImpl*) implementation
-{
-    return impl;
-}
-
-- (void) setImplementation:(wxWidgetCocoaImpl*) item
-{
-    impl = item;
-}
-
 - (void)controlTextDidChange:(NSNotification *)aNotification
 {
+    wxUnusedVar(aNotification);
+    wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
     if ( impl )
     {
         wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
 
 @interface wxNSTextView : NSScrollView
 {
-    wxWidgetCocoaImpl* impl;
 }
 
-- (void) setImplementation:(wxWidgetCocoaImpl*) item;
-- (wxWidgetCocoaImpl*) implementation;
 @end
 
 @implementation wxNSTextView
     }
 }
 
-- (wxWidgetCocoaImpl*) implementation
-{
-    return impl;
-}
-
-- (void) setImplementation:(wxWidgetCocoaImpl*) item
-{
-    impl = item;
-}
-
-
 - (void)textDidChange:(NSNotification *)aNotification
 {
+    wxUnusedVar(aNotification);
+    wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
     if ( impl )
     {
         wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
 
 - (BOOL)textView:(NSTextView *)aTextView doCommandBySelector:(SEL)commandSelector
 {
+    wxUnusedVar(aTextView);
+    wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
     if ( impl  )
     {
         wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
     }
 }
 
-- (wxWidgetCocoaImpl*) implementation
-{
-    return impl;
-}
-
-- (void) setImplementation:(wxWidgetCocoaImpl*) item
-{
-    impl = item;
-}
-
 - (void) setEnabled:(BOOL) flag
 {
     [super setEnabled: flag];
 
 - (void)controlTextDidChange:(NSNotification *)aNotification
 {
+    wxUnusedVar(aNotification);
+    wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
     if ( impl )
     {
         wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
@@ -219,8 +189,11 @@ typedef BOOL (*wxOSX_insertNewlineHandlerPtr)(NSView* self, SEL _cmd, NSControl
 
 - (BOOL)control:(NSControl*)control textView:(NSTextView*)textView doCommandBySelector:(SEL)commandSelector
 {
+    wxUnusedVar(textView);
+    wxUnusedVar(control);
     if (commandSelector == @selector(insertNewline:))
     {
+        wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
         if ( impl  )
         {
             wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
@@ -258,7 +231,6 @@ typedef BOOL (*wxOSX_insertNewlineHandlerPtr)(NSView* self, SEL _cmd, NSControl
 wxNSTextViewControl::wxNSTextViewControl( wxTextCtrl *wxPeer, WXWidget w ) : wxWidgetCocoaImpl(wxPeer, w)
 {
     m_scrollView = (NSScrollView*) w;
-    [(wxNSTextField*)w setImplementation: this];
     
     [m_scrollView setHasVerticalScroller:YES];
     [m_scrollView setHasHorizontalScroller:NO];
@@ -439,7 +411,8 @@ void wxNSTextFieldControl::WriteText(const wxString& str)
     SetSelection(GetStringValue().length(), GetStringValue().length());
 }
 
-void wxNSTextFieldControl::controlAction(WXWidget slf, void* _cmd, void *sender)
+void wxNSTextFieldControl::controlAction(WXWidget WXUNUSED(slf), 
+    void* WXUNUSED(_cmd), void *WXUNUSED(sender))
 {
     wxWindow* wxpeer = (wxWindow*) GetWXPeer();
     if ( wxpeer && (wxpeer->GetWindowStyle() & wxTE_PROCESS_ENTER) ) 
@@ -456,26 +429,27 @@ void wxNSTextFieldControl::controlAction(WXWidget slf, void* _cmd, void *sender)
 //
 
 wxWidgetImplType* wxWidgetImpl::CreateTextControl( wxTextCtrl* wxpeer, 
-                                    wxWindowMac* parent
-                                    wxWindowID id
+                                    wxWindowMac* WXUNUSED(parent)
+                                    wxWindowID WXUNUSED(id)
                                     const wxString& str,
                                     const wxPoint& pos, 
                                     const wxSize& size,
                                     long style, 
-                                    long extraStyle)
+                                    long WXUNUSED(extraStyle))
 {
     NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
-    NSTextField* v = nil;
     wxWidgetCocoaImpl* c = NULL;
     
     if ( style & wxTE_MULTILINE || style & wxTE_RICH || style & wxTE_RICH2 )
     {
+        wxNSTextView* v = nil;
         v = [[wxNSTextView alloc] initWithFrame:r];
         c = new wxNSTextViewControl( wxpeer, v );
         static_cast<wxNSTextViewControl*>(c)->SetStringValue(str);
     }
     else 
     {
+        NSTextField* v = nil;
         if ( style & wxTE_PASSWORD )
             v = [[wxNSSecureTextField alloc] initWithFrame:r];
         else
@@ -491,7 +465,6 @@ wxWidgetImplType* wxWidgetImpl::CreateTextControl( wxTextCtrl* wxpeer,
         [v setBordered:NO];
         
         c = new wxNSTextFieldControl( wxpeer, v );
-        [v setImplementation: c];
         static_cast<wxNSTextFieldControl*>(c)->SetStringValue(str);
     }