cleaning up warnings, more common event code

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58092 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2009-01-14 13:56:05 +00:00
parent 17ad109b8b
commit ffad7b0dd2
8 changed files with 132 additions and 71 deletions

View File

@@ -53,12 +53,64 @@
WXCOCOAIMPL_COMMON_IMPLEMENTATION
- (id)initWithFrame:(NSRect)frame
{
[super initWithFrame:frame];
impl = NULL;
[self setDelegate: self];
[self setTarget: self];
// [self setAction: @selector(enterAction:)];
return self;
}
// use our common calls
- (void) setTitle:(NSString *) title
{
[self setStringValue: title];
}
/*
- (void)controlTextDidChange:(NSNotification *)aNotification
{
if ( impl )
{
wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
if ( wxpeer ) {
wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, wxpeer->GetId());
event.SetEventObject( wxpeer );
event.SetString( static_cast<wxTextCtrl*>(wxpeer)->GetValue() );
wxpeer->HandleWindowEvent( event );
}
}
}
- (void)controlTextDidEndEditing:(NSNotification *)aNotification
{
if ( impl )
{
wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
if ( wxpeer ) {
wxFocusEvent event(wxEVT_KILL_FOCUS, wxpeer->GetId());
event.SetEventObject( wxpeer );
event.SetWindow( wxpeer );
wxpeer->HandleWindowEvent( event );
}
}
}
- (void) enterAction: (id) sender
{
if ( impl )
{
wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
if ( wxpeer && (wxpeer->GetWindowStyle() & wxTE_PROCESS_ENTER) ) {
wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, wxpeer->GetId());
event.SetEventObject( wxpeer );
event.SetString( static_cast<wxTextCtrl*>(wxpeer)->GetValue() );
wxpeer->HandleWindowEvent( event );
}
}
}
*/
@end
wxNSTextFieldControl::wxNSTextFieldControl( wxTextCtrl *wxPeer, WXWidget w ) : wxWidgetCocoaImpl(wxPeer, w)