|
|
| version 1.4, 2003/11/05 16:08:59 | version 1.5, 2003/11/05 16:15:44 |
|---|---|
| Line 113 static void openpopup(HIPoint location); | Line 113 static void openpopup(HIPoint location); |
| static void skinchange(void); | static void skinchange(void); |
| static DragReceiveHandlerUPP dr; | static DragReceiveHandlerUPP dr; |
| static bool isPUMA; | |
| // ---- | // ---- |
| static bool isPuma(void) { | static void checkOSVersion(void) { |
| long res; | long res; |
| Gestalt(gestaltSystemVersion, &res); | Gestalt(gestaltSystemVersion, &res); |
| if (res<0x1020) { | if (res<0x1020) { |
| return(true); | isPUMA = true; |
| } | |
| else { | |
| isPUMA = false; | |
| } | } |
| return(false); | |
| } | } |
| Line 609 static WindowRef makeNibWindow (IBNibRef | Line 613 static WindowRef makeNibWindow (IBNibRef |
| OSStatus err; | OSStatus err; |
| WindowRef win = NULL; | WindowRef win = NULL; |
| if (isPuma()) { | if (isPUMA) { |
| Rect bounds; | Rect bounds; |
| SetRect(&bounds, 0, 0, 100, 100); | SetRect(&bounds, 0, 0, 100, 100); |
| err = CreateNewWindow(kFloatingWindowClass, kWindowStandardHandlerAttribute, &bounds, &win); | err = CreateNewWindow(kFloatingWindowClass, kWindowStandardHandlerAttribute, &bounds, &win); |
| Line 793 void toolwin_open(void) { | Line 797 void toolwin_open(void) { |
| toolwin_close(); | toolwin_close(); |
| return; | return; |
| } | } |
| checkOSVersion(); | |
| ZeroMemory(&toolwin, sizeof(toolwin)); | ZeroMemory(&toolwin, sizeof(toolwin)); |
| hbmp = skinload(np2tool.skin, &bounds); | hbmp = skinload(np2tool.skin, &bounds); |
| Line 806 void toolwin_open(void) { | Line 812 void toolwin_open(void) { |
| goto twope_err2; | goto twope_err2; |
| } | } |
| if (isPuma()) { | if (isPUMA) { |
| toolwincreate(hWnd); | toolwincreate(hWnd); |
| } | } |
| SizeWindow(hWnd, bounds.right-bounds.left, bounds.bottom-bounds.top, true); | SizeWindow(hWnd, bounds.right-bounds.left, bounds.bottom-bounds.top, true); |
| Line 815 void toolwin_open(void) { | Line 821 void toolwin_open(void) { |
| info.u.picture = hbmp; | info.u.picture = hbmp; |
| 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); |
| if (!isPuma()) { | if (!isPUMA) { |
| toolwincreate(hWnd); | toolwincreate(hWnd); |
| } | } |
| if (isPuma()) { | if (isPUMA) { |
| if (np2tool.posy < 35) np2tool.posy = 35; | 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); |
| Line 845 twope_err1: | Line 851 twope_err1: |
| void toolwin_close(void) { | void toolwin_close(void) { |
| if (toolwin.hwnd) { | if (toolwin.hwnd) { |
| if (!isPuma()) { | if (isPUMA) { |
| CloseDrawer(toolwin.hwnd, 0); | HideWindow(toolwin.hwnd); |
| } | } |
| else{ | else { |
| DisposeWindow(toolwin.hwnd); | CloseDrawer(toolwin.hwnd, 0); |
| } | } |
| RemoveReceiveHandler(dr, toolwin.hwnd); | RemoveReceiveHandler(dr, toolwin.hwnd); |
| toolwindestroy(); | toolwindestroy(); |