Пример #1
0
/* ==========                                                         */
static void PASCAL ChangeFont (void)

{
    SCREEN  *sp, *fsp;
    RECT    Rect;

    /*-loop through all the screens, resizing the vision that emacs has
       of them, processing the current ("first") screen last */
    InternalRequest = TRUE;
    fsp = first_screen;
    do {
	sp = first_screen;
	while (sp->s_next_screen != (SCREEN *)NULL) sp = sp->s_next_screen;
        select_screen (sp, FALSE);
        GetClientRect (sp->s_drvhandle, &Rect);
        newwidth (TRUE, DisplayableColumns (sp->s_drvhandle,
                                            Rect.right, &EmacsCM));
        newsize (TRUE, DisplayableRows (sp->s_drvhandle,
                                        Rect.bottom, &EmacsCM));
    } while (sp != fsp);
    InternalRequest = FALSE;

    /*-update the frame's client area and the MDIClient's size */
    InvalidateRect (hFrameWnd, NULL, TRUE);
    GetClientRect (hFrameWnd, &Rect);
    MoveWindow (hMDIClientWnd, 0, 0,
                Rect.right, Rect.bottom - EmacsCM.MLHeight,
                TRUE);
} /* ChangeFont */
Пример #2
0
BOOL FAR PASCAL ScrReSize (HWND hWnd, UINT wParam, WORD cx, WORD cy)

/* returns TRUE only if real resizing performed */
{
    BOOL    ChgWidth, ChgHeight;

    if ((wParam != SIZENORMAL) && (wParam != SIZEFULLSCREEN)) {
        return FALSE;
    }
    ChgWidth = (cx != GetWindowWord (hWnd, GWW_SCRCX));
    ChgHeight = (cy != GetWindowWord (hWnd, GWW_SCRCY));
    if (!ChgWidth && !ChgHeight) return FALSE;

    SetWindowWord (hWnd, GWW_SCRCX, cx);
    SetWindowWord (hWnd, GWW_SCRCY, cy);
    if (!InternalRequest) {
        SCREEN  *TopScreen;

        InternalRequest = TRUE;
        TopScreen = first_screen;
	select_screen ((SCREEN *)GetWindowLong (hWnd, GWL_SCRPTR), FALSE);
	if (ChgWidth) {
            newwidth (TRUE, DisplayableColumns (hWnd, cx, &EmacsCM));
        }
	if (ChgHeight) {
	    newsize (TRUE, DisplayableRows (hWnd, cy, &EmacsCM));
	}
	select_screen (TopScreen, FALSE);
	update (FALSE);
	InternalRequest = FALSE;
    }
    return TRUE;
} /* ScrReSize */
Пример #3
0
static void PASCAL UpdateMaxRowCol (HWND hDlg, HFONT hFont)
{
    CellMetrics cm;
    char    text[17];

    BuildCellMetrics (&cm, hFont);
    SetDlgItemText (hDlg, ID_MAXROWS,
		    itoa (DisplayableRows (hFrameWnd, -1, &cm), text, 10));
    SetDlgItemText (hDlg, ID_MAXCOLUMNS,
		    itoa (DisplayableColumns (hFrameWnd, -1, &cm), text, 10));
} /* UpdateMaxRowCol */