Example #1
0
/***********************************************************************
 *
 * FUNCTION:    PrvTimeZoneListDrawItem
 *
 * DESCRIPTION: Draw the itemNum item of the time zone list. Used as draw
 *		callback routine for the time zone list object.
 *
 * PARAMETERS:
 *		itemNum		 ->	what item to draw
 *		bounds		 ->	rectangle to draw into 
 *		itemsText	 ->	ptr to array of TimeZoneEntryType records.
 *
 * RETURNED: nothing	
 *
 * HISTORY:
 *		03/07/00	peter	initial revision
 *		07/31/00	kwk	Modified to use TimeZoneEntryType records.
 *
 ***********************************************************************/
static void PrvTimeZoneListDrawItem(Int16 itemNum, RectanglePtr bounds, Char** itemsText)
{
	const TimeZoneEntryType* tzList = (const TimeZoneEntryType*)itemsText;
	Char gmtOffset[maxGmtOffsetLength + 1];
	
	// Skip to appropriate item to draw.
	tzList += itemNum;
	
	// Draw the name left-justified, and truncated.
	// DOLATER kwk - should we worry about the text in ZeroTimeZoneOffsetString
	// being wider than gmtOffsetColumnWidth?
	WinDrawTruncChars(tzList->tzName,
							StrLen(tzList->tzName),
							bounds->topLeft.x + descriptionColumnOffset,
							bounds->topLeft.y,
							usableListWidth - descriptionColumnOffset - gmtOffsetColumnWidth);
	
	// Draw the offset right-justified.
	if (tzList->tzOffset == 0)
	{
		SysCopyStringResource(gmtOffset, ZeroTimeZoneOffsetString);
	}
	else
	{
		PrvOffsetToString(gmtOffset, tzList->tzOffset);
	}
	
	WinDrawChars(	gmtOffset,
						StrLen(gmtOffset),
						bounds->topLeft.x + usableListWidth - gmtColumnOffset - FntCharsWidth(gmtOffset, StrLen(gmtOffset)),
						bounds->topLeft.y);
} // PrvTimeZoneListDrawItem
Example #2
0
static void ModuleNameDrawFunction(void* t, Int16 row, Int16 column, RectangleType* bounds)
{
    TableType* table = static_cast<TableType*>(t);
    const char* text = static_cast<const char*>(TblGetItemPtr(table, row, column));
    FontID oldFont = FntSetFont(stdFont);
    WinDrawTruncChars(text, StrLen(text), bounds->topLeft.x, bounds->topLeft.y, bounds->extent.x);
    FntSetFont(oldFont);
}
Example #3
0
static void MainFormDrawLookupStatus(AppContext* appContext, FormType* form)
{
    WinPushDrawState();
    SetGlobalBackColor(appContext);
    UInt16 statusBarStartY=appContext->screenHeight-lookupStatusBarHeight;
    ClearRectangle(0, statusBarStartY, appContext->screenWidth, lookupStatusBarHeight);
    WinDrawLine(0, statusBarStartY-3, appContext->screenWidth, statusBarStartY-3);
    const char* text=GetConnectionStatusText(appContext);
    Assert(text);
    UInt16 textLen=StrLen(text);    
    WinDrawTruncChars(text, textLen, 1, statusBarStartY+1, appContext->screenWidth - 14);
    WinPopDrawState();
}