Pro's and Contra's fom Resources or Coded screens

Re: Pro's and Contra's fom Resources or Coded screens

Postby TimStone » Fri Aug 04, 2017 4:42 pm

Here is the problem. If you look at the examples, they usually do not use resources. Suddenly we have a new problem. We have to determine which type of resource control to use and redefine for the command function. It takes extra time to figure this out.

I use almost all resources. My screens are large and complex, and this keeps them accurate. However, it would help to have all the docs include the proper control syntax for an .rc file along with the REDEFINE commands. tBar is a perfect example ... it changed with the many wonderful improvements from what was originally in docs and samples.

Antonio, relative spacing is still a guessing game. I do have a challenge for you. All the examples are always with just a few controls, but in business applications, they are far more complex. Try this: Build a DIALOG ( not Window ) with 30 controls of various types ( labels, text fields, list boxes, radio controls, comboboxes, browse, etc ). Even using your relative positioning for @ commands, 1) Are all of the controls aligned properly on the horizontal lines, 2) Are all input fields of the same height, 3) Is the same font used in all of them, and 4) Are all column positions matching ? My experience in the past was that sizes varied, and different relative positions had to be used to get proper alignment. Again .. in the business world we input a huge amount of data on a single screen, very much unlike the simple samples we test with in FWH. It is precisely these problems that have prevented me from using the @ syntax.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2942
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Pro's and Contra's fom Resources or Coded screens

Postby Silvio.Falconi » Fri Aug 04, 2017 5:14 pm

I want to take advantage of the fact that now we are talking about this topic to ask all the users of the forum and in particular to Antonio Linares and his team the cause because the fivewin libs does not have a dialog designer.

The designer sample in the .\samples folder is well compiled and could also work but then when we compile the output prg the dialog is created badly and the controls are not right in the right and right coordinates.


I think such a utility can be useful to us as we do daily and often lose time to design the dialog.

In Xmate there is a utility that does this but then we can not move the controls and xmate creates a just right size dialog with the right controls (in dynamic code fwh and also in resource) but the fields are placed one behind the other .

For example this utility can not be fivedit (cristobal) !!!!

The controls we use in particular are:
say
get
datepicker
combobox
radio
check
xbrowse

button

this My 0,50 cent :shock:
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7004
Joined: Thu Oct 18, 2012 7:17 pm

Re: Pro's and Contra's fom Resources or Coded screens

Postby TimStone » Fri Aug 04, 2017 5:31 pm

Silvio,

When I first started, I used the Resource Compiler from Borland. It worked, but when I stopped using Borland, some controls were no longer supported. I learned to simply edit the .rc file, and found my accuracy for placement and sizes was 100%.

When you design with a tool, sometimes placement is not exact. It can be a few pixels off and then it looks bad. So, by doing it manually, I never have an issue ... it's always placed at the exact row and column, with the proper length and height.

Visual Studio does have a resource designer but I haven't been successful with it so far. It makes some file modifications that conflict with our FWH builds. It is supplied FREE in the Community Edition of Visual Studio ( which is also free ), and one day I will have the time to actually work with it.

I believe there are other free resource designers available. Over the years I've tried a few, but I've gotten so used to just creating the DIALOGS with a text editor that it works well for me. If we did want to use the @ commands, like in the old Clipper days ... ( dBase ), we would need to be sure that all controls were to respond exactly the same way ... height, width, placement, and font. We should be able to say:
@ 1,1 SAY "Line 1"
@ 1,10 GET line1
@ 2,1 SAY "Line 2"
@ 2,10 GET line2

And know that each line was properly spaced, no overlap, just like with Clipper / DOS.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2942
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Pro's and Contra's fom Resources or Coded screens

Postby Silvio.Falconi » Fri Aug 04, 2017 5:53 pm

Timm
I allready say to you
I must use fwh
no Visual studio and Other 3 parts
if I need to use other I changed the programming language
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7004
Joined: Thu Oct 18, 2012 7:17 pm

Re: Pro's and Contra's fom Resources or Coded screens

Postby TimStone » Fri Aug 04, 2017 6:57 pm

Silvio,

Visual Studio is the compiler / linker ... instead of Pelles or Borland
You use Harbour rather than xHarbour.

WE ALL LOVE AND USE FWH ... this is all about using FWH ... but some of us do our builds with VS 2017. Why ? Because it does address some Windows 10 capabilities that are NOT available with any of the other compilers.

Antonio created FWH. Even though he supports xHarbour, he RECOMMENDS HARBOUR with FWH. I followed his suggestions, and worked with him to start building with VS 2012 ... and now we are up to 2017 ... and it is FREE.

You do not need to change ... but others who read this thread may be interested in exploring how to use the free 2017 Visual Studio to build FWH applications ... and they are the ones to whom I am sharing this ...

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2942
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Pro's and Contra's fom Resources or Coded screens

Postby Silvio.Falconi » Fri Aug 04, 2017 7:10 pm

But at Sillian i not listen Antonio talking for VC but only fwh instruments as for make a sample fivedit.
We talk also of report designer with otto and maurizio and other people as ER and i not listen VC or other 3d parts.
I think we must use only fwh and the utilies of fwh without 3d parties
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7004
Joined: Thu Oct 18, 2012 7:17 pm

Re: Pro's and Contra's fom Resources or Coded screens

Postby TimStone » Fri Aug 04, 2017 7:23 pm

FWH will never have it's own compiler and linker.

We write ALL business/program code and functions in FWH.

We use Harbour or xHarbour to translate that to C code.

We use Pelles, Borland, or Microsoft to translate that to machine code objects and link them into an .exe file.

We run in Windows, and use libraries with many functions. These are all called from our FWH code. Some of the new Windows 10 functions are not available from Pelles or Borland at this time ( like the FWH code Antonio put together to give us the ability to take pictures from a device camera inside our applications ). They are supported by the new Microsoft compiler and linker.

These are not alternatives to FWH. We still use FWH for all of our work. You can still do the reports and editor in FWH ... and use these tools to assemble it into an .exe. For example, I took modified an older dbu code to create a File Editor for working with .dbfs in my application. It is pure FWH ... but still assembled with Harbour and MSFT VC++.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2942
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Pro's and Contra's fom Resources or Coded screens

Postby Otto » Fri Aug 04, 2017 10:45 pm

Hello,

the problem I have is „modern“ look and different form factors.

Now I started working on responsive dialogs.
I don’t found a way to get such a design with available resource editors.

If you resize a dialog font should change and not only the size of the controls but also the controls should switch to the next row if necessary.

I use a similar concept as Antonio suggested above.

I think we should look into responsive web design an copy those concepts.

Best regards,
Otto


Image


Image

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6301
Joined: Fri Oct 07, 2005 7:07 pm

Re: Pro's and Contra's fom Resources or Coded screens

Postby cnavarro » Sat Aug 05, 2017 12:26 am

Carles wrote:Marc,

Larger screens = Resources
Little = Resources

Believe me :wink:

C.


Carles, explain me, please

Larger screens = resources

and

Medium and Little screens = same resources or other resources

Regards
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Pro's and Contra's fom Resources or Coded screens

Postby Enrico Maria Giordano » Sat Aug 05, 2017 7:35 am

Otto wrote:Hello,

the problem I have is „modern“ look and different form factors.

Now I started working on responsive dialogs.
I don’t found a way to get such a design with available resource editors.


You can make responsive dialogs with or without resources. Dialogs and controls can be always resized.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8696
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Pro's and Contra's fom Resources or Coded screens

Postby Marc Venken » Sat Aug 05, 2017 8:40 am

TimStone wrote:
When you design with a tool, sometimes placement is not exact. It can be a few pixels off and then it looks bad. So, by doing it manually, I never have an issue ... it's always placed at the exact row and column, with the proper length and height.

Tim


I changed from RWS 16bit to Pelles 32 bit for my program conversion. Until now I did'nt notice this ?

So you code always from texteditor, or are you making the design in a Tool and then finetune the coordinates in the text editor?
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1417
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Pro's and Contra's fom Resources or Coded screens

Postby Marc Venken » Sat Aug 05, 2017 8:53 am

For the resizeble part of dialogs,

Do you have in mind that the users resize like they want (dragging a screen to a certion point) or do you create with the standart screen sizes in mind like

1920 x 1080
1600 x 900
1280 x 720
.....

I was thinking that it is more simple to let choose between some standart settings and not user resisable.

For resisable application,
Maybe a Xbrowse with all controls in it like :

Screen, Name, Top, Bottom, Size, Hight, .... can be used as a relative database?

At design time we could pop_up the Xbrwowse, change some coordinates, and refresh the dialog with new coordinates, until the screen is ok. Maybe this could work ?

For changing to a other standart screen size, a algoritm can be calculated so all controls resize automatic.

Sc_R:= 1 // 1280 x 720
Sc_C:= 2 // 1280 x 720

// values needed for positioning, based on selected screen.

@ xB_Row * Sc_R, xB_Col *Sc_C SAY "Xb_Name:" OF oDlg PIXEL

Maybe with the data of the Xbrowse, a kind of preview can be made, and a coded designer is born. Put all in a Class and we can use it... (All in theorie :wink: )
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1417
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Pro's and Contra's fom Resources or Coded screens

Postby TimStone » Sat Aug 05, 2017 5:45 pm

Marc,

Originally I had dialogs designed in the resource utility. First I modified those. Now I simply create them from scratch. Look at this sample:

Code: Select all  Expand view

INVLIST DIALOG 0, 0, 850, 460
STYLE WS_POPUP | WS_CAPTION
CAPTION "Invoice Manager"
{
    CONTROL                 "", 100, "TBar", 0|WS_CHILD|WS_VISIBLE, 0,0, 850, 30
    CONTROL         "",390,"TxBrowse",WS_BORDER | WS_VSCROLL | WS_TABSTOP,10,150,830,300
    LTEXT           "",4001,40,40,50,10
    EDITTEXT        397,100,40,160,10
    LTEXT           "Client",-1,40,55,50,10
    EDITTEXT        398,100,55,160,10
    LTEXT           "Writer",-1,40,70,50,10
    EDITTEXT        399,100,70,160,10
    LTEXT           "Tag #",-1,300,40,40,10
    EDITTEXT        400,350,40,80,10
    LTEXT           "Home  ",-1,300,55,40,10
    EDITTEXT        401,350,55,80,10
    LTEXT           "Business",-1,300,70,39,10
    EDITTEXT        402,350,70,80,10
    LTEXT           "Status",-1,470,40,40,10
    EDITTEXT        412,520,40,20,10
    CONTROL        "Complete ?",413,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,470,55,50,10
    LTEXT           "Parts",-1,40,100,50,10
    EDITTEXT        403,100,100,60,10,ES_RIGHT  
    LTEXT           "Labor",-1,40,115,50,10
    EDITTEXT        404,100,115,60,10,ES_RIGHT  
    LTEXT           "Sublets",-1,40,130,50,10
    EDITTEXT        405,100,130,60,10,ES_RIGHT  
    LTEXT           "Supplies",-1,200,100,50,10
    EDITTEXT        406,260,100,60,10,ES_RIGHT  
    LTEXT           "Environment",-1,200,115,50,10
    EDITTEXT        407,260,115,60,10,ES_RIGHT  
    LTEXT           "",801,200,130,50,10
    EDITTEXT        408,260,130,60,10,ES_RIGHT  
    LTEXT           "Tax",-1,360,100,50,10
    EDITTEXT        409,420,100,60,10,ES_RIGHT  
    LTEXT           "Total",-1,360,115,50,10
    EDITTEXT        410,420,115,60,10,ES_RIGHT  
    LTEXT           "Deposits",-1,360,130,50,10
    EDITTEXT        411,420,130,60,10,ES_RIGHT  
    LTEXT           "Estimate",-1,520,100,50,10
    EDITTEXT        415,580,100,60,10,ES_RIGHT  
    LTEXT           "Due Out",-1,520,130,50,10
    EDITTEXT        414,580,130,150,10
}
 


1) I define the dialog. The sizing is for a widescreen monitor
2) My first control is a button bar that will be redefined in the FWH code
3) My second control is an xbrowse which occupies the lower half of the dialog
4) The rest are labels and text entries assigned to the fields in the database in the FWH code
5) The first digit ( number ) is the resource ID, except for LTEXT where a -1 is used to designate the label in position 1 is to be used.
6) The last 4 digits are for position: Starting column, starting row, width, height. Because I want all controls to have the same height, the last number should be the same, except for dropdowns where you will specify how far down you want the list to display.
7) It becomes very easy to space. I can either use the same starting column if I want controls to all match up vertically, or if I have various size controls, I simply add values. For example, If I have a label at column 10, and it's width is 30, the end is at 40. I add 10, and put my text box starting at 50. If it is 80 wide, that puts the end at 130. Now I want 20 between different field gets, so the next label starts at 150.
8) I increment all rows by 15. So the second location number, if I start at 10, would be 10, then 25, then 40, then 55, then 70 etc. If the field height is 10, then the spacing between all fields vertically will always look consistent.
9) In some cases you see a LTEXT with no label, and a number instead of -1, ie. LTEXT "",801,200,130,50,10 This becomes a dynamic label. The ID is 801, and you put it's value into your FWH code. Most text may be static ( -1 ) but sometimes you want labels to change according to values in the data. Also, it has other benefits. My software can be used in several different settings, and certain keywords need to change depending on who uses it. So, I have a definition table for those values that is set in public variables on startup. You could also use this concept to support different languages. Each label can be assigned a resource ID number in the .rc file, and then on startup you can assign text values to each.

This may seem confusing at first, but once you understand it, and use it a few times, it becomes very fast. I start with a simple template for the dialog, paste it into the editor, and then fill it in according to my needs.

Once I started doing this, I found that the resource editors often look good, but can be a few pixels off in alignment. Visually spacing may look OK, but it varies and people will notice that.

With all of this said, it would be nice to have resizable dialogs but once wrapping comes into play it becomes difficult to look clean. Also, business clients know where a field should be, and if it moves because someone changes the screen, they get upset. Also, with comprehensive data screens, allowing fields to wrap will soon push displays off the screen. I see the examples posted, but they are all of screens with few fields and limited data input. That is fine for a popup, but not for comprehensive data entry that my clients are seeking.

I hope this is informative.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2942
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Pro's and Contra's fom Resources or Coded screens

Postby Carlos Mora » Sat Aug 05, 2017 6:39 pm

Tim,
it is clear thar resource's source is not that difficult, but... How do you make that layout responsive? A Dialog designed for a given screen size may not fit or look as good as in the original screen.

How do you handle that?

Best regards,

Carlos
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Carlos Mora
 
Posts: 989
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Re: Pro's and Contra's fom Resources or Coded screens

Postby Marc Venken » Sat Aug 05, 2017 6:43 pm

This is sure good information !

Looking at the data from your code, in seems that this information can be put into a Xbrowse (with database) and then changed in realtime.

I have seen Mr. Rao create code from data in a Xbrowse. Maybe a resource file can be created this way. The problem will be that the resources
file needs to be compiled with the exe not ?

You also change positions in your file, and have to recompile again to have the new data show, right ?
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1417
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 36 guests