It is currently Thu Oct 17, 2019 1:52 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Is PB's dialog library DPI aware?
PostPosted: Sun Sep 13, 2015 8:06 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3677
Location: Berlin, Germany
Hi,

in PB's Reference Manual it reads:

Quote:
The dialog library allow to easily create complex user interface (GUI) based on an XML definition. It features automatic gadget layout, which is very useful when creating interface which needs to work on different operating systems or working with different font size.

Does this mean that a GUI created with PB's dialog library is automatically DPI aware? That would be very cool.

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: Is PB's dialog library DPI aware?
PostPosted: Sun Sep 13, 2015 10:31 am 
Offline
Addict
Addict
User avatar

Joined: Sat Apr 26, 2003 8:26 am
Posts: 2924
Location: Planet Earth
DPI-awareness is one of the most important things today, in my opinion.
More and more people are switching to Retina/4k/5k displays, and in the
transistion phase the other people still have cheaper, low-res, full HD displays.

It's not only about the dialog lib, it's also functions like GetDpiX/Y for all
output devices (screen, printer, ...). AFAIK such functions are available
on all supported platforms - because it is a basic requirement for developers.

On printers such functions are required to be able to produce the same ouput
on printers with 300/600/2400 DPI. It's the same with displays - 96 vs. 200+ DPI/PPI.


Top
 Profile  
Reply with quote  
 Post subject: Re: Is PB's dialog library DPI aware?
PostPosted: Sun Sep 13, 2015 10:40 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3677
Location: Berlin, Germany
Hi Danilo, thanks for your reply.

Danilo wrote:
DPI-awareness is one of the most important things today, in my opinion.
More and more people are switching to Retina/4k/5k displays, and in the
transistion phase the other people still have cheaper, low-res, full HD displays.

I agree.

Danilo wrote:
it's also functions like GetDpiX/Y for all
output devices (screen, printer, ...). AFAIK such functions are available
on all supported platforms - because it is a basic requirement for developers.

I know. :-)
I'm currently using those GetDpiX/Y functions in my programs (on Windows).

However, it would be more elegant/easier for me if the dialog library would take care of this.
It would be a generic solution, without the need for different API calls on different platforms.

And of course we need to know:
When a program uses PB's dialog library, does it have to use additionally those GetDpiX/Y API functions, or can it do without them?

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: Is PB's dialog library DPI aware?
PostPosted: Sun Sep 13, 2015 12:29 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Apr 26, 2003 8:26 am
Posts: 2924
Location: Planet Earth
Little John wrote:
And of course we need to know:
When a program uses PB's dialog library, does it have to use additionally those GetDpiX/Y API functions, or can it do without them?

Of course everything should be documented


Top
 Profile  
Reply with quote  
 Post subject: Re: Is PB's dialog library DPI aware?
PostPosted: Sun Sep 13, 2015 2:59 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Feb 19, 2010 3:42 am
Posts: 531
Won't it work to put "width='100em'" or "height='120mm'" into the source and replace it by regexp
with the corrected values?

I don't see a good way of standardization here...
And it's only about DPI not layout correct...?








Code:
procedure getDPIXScreen()
   protected hdc,
                     xdpi

   hdc = GetDC_(GetDesktopWindow_())
   
   if hdc
      xdpi = GetDeviceCaps_(hdc, #LOGPIXELSX)
      ReleaseDC_(GetDesktopWindow_(), hdc)
   endIf

   procedureReturn xdpi   
endProcedure ; getDPIXScreen


procedure getDPIYScreen()      
   protected hdc,
                      ydpi
   
   hdc = GetDC_(GetDesktopWindow_())
   
   if hdc
      ydpi = GetDeviceCaps_(hdc, #LOGPIXELSY)
      ReleaseDC_(GetDesktopWindow_(), hdc)
   endIf
   
   procedureReturn ydpi      
endProcedure ; getDPIYScreen


Top
 Profile  
Reply with quote  
 Post subject: Re: Is PB's dialog library DPI aware?
PostPosted: Sun Sep 13, 2015 8:33 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Fri Apr 25, 2003 6:41 pm
Posts: 1356
I don't think, that scaling to DPI is always usefull. For example, when I connect my pc with my 50Inch TV in 1080p - everything would be unreadable small.

Also important, how far away are you from the display? My TV is much bigger, but because i sit more far away, everything is a little bit smaller. That is a problem of many PS4/3,XBOX360/ONE-Games that the text is very small. I think this is because the developer test everything on a monitor and not on a TV.

And for example older people prefer often a zoomed view.

There should be OS-Api-Routines to handle the sclaing...


Top
 Profile  
Reply with quote  
 Post subject: Re: Is PB's dialog library DPI aware?
PostPosted: Sun Sep 13, 2015 8:51 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3677
Location: Berlin, Germany
GPI wrote:
There should be OS-Api-Routines to handle the sclaing...

Yes, as written above, there are OS API routines for handling the scaling ...

My question in this thread is, whether a GUI created with PB's dialog library is automatically DPI aware,
so that it's not necessary for me to call the respective API routines in the program myself.

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: Is PB's dialog library DPI aware?
PostPosted: Thu Sep 24, 2015 7:19 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3677
Location: Berlin, Germany
Dear Fred or Freak,

I would be grateful if you could shed light on this. :-)

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Last edited by Little John on Thu Sep 24, 2015 1:31 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Is PB's dialog library DPI aware?
PostPosted: Thu Sep 24, 2015 7:25 am 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13622
Location: France
We already did some internal test for DPI aware dialog, but it's not really finished, may be for the next version.


Top
 Profile  
Reply with quote  
 Post subject: Re: Is PB's dialog library DPI aware?
PostPosted: Thu Sep 24, 2015 7:29 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 06, 2005 2:35 pm
Posts: 1212
Location: germany
Hi All,

I also reported and asked DPI related questions and wishes in the past (starting Dec. 2013). They are all not really done:

viewtopic.php?f=7&t=57737
viewtopic.php?f=3&t=61139
viewtopic.php?f=19&t=62517
viewtopic.php?f=3&t=60506 (point 5)

Would be really great if at least the XML Dialogue would respect OS settings for DPI on used Desktop/Monitor.

Kukulkan


Top
 Profile  
Reply with quote  
 Post subject: Re: Is PB's dialog library DPI aware?
PostPosted: Thu Sep 24, 2015 1:30 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3677
Location: Berlin, Germany
Fred wrote:
We already did some internal test for DPI aware dialog, but it's not really finished, may be for the next version.

That's cool, thank you for the information!
I'm looking forward to have this feature in a future PB version. :-) Thanks.

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: Is PB's dialog library DPI aware?
PostPosted: Mon Dec 04, 2017 11:36 pm 
Offline
User
User

Joined: Thu Aug 10, 2017 7:35 am
Posts: 78
I've looked through the changelogs since 2015 up to v5.61 but
I don't see any comment that dialog should now be totally DPI aware.

So, what's the current state?


Top
 Profile  
Reply with quote  
 Post subject: Re: Is PB's dialog library DPI aware?
PostPosted: Tue Dec 05, 2017 8:10 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 06, 2005 2:35 pm
Posts: 1212
Location: germany
I'm also interested!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye