inline void CXFont::ChangeWork() { if (!_hFont) { _hFont = CreatePointFont(_fontSize*10, _fontName); } }
void DialogUtil::SetHeaderFont( HWND hdlg, int nID ) { ASSERT( hdlg != nullptr ); HWND hControl = ::GetDlgItem( hdlg, nID ); ASSERT( hControl != nullptr ); // TODO: Fix font leak const int FONT_POINTS = 16; HFONT hfont = CreatePointFont( FONT_POINTS*10, "Arial Black" ); ::SendMessage( hControl, WM_SETFONT, (WPARAM)hfont, TRUE ); }
virtual void on_init() { try { static_api_ptr_t<columns_ui::control> ctrl; } catch (exception_service_not_found e) { MessageBox(core_api::get_main_window(), _T("You don't have (proper version of) Columns UI installed.\n") _T("foo_uie_explorer can only work with Columns UI.\n") _T("You have to activate Columns UI after you install it, too."), _T("foo_uie_explorer"), MB_ICONERROR); return; } catch (exception_service_duplicated e) {} globals::hSymbolFont = CreatePointFont(120, _T("Marlett")); }
BOOL CPPgWiz1Welcome::OnInitDialog() { CFont fontVerdanaBold; CreatePointFont(fontVerdanaBold, 12*10, _T("Verdana Bold")); LOGFONT lf; fontVerdanaBold.GetLogFont(&lf); lf.lfWeight = FW_BOLD; m_FontTitle.CreateFontIndirect(&lf); CStatic* pStatic = (CStatic*)GetDlgItem(IDC_WIZ1_TITLE); pStatic->SetFont(&m_FontTitle); CDlgPageWizard::OnInitDialog(); InitWindowStyles(this); GetDlgItem(IDC_WIZ1_TITLE)->SetWindowText(GetResString(IDS_WIZ1_WELCOME_TITLE)); GetDlgItem(IDC_WIZ1_ACTIONS)->SetWindowText(GetResString(IDS_WIZ1_WELCOME_ACTIONS)); GetDlgItem(IDC_WIZ1_BTN_HINT)->SetWindowText(GetResString(IDS_WIZ1_WELCOME_BTN_HINT)); return TRUE; }
ZFont::ZFont( zVIEW vSubtask, zCPCHAR cpcTag, zCPCHAR cpcFaceName, int nPtSize, CDC *pDC, zLONG lTextColor ) { #ifdef DEBUG_ALL TraceLineS( "ZFont ctor2: ", cpcTag ); #endif ZSubtask *pZSubtask; if ( GetWindowAndCtrl( &pZSubtask, 0, vSubtask, 0 ) == 0 && pZSubtask->m_pZPrintout && pZSubtask->m_pZPrintout->m_dHeight >= 0.1 && pZSubtask->m_pZPrintout->m_dHeight <= -0.1 ) { // Scale the font as specified in Zeidon.ini nPtSize = (int) ((double) nPtSize * pZSubtask->m_pZPrintout->m_dHeight); } CreatePointFont( nPtSize, cpcFaceName, pDC ); m_TagList.AddTail( cpcTag ); m_clrText = fnTranslateColor( lTextColor ); }
COScopeCtrl::COScopeCtrl(int NTrends) { int i; static const COLORREF PresetColor[16] = { RGB(0xFF, 0x00, 0x00), RGB(0xFF, 0xC0, 0xC0), RGB(0xFF, 0xFF, 0x00), RGB(0xFF, 0xA0, 0x00), RGB(0xA0, 0x60, 0x00), RGB(0x00, 0xFF, 0x00), RGB(0x00, 0xA0, 0x00), RGB(0x00, 0x00, 0xFF), RGB(0x00, 0xA0, 0xFF), RGB(0x00, 0xFF, 0xFF), RGB(0x00, 0xA0, 0xA0), RGB(0xC0, 0xC0, 0xFF), RGB(0xFF, 0x00, 0xFF), RGB(0xA0, 0x00, 0xA0), RGB(0xFF, 0xFF, 0xFF), RGB(0x80, 0x80, 0x80) }; // *) Using "Arial" or "MS Sans Serif" gives a more accurate small font, // but does not work for Korean fonts. // *) Using "MS Shell Dlg" gives somewhat less accurate small fonts, but // does work for all languages which are currently supported by šMule. // 8pt 'MS Shell Dlg' -- this shall be available on all Windows systems.. if (sm_fontAxis.m_hObject == NULL) { if (CreatePointFont(sm_fontAxis, 8*10, theApp.GetDefaultFontFaceName())) sm_fontAxis.GetLogFont(&sm_logFontAxis); else if (sm_logFontAxis.lfHeight == 0) { memset(&sm_logFontAxis, 0, sizeof sm_logFontAxis); sm_logFontAxis.lfHeight = 10; } } // since plotting is based on a LineTo for each new point // we need a starting point (i.e. a "previous" point) // use 0.0 as the default first point. // these are public member variables, and can be changed outside // (after construction). // G.Hayduk: NTrends is the number of trends that will be drawn on // the plot. First 15 plots have predefined colors, but others will // be drawn with white, unless you call SetPlotColor m_PlotData = new PlotData_t[NTrends]; m_NTrends = NTrends; for (i = 0; i < m_NTrends; i++) { if (i < 15) m_PlotData[i].crPlotColor = PresetColor[i]; // see also SetPlotColor else m_PlotData[i].crPlotColor = RGB(255, 255, 255); // see also SetPlotColor m_PlotData[i].penPlot.CreatePen(PS_SOLID, 0, m_PlotData[i].crPlotColor); m_PlotData[i].dPreviousPosition = 0.0; m_PlotData[i].nPrevY = -1; m_PlotData[i].dLowerLimit = -10.0; m_PlotData[i].dUpperLimit = 10.0; m_PlotData[i].dRange = m_PlotData[i].dUpperLimit - m_PlotData[i].dLowerLimit; m_PlotData[i].lstPoints.AddTail(0.0); // Initialize our new trend ratio variable to 1 m_PlotData[i].iTrendRatio = 1; m_PlotData[i].LegendLabel.Format(_T("Legend %i"),i); m_PlotData[i].BarsPlot = false; } // public variable for the number of decimal places on the y axis // G.Hayduk: I've deleted the possibility of changing this parameter // in SetRange, so change it after constructing the plot m_nYDecimals = 1; // set some initial values for the scaling until "SetRange" is called. // these are protected varaibles and must be set with SetRange // in order to ensure that m_dRange is updated accordingly // m_nShiftPixels determines how much the plot shifts (in terms of pixels) // with the addition of a new data point drawBars = false; autofitYscale = false; m_nShiftPixels = 1; m_nTrendPoints = 0; m_nMaxPointCnt = 1024; CustShift.m_nPointsToDo = 0; // G.Hayduk: actually I needed an OScopeCtrl to draw specific number of // data samples and stretch them on the plot ctrl. Now, OScopeCtrl has // two modes of operation: fixed Shift (when m_nTrendPoints=0, // m_nShiftPixels is in use), or fixed number of Points in the plot width // (when m_nTrendPoints>0) // When m_nTrendPoints>0, CustShift structure is in use // background, grid and data colors // these are public variables and can be set directly m_crBackColor = RGB(0, 0, 0); // see also SetBackgroundColor m_crGridColor = RGB(0, 255, 255); // see also SetGridColor // public member variables, can be set directly m_str.XUnits.Format(_T("Samples")); // can also be set with SetXUnits m_str.YUnits.Format(_T("Y units")); // can also be set with SetYUnits // G.Hayduk: configurable number of grids init // you are free to change those between contructing the object // and calling Create m_nXGrids = 6; m_nYGrids = 5; m_nTrendPoints = -1; m_nXPartial = 0; m_bDoUpdate = true; m_nRedrawTimer = 0; m_uLastMouseFlags = 0; m_ptLastMousePos.x = -1; m_ptLastMousePos.y = -1; ready = false; }