Exemplo n.º 1
0
/*============================================================================*/
	void MyFontDialog::
OnOK()                                                                  /*

	This member is caused to execute after the DoModal() member has
	terminated with the OK button activated. The action here is just to
	create the logfont form of the selected font.
*-----------------------------------------------------------------------------*/
{
	LOGFONT lf = GetLogFont();
	SetChoiceLogFont(lf);
}
Exemplo n.º 2
0
/*============================================================================*/
	void MyFontDialog::
Serialize(CArchive &ar)                                               	/*

        Called to serialize the current font dialog object to or deserialize it
	from the archive ar, depending on the sense of IsStoring().  Leaves the
	archive open for for further operations.
*-----------------------------------------------------------------------------*/
{
	  // perform loading or storing
        if (ar.IsStoring())
        {
		  // save the font as a LOGFONT
		LOGFONT lf = GetLogFont();
		ArchiveObject f(&lf, sizeof(LOGFONT));
        	ar << f;
		  // save m_tm
	 	ArchiveObject g(GetTextMetricPtr(), sizeof(TEXTMETRIC));
	 	ar << g;
   		  // save character height and width
		ar << GetAvgSize();
		  // save the font color
		ar << GetParameters().rgbColors;
	}
        else    // recovering
        {
                  // recover the font as LOGFONT
		LOGFONT lf;
		ArchiveObject f(&lf, sizeof(LOGFONT));
		ar >> f;
		CHOOSEFONT cf = GetParameters();
		cf.lpLogFont = &lf;
		SetParameters(cf);
		SetChoiceLogFont(lf);
		  // recover the text metrics
	 	ArchiveObject g(GetTextMetricPtr(), sizeof(TEXTMETRIC));
	 	ar >> g;
   		  // recover character height and width
		SIZE z;
		ar >> z;
		SetAvgSize(z);
		  // retrieve the font color
		COLORREF rgb;
		ar >> rgb;
		SetColor(rgb);
	}
}
Exemplo n.º 3
0
static void RedrawSampleFont(void)
{
  GetLogFont(NewLogFont);

#ifdef ENABLE_SDL
  // XXX
#else /* !ENABLE_SDL */
  NewFont.set(NewLogFont);
#endif /* !ENABLE_SDL */

  WndFrame *wp = (WndFrame *)wf->FindByName(_T("prpFontSample"));
  if (wp) {
    if (NewFont.defined()) {
      wp->SetFont(NewFont);
      wp->SetCaption(_("Sample Text\n123"));
    } else {
      wp->SetCaption(_("Font not found."));
    }
  }
}