Unfortunately the "window resizing" has been removed from the latest roadmap without any explanation. Most of the participants of the DevDay complained about this in the presence of Martin Teetz. New in the roadmap for SQLBase 12.2 is support of the .NET Core Treiber. I will post the PPT/sample files in the DevDay thread as soon as they are available. They will be sent via E-Mail to the participants.a_sivababu wrote: ↑03 Dec 2018, 05:20Good News Uwe, Any other good news from Devday and new features they discussed?
as per earlier one, the long awaiting desktop responsive design is planned in TD 7.2 but not sure this enhancement will be done or not.
As usual, any PPT and/ore sample files from this Devday
Window resizing
Window resizing
Best regards,
Uwe van der Horst
stp.one
Uwe van der Horst
stp.one
Re: Window resizing
Any news on "window resizing" topic?
We assured our customers, that there will be a solution in 2019.
We assured our customers, that there will be a solution in 2019.
Re: Window resizing
We solved our own window resizing issue several years ago by hiding each window on SAM_Create, then calling a helper function to iterate through all child items, enlarging window size and position, and font size, by the required amount, and then making the form visible again on SAM_CreateComplete. This logic can be placed in a General Window class that all forms/dialogs are derived from.
The amount by which a form and its fonts are resized can be controlled manually or automatically (to grow to fit the current monitor).
This has worked for TD 1.1.2 applications and through several migrations, 4.2 and 6.3 (and I believe it works ok in 7.1 too).
The core logic is about 150 lines of code and once you apply it you can just forget about it. I don't think I'm giving any secrets away if I show a tiny snippet of this:
There are obviously lots of corner cases: coping with different types of objects, child tables, tab bars, etc. That's why the actual code is more complex.
Other benefits are we can dynamically apply a replacement font to all touched children with a given font for better readability in various environments. We can dynamically replace colours of certain items to suit colour blindness, etc.
OK, it would be nice to have native resizing but we would probably end up still using our custom resizing logic for all the additional benefits it gives.
The amount by which a form and its fonts are resized can be controlled manually or automatically (to grow to fit the current monitor).
This has worked for TD 1.1.2 applications and through several migrations, 4.2 and 6.3 (and I believe it works ok in 7.1 too).
The core logic is about 150 lines of code and once you apply it you can just forget about it. I don't think I'm giving any secrets away if I show a tiny snippet of this:
Code: Select all
Set hWndCurrentItem = SalGetFirstChild( hWndParentForm, TYPE_Any )
While hWndCurrentItem != hWndNULL
Call SalGetWindowSize( hWndCurrentItem, nWidth, nHeight )
Call SalGetWindowLoc( hWndCurrentItem, nX, nY )
Set nWidth = nWidth * nScaleX
Set nHeight = nHeight * nScaleY
Set nX = nX * nScaleX
Set nY = nY * nScaleY
Call SalSetWindowSize( hWndCurrentItem, nWidth, nHeight )
Call SalSetWindowLoc( hWndCurrentItem, nX, nY )
! Go on to next screen object.
Set hWndCurrentItem = SalGetNextChild( hWndCurrentItem, TYPE_Any )
Other benefits are we can dynamically apply a replacement font to all touched children with a given font for better readability in various environments. We can dynamically replace colours of certain items to suit colour blindness, etc.
OK, it would be nice to have native resizing but we would probably end up still using our custom resizing logic for all the additional benefits it gives.
Re: Window resizing
Hello Mr. Wardies
How to calculate nScaleX and nScaleY ?
Arunas
How to calculate nScaleX and nScaleY ?
Arunas
Re: Window resizing
First, estimate the pixel size of your largest window form (e.g. 600x450). Let's call these constants nDesignWidth x nDesignHeight.
Then, call the SystemParametersInfoA() user32.dll WINAPI with action SPI_GETWORKAREA to retrieve the x1, y1, x2, y2 pixel locations of the primary monitor. Now you can work out the width and height of the primary monitor in pixels. Let's call that nWidth x nHeight.
Now you can calculate the nScaleX scaling factor simply by nWidth / nDesignWidth.
Same for nScaleY.
[EDIT] Of course, you will need to grow and position the form/dialog window too. This is just as trivial as the previous code snippet that iterated through the children of the window.
Then, call the SystemParametersInfoA() user32.dll WINAPI with action SPI_GETWORKAREA to retrieve the x1, y1, x2, y2 pixel locations of the primary monitor. Now you can work out the width and height of the primary monitor in pixels. Let's call that nWidth x nHeight.
Now you can calculate the nScaleX scaling factor simply by nWidth / nDesignWidth.
Same for nScaleY.
[EDIT] Of course, you will need to grow and position the form/dialog window too. This is just as trivial as the previous code snippet that iterated through the children of the window.
Re: Window resizing
In SalExtension library found only
Function: SystemParametersInfoW
Description:
Export Ordinal: 0
Returns
Boolean: BOOL
Parameters
Number: UINT
Number: UINT
Number: LPVOID
Number: UINT
First parameter should be SPI_GETWORKAREA = 0x0030
What about other parameters? Which parameter returns info about x1, y1, x2, y2 pixel locations?
Function: SystemParametersInfoW
Description:
Export Ordinal: 0
Returns
Boolean: BOOL
Parameters
Number: UINT
Number: UINT
Number: LPVOID
Number: UINT
First parameter should be SPI_GETWORKAREA = 0x0030
What about other parameters? Which parameter returns info about x1, y1, x2, y2 pixel locations?
-
- Founder/Site Admin
- Posts: 3512
- Joined: 24 Feb 2017, 09:12
- Location: Gouda, The Netherlands
Re: Window resizing
I have moved the posts on window resizing out of the topic "Restriction of the OpenText Forum will be canceled" and put them in this one.
It deserves its own dedicated topic
It deserves its own dedicated topic

Regards,
Dave Rabelink

Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel
Dave Rabelink

Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel
Re: Window resizing
Thank you, Dave.
Hi Arunas,
Sorry for the delay.
I haven't used the SalExtension library before but you can just define the function interface yourself as long as you know the parameters by cross-referencing against the documentation.
In this case, with action SPI_GETWORKAREA = 0x0030 as you've said, we see in the Win32 API documentation for SystemParametersInfoA that The pvParam parameter must point to a RECT structure that receives the coordinates of the work area, expressed in physical pixel size.
You can find info on how to represent the pointer to the RECT structure in your own External Function definition for user32.dll; see TD Book TD Developing with SQLWindows.pdf, section: Using C Structures (structPointer External Data Type). The 3rd parameter will be a structPointer (representing the RECT) and nested therein are the 4 x Receive Number: LONG representing the x1, y1, x2, y2 pixel values that are passed back.
If unfamiliar with calling external DLL functions, I would recommend all of Chapter 22 – Calling External Functions in Dynamic Link Libraries of the aforementioned developer's book PDF.
Hi Arunas,
Sorry for the delay.
I haven't used the SalExtension library before but you can just define the function interface yourself as long as you know the parameters by cross-referencing against the documentation.
In this case, with action SPI_GETWORKAREA = 0x0030 as you've said, we see in the Win32 API documentation for SystemParametersInfoA that The pvParam parameter must point to a RECT structure that receives the coordinates of the work area, expressed in physical pixel size.
You can find info on how to represent the pointer to the RECT structure in your own External Function definition for user32.dll; see TD Book TD Developing with SQLWindows.pdf, section: Using C Structures (structPointer External Data Type). The 3rd parameter will be a structPointer (representing the RECT) and nested therein are the 4 x Receive Number: LONG representing the x1, y1, x2, y2 pixel values that are passed back.
If unfamiliar with calling external DLL functions, I would recommend all of Chapter 22 – Calling External Functions in Dynamic Link Libraries of the aforementioned developer's book PDF.
Re: Window resizing
A feature request:
TD-24383
Allow Zooming of all TD child control in top level window including anchoring feature
TD-24383
Allow Zooming of all TD child control in top level window including anchoring feature
Who is online
Users browsing this forum: [Ccbot] and 1 guest