First steps

Post Reply
User avatar
MarcoBoschi
Posts: 1071
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

First steps

Post by MarcoBoschi »

Sometimes I have to prepare a simple dialog to test some functions.
Some Says , some gets and Button that invokes a function
As you can see in the picture Says and Gets are not aligned
although the coordinates of SAY and GET are identical


Is there a trick to make sure that they are aligned?
I.E to use a particular font or something else?

Image

Code: Select all | Expand

#include "fivewin.ch"
FUNCTION MAIN()

LOCAL oDlg
LOCAL oSay1 , oSay2 , oSay3
LOCAL oGet1 , oGet2 , oGet3
LOCAL cGet1 , cGet2 , cGet3

LOCAL oButton

cGet1 := SPACE( 20 )
cGet2 := SPACE( 20 )
cGet3 := SPACE( 20 )

DEFINE DIALOG oDlg FROM 3 , 3 TO 400 , 400 PIXEL

@ 2 , 2 SAY oSay1  PROMPT "First"  OF oDlg
@ 4 , 2 SAY oSay2  PROMPT "Second" OF oDlg
@ 6 , 2 SAY oSay3  PROMPT "Third"  OF oDlg

@ 2 , 10 GET oGet1 VAR cGet1 OF oDlg
@ 4 , 10 GET oGet2 VAR cGet2 OF oDlg
@ 6 , 10 GET oGet3 VAR cGet3 OF oDlg

@ 8 , 10 BUTTON oButton ACTION MsgInfo( "TEST" )

ACTIVATE DIALOG oDlg CENTER

RETURN NIL
 
Marco Boschi
info@marcoboschi.it
User avatar
Silvio.Falconi
Posts: 7136
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: First steps

Post by Silvio.Falconi »

Marco,

I made a good sample to create easy dialogs here :
viewtopic.php?p=135888#p135888
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
MarcoBoschi
Posts: 1071
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: First steps

Post by MarcoBoschi »

Very Good!
many thanks
marco
Marco Boschi
info@marcoboschi.it
User avatar
Enrico Maria Giordano
Posts: 8753
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: First steps

Post by Enrico Maria Giordano »

Marco,

use pixel coordinates.

EMG
User avatar
Otto
Posts: 6403
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 24 times
Been thanked: 2 times
Contact:

Re: First steps

Post by Otto »

Hello Marco,

I would suggest you following – the most comfortable way I found.
1) Create your dialog with Visual Union for Fivewin.
2) Generate source code from your visual design.
3) Afterwards you can use AUTOCODE to edit every line in a visual style.

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
MarcoBoschi
Posts: 1071
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: First steps

Post by MarcoBoschi »

Thank you
Silvio
Enrico
Otto
Marco Boschi
info@marcoboschi.it
User avatar
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 75 times
Contact:

Re: First steps

Post by Antonio Linares »

Marco,

As Enrico has pointed:

@ ..., ... SAY ... OF ... PIXEL

@ ..., ... GET ... OF ... PIXEL

the PIXEL clause avoids any calculations. What you write is what you get.

Besides that, you can use the SIZE clause to specify some desired dimensions:

@ ..., ... SAY ... OF ... PIXEL SIZE ..., ... // nWidth and nHeight

@ ..., ... GET ... OF ... PIXEL SIZE ..., ...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 75 times
Contact:

Re: First steps

Post by Antonio Linares »

Otto,

FiveWin provides a samples/fiveform.prg utility that it is a forms designer that generates source code :-)

The good thing is that we also have it for FiveLinux and FiveMac, and we provide full source code for it. So you can even include it in your own apps :-)

Finally, where do you download Visual Union from ? We do have it at FiveWin-contributions:
https://code.google.com/p/fivewin-contributions/downloads/list
but not sure if that is the latest version
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Otto
Posts: 6403
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 24 times
Been thanked: 2 times
Contact:

Re: First steps

Post by Otto »

Hello Antonio,
thank you for the information.
I don’t know how it happened but I forgot about the existence of fiveform.
I tested now and I replace Visual Union. The version I have is of Visual Union is from 2008.
This is exactly what I was looking for.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
James Bott
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: First steps

Post by James Bott »

Antonio,

I have just tried to compile fiveform.prg and I am getting some linking errors. Which Libs am I missing?

Using FW 13.04 and BCC 5.82 and the standard Buildx.bat file.

James

xHarbour 1.2.3 Intl. (SimpLex) (Build 20130326)
Copyright 1999-2013, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'fiveform.prg' and generating preprocessed output to 'fiveform.ppo'...

...

Generating C source output to 'fiveform.c'...
Done.

Lines 886, Functions/Procedures 35, pCodes 4934
Borland C++ 5.82 for Win32 Copyright (c) 1993, 2005 Borland
fiveform.c:
Borland Resource Compiler Version 5.40
Copyright (c) 1990, 1999 Inprise Corporation. All rights reserved.
Turbo Incremental Link 5.69 Copyright (c) 1997-2005 Borland
Error: Unresolved external '_HB_FUN_EXECUTE' referenced from C:\FWH\SAMPLES\FIVEFORM.OBJ
Error: Unresolved external '_HB_FUN_HB_SETCLSHANDLE' referenced from C:\FWH\SAMPLES\FIVEFORM.OBJ
* Linking errors *
User avatar
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 75 times
Contact:

Re: First steps

Post by Antonio Linares »

James,

FWH function Execute() is only available for Harbour, as xHarbour does not support it. So please add a dummy function Execute()

Same applied to SetClsHandle() though I am afraid there is no workaround here. Just add a dummy function and see how it behaves, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
James Bott
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: First steps

Post by James Bott »

Well, I can get it to compile under xHarbour but it hangs.

Perhaps someone can send me a copy of the Harbour compiled fiveform.exe?

Regards,
James
jbott at compuserve dot com
Post Reply