Page 1 of 1
First steps
Posted: Tue Apr 02, 2013 1:32 pm
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?

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
Re: First steps
Posted: Tue Apr 02, 2013 2:13 pm
by Silvio.Falconi
Marco,
I made a good sample to create easy dialogs here :
viewtopic.php?p=135888#p135888
Re: First steps
Posted: Tue Apr 02, 2013 2:41 pm
by MarcoBoschi
Very Good!
many thanks
marco
Re: First steps
Posted: Tue Apr 02, 2013 5:56 pm
by Enrico Maria Giordano
Marco,
use pixel coordinates.
EMG
Re: First steps
Posted: Tue Apr 02, 2013 7:25 pm
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



Re: First steps
Posted: Wed Apr 03, 2013 11:44 am
by MarcoBoschi
Thank you
Silvio
Enrico
Otto
Re: First steps
Posted: Wed Apr 03, 2013 12:27 pm
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 ..., ...
Re: First steps
Posted: Wed Apr 03, 2013 12:29 pm
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/listbut not sure if that is the latest version
Re: First steps
Posted: Wed Apr 03, 2013 5:08 pm
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
Re: First steps
Posted: Thu Jun 27, 2013 1:10 am
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 *
Re: First steps
Posted: Thu Jun 27, 2013 4:00 am
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
Re: First steps
Posted: Thu Jun 27, 2013 1:20 pm
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