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
Impact of Video Settings
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: Impact of Video Settings
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.
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
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
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
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: Impact of Video Settings
on Windows 7/8x/10 > 125% you will always get 96DPI for a "virtual" Desktop ( 125% is native )bwolfsohn wrote:checking for 96dpi..
! 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 ) 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>
if you use "DPI-aware" and LayoutManager you do not have to think about "any Size"
greetings by OHR
Jimmy
Jimmy
Re: Impact of Video Settings
A little over my head. Where would you put this desktop.prg in an application.
Fred
Fred
Re: Impact of Video Settings
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.
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
The eXpress train is coming - and it has more cars.
Re: Impact of Video Settings
you are working withrdonnay 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.Code: Select all
nDPI := GetDeviceCaps(h,90)
Code: Select all
#define LOGPIXELSY 90
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
greetings by OHR
Jimmy
Jimmy