Beispiel #1
0
//__________________________________________________________________
void		_HYGraphicPane::DrawInfoBox (_HYRect theBox, _String boxName)
{
	long   stringWidth, 
		   avWidth = theBox.right-theBox.left-20;
		   
	theBox.width = 1;
	
	DrawRect (theBox);
	if (boxName.sLength)
	{
		stringWidth = GetVisibleStringWidth (boxName, font);
		while (stringWidth>avWidth && boxName.sLength)
		{
			boxName.Trim (0, boxName.sLength-2);
			stringWidth = GetVisibleStringWidth (boxName, font);
		}
		// measure string length
		_HYRect		textRect = theBox;
		textRect.left += 8;
		textRect.right = textRect.left+stringWidth+4;
		textRect.top-=6;
		textRect.bottom = textRect.top+9;
		EraseRect   (textRect);
		DisplayText (boxName, textRect.bottom, textRect.left+2, true);
	}
}
Beispiel #2
0
bool    PushFilePath (_String& pName, bool trim)
{
    char c = GetPlatformDirectoryChar();

    long    f = pName.FindBackwards(_String(c),0,-1);
    if (f>=0) {
        _String newP = pName.Cut(0,f);
        pathNames && & newP;
        if (trim)
            pName.Trim (f+1,-1);
        return true;
    } else if (pathNames.lLength) {
        pathNames && pathNames(pathNames.lLength-1);
    } else {
        pathNames && & empty;
    }

    return false;
}