Diff for /np2/macosx/toolwin.cpp between versions 1.2 and 1.3

version 1.2, 2003/11/03 17:36:24 version 1.3, 2003/11/05 15:12:17
Line 12 Line 12
 #include        "soundmng.h"  #include        "soundmng.h"
 #include        "fdefine.h"  #include        "fdefine.h"
   
   //for 10.2
   //#define       JAGUAR
   
 enum {  enum {
         IDC_TOOLHDDACC                  = 0,          IDC_TOOLHDDACC                  = 0,
         IDC_TOOLFDD1ACC,          IDC_TOOLFDD1ACC,
Line 441  static void toolwindestroy(void) { Line 444  static void toolwindestroy(void) {
 static pascal OSStatus cfWinproc(EventHandlerCallRef myHandler, EventRef event, void* userData) {  static pascal OSStatus cfWinproc(EventHandlerCallRef myHandler, EventRef event, void* userData) {
     OSStatus    err = eventNotHandledErr;      OSStatus    err = eventNotHandledErr;
     HICommand   cmd;      HICommand   cmd;
       ControlRef  sub;
       int                 i;
   
     if (GetEventClass(event)==kEventClassCommand && GetEventKind(event)==kEventCommandProcess ) {      if (GetEventClass(event)==kEventClassCommand && GetEventKind(event)==kEventCommandProcess ) {
         GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &cmd);          GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &cmd);
Line 497  static pascal OSStatus cfWinproc(EventHa Line 502  static pascal OSStatus cfWinproc(EventHa
                 err=noErr;                  err=noErr;
                 break;                  break;
                                   
               case kEventWindowDrawContent:
               case kEventWindowShown:
                   for (i=0; i<IDC_MAXITEMS; i++) {
                       sub = toolwin.sub[i];
                       if (sub) {
                           Draw1Control(sub);
                       }
                   }
                   break;
   
                   
             default:              default:
                 break;                  break;
         }          }
Line 584  static pascal OSErr DragReceiver( Window Line 600  static pascal OSErr DragReceiver( Window
 static WindowRef makeNibWindow (IBNibRef nibRef) {  static WindowRef makeNibWindow (IBNibRef nibRef) {
     OSStatus    err;      OSStatus    err;
     WindowRef   win = NULL;      WindowRef   win = NULL;
 #if 0  #ifndef JAGUAR
     Rect        bounds;      Rect        bounds;
     SetRect(&bounds, 0, 0, 100, 100);      SetRect(&bounds, 0, 0, 100, 100);
     err = CreateNewWindow(kOverlayWindowClass, kWindowStandardHandlerAttribute, &bounds, &win);      err = CreateNewWindow(kFloatingWindowClass, kWindowStandardHandlerAttribute, &bounds, &win);
 #else  #else
     err = CreateWindowFromNib(nibRef, CFSTR("ToolWindow"), &win);      err = CreateWindowFromNib(nibRef, CFSTR("ToolWindow"), &win);
 #endif  #endif
     if (err == noErr) {      if (err == noErr) {
           InstallStandardEventHandler(GetWindowEventTarget(win));
         EventTypeSpec   list[]={           EventTypeSpec   list[]={ 
             { kEventClassCommand, kEventCommandProcess },              { kEventClassCommand, kEventCommandProcess },
             { kEventClassWindow, kEventWindowClose },               { kEventClassWindow, kEventWindowClose }, 
               { kEventClassWindow, kEventWindowShown }, 
               { kEventClassWindow, kEventWindowDrawContent }, 
         };          };
         EventHandlerRef ref;          EventHandlerRef ref;
         InstallWindowEventHandler (win, NewEventHandlerUPP(cfWinproc), GetEventTypeCount(list), list, (void *)win, &ref);          InstallWindowEventHandler (win, NewEventHandlerUPP(cfWinproc), GetEventTypeCount(list), list, (void *)win, &ref);
Line 777  void toolwin_open(void) { Line 796  void toolwin_open(void) {
                 goto twope_err2;                  goto twope_err2;
         }          }
           
   #ifndef JAGUAR
       toolwincreate(hWnd);
   #endif
     SizeWindow(hWnd, bounds.right-bounds.left, bounds.bottom-bounds.top, true);      SizeWindow(hWnd, bounds.right-bounds.left, bounds.bottom-bounds.top, true);
     ControlButtonContentInfo    info;      ControlButtonContentInfo    info;
     info.contentType = kControlContentPictHandle;      info.contentType = kControlContentPictHandle;
Line 784  void toolwin_open(void) { Line 806  void toolwin_open(void) {
     CreatePictureControl(hWnd, &bounds, &info, true, &image);      CreatePictureControl(hWnd, &bounds, &info, true, &image);
     InstallControlEventHandler (image, NewEventHandlerUPP(cfControlproc), GetEventTypeCount(list), list, (void *)hWnd, &ref);      InstallControlEventHandler (image, NewEventHandlerUPP(cfControlproc), GetEventTypeCount(list), list, (void *)hWnd, &ref);
   
   #ifdef JAGUAR
     toolwincreate(hWnd);      toolwincreate(hWnd);
   #endif
   
 #if 0  #ifndef JAGUAR
     if (np2tool.posy < 30) np2tool.posy = 30;      if (np2tool.posy < 35) np2tool.posy = 35;
     if (np2tool.posx < 5 ) np2tool.posx = 5;      if (np2tool.posx < 5 ) np2tool.posx = 5;
     MoveWindow(hWnd, np2tool.posx, np2tool.posy, true);      MoveWindow(hWnd, np2tool.posx, np2tool.posy, true);
     ShowWindow(hWnd);      ShowWindow(hWnd);
Line 811  twope_err1: Line 835  twope_err1:
 void toolwin_close(void) {  void toolwin_close(void) {
   
     if (toolwin.hwnd) {      if (toolwin.hwnd) {
   #ifdef JAGUAR
         CloseDrawer(toolwin.hwnd, 0);          CloseDrawer(toolwin.hwnd, 0);
   #else
           DisposeWindow(toolwin.hwnd);
   #endif
         RemoveReceiveHandler(dr, toolwin.hwnd);          RemoveReceiveHandler(dr, toolwin.hwnd);
         toolwindestroy();          toolwindestroy();
         DisposeWindow(toolwin.hwnd);          DisposeWindow(toolwin.hwnd);

Removed from v.1.2  
changed lines
  Added in v.1.3


RetroPC.NET-CVS <cvs@retropc.net>