void cSettingsDialog::OnInit() { int iDPI = GetDPI(); LOG<<"DPI="<<iDPI<<std::endl; // Add controls lineHistory.Create(*this, TEXT("History")); historyStaticClearFolders.Create(*this, TEXT("Clear Previous Folders:")); buttonHistoryClearFolders.Create(*this, 102, TEXT("Clear")); historyStaticClearCache.Create(*this, TEXT("Clear Cache:")); buttonHistoryClearCache.Create(*this, 103, TEXT("Clear")); historyStaticCacheSize.Create(*this, TEXT("Cache Size:")); historyCacheMaximumSizeGB.Create(*this, 105, 1, 20, 1); historyCacheMaximumSizeGB.SetValue(int(settings.GetMaximumCacheSizeGB())); historyStaticGB.Create(*this, TEXT("GB")); // Add horizontal line horizontalLine.Create(*this); // Add standard buttons buttonOk.CreateOk(*this, TEXT("Ok")); buttonCancel.CreateCancel(*this); LayoutAndSetWindowSize(); // Make sure our controls start in the correct state EnableControls(); }
void AbstractRenderView::initializeForFirstPaint() { if (m_onFirstPaintInitialized) { return; } m_onFirstPaintInitialized = true; // let the subclass create a context first initializeRenderContext(); auto updateRenWinDpi = [this] () -> void { auto renWin = renderWindow(); auto nativeParent = nativeParentWidget(); if (!renWin || !nativeParent) { return; } const auto dpi = static_cast<int>(nativeParent->windowHandle()->screen()->logicalDotsPerInch()); if (dpi != renWin->GetDPI()) { renWin->SetDPI(dpi); } }; if (auto nativeParent = nativeParentWidget()) { connect(nativeParent->windowHandle(), &QWindow::screenChanged, updateRenWinDpi); } updateRenWinDpi(); }
ImagemapFilterOptions ImagemapDlg::GetOptions() { //This variable will hold the imagemap filter options to return. Base these options //on the options we were given ImagemapFilterOptions ifoGet=ms_Options; //Get the map name ifoGet.m_strName=GetStringGadgetValue(_R(IDC_IMAGEMAP_MAPNAME)); //Get the "Approximate curves with lines" drop down box switch (GetSelectedValueIndex(_R(IDC_IMAGEMAP_APPROX))) { case 0: ifoGet.m_ffApprox=FF_VERYCLOSELY; break; case 1: ifoGet.m_ffApprox=FF_CLOSELY; break; case 2: ifoGet.m_ffApprox=FF_APPROXIMATELY; break; default: ERROR3("ImagemapDlg::GetOptions - invalid flattening factor"); case 3: ifoGet.m_ffApprox=FF_NOTATALL; break; } //Get the Area For Imagemap radio buttons if (GetLongGadgetValue(_R(IDC_IMAGEMAP_AREA_SELECTION), 0, 1)==1) ifoGet.m_stExportArea=SELECTION; else ifoGet.m_stExportArea=DRAWING; //Get the DPI from the Width and Height and the Area For Imagemap ifoGet.m_dDPI=GetDPI(ifoGet.m_stExportArea); //Get the "save clickable areas as rectangles" ifoGet.m_fAllRectangles=(GetLongGadgetValue(_R(IDC_IMAGEMAP_ALLRECTANGLES), 0, 1)==1); //Get the "copy imagemap to clipboard" ifoGet.m_fClipboard=(GetLongGadgetValue(_R(IDC_IMAGEMAP_CLIPBOARD), 0 ,1)==1); //And return our new set of imagemap options return ifoGet; }
/******************************************************************************************** > virtual BOOL MakeBitmapExportOptions::SetAsDefaults() const Author: Colin_Barfoot (Xara Group Ltd) <*****@*****.**> Created: 29/10/96 Purpose: Provides additional implementation to set GIF specific info as defaults See Also: BitmapExportInfo::SetAsDefaults() ********************************************************************************************/ BOOL MakeBitmapExportOptions::SetAsDefaults() const { BOOL ok = FALSE; if (MaskedFilterExportOptions::SetAsDefaults()) { g_Dpi = GetDPI(); g_Depth = GetDepth(); g_Dither = GetDither(); g_TranspBkGnd = WantTransparent(); ok = TRUE; } return ok; }
int TBSystem::GetPixelsPerLine() { return 40 * GetDPI() / 96; }
int TBSystem::GetPanThreshold() { return 5 * GetDPI() / 96; }
DPoint Service::CalcTextSize(RefPtr<Pango::Layout> lay) { return CalcAbsSizes(lay, GetDPI(trkLay)); }
int TBSystem::GetPixelsPerLine() { // TODO: Move to CVar return 40 * GetDPI() / 96; }
int TBSystem::GetPanThreshold() { // TODO: Move to CVar return 5 * GetDPI() / 96; }
qreal Theme::mmToPixel(qreal mm) const { return mm*GetDPI()/25.4; }
// only for touch platforms int TBSystem::GetPanThreshold() { // FIXME! // (probably not necessary, only for touch platforms...) return 5 * GetDPI() / 96; }