View previous topic :: View next topic |
Author |
Message |
Thomas
Joined: 18 Feb 2005 Posts: 57 Location: Gummersbach, Germany
|
Posted: Mon Aug 11, 2025 3:31 pm Post subject: Get current position (or absolute position of a control) |
|
|
I know how to set the absolute position for the next control with %ap.
Is there a format code providing the current position (= absolute position for the next control if not using %ap). This would help to better align controls in a grid. %rp can only be defined for the previous control but unfortunately not for any other reccent controls. _________________ Thomas |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8251 Location: Salford, UK
|
Posted: Mon Aug 11, 2025 5:38 pm Post subject: |
|
|
There is no such format code. The only other related and undocumented code is %pp which takes four integer arguments and provides the pixel x,y,width and height of the next control.
If you can provide code that shows what the new code would look like and more details about what it does, then I could add it to the wish list. |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2412 Location: Yateley, Hants, UK
|
Posted: Sun Aug 17, 2025 11:41 am Post subject: |
|
|
Thomas,
It all depends on how you design your forms / dialogs. If you have the same types of controls in rows or columns, then they line up automatically, especially if you arrange then with �boxes� (%ob � %cb). You don�t have to have the boxes visible � they can be no_border or invisible (same thing). If you have a design that has a lot of different controls then they never line up.
If you do force them to line up using %ap, then what happens when you move to a screen with a different resolution then they don�t line up any more, but if you have grouped them as I said then they always line up.
Controls also have a text prompt. If you put that to the left of a control, because Windows uses a proportionally spaced font the following controls don't line up. If the text is to the right, then the controls (such as radio buttons) will line up in a column - but the overall design and use of boxes is critical.
It�s something that bothered me for years until I discovered the trick(s).
Eddie |
|
Back to top |
|
 |
Kenneth_Smith
Joined: 18 May 2012 Posts: 835 Location: Lanarkshire, Scotland.
|
Posted: Sun Aug 17, 2025 12:39 pm Post subject: |
|
|
Eddie, Perhaps I am lazy, but I find using %fn[Consolas] makes the alignment of text and controls much easier. |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2412 Location: Yateley, Hants, UK
|
Posted: Sun Aug 17, 2025 2:15 pm Post subject: |
|
|
Ken, A useful find. I didn't realise that Consolas was a monospaced font.
Monospaced fonts are great when printing tabulated numerical output: when you lapse into standard Fortran output standard printer fonts often aren't great, and trying to tabulate numerical data with a proportionally-spaced font isn't an easy matter.
I'm presuming a couple of things. Firstly that you program solely for yourself as then aesthetics don't matter so much, and secondly that you prefer the text prompt on a control to come first - which is where monospacing helps the alignment. But it doesn't help the alignment of different types of control.
Some of my 'client base' was undergraduate students, and they are picky about things looking amateurish, turning their noses up at perfectly acceptable and functional DOS apps that saved them the time (and expense) of days doing topographic survey fieldwork. Fortunately, I'd retired before they demanded the apps on their mobile phones!
Eddie |
|
Back to top |
|
 |
|