Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, November 26, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: v7 Large Fonts: Fixed with Application.Environment?
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
v7 Large Fonts: Fixed with Application.Environment? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Sep 06 3:01 PM
fiogf49gjkf0d
A bit of history may be in order. Legacy forms do not scale and on a system with 120DPI, everything is tiny. Active forms, on the other hand, scale and what I mean by that is the controls themselves upsize to support the larger DPI. The problem with scaling was the form itself would not resize to adjust to the larger controls so part of the form would be cut off. A quick temporary fix is to add scrollbars but it looks and behaves rather lame.

There was good news, at least in my head, when it came to 6.2. MainViews introduced the Height/Weight property allowing you to change the size of the form at runtime. The only problem with this is there is no native function to give you the DPI and the only function I know of is in Win32, meaning there is no easy way to script it. If I had to guess, I would say the Environment object was introduced specifically for this purpose but it may be there for something else entirely.

Does any BP with access to the stock code know if SalesLogix uses Application.Environment to fix the large fonts issue with their customizations? Or did the upgrade to Delphi 7 silently "fix" the problem? I'd like to be able to backport the capability to 6.2 and use it now if I can. I figured someone else has to know something because they wouldn't just throw in the object like that unless it finally addressed the problem.
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: v7 Large Fonts: Fixed with Application.Environment? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Sep 06 5:53 PM
fiogf49gjkf0d
OK...
V7.0 ONLY...

Function:
Use to resolve alignment issues when display settings are NOT 96dpi

Here's what the parameters are:
DesktopHeight
Specifies the height of the entire virtual desktop

DesktopLeft
Specifies the x-coordinate of the desktop's left edge relative to the upper-left cornor of the PRIMARY monitor

DesktopTop
Specifies the y-coordinate of the desktop's top relative to the upper-left cornor of the PRIMARY monitor

DesktopWidth
Specifies the width of the entire virtual desktop

Height
Indicates the vertical size of the screen in pixels

PixelsPerInch
Indicates the number of screen pixels that make up a logical inch in the vertical direction

Width
Indicated the horizontal size of the screen in pixels

Ex:
Control.Top = cLng(Application.Environment.PixelsPerInch * Control.Top / 96

--
rjl
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: v7 Large Fonts: Fixed with Application.Environment? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Sep 06 9:13 PM
fiogf49gjkf0d
Sorry RJ, I should have mentioned that I have the LAN Developer's reference from the support site but I've yet to receive our copy of the software. I wrote this hoping that a BP with access to either the betas or the final version can alert me to any stock code or if something in the application itself "magically" fixes it. The issue seems to be a low priority on almost everyone's list though, so I didn't really expect much of a response.

When I read the example it didn't make sense at first because if you were to apply it to every control on a form, you would in effect be doing EXACTLY what the existing scaling technique is doing. The problem does not lie in the controls because their height, width, and spacing adjust when scaling is turned on. The problem is with the form itself because by default the width and height automatically take whatever is defined in Architect. It wasn't until the introduction of the MainView in 6.2 that you could change the width and height to something other than what was defined. You aren't given the Application.Environment object so you have to get the PixelsPerInch another way. The Win32_DesktopMonitor WMI class has PixelsPerXLogicalInch and PixelsPerYLogicalInch properties that should match the Application.Environment.PixelsPerInch property. I believe the reason SalesLogix doesn't include an X and Y property is because the core Win32 API call (GetDeviceCaps) returns X and Y coordinates but under normal circumstances they should always match. If by some chance you were given a system where they did not match, at least you could use WMI to adjust the width (X) and height (Y) accordingly.

I believe I have my answer but I'll verify it just to make sure. I'll try to write up an article and submit it as well considering I can explain it better with pictures. I'm not the only person to express frustration with large fonts, I may just be stubborn enough to try and figure it out programmatically.
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/26/2024 4:29:14 PM