ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/MacOSX/Controller.mm
(Generate patch)

Comparing BasiliskII/src/MacOSX/Controller.mm (file contents):
Revision 1.6 by nigel, 2003-01-10T23:01:48Z vs.
Revision 1.11 by cebix, 2004-01-12T15:29:24Z

# Line 3 | Line 3
3   *
4   *      $Id$
5   *
6 < *  Basilisk II (C) 1997-2001 Christian Bauer
6 > *  Basilisk II (C) 1997-2004 Christian Bauer
7   *
8   *  This program is free software; you can redistribute it and/or modify
9   *  it under the terms of the GNU General Public License as published by
# Line 67 | Line 67
67  
68   - (void) sendEvent: (NSEvent *)event;
69   {
70 <        if ( [self isAnyEmulatorDisplayingSheets] || ! [self isAnyEmulatorRunning] )
70 >        if ( [self isAnyEmulatorDisplayingSheets] ||
71 >                        [[thePrefsEditor window] isVisible] || ! [self isAnyEmulatorRunning] )
72                  [super sendEvent: event];
73          else
74          {
# Line 107 | Line 108
108   //
109   //              switch ( NSRunAlertPanel(title, msg, def, alt, other, nil) )
110   //              {
111 < //                      case NSAlertDefault:   savePrefs();
112 < //                      case NSAlertAlternate: return NSTerminateNow;
113 < //                      case NSAlertOther:     return NSTerminateCancel;
111 > //                      case NSAlertDefault:    savePrefs();
112 > //                      case NSAlertAlternate:  return NSTerminateNow;
113 > //                      case NSAlertOther:              return NSTerminateCancel;
114   //              }
115   //      }
116  
# Line 193 | Line 194
194                                    type: (NSEventType)type                              
195   {
196          EmulatorView    *view;
197 +        BOOL                    fullScreen;
198  
199   #ifdef ENABLE_MULTIPLE
200          // We need to work out what window's Emulator should receive these messages
# Line 204 | Line 206
206          {
207                  theEmulator = [emulators objectAtIndex: tmp];
208                  view = [theEmulator screen];
209 +                fullScreen = [view isFullScreen];
210  
211                  if ( [theEmulator isRunning] &&
212 <                                ( [[theEmulator window] isMainWindow] || [view isFullScreen] ) )
212 >                                ( fullScreen || [[theEmulator window] isMainWindow] ) )
213                          break;
214          }
215          
216          if ( tmp < [emulators count] )          // i.e. if we exited the for loop
217   #else
218          view = [theEmulator screen];
219 +        fullScreen = [view isFullScreen];
220  
221          if ( [theEmulator isRunning] &&
222 <                                ( [[theEmulator window] isMainWindow] || [view isFullScreen] ) )
222 >                                ( fullScreen || [[theEmulator window] isMainWindow] ) )
223   #endif
224          {
225 <                if ( [view mouseInView: event] )
225 >                if ( fullScreen || [view mouseInView: event] )
226                  {
227                          switch ( type )
228                          {
# Line 230 | Line 234
234                                          break;
235                                  case NSLeftMouseDragged:
236                                  case NSMouseMoved:
237 <                                        [view processMouseMove: event];
237 >                                        if ( fullScreen )
238 >                                                [view fullscreenMouseMove];
239 >                                        else
240 >                                                [view processMouseMove: event];
241                                          break;
242                                  default:
243                                          [super sendEvent: event];               // NSApplication default
# Line 252 | Line 259
259  
260   // Methods to display documentation:
261  
262 + - (IBAction) HelpHowTo: (id)sender
263 + {
264 +        NSString        *path = [[NSBundle mainBundle] pathForResource: @"HowTo"
265 +                                                                                                                ofType: @"html"];
266 +
267 +        if ( ! path )
268 +                InfoSheet(@"Cannot find HowTo.html", [theEmulator window]);
269 +        else
270 +                if ( ! [[NSWorkspace sharedWorkspace] openFile: path] )
271 +                        InfoSheet(@"Cannot open HowTo.html with default app", [theEmulator window]);
272 + }
273 +
274   - (IBAction) HelpToDo: (id)sender
275   {
276 <    NSString    *path = [[NSBundle mainBundle] pathForResource: @"ToDo"
277 <                                                        ofType: @"html"];
276 >        NSString        *path = [[NSBundle mainBundle] pathForResource: @"ToDo"
277 >                                                                                                                ofType: @"html"];
278  
279 <    if ( ! path )
280 <        InfoSheet(@"Cannot find ToDo.html", [theEmulator window]);
281 <    else
282 <        if ( ! [[NSWorkspace sharedWorkspace] openFile: path
283 <                                       withApplication: @"TextEdit"] )
284 <            InfoSheet(@"Cannot open ToDo.html with TextEdit", [theEmulator window]);
279 >        if ( ! path )
280 >                InfoSheet(@"Cannot find ToDo.html", [theEmulator window]);
281 >        else
282 >                if ( ! [[NSWorkspace sharedWorkspace] openFile: path
283 >                                                                           withApplication: @"TextEdit"] )
284 >                        InfoSheet(@"Cannot open ToDo.html with TextEdit", [theEmulator window]);
285   }
286  
287   - (IBAction) HelpVersions: (id)sender
288   {
289 <    NSString    *path = [[NSBundle mainBundle] pathForResource: @"Versions"
290 <                                                        ofType: @"html"];
289 >        NSString        *path = [[NSBundle mainBundle] pathForResource: @"Versions"
290 >                                                                                                                ofType: @"html"];
291  
292 <    if ( ! path )
293 <        InfoSheet(@"Cannot find Versions.html", [theEmulator window]);
294 <    else
295 <        if ( ! [[NSWorkspace sharedWorkspace] openFile: path
296 <                                       withApplication: @"TextEdit"] )
297 <            InfoSheet(@"Cannot open Versions.html with TextEdit", [theEmulator window]);
292 >        if ( ! path )
293 >                InfoSheet(@"Cannot find Versions.html", [theEmulator window]);
294 >        else
295 >                if ( ! [[NSWorkspace sharedWorkspace] openFile: path
296 >                                                                           withApplication: @"TextEdit"] )
297 >                        InfoSheet(@"Cannot open Versions.html with TextEdit",
298 >                                                                                                [theEmulator window]);
299   }
300  
301  
# Line 377 | Line 397
397          return count;
398   }
399  
400 < @end
400 > @end

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines