Diff for /np2/macosx/toolwin.cpp between versions 1.13 and 1.14

version 1.13, 2003/11/24 20:44:14 version 1.14, 2003/11/27 16:25:42
Line 113  static const OSType subcommand[11] ={ '- Line 113  static const OSType subcommand[11] ={ '-
   
 #define BASENUMBER      4  #define BASENUMBER      4
 static const ControlID popup[2] = { {'pop1', 1}, {'pop2', 2} };  static const ControlID popup[2] = { {'pop1', 1}, {'pop2', 2} };
   static const ControlID imageid = {'back', 0};
   
 static DragReceiveHandlerUPP    dr;  static DragReceiveHandlerUPP    dr;
 static DragTrackingHandlerUPP   tr;  static DragTrackingHandlerUPP   tr;
Line 358  static pascal OSStatus cfControlproc(Eve Line 359  static pascal OSStatus cfControlproc(Eve
     return err;      return err;
 }  }
   
   static PixPatHandle     portpat;
   
   static void setDragColor(GrafPtr window) {
       GrafPtr             port;
       RGBColor    color;
       bool                portchanged;
       
       portchanged = QDSwapPort(window, &port);
       GetThemeBrushAsColor(kThemeBrushDragHilite, 32, true, &color);
       portpat = NewPixPat();
       MakeRGBPat(portpat, &color);
       PenPixPat(portpat);
       PenSize(3, 3);
       if (portchanged) QDSwapPort(port, NULL);
   }
   
 static void toolwincreate(WindowRef hWnd) {  static void toolwincreate(WindowRef hWnd) {
   
 const SUBITEM   *p;  const SUBITEM   *p;
Line 366  const SUBITEM *p; Line 383  const SUBITEM *p;
 const char              *cls;  const char              *cls;
         UInt32          style;          UInt32          style;
           
       setDragColor(GetWindowPort(hWnd));
       
     ControlButtonContentInfo    info;      ControlButtonContentInfo    info;
     info.contentType = kControlContentPictHandle;      info.contentType = kControlContentPictHandle;
     info.u.picture = NULL;      info.u.picture = NULL;
Line 465  static void toolwindestroy(void) { Line 484  static void toolwindestroy(void) {
                 DisposePixPat(toolwin.access[1]);                  DisposePixPat(toolwin.access[1]);
         KillPicture(toolwin.hbmp);          KillPicture(toolwin.hbmp);
         toolwin.hbmp = NULL;          toolwin.hbmp = NULL;
           DisposePixPat(portpat);
         }          }
 }  }
   
Line 692  static OSErr DragTracker (DragTrackingMe Line 712  static OSErr DragTracker (DragTrackingMe
     bool                portchanged = false;      bool                portchanged = false;
     static bool hilite = false;      static bool hilite = false;
     Rect                bounds;      Rect                bounds;
     Boolean             inframe = TRUE;      ControlRef  back;
           
     if (message == kDragTrackingEnterHandler || message == kDragTrackingLeaveHandler) {      if (message == kDragTrackingEnterHandler || message == kDragTrackingLeaveHandler) {
         hilite = false;          hilite = false;
Line 700  static OSErr DragTracker (DragTrackingMe Line 720  static OSErr DragTracker (DragTrackingMe
     }      }
     if (getFSSpecFromDragItem(theDrag, &aHFSFlavor) != noErr) {      if (getFSSpecFromDragItem(theDrag, &aHFSFlavor) != noErr) {
         if (hilite) {          if (hilite) {
             if (HideDragHilite(theDrag) == noErr) {              GetControlByID(theWindow, &imageid, &back);
                 hilite = false;              Draw1Control(back);
             }              hilite = false;
         }          }
         return (-1);          return (-1);
     }      }
Line 715  static OSErr DragTracker (DragTrackingMe Line 735  static OSErr DragTracker (DragTrackingMe
                     message = kDragTrackingLeaveWindow;                      message = kDragTrackingLeaveWindow;
                 }                  }
                 else {                  else {
                     rgn = NewRgn();  
                     GetControlByID(theWindow, &popup[drv], &targetControl);                      GetControlByID(theWindow, &popup[drv], &targetControl);
                     GetControlBounds(targetControl, &bounds);                      GetControlBounds(targetControl, &bounds);
                     RectRgn(rgn, &bounds);  
                     inframe = FALSE;  
                 }                  }
                 break;                  break;
                           
             case FTYPE_INI:              case FTYPE_INI:
             case FTYPE_THD:              case FTYPE_THD:
             case FTYPE_HDI:              case FTYPE_HDI:
                 rgn = NewRgn();  
                 GetWindowBounds(theWindow, kWindowContentRgn, &bounds);                  GetWindowBounds(theWindow, kWindowContentRgn, &bounds);
                 OffsetRect(&bounds, -bounds.left, -bounds.top);                  OffsetRect(&bounds, -bounds.left, -bounds.top);
                 RectRgn(rgn, &bounds);  
                 inframe = TRUE;  
                 break;                  break;
                           
             default:              default:
Line 740  static OSErr DragTracker (DragTrackingMe Line 754  static OSErr DragTracker (DragTrackingMe
           
     portchanged = QDSwapPort(GetWindowPort(theWindow), &port);      portchanged = QDSwapPort(GetWindowPort(theWindow), &port);
     if (message == kDragTrackingLeaveWindow && hilite) {      if (message == kDragTrackingLeaveWindow && hilite) {
         if (HideDragHilite(theDrag) == noErr) {          GetControlByID(theWindow, &imageid, &back);
             hilite = false;          Draw1Control(back);
         }          hilite = false;
     }      }
     else {      else {
         if (ShowDragHilite(theDrag, rgn, inframe) == noErr) {          rgn = NewRgn();
             hilite = true;          if (rgn) {
               RectRgn(rgn, &bounds);
               FrameRgn(rgn);
               DisposeRgn(rgn);
         }          }
           hilite = true;
     }      }
     if (portchanged) QDSwapPort(port, NULL);      if (portchanged) QDSwapPort(port, NULL);
     if (rgn) DisposeRgn(rgn);  
   
     return(noErr);      return(noErr);
 }  }
Line 759  static pascal OSErr DragReceiver( Window Line 776  static pascal OSErr DragReceiver( Window
 {  {
     SInt16              drv = -1;      SInt16              drv = -1;
         HFSFlavor aHFSFlavor;          HFSFlavor aHFSFlavor;
       ControlRef  back;
   
       GetControlByID(theWindow, &imageid, &back);
       Draw1Control(back);
   
     if (getFSSpecFromDragItem(theDrag, &aHFSFlavor) != noErr) {      if (getFSSpecFromDragItem(theDrag, &aHFSFlavor) != noErr) {
         return (-1);          return (-1);
Line 968  void toolwin_open(void) { Line 989  void toolwin_open(void) {
     info.contentType = kControlContentPictHandle;      info.contentType = kControlContentPictHandle;
     info.u.picture = hbmp;      info.u.picture = hbmp;
     CreatePictureControl(hWnd, &bounds, &info, true, &image);      CreatePictureControl(hWnd, &bounds, &info, true, &image);
       SetControlID(image, &imageid);
     InstallControlEventHandler (image, NewEventHandlerUPP(cfControlproc), GetEventTypeCount(list), list, (void *)hWnd, &ref);      InstallControlEventHandler (image, NewEventHandlerUPP(cfControlproc), GetEventTypeCount(list), list, (void *)hWnd, &ref);
     if (!isPUMA) {      if (!isPUMA) {
         toolwincreate(hWnd);          toolwincreate(hWnd);

Removed from v.1.13  
changed lines
  Added in v.1.14


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