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.4 by nigel, 2002-05-30T12:50:21Z vs.
Revision 1.9 by nigel, 2003-04-01T01:56:41Z

# Line 33 | Line 33
33   #define DEBUG 0
34   #import <debug.h>
35  
36 + #import "misc_macosx.h"
37   #import "video_macosx.h"
38  
39   //
# Line 42 | Line 43
43   - (id) init
44   {
45   #ifdef ENABLE_MULTIPLE
46 <        emulators  = [[NSMutableArray alloc] init];
46 >        emulators  = [NSMutableArray new];
47   #endif
48          return [super init];
49   }
# Line 66 | 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 192 | 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 203 | 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 229 | 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 248 | Line 256
256                  [super sendEvent: event];
257   }
258  
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 +                                       withApplication: @"TextEdit"] )
272 +            InfoSheet(@"Cannot open HowTo.html with TextEdit", [theEmulator window]);
273 + }
274 +
275 + - (IBAction) HelpToDo: (id)sender
276 + {
277 +    NSString    *path = [[NSBundle mainBundle] pathForResource: @"ToDo"
278 +                                                        ofType: @"html"];
279 +
280 +    if ( ! path )
281 +        InfoSheet(@"Cannot find ToDo.html", [theEmulator window]);
282 +    else
283 +        if ( ! [[NSWorkspace sharedWorkspace] openFile: path
284 +                                       withApplication: @"TextEdit"] )
285 +            InfoSheet(@"Cannot open ToDo.html with TextEdit", [theEmulator window]);
286 + }
287 +
288 + - (IBAction) HelpVersions: (id)sender
289 + {
290 +    NSString    *path = [[NSBundle mainBundle] pathForResource: @"Versions"
291 +                                                        ofType: @"html"];
292 +
293 +    if ( ! path )
294 +        InfoSheet(@"Cannot find Versions.html", [theEmulator window]);
295 +    else
296 +        if ( ! [[NSWorkspace sharedWorkspace] openFile: path
297 +                                       withApplication: @"TextEdit"] )
298 +            InfoSheet(@"Cannot open Versions.html with TextEdit",
299 +                                                                                                [theEmulator window]);
300 + }
301 +
302 +
303 + // Menu items which for managing more than one window
304 +
305   #ifdef ENABLE_MULTIPLE
306  
307   - (IBAction) NewEmulator: (id)sender

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines