eudora-mac/taskProgress.c

1 line
43 KiB
C
Raw Permalink Normal View History

2018-05-23 09:59:15 +00:00
/* Copyright (c) 2017, Computer History Museum All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Computer History Museum nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* File: taskProgress.c Author: Clarence Wong <cwong@qualcomm.com> Date: Augutst 1997 - ... Copyright (c) 1997 by QUALCOMM Incorporated Comments: Much of this code is borrowed from Alan Bird's stationerywin.c and Steve Dorner's progress.c */ #include "taskProgress.h" #include "task_ldef.h" // Task Progress controls enum { kNetworkPopup=0, kFilterButton, kStopButton, kHelpButton, }; #define FILE_NUM 104 #pragma segment TaskProgressWindow static ControlHandle FilterButton = nil; /************************************************************************ * prototypes ************************************************************************/ static void TPDoDidResize(MyWindowPtr win, Rect *oldContR); static void TPDoZoomSize(MyWindowPtr win,Rect *zoom); static void TPDoUpdate(MyWindowPtr win); static void TPDoActivate(MyWindowPtr win); static Boolean TPDoClose(MyWindowPtr win); static void TPDoButton(MyWindowPtr win,ControlHandle button,long modifiers,short part); static void TPDoClick(MyWindowPtr win,EventRecord *event); static void TPDoCursor(Point mouse); static Boolean TPDoKey(MyWindowPtr win, EventRecord *event); static void TPDoShowHelp(MyWindowPtr win,Point mouse); static Boolean TPPosition(Boolean save, MyWindowPtr win); static void TPIdle(MyWindowPtr win); UPtr GetNextCheckTime (UPtr item); UPtr GetLastCheckTime (UPtr item); static void DrawTPProgress(MyWindowPtr win, Rect *lRect,Handle data); static void DrawTPFilter(MyWindowPtr win, Rect *lRect,Handle data); static void DrawTPError(MyWindowPtr win, Rect *lRect,Handle data); static void PositionAllCells(void); static void SetTPWTitle(void); static pascal void FooterUserPaneBackground (ControlHandle control, ControlBackgroundPtr info); static pascal void SetWindowBackground (ControlHandle control, ControlBackgroundPtr info); OSErr TPAddHelpButton(taskErrHandle taskErrs); #define kListInset 10 #define kTextInset 10 #define kCellIndent 4 #define PROG_BAR_WI 100 #define PROG_TOTAL_HI ((PROG_BOX_HI * 3) + INSET + (2*kCellIndent)) #define kRemainWidth 40 #define kLastMailCheckWidth 140 #define kNextMailCheckWidth 145 #define kNextTimeRefCon 'tpnx' #define kLastTimeRefCon 'tpls' #define kFooterRefCon 'tpft' #define kNetworkRefCon 'tpnc' #define kListPaneRefCon 'tplp' #define kNetworkWidth 24 #define kNetworkHeight 20 #define PROG_WI (GetRLong(PROG_CONT_WIDTH) + (2*kListInset)) ListHandle TaskListHandle = nil; taskErr