|
|
| version 1.13, 2003/11/24 20:44:14 | version 1.15, 2004/01/05 01:53:34 |
|---|---|
| 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 191 static void setlist(ControlRef hwnd, con | Line 192 static void setlist(ControlRef hwnd, con |
| const char *q; | const char *q; |
| const char *p; | const char *p; |
| CFStringRef str; | CFStringRef str; |
| SInt32 attr = kMenuItemAttrIconDisabled; | |
| Str255 pname; | Str255 pname; |
| bool success = false; | bool success = false; |
| Line 209 const char *p; | Line 209 const char *p; |
| } | } |
| #endif | #endif |
| for (i=0; i<fdd->cnt; i++) { | for (i=0; i<fdd->cnt; i++) { |
| SInt32 attr = kMenuItemAttrIconDisabled; | |
| p = fdd->name[fdd->pos[i]]; | p = fdd->name[fdd->pos[i]]; |
| success = getLongFileName(cfname, p); | success = getLongFileName(cfname, p); |
| str = CFStringCreateWithCString(NULL, cfname, CFStringGetSystemEncoding()); | str = CFStringCreateWithCString(NULL, cfname, CFStringGetSystemEncoding()); |
| Line 238 const char *p; | Line 239 const char *p; |
| if (file_attr(p)==FILEATTR_ARCHIVE) { | if (file_attr(p)==FILEATTR_ARCHIVE) { |
| EnableMenuItem(menu, i+1); | EnableMenuItem(menu, i+1); |
| } | } |
| else { | |
| DisableMenuItem(menu, i+1); | |
| } | |
| } | } |
| p += sizeof(fdd->name[0]); | p += sizeof(fdd->name[0]); |
| } | } |
| Line 358 static pascal OSStatus cfControlproc(Eve | Line 362 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 386 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 487 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 715 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 723 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 738 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 757 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 779 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 992 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); |