Exemple #1
0
void _L1TXX( short xpos, short ypos, char _WCI86FAR * str,
/*========*/ struct xycoord _WCI86FAR * concat, struct xycoord _WCI86FAR * extent )

/*  Inquire the extents of the character drawing parallelogram and
    return the concatenation point. The concatenation point is the same
    as the drawing point if it cannot be calculated exactly.    */

{
    short               hor;        /* horizontal alignment */
    short               vert;       /* vertical alignment   */
    struct xycoord      up;         /* character up vector  */
    struct xycoord      base;       /* character base line vector   */
    struct xycoord      space;      /* spacing between characters   */
    struct xycoord      length;     /* horizontal side of parallelogram */
    struct xycoord      height;     /* vertical side of parallelogram   */
    struct xycoord      trans;      /* translation for parallelogram    */

    GetVectors( &base, &up );
    GetAlignment( &hor, &vert );
    CalcSpacing( &base, &up, &space );
    CalcSides( &length, &height, &base, &up, &space, str );
    CalcTranslation( &trans, &length, &height, &up, hor, vert );
    CalcCorners( extent, &length, &height, &trans, xpos, ypos );
    if( _TextSettings.txpath == _PATH_RIGHT ||
        _TextSettings.txpath == _PATH_LEFT ) {
        CalcConcat( concat, &length, &space, xpos, ypos, hor, vert );
    } else {
        CalcConcat( concat, &height, &space, xpos, ypos, hor, vert );
    }
}
Exemple #2
0
void _L1Text( short xpos, short ypos, char _WCI86FAR * str )
/*=====================================================

    Draw the character string pointed to by "str" at the position
    (xpos, ypos) using the current graphics text settings.  */

{
    short               hor;        /* horizontal alignment */
    short               vert;       /* vertical alignment   */
    struct xycoord      up;         /* character up vector  */
    struct xycoord      base;       /* character base line vector   */
    struct xycoord      prop;       /* adjustment vector for prop. font */
    struct xycoord      nommove;    /* nominal displacement vector  */
    struct xycoord      space;      /* spacing between characters   */
    struct xycoord      length;     /* horizontal side of parallelogram */
    struct xycoord      height;     /* vertical side of parallelogram   */
    struct xycoord      trans;      /* translation for parallelogram    */
    struct xycoord      corner[4];  /*  0 - lower left  */
                                    /*  1 - lower right */
                                    /*  2 - upper right */
                                    /*  3 - upper left  */
    if( *str == '\0' ) {
        _ErrorStatus = _GRNOOUTPUT;
        return;
    }
    if( _TextSettings.height == 0 || _TextSettings.width == 0 ) {
        _ErrorStatus = _GRNOOUTPUT;
        return;
    }
    GetVectors( &base, &up );
    GetAlignment( &hor, &vert );
    CalcSpacing( &base, &up, &space );
    CalcSides( &length, &height, &base, &up, &space, str );
    CalcTranslation( &trans, &length, &height, &up, hor, vert );
    CalcCorners( &corner, &length, &height, &trans, xpos, ypos );
    if( _TextSettings.txpath == _PATH_UP ) {    /* select proper corner for */
        xpos = corner[ 0 ].xcoord;              /* text starting position   */
        ypos = corner[ 0 ].ycoord;
    } else {
        xpos = corner[ _TextSettings.txpath ].xcoord;
        ypos = corner[ _TextSettings.txpath ].ycoord;
    }
    if( _TextSettings.txpath == _PATH_RIGHT ||
        _TextSettings.txpath == _PATH_LEFT ) {
        while( *str != '\0' ) {
            CalcNominal( &base, &up, &prop, &nommove, &space, *str );
            if( _TextSettings.txpath == _PATH_RIGHT ) {
                _HershDraw( *str, up.xcoord, -up.ycoord,
                            prop.xcoord, -prop.ycoord, xpos, ypos );
            } else {
                _HershDraw( *str, up.xcoord, -up.ycoord,
                            prop.xcoord, -prop.ycoord,
                            xpos-prop.xcoord, ypos+prop.ycoord );
            }
            xpos += nommove.xcoord;
            ypos -= nommove.ycoord;
            str++;
        }
    } else {                                        /* path is Up or DOWN   */
        if( _TextSettings.txpath == _PATH_DOWN ) {
            xpos -= up.xcoord;                      /* special increment*/
            ypos += up.ycoord;                      /* for path down    */
        }
        while( *str != '\0' ) {
            CalcNominal( &base, &up, &prop, &nommove, &space, *str );
            _HershDraw( *str, up.xcoord, -up.ycoord,
                        prop.xcoord, -prop.ycoord,
                        xpos + ( length.xcoord-prop.xcoord ) / 2,
                        ypos - ( length.ycoord-prop.ycoord ) / 2 );
            xpos += nommove.xcoord;
            ypos -= nommove.ycoord;
            str++;
        }
    }
    _RefreshWindow();
}
BOOL COptionSheet::OnInitDialog() 
{
	BOOL		result;
	CRect		rcClient;
	int			width;
	int			height;

	// Call the default behaviour
	CDialog::OnInitDialog();

	m_CurrentPage = NULL;

	// Create out button font
	if(NULL != m_Font.GetSafeHandle()) {
		m_Font.DeleteObject();
	}

	m_Font.Attach(GetStockObject(DEFAULT_GUI_FONT));

	// Set the icon
	if(m_psh.dwFlags & OSH_USEHICON && NULL != m_psh.hIcon) {
		SetIcon(m_psh.hIcon, FALSE);
	}

	// Calculate spacing needed by all items
	result = CalcSpacing(m_Font);
	if(FALSE == result) {
		ASSERT(0);
		DestroyWindow();
		return TRUE;
	}

	// Adjust our X position to compensate for the biggest child dialog
	width = m_MaxChildSize.cx;
	if(m_psh.dwFlags & OSH_WIZARDFULL) {
		width += (FULLPAGE_SPACING * 2);
	} else {
		width += (PAGE_SPACING * 2);
	}
	if(0 != m_ListWidth) {
		width += m_ListWidth + PAGE_SPACING;
	}

	if(width < m_AllButtonsWidth) {
		width = m_AllButtonsWidth;
	}

	width += m_XBorder;


	// Adjust our X position to compensate for the biggest child dialog
	height = m_YBorder + m_MaxChildSize.cy + m_ButtonSpacing;
	if(!(m_psh.dwFlags & OSH_WIZARDFULL)) {
		height += (PAGE_SPACING * 2);
	}
	
	// Set the new window position
	SetWindowPos(&wndTop,
				 0,
				 0,
				 width, 
				 height,
				 SWP_NOMOVE | SWP_NOZORDER);

	// Set the title
	if(0 != m_strCaption.GetLength()) {
		SetWindowText(m_strCaption);
	}


	// Add the buttons
	AddButtons();

	// IF we are not in wizard mode, select the first root tree item
	// otherwise, display the first page in the list.
	if(FALSE == IsWizardMode()) {
		CRect rect;
		// Select the default item
		BuildList();
		CalcTreeRect(rect);
		GetListControlWnd()->MoveWindow(rect);
	}

	SetActivePage(m_StartPageIndex);

	SetModified(FALSE);

	// We are done!
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}