这篇教程C++ ChooseFont函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ChooseFont函数的典型用法代码示例。如果您正苦于以下问题:C++ ChooseFont函数的具体用法?C++ ChooseFont怎么用?C++ ChooseFont使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ChooseFont函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: PDC_choose_a_new_fontint PDC_choose_a_new_font( void){ LOGFONT lf = PDC_get_logical_font( 0); CHOOSEFONT cf; int rval; extern HWND PDC_hWnd; lf.lfHeight = -PDC_font_size; debug_printf( "In PDC_choose_a_new_font: %d/n", lf.lfHeight); memset( &cf, 0, sizeof( CHOOSEFONT)); cf.lStructSize = sizeof( CHOOSEFONT); cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_SCREENFONTS; cf.hwndOwner = PDC_hWnd; cf.lpLogFont = &lf; cf.rgbColors = RGB( 0, 0, 0); rval = ChooseFont( &cf); if( rval)#ifdef PDC_WIDE// should this be _tcscpy() ??? wcscpy( PDC_font_name, lf.lfFaceName);#else strcpy( PDC_font_name, lf.lfFaceName);#endif debug_printf( "rval %d; %ld/n", rval, CommDlgExtendedError( )); debug_printf( "output size: %d/n", lf.lfHeight); PDC_font_size = -lf.lfHeight; return( rval);}
开发者ID:rexx-org,项目名称:PDCurses,代码行数:28,
示例2: ChooseMonoFont/* * ChooseMonoFont - allow the picking of a mono font */bool ChooseMonoFont( HWND hwnd ){ CHOOSEFONT cf; LOGFONT lf; HFONT font; memset( &cf, 0, sizeof( CHOOSEFONT ) ); lf = logFont; cf.lStructSize = sizeof( CHOOSEFONT ); cf.hwndOwner = hwnd; cf.lpLogFont = &lf; cf.Flags = CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT; if( !variableAllowed ) { cf.Flags |= CF_FIXEDPITCHONLY; } cf.nFontType = SCREEN_FONTTYPE; cf.rgbColors = RGB( 0, 0, 0 ); if( !ChooseFont( &cf ) ) { return( false ); } font = CreateFontIndirect( &lf ); if( font == NULL ) { return( false ); } DeleteObject( fixedFont ); logFont = lf; fixedFont = font; return( true );} /* ChooseMonoFont */
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:35,
示例3: sizeofvoid DesktopManager::ChoosePreviewWindowFont(HWND hDlg){ CHOOSEFONT cf; cf.lStructSize = sizeof(CHOOSEFONT); cf.hwndOwner = hDlg; cf.hDC = (HDC)NULL; cf.lpLogFont = &m_lfPreviewWindowFontInfo; cf.iPointSize = 0; cf.Flags = CF_SCREENFONTS | CF_EFFECTS | CF_FORCEFONTEXIST | CF_INITTOLOGFONTSTRUCT; cf.rgbColors = m_crPreviewWindowFontColor; cf.lCustData = 0; cf.lpfnHook = (LPCFHOOKPROC)NULL; cf.lpTemplateName = (LPTSTR)NULL; cf.hInstance = (HINSTANCE)vdWindow; cf.lpszStyle = (LPTSTR)NULL; cf.nFontType = SCREEN_FONTTYPE; cf.nSizeMin = 0; cf.nSizeMax = 0; if (ChooseFont(&cf)) { if (m_hPreviewWindowFont) DeleteObject(m_hPreviewWindowFont); m_hPreviewWindowFont = CreateFontIndirect(cf.lpLogFont); m_crPreviewWindowFontColor = cf.rgbColors; vdWindow.Refresh(); }}
开发者ID:HaijinW,项目名称:VirtualDimension,代码行数:31,
示例4: selectFontint selectFont(HWND hDlg, LOGFONT *lf){ COLORREF color=RGB(0, 0, 0); logmsg("SelectFont"); HDC hDC = GetDC(hDlg); CHOOSEFONT cf; ZeroMemory(&cf, sizeof(CHOOSEFONT)); cf.lStructSize = sizeof(cf); cf.hwndOwner = hDlg; cf.hDC = hDC; cf.lpLogFont = lf; cf.rgbColors = 0; cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_EFFECTS | CF_BOTH | CF_FORCEFONTEXIST; cf.nFontType = 0; cf.rgbColors=color; if (!ChooseFont(&cf)) { if (cf.hDC) DeleteDC(cf.hDC); ReleaseDC(hDlg, hDC); return 1; } if (cf.hDC) DeleteDC(cf.hDC); ReleaseDC(hDlg, hDC); return 0;}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:33,
示例5: CallChangeFont/*------------------------------------------------------------------------ Procedure: CallChangeFont ID:1 Purpose: Calls the standard windows font change dialog. If the user validates a font, it will destroy the current font, and recreate a new font with the given parameters. Input: The calling window handle Output: Zero if the user cancelled, 1 otherwise. Errors: None------------------------------------------------------------------------*/static int CallChangeFont(HWND hwnd){ LOGFONT lf; CHOOSEFONT cf; int r; HWND hwndChild; memset(&cf, 0, sizeof(CHOOSEFONT)); memcpy(&lf, &CurrentFont, sizeof(LOGFONT)); cf.lStructSize = sizeof(CHOOSEFONT); cf.hwndOwner = hwnd; cf.lpLogFont = &lf; cf.Flags = CF_SCREENFONTS | CF_EFFECTS | CF_APPLY | CF_INITTOLOGFONTSTRUCT; cf.nFontType = SCREEN_FONTTYPE; r = ChooseFont(&cf); if (!r) return (0); DeleteObject(ProgramParams.hFont); memcpy(&CurrentFont, &lf, sizeof(LOGFONT)); ProgramParams.hFont = CreateFontIndirect(&CurrentFont); strcpy(CurrentFontName, CurrentFont.lfFaceName); CurrentFontFamily = lf.lfPitchAndFamily; CurrentFontStyle = lf.lfWeight; hwndChild = (HWND) GetWindowLongPtr(hwndSession, DWLP_USER); SendMessage(hwndChild,WM_SETFONT,(WPARAM)ProgramParams.hFont,0); ForceRepaint(); return (1);}
开发者ID:retired-camels,项目名称:ocaml,代码行数:38,
示例6: sizeofvoid CTextInputCtrl::SetFont(HWND hwndParent){ CHOOSEFONT cf; LOGFONT lf = _lfCurrentFont; cf.lStructSize = sizeof(CHOOSEFONT); cf.hwndOwner = hwndParent; cf.lpLogFont = &lf; cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_SCREENFONTS; cf.rgbColors = RGB(0, 0, 0); cf.lCustData = 0; cf.lpfnHook = NULL; cf.lpTemplateName = NULL; cf.hInstance = NULL; cf.lpszStyle = NULL; cf.nFontType = SCREEN_FONTTYPE; cf.nSizeMin = 0; cf.nSizeMax = 0; if (ChooseFont(&cf)) { _lfCurrentFont = lf; // Level 2 Support SetCompositionFont(); InvalidateRect(_hwnd, NULL, TRUE); }}
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:30,
示例7: OpenFontDialogvoid OpenFontDialog(HWND hWnd){ HDC hDC = GetDC(hWnd); CHOOSEFONT chf; LOGFONT lf; HFONT hFontNormal = (HFONT)GetStockObject(DEFAULT_GUI_FONT); GetObject(hFontNormal, sizeof(lf), &lf); chf.hDC = CreateCompatibleDC(hDC); ReleaseDC(hLeftWindow, hDC); chf.lStructSize = sizeof (CHOOSEFONT); chf.hwndOwner = hWnd; chf.lpLogFont = &lf; chf.Flags = CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT | CF_LIMITSIZE; chf.rgbColors = RGB (0, 0, 0); chf.lCustData = 0; chf.hInstance = hInst; chf.lpszStyle = (LPTSTR)NULL; chf.nFontType = SCREEN_FONTTYPE; chf.nSizeMin = 0; chf.nSizeMax = 20; chf.lpfnHook = (LPCFHOOKPROC)(FARPROC)NULL; if (ChooseFont(&chf)) { HFONT hFont = CreateFontIndirect(&lf); SendMessage(hWnd, WM_SETFONT, (WPARAM) hFont, 0); }}
开发者ID:weimingtom,项目名称:twentylight,代码行数:27,
示例8: cmFonts//*************************************************************************// cmFonts -- use the Choose Fonts common dialog to get a new font spec// from the user. To do this, we fill out a CHOOSEFONTS structure and// pass it to the ChooseFonts routine. Windows 3.1 takes care of the rest!//*************************************************************************void cmFonts(HWND hWnd){ CHOOSEFONT CF; LOGFONT FontRec = MainFontRec; CF.lStructSize = sizeof(CF); CF.hwndOwner = hWnd; CF.Flags = CF_ANSIONLY | CF_TTONLY | CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT | CF_ENABLETEMPLATE; CF.nFontType = SCREEN_FONTTYPE; CF.lpLogFont = &FontRec; CF.nSizeMin = 20; CF.nSizeMax = 20; CF.lpTemplateName = "FontDlg"; CF.hInstance = hInst; if (ChooseFont(&CF)) { // Only get the font name, weight, and italics; // we don't care about size strcpy(MainFontRec.lfFaceName, FontRec.lfFaceName); MainFontRec.lfWeight = FontRec.lfWeight; MainFontRec.lfItalic = FontRec.lfItalic; InvalidateRect(hwnd, NULL, TRUE); }} // end of cmFonts()
开发者ID:LucasvBerkel,项目名称:TweedejaarsProject,代码行数:31,
示例9: DlgChooseFontint DlgChooseFont(HWND hwnd, char *fontName, int *fontHeight, int *fontWidth){ LOGFONT lf; CHOOSEFONT cf; memset(&lf,0,sizeof(LOGFONT)); if(fontHeight!=NULL) lf.lfHeight = *fontHeight; if(fontWidth!=NULL) lf.lfWidth = *fontWidth; if(fontName!=NULL) strcpy(lf.lfFaceName,fontName); memset(&cf,0,sizeof(CHOOSEFONT)); cf.lStructSize = sizeof(CHOOSEFONT); cf.hwndOwner = hwnd;// cf.hDC = NULL; cf.lpLogFont = &lf;// cf.iPointSize = 16;// cf.Flags = CF_ANSIONLY | CF_FORCEFONTEXIST ; cf.Flags = CF_ANSIONLY | CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT;// cf.rgbColors = RGB(0,0,0);// cf.lCustData = NULL;// cf.lpfnHook = NULL;// cf.lpTemplateName = NULL;// cf.hInstance = 0;// cf.lpszStyle = NULL; cf.nFontType = SCREEN_FONTTYPE;// cf.nSizeMin = 4;// cf.nSizeMax = 72; if(ChooseFont(&cf)!=TRUE) return -1; if(fontName!=NULL) strcpy(fontName,lf.lfFaceName); if(fontHeight!=NULL) *fontHeight = abs(lf.lfHeight); if(fontWidth!=NULL) *fontWidth = lf.lfWidth; return 0;}
开发者ID:Distrotech,项目名称:TiMidity,代码行数:35,
示例10: MyCreateFontHFONT FAR PASCAL MyCreateFont( void ) { CHOOSEFONT cf; LOGFONT lf; HFONT hfont; // Initialize members of the CHOOSEFONT structure. cf.lStructSize = sizeof(CHOOSEFONT); cf.hwndOwner = (HWND)NULL; cf.hDC = (HDC)NULL; cf.lpLogFont = &lf; cf.iPointSize = 0; cf.Flags = CF_SCREENFONTS | CF_FIXEDPITCHONLY; cf.rgbColors = RGB(0,0,0); cf.lCustData = 0L; cf.lpfnHook = (LPCFHOOKPROC)NULL; cf.lpTemplateName = (LPSTR)NULL; cf.hInstance = (HINSTANCE) NULL; cf.lpszStyle = (LPSTR)NULL; cf.nFontType = SCREEN_FONTTYPE; cf.nSizeMin = 0; cf.nSizeMax = 0; // Display the CHOOSEFONT common-dialog box. ChooseFont(&cf); // Create a logical font based on the user's // selection and return a handle identifying // that font. hfont = CreateFontIndirect(cf.lpLogFont); return (hfont); }
开发者ID:g8bpq,项目名称:BPQ32,代码行数:35,
示例11: memsetHFONT ringFont::Select(HWND hWnd/*=NULL*/){ CHOOSEFONT CF; memset(&CF,0,sizeof(CHOOSEFONT)); //LOGFONT FontRec = m_lpMainFontRec; CF.lStructSize = sizeof(CF); CF.hwndOwner = hWnd; CF.Flags = CF_ANSIONLY | CF_TTONLY | CF_SCREENFONTS | CF_EFFECTS | CF_INITTOLOGFONTSTRUCT;// | CF_ENABLETEMPLATE; CF.nFontType = SCREEN_FONTTYPE; CF.lpLogFont = &m_lpMainFontRec; CF.nSizeMin = 20; CF.nSizeMax = 20; CF.rgbColors = m_crColor; //CF.lpTemplateName = "FontDlg"; CF.hInstance = GetInstance(); if (ChooseFont(&CF)) { m_crColor = CF.rgbColors; if(m_font && !m_bExtern) DeleteObject(m_font); m_font = CreateFontIndirect(&m_lpMainFontRec); m_bExtern = FALSE; } return m_font;}
开发者ID:tianjigezhu,项目名称:UI-Library,代码行数:28,
示例12: changeFontvoid changeFont(HWND hwnd){ CHOOSEFONT cf; LOGFONT logfont; GetObject(hfDefault, sizeof(LOGFONT), &logfont); ZeroMemory(&cf, sizeof(cf)); cf.lStructSize = sizeof(CHOOSEFONT); cf.Flags = CF_EFFECTS | CF_INITTOLOGFONTSTRUCT | CF_SCREENFONTS; cf.hwndOwner = hwnd; cf.lpLogFont = &logfont; cf.rgbColors = textColour; if(ChooseFont(&cf)) { HFONT hfont = CreateFontIndirect(&logfont); textColour = cf.rgbColors; SendMessage(hEdit, WM_SETFONT, (WPARAM)hfont, MAKELPARAM(TRUE, 0)); DeleteObject(hfDefault); if(hfont) { hfDefault = hfont; } else { MessageBox(hwnd, "Failed to create font.", "Error", MB_OK | MB_ICONEXCLAMATION); } }}
开发者ID:REPOmAN2v2,项目名称:SimpleEditor,代码行数:28,
示例13: sizeofvoid OnScreenDisplayWnd::SelectFont(){ CHOOSEFONT cf; cf.lStructSize = sizeof(CHOOSEFONT); cf.hwndOwner = vdWindow; cf.hDC = (HDC)NULL; cf.lpLogFont = &m_lf; cf.iPointSize = 0; cf.Flags = CF_SCREENFONTS | CF_EFFECTS | CF_FORCEFONTEXIST | CF_INITTOLOGFONTSTRUCT; cf.rgbColors = m_fgColor; cf.lCustData = 0; cf.lpfnHook = (LPCFHOOKPROC)NULL; cf.lpTemplateName = (LPSTR)NULL; cf.hInstance = (HINSTANCE)vdWindow; cf.lpszStyle = (LPSTR)NULL; cf.nFontType = SCREEN_FONTTYPE; cf.nSizeMin = 0; cf.nSizeMax = 0; if (ChooseFont(&cf)) { if (m_font) DeleteObject(m_font); m_font = CreateFontIndirect(cf.lpLogFont); m_fgColor = cf.rgbColors; }}
开发者ID:Mrunali,项目名称:Virtual-Dimention,代码行数:29,
示例14: DisplayWindow_GetFontvoid CDisplayColoursDialog::OnChooseFont(){ HFONT hFont; DisplayWindow_GetFont(m_hPreviewDisplayWindow,reinterpret_cast<WPARAM>(&hFont)); LOGFONT lf; GetObject(hFont,sizeof(lf),reinterpret_cast<LPVOID>(&lf)); CHOOSEFONT cf; TCHAR szStyle[512]; cf.lStructSize = sizeof(cf); cf.hwndOwner = m_hDlg; cf.Flags = CF_FORCEFONTEXIST|CF_SCREENFONTS|CF_EFFECTS|CF_INITTOLOGFONTSTRUCT; cf.lpLogFont = &lf; cf.rgbColors = DisplayWindow_GetTextColor(m_hPreviewDisplayWindow); cf.lCustData = NULL; cf.lpszStyle = szStyle; BOOL res = ChooseFont(&cf); if(res) { /* TODO: This font must be freed. */ m_hDisplayFont = CreateFontIndirect(cf.lpLogFont); m_TextColor = cf.rgbColors; DisplayWindow_SetFont(m_hPreviewDisplayWindow,reinterpret_cast<WPARAM>(m_hDisplayFont)); DisplayWindow_SetTextColor(m_hPreviewDisplayWindow,m_TextColor); }}
开发者ID:3scp8,项目名称:explorerplusplus,代码行数:29,
示例15: win32_font_selectorvoid win32_font_selector (char *fontname, int flag){ CHOOSEFONT cf; /* info for font selection dialog */ ZeroMemory(&cf, sizeof cf); cf.lStructSize = sizeof cf; cf.Flags = CF_SCREENFONTS | CF_TTONLY | CF_LIMITSIZE | CF_INITTOLOGFONTSTRUCT | CF_NOSCRIPTSEL; if (flag == FIXED_FONT_SELECTION) { cf.Flags |= CF_FIXEDPITCHONLY; } cf.nSizeMin = 6; cf.nSizeMax = 24; fontspec_to_win32(&cf, fontname, flag); if (ChooseFont(&cf)) { winfont_to_fontspec(fontname, &cf); } else { /* signal cancellation */ *fontname = '/0'; } /* allocated via pango */ g_free(cf.lpLogFont); }
开发者ID:HelioGuilherme66,项目名称:gretl,代码行数:26,
示例16: SetViewColorvoidCSelectionView::AttachedToWindow(){ BView::AttachedToWindow(); SetViewColor(kB_GrayTable[6]); fCellView->AttachSelectionView(this); ChooseFont();} // AttachedToWindow
开发者ID:ModeenF,项目名称:OpenSumIt,代码行数:8,
示例17: GetFont//// Display the font-chooser dialog//BOOL GetFont(HWND hwndParent, LOGFONT *logfont){ CHOOSEFONT cf = { sizeof(cf) }; cf.hwndOwner = hwndParent; cf.lpLogFont = logfont; cf.Flags = CF_SCREENFONTS|CF_FORCEFONTEXIST|CF_INITTOLOGFONTSTRUCT; return ChooseFont(&cf);}
开发者ID:zie87,项目名称:sds,代码行数:13,
示例18: scaleresource_choosefontint scaleresource_choosefont (HWND hDlg, int fonttype){ CHOOSEFONT cf = { 0 }; LOGFONT lf = { 0 }; HDC hdc; TCHAR *fontname[2]; int *fontsize[2], *fontstyle[2], *fontweight[2]; int lm; fontname[0] = fontname_gui; fontname[1] = fontname_list; fontsize[0] = &fontsize_gui; fontsize[1] = &fontsize_list; fontstyle[0] = &fontstyle_gui; fontstyle[1] = &fontstyle_list; fontweight[0] = &fontweight_gui; fontweight[1] = &fontweight_list; cf.lStructSize = sizeof cf; cf.hwndOwner = hDlg; cf.Flags = CF_FORCEFONTEXIST | CF_INITTOLOGFONTSTRUCT | CF_NOSCRIPTSEL | CF_SCREENFONTS; cf.lpLogFont = &lf; cf.nFontType = REGULAR_FONTTYPE; cf.iPointSize = *fontsize[fonttype]; hdc = GetDC (NULL); lm = GetDeviceCaps (hdc, LOGPIXELSY); _tcscpy (lf.lfFaceName, fontname[fonttype]); lf.lfHeight = -MulDiv (*fontsize[fonttype], lm, 72); lf.lfWeight = *fontweight[fonttype]; lf.lfItalic = (*fontstyle[fonttype] & ITALIC_FONTTYPE) != 0; if (!ChooseFont (&cf)) { ReleaseDC (NULL, hdc); return 0; } _tcscpy (fontname[fonttype], lf.lfFaceName); *fontsize[fonttype] = lf.lfHeight; *fontsize[fonttype] = -MulDiv (*fontsize[fonttype], 72, GetDeviceCaps (hdc, LOGPIXELSY)); *fontstyle[fonttype] = lf.lfItalic ? ITALIC_FONTTYPE : 0; *fontweight[fonttype] = lf.lfWeight; ReleaseDC (NULL, hdc); regsetfont (NULL, fontprefix, fontreg[fonttype], fontname[fonttype], *fontsize[fonttype], *fontstyle[fonttype], *fontweight[fonttype]); openfont (true); return 1;}
开发者ID:Blonder,项目名称:WinUAE,代码行数:55,
示例19: OnChooseFontHRESULT OnChooseFont(HWND hwnd){ HRESULT hr = S_OK; LOGFONT logFont = g_logFont; CHOOSEFONT font = { 0 }; font.lStructSize = sizeof(font); font.hwndOwner = hwnd; font.lpLogFont = &logFont; font.iPointSize = static_cast<int>(g_fontSize * (720 / 96.0f)); // Don't show vertical fonts because we don't do vertical layout and don't show // bitmap fonts because DirectWrite doesn't support them. font.Flags = CF_SCREENFONTS | CF_SCALABLEONLY | CF_NOVERTFONTS | CF_INITTOLOGFONTSTRUCT; // Show the common font dialog box. if (ChooseFont(&font)) { // The lfFaceName might not be initialized if the user didn't select a face name. if (logFont.lfFaceName[0] == L'/0') memcpy(logFont.lfFaceName, g_logFont.lfFaceName, sizeof(logFont.lfFaceName)); float newFontSize = font.iPointSize * (96.0f / 720); // Map the Win32 font properties to an IDWriteTextFormat. IDWriteTextFormat* newTextFormat = NULL; HRESULT hr = CreateTextFormatFromLOGFONT(logFont, newFontSize, &newTextFormat); if (SUCCEEDED(hr)) { // Save the new font properties. g_logFont = logFont; g_fontSize = newFontSize; SafeAttach(&g_textFormat, SafeDetach(&newTextFormat)); if (g_renderer != NULL) { g_renderer->SetFormat(g_textFormat); } InvalidateRect(hwnd, NULL, TRUE); } SafeRelease(&newTextFormat); } // Potentially expected error, but not fatal, // so just do nothing. if (hr == DWRITE_E_NOFONT) hr = S_OK; return hr;}
开发者ID:AbdoSalem95,项目名称:WindowsSDK7-Samples,代码行数:54,
示例20: ZeroMemorybool ConfigPage::DoFontChooser(HWND hwndDlg){ CHOOSEFONT chooseFont; ZeroMemory(&chooseFont, sizeof(CHOOSEFONT)); chooseFont.lStructSize = sizeof(CHOOSEFONT); chooseFont.hwndOwner = hwndDlg; chooseFont.Flags = CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT | CF_NOSCRIPTSEL; chooseFont.lpLogFont = &newFont; return (ChooseFont(&chooseFont) == TRUE);}
开发者ID:Alim-Oezdemir,项目名称:emergedesktop,代码行数:12,
示例21: userPickFontstatic bool userPickFont( LOGFONT *l, HWND parent ){ CHOOSEFONT cf; memset( &cf, 0, sizeof( CHOOSEFONT ) ); cf.lStructSize = sizeof( CHOOSEFONT ); cf.hwndOwner = parent; cf.lpLogFont = l; cf.Flags = CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT; cf.rgbColors = RGB( 0, 0, 0 ); cf.nFontType = SCREEN_FONTTYPE; return( ChooseFont( &cf ) );}
开发者ID:bhanug,项目名称:open-watcom-v2,代码行数:15,
示例22: dbwFontChoose/*----------------------------------------------------------------------------- Name : dbwFontChoose Description : Chooses the current font using the ChooseFont dialog Inputs : .. Outputs : Set the dbwFontWidth and dbwFontHeight variables Return : ERROR if user cancelled or cannot select a font----------------------------------------------------------------------------*/sdword dbwFontChoose(void){ CHOOSEFONT chooseFont; chooseFont.lStructSize = sizeof(CHOOSEFONT); chooseFont.hwndOwner = hDebugWindow; chooseFont.hDC = NULL; //only used for printer fonts chooseFont.lpLogFont = &dbwLogicalFont; chooseFont.Flags = CF_FIXEDPITCHONLY | CF_LIMITSIZE | CF_SCREENFONTS; chooseFont.nSizeMin = DBW_FontPointsMin; chooseFont.nSizeMax = DBW_FontPointsMax; if (ChooseFont(&chooseFont) != TRUE) //select the font return(ERROR); return(OKAY);}
开发者ID:videogamepreservation,项目名称:homeworld,代码行数:23,
示例23: memsetvoid CMainFrame::OnSimulatorSetFont(){ CHOOSEFONT choiceFont; // Initialize the font structure: // memset(&choiceFont, 0, sizeof(choiceFont)); choiceFont.lStructSize = sizeof(choiceFont); choiceFont.hwndOwner = g_pView->m_hWnd ; LOGFONT lFont; CFont* cFont = g_pView->GetSpimFont(); cFont->GetLogFont(&lFont); choiceFont.lpLogFont = &lFont; choiceFont.Flags = CF_INITTOLOGFONTSTRUCT | CF_FIXEDPITCHONLY | CF_SCREENFONTS; if (ChooseFont(&choiceFont)) { g_pView->SetSpimFont(choiceFont.lpLogFont); }}
开发者ID:petru-dimitriu,项目名称:qtspim,代码行数:20,
示例24: ChooseFixedFont/* FUNCTION: ChooseFixedFont(HWND) PURPOSE: Changes the terminal font and appropriately resizes the window. PARAMETERS: hWnd - window handle of menu owner NOTE: There is a bug whereby when you choose the same font but set it to italic, it doesn't register the change.*/void ChooseFixedFont(HWND hWnd) { CHOOSEFONT cf = {0}; LOGFONT lf; lf = LFSCREENFONT(TermInfo); cf.lStructSize = sizeof(CHOOSEFONT); cf.hwndOwner = hWnd; cf.lpLogFont = &lf; cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_SCREENFONTS | CF_FIXEDPITCHONLY | CF_NOSCRIPTSEL; cf.rgbColors = FGCOLOUR(TermInfo); if (!ChooseFont(&cf)) { // We'll do something I'm sure! } InitNewFont(lf, cf.rgbColors); ResizeTerm(hWnd);}
开发者ID:AshuDassanRepo,项目名称:bcit-courses,代码行数:32,
|