PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: DLL based control  (Read 1061 times)

James Fuller

  • FireFly3 Registered User
  • Senior Member
  • *
  • Posts: 278
  • FF3 User
DLL based control
« on: November 09, 2016, 09:03:45 AM »

Jose,
  While investigating the Free Pb Classics, I resurrected some of my commercial work only to notice how bad it looks on my 1920x1200 monitor. itsy-bitsy :)
I know Paul is working on a complete grid but I was wondering if you could put together a simple dll based control showing how one would handle DPI. The attached is actually a data input screen using Spread 3.0. It just uses the Row labels and one column for data. I started a dll control with PowerBASIC WAY WAY back that had this general appearance but it is long lost ....
I would like to investigate using CWindow in a DLL to create something similar but do not know where to begin.

James


Logged

José Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3111
    • Jos
Re: DLL based control
« Reply #1 on: November 09, 2016, 01:42:18 PM »

I don't use DLLs or libraries.

Handling DPI is very simple, you just have to do scaling. Either allow the user to pass the DPI value or detect it yourself calling IsProcessDPIAware and, instead of using fixed values, calculate the scaling ratio and multiply the values by it. If you use images or create fonts, you also must scale them. If fonts are created by the callers, they are responsible to pass the handle of appropriately scaled fonts.

Many controls don't need special treatment because they use relative values caculated according its width and height, e.g. my graphic control (CGraphCtx.inc), my adaptation of Börje's progress bar control (CPgBar3D.inc) or CXpButton.inc. I only used some adjustments with CCbColor.inc because it is ownerdraw. Look at these controls.



José Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3111
    • Jos
Re: DLL based control
« Reply #2 on: November 09, 2016, 01:44:59 PM »

Quote
While investigating the Free Pb Classics, I resurrected some of my commercial work only to notice how bad it looks on my 1920x1200 monitor. itsy-bitsy :)

Just wait until 4k monitors became the norm...