Page 1 of 2

Resizeable screen formats

PostPosted: Fri May 20, 2016 4:25 pm
by TimStone
My applications handle a large amount of data input on each screen, and they must be laid out very precisely. For this reason, I have them all in .rc defined dialogs, and they are clean.

Once I moved into windows from DOS / Clipper, I essentially abandoned @ SAY, @ GET formatting. The main reason was that I could never quite understand how to calculate the right numbers for positioning of the display lines.

The problem with the .rc dialogs is that they cannot be resized by the user. If I remember correctly, if I use the @ formatting, I can. ( Resize means I drag out the lower right corner of a dialog and the fields / text will get larger on the screen ). Maybe I do not remember this correctly at all. So much input to sort through in my brain.

So, can someone point me to precise FWH Samples that can help me understand:
1) How to properly calculate the numbers to use with the @ commands
2) How to make the dialog resize, and change the size of the controls, when expanding it out on the screen.

Thank you so much ...

Re: Resizeable screen formats

PostPosted: Fri May 20, 2016 5:45 pm
by Antonio Linares
Tim,

FWH provides a Class TLayout, developed by Daniel Garcia Gil, that automatically reorganizes and resizes the controls.

Please review FWH\samples\layout.prg, layout2.prg, layout4.prg examples

Re: Resizeable screen formats

PostPosted: Fri May 20, 2016 5:51 pm
by Antonio Linares
Please review FWH\samples\testdlg7.prg to see how to allow the mouse to resize a resources defined dialog

Re: Resizeable screen formats

PostPosted: Mon May 23, 2016 8:46 am
by Silvio.Falconi
search on this forum
there is a clas to resize a window ...perhaps we change it for dialog class

Re: Resizeable screen formats

PostPosted: Mon May 23, 2016 3:26 pm
by James Bott
Tim,

Try searching the forum for "resize."

There is an autoresize() function here that may be what you need.

viewtopic.php?f=3&t=16201&p=83889&hilit=autoresize#p83889

Note that there are at least two versions of this function so look for the most recent one.

James

Re: Resizeable screen formats

PostPosted: Mon May 23, 2016 6:02 pm
by Gale FORd
I know that one of the products from Timm was EasyDialog. I used it in the past and know that it covers a lot of controls when dialog is resized.
You can control how and which controls move, resize, or combination.

I don't know if the version now controlled by Fivewin has been upgraded like EasyReports have.

Re: Resizeable screen formats

PostPosted: Wed Jun 01, 2016 2:28 pm
by James Bott
Tim,

I'm curious to know if you solved this, and if so how?

James

Re: Resizeable screen formats

PostPosted: Wed Jun 01, 2016 5:11 pm
by TimStone
I set it aside for now.

The first question I asked, how to calculate the numbers used in @SAY and @GET never got addressed.

There must be a way to use them precisely but it seems like when I do use them, it's pretty much a guessing game.

Tim

Re: Resizeable screen formats

PostPosted: Wed Jun 01, 2016 8:02 pm
by Antonio Linares
Tim,

FWH uses FWH\include\constant.ch to calculate those numbers

The idea when I implemented it many years ago was that doing @ nRow, ... a control could fit automatically bellow or above another
control of its same class

Re: Resizeable screen formats

PostPosted: Wed Jun 01, 2016 9:33 pm
by TimStone
Try this simple piece of code:

Code: Select all  Expand view

    DEFINE DIALOG oTstDlg2 TITLE "Framp" OF oWnd
       
        @ 1,0 SAY "Test"
        @ 1,8 GET tg1
        @ 2,0 SAY "Two"
        @ 2,8 GET tg2
        @ 3,0 SAY "Three"
        @ 3,8 GET tg3
        @ 4,0 SAY "Four"
        @ 4,8 GET tg4
       
    ACTIVATE DIALOG oTstDlg2 CENTERED
 


Because you have defined the height of SAY ( 15) and Get ( 13 ) differently, as you will see from the sample, the titles do not line up with the get fields. They go progressive lower. So the values would not be consistent and thus it would require decimals for the Say commands to get them to match the GET. Of course, a Caption option for the GET might be useful ...or Title ....

This is why I went to dialogs in the first place. However, all the samples use the @ options.

Re: Resizeable screen formats

PostPosted: Wed Jun 01, 2016 9:38 pm
by Antonio Linares
Tim,

If you use the PIXEL clause then you place them exactly where you want

Re: Resizeable screen formats

PostPosted: Wed Jun 01, 2016 9:45 pm
by Antonio Linares
From your example:

Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   local oDlg, tg1, tg2, tg3, tg4

   DEFINE DIALOG oDlg TITLE "Framp"
       
        @ 12, 10 SAY "Test" PIXEL  
        @ 10, 40 GET tg1 PIXEL SIZE 80, 10
        @ 22, 10 SAY "Two" PIXEL
        @ 20, 40 GET tg2 PIXEL SIZE 80, 10
        @ 32, 10 SAY "Three" PIXEL
        @ 30, 40 GET tg3 PIXEL SIZE 80, 10
        @ 42, 10 SAY "Four" PIXEL
        @ 40, 40 GET tg4 PIXEL SIZE 80, 10
       
    ACTIVATE DIALOG oDlg CENTERED

return nil

Re: Resizeable screen formats

PostPosted: Wed Jun 01, 2016 9:51 pm
by TimStone
However, you are using different lines for SAY and GET

Re: Resizeable screen formats

PostPosted: Wed Jun 01, 2016 10:21 pm
by Antonio Linares
yes because they have different heights

Re: Resizeable screen formats

PostPosted: Wed Jun 01, 2016 10:29 pm
by TimStone
My point is Why ?

In clipper where this originated you used @ SAY for the title, and @ GET for the field, on the same line.

Of course, the best was Clipper with: @ 10,20 SAY "Sample" GET cSample