Page 1 of 1
Impact of Video Settings
Posted: Thu Jan 21, 2016 9:17 am
by omni
Roger,
More and more users are adjusting their desktops to 1.25%. Also, some monitors, especially on windows 10, autoadjust to make text larger. Mine, for instance locks in at 175% and I cannot change it. But the font that is set up is very small if not adjusted to make the screens high graphics.
The impact is ugly. For both 1.9 and 2.0 the windows are perfect when opened at normal font. As the text size is modified by windows set up, the gets on rows are on top of the next @dcsay, if one exists that is close. (ie, like a city/state/zip line with descriptions).
Any thoughts on how to handle this? 1.9 and 2.0 display slightly differently on this issue but both have the same basic problem.
Thanks
Fred
omni
Re: Impact of Video Settings
Posted: Thu Jan 21, 2016 9:29 am
by Cliff Wiernik
I also have the problem when users do that. I have implemented my screen sizing using the method in xdemo where based on screen size, it sets some of the various parameters.
I am looking to the best way to address this. I don' t really know that I want the full autoresizing as in limited testing it has not worked completely and I would likely need to make some other changes. I have looked at the scale font samples, but want to know how to make the change from the xdemo approach to using scalefonts if that is the best way.
I know that in principle, if they set the fonts to 125%, then the application has to either undo the standard spacing to compensate for the change otherwise, gets don't fit within the box and says are too big.
But what is the best approach from the current starting point.
Re: Impact of Video Settings
Posted: Thu Jan 21, 2016 12:14 pm
by bwolfsohn
checking for 96dpi..
function issmallfonts(lDisplay)
*********************
// Pixels per inch if small or large font is active
#define SMALLFONT 96
#define LARGEFONT 120
// DeviceCap ID to retrieve device pix/inch attribute
#define LOGPIXELSX 88
#define LOGPIXELSY 90
LOCAL oDesktop := AppDesktop()
LOCAL hWND
LOCAL hDC
LOCAL nLogPix,cMsg
default lDisplay:=.f.
IF(ValType(oDesktop)!="O" .AND. !oDesktop:IsDerivedFrom("XbpIWindow"))
// Non GUI mode
RETURN(NIL)
ENDIF
hWND := oDesktop:GetHWND()
hDC := GetDC(hWND)
IF(hDC==-1)
// could not aquire device
RETURN(NIL)
ENDIF
nLogPix := GetDeviceCaps(hDC,LOGPIXELSX)
ReleaseDC(hWND,hDC)
IF lDisplay
cMsg:="Font Size is "+dc_xtoc(nLogPix)+" DPI"
cMsg+=". 96 DPI is the only DPI setting compatible with CUS Software"
dc_msgbox(cMsg)
ENDIF
RETURN(nLogPix== SMALLFONT)
DLLFUNCTION GetDC( nHWND ) USING STDCALL FROM USER32.DLL
DLLFUNCTION ReleaseDC( nHWND, nHDC ) USING STDCALL FROM USER32.DLL
DLLFUNCTION GetDeviceCaps( nHWND, nIndex ) USING STDCALL FROM GDI32.DLL
Re: Impact of Video Settings
Posted: Thu Jan 21, 2016 6:17 pm
by Auge_Ohr
bwolfsohn wrote:checking for 96dpi..
on Windows 7/8x/10 > 125% you will always get 96DPI for a "virtual" Desktop ( 125% is native )
! Note : when use a "virtual" Desktop Xbase++ AppDeskTop():CurrentSize() return "virtual" Size not real native Size .
API Function GetDeviceCaps is right but IMHO you need other Constant ( see Sample )
- DESKSIZE.ZIP
- use ot4xb Syntax
- (816 Bytes) Downloaded 894 times
since v1.9x we have "undocumented" Function LayoutManager (in xppui3.lib) which now in v2.x appear in Help File.
you donĀ“t need any "resize" or "zoom" when User maximize ... let Xbase++ calculate Position / Size of a XbPart
! Note : LayoutManager does not change Font Size ...
begin with Vista / Windows 7 you can write "more" Segment into your XP Manifest. when using
Code: Select all
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</windowsSettings>
</application>
you can make your Xbase++ Application "DPI-aware".
if you use "DPI-aware" and LayoutManager you do not have to think about "any Size"
Re: Impact of Video Settings
Posted: Thu Jan 21, 2016 7:11 pm
by omni
A little over my head. Where would you put this desktop.prg in an application.
Fred
Re: Impact of Video Settings
Posted: Thu Jan 21, 2016 7:39 pm
by rdonnay
You can test for the DPI setting at the start of your program and then set your basefont accordingly.
Try the below code. I haven't tested it.
Code: Select all
o := AppDesktop()
h := getDc(o:getHwnd())
nDPI := GetDeviceCaps(h,90)
IF nDPI == 96
DC_BaseFont('8.Helv')
ELSE
DC_BaseFont('7.Helv')
ENDIF
Re: Impact of Video Settings
Posted: Fri Jan 22, 2016 6:01 pm
by Auge_Ohr
rdonnay wrote:You can test for the DPI setting at the start of your program and then set your basefont accordingly.
Try the below code. I haven't tested it.
you are working with
which give you "virtual" Size. this will always give you 96 !
lets say real native Size is 1920 x 1280. now adjust to 200 % and check AppDeskTop():Currentsize() which will show <> 1920 x 1280
now try
Code: Select all
#define DESKTOPVERTRES 117
#define DESKTOPHORZRES 118
and you will see what i mean that the "old" Code only work on "native" Resolution of "old" Windows OS().