Página 1 de 1

Can't get this to work

Publicado: Lun Ene 17, 2005 5:18 pm
por Christian Lauer
Hola a todos,
I designed a login-dialog which is called before the main program is
executed. I can't assign a value to the edit field. What is wrong?
Thanks for any help!
Saludos
Christian Lauer
Error message:
TFORM:ERROR(179)
Error BASE/1004 Message not found: TFORM:PANELMAIN
Arguments: ()
Here is the code:
>snip>-------------------------------------------
/*
* Projekt: BaSYS
* Datei: BLLogin.prg * Beschreibung:
* Autor:
* Datum: 01-10-2005
*/
#include "Xailer.ch"
#include "BASYS.CH"
//---------------------------------------------------------- --------------------
function BLLogin()
local cMandant := "", cUser := "", cSQL := "",;
formLogin := NIL,;
iResult := mrRetry,;
lSplashScreen := FALSE
MsgAlert("Procedure to login to the application")
begin sequence
formLogin := TForm():New()
formLogin:CreateForm()
formLogin:panelMain:editMandant:Value := BSetMandant()
formLogin:panelMain:editUser:Value := BSetBearbNr()
do case
case BSetDBType() == DB_DESKTOP
formLogin:panelMain:groupDB:radioLocal:lChecked := TRUE
formLogin:panelMain:groupDB:radioLAN:lChecked := FALSE
formLogin:panelMain:groupDB:radioInternet:lChecked := FALSE
case BSetDBType() == DB_LANSERVER
formLogin:panelMain:groupDB:radioLocal:lChecked := FALSE
formLogin:panelMain:groupDB:radioLAN:lChecked := TRUE
formLogin:panelMain:groupDB:radioInternet:lChecked := FALSE
case BSetDBType() == DB_INETSERVER
formLogin:panelMain:groupDB:radioLocal:lChecked := FALSE
formLogin:panelMain:groupDB:radioLAN:lChecked := FALSE
formLogin:panelMain:groupDB:radioInternet:lChecked := TRUE
endcase
iResult := formLogin:ShowModal()
if iResult == mrOK
MsgAlert("OK Button gedrí¼ckt")
endif
end
formLogin := NIL
return TRUE
//---------------------------------------------------------- --------------------
CLASS formLogin FROM TForm
COMPONENT panelMain
COMPONENT oLabel1
COMPONENT oLabel2
COMPONENT oLabel3
COMPONENT groupDB
COMPONENT radioLocal
COMPONENT radioLAN
COMPONENT radioInternet
COMPONENT editMandant
COMPONENT editUser
COMPONENT editPassword
COMPONENT oLabel4
COMPONENT oLabel5
COMPONENT oLabel6
COMPONENT oBtnBmp1
COMPONENT oBtnBmp2
COMPONENT oBtnBmp3
METHOD CreateForm()
METHOD FormCreate( oSender )
ENDCLASS
#include "BLLogIn.xfm"
//---------------------------------------------------------- --------------------
METHOD FormCreate( oSender ) CLASS formLogin
Alert("Create Form")
RETURN Nil
//---------------------------------------------------------- --------------------

Can't get this to work

Publicado: Lun Ene 17, 2005 6:54 pm
por jfgimenez
Christian,
> ...
> begin sequence
> formLogin := TForm():New()
> formLogin:CreateForm()
The above line is not correct. You shouldn't call the CreateForm() method of
a form directly. It's called automatically from inside New().
If you still have problems, you can "publish" your project using the
"Project" > "Publish project..." option, and send the .zip file to this NG.
BTW, you may use "WITH OBJECT / END OBJECT" structures. They make the code
more readable:
WITH OBJECT formLogin := TForm():New()
WITH OBJECT :panelMain
:editMandant:Value := BSetMandant()
:editUser:Value := BSetBearbNr()
WITH OBJECT :groupDB
do case
case BSetDBType() == DB_DESKTOP
:radioLocal:lChecked := TRUE
:radioLAN:lChecked := FALSE
:radioInternet:lChecked := FALSE
case BSetDBType() == DB_LANSERVER
:radioLocal:lChecked := FALSE
:radioLAN:lChecked := TRUE
:radioInternet:lChecked := FALSE
case BSetDBType() == DB_INETSERVER
:radioLocal:lChecked := FALSE
:radioLAN:lChecked := FALSE
:radioInternet:lChecked := TRUE
endcase
END OBJECT
END OBJECT
iResult := :ShowModal()
if iResult == mrOK
MsgAlert("OK Button gedrückt")
endif
end
END OBJECT
--
Regards,
Jose F. Gimenez

Can't get this to work

Publicado: Lun Ene 17, 2005 9:45 pm
por Christian Lauer
Jose,
thanks for your answer. I tried what you suggested without success.
There is already the following error:
TFORM:ERROR(179)
Error BASE/1004 Message not found: TFORM:PANELMAIN
Arguments: ()
I enclosed the project as .zip-file.
BTW: Do you plan to support xHB (commercial xHarbour) and when? Where
can I find more information on additional functions provided by Xailer
(I already realized that MsgAlert(), which too is provided by FiveWin,
also works under Xailor)?
Regards
Christian Lauer
--

Can't get this to work

Publicado: Mar Ene 18, 2005 10:16 am
por jfgimenez
Christian,
> thanks for your answer. I tried what you suggested without success.
> There is already the following error:
>
> TFORM:ERROR(179)
> Error BASE/1004 Message not found: TFORM:PANELMAIN
> Arguments: ()
>
> I enclosed the project as .zip-file.
I'm affraid you have attached a wrong file. Please, use the option "Publish
project..." from the "Project" menu. That option let you create a .zip file
automatically with the required project's files.
> BTW: Do you plan to support xHB (commercial xHarbour) and when?
Yes, we plan to support other C compilers than BCC, including MSVC and
PellesC. xHB will be supported also.
Now we're working on the pre-release; we'll begin this task in a few weeks.
> Where can I find more information on additional functions provided by
> Xailer
> (I already realized that MsgAlert(), which too is provided by FiveWin,
> also works under Xailor)?
For now, almost documentation is in spanish; it's located in xailerdoc,
and a few classes are already included in the Xailer's help. But we are
working in the english translation.
--
Regards,
Jose F. Gimenez

Can't get this to work

Publicado: Mié Ene 19, 2005 9:50 am
por jfgimenez
Christian,
the problem is in this line:
WITH OBJECT formLogin := TForm():New()
In Xailer, every form is a new class derived from TForm, but not an instance
of TFom. So, the right way to instantiate a form is instantiating its own
class:
WITH OBJECT formLogin := formLogin():New()
However, as every forms are derived from TForm, all properties and methods
from TForm are available.
> Do you need any help in translating, e.g. english to german?
Thanks for your offer, but actually both GUI and IDE are in german too.
There are 8 languages supported: Spanish, English, French, German, Italian,
Portuguese, Catala and Galician.
--
Un saludo,
José F. Giménez

Can't get this to work

Publicado: Mié Ene 19, 2005 12:26 pm
por Christian Lauer
Jose
thank you very much for your assistance, now it works fine.
Though in this construct
WITH OBJECT formLogin := TForm():New()
WITH OBJECT :panelMain ----------------> this results in an error
:editMandant:Value := BSetMandant()
:editUser:Value := BSetBearbNr()
WITH OBJECT :groupDB --------------> this results in an error too
do case
case BSetDBType() == DB_DESKTOP
:radioLocal:lChecked := TRUE
:radioLAN:lChecked := FALSE
:radioInternet:lChecked := FALSE
....
because editMandant seams not to be created and the same belongs to
radioLocal etc.
In the .frx file, the creating of :panelMain is enclosed in WITH OBJECT
.... END, same ist :groupDB.
So I think, editMandant and radioLocal are directly descendants from
formLogin rather than panelMain or groupDB? After removing WITH OBJECT
for panelMain and groupDB I didn't get any error message.
Saludos
Christian Lauer

Can't get this to work

Publicado: Mié Ene 19, 2005 12:48 pm
por jfgimenez
Christian,
> So I think, editMandant and radioLocal are directly descendants from
> formLogin rather than panelMain or groupDB? After removing WITH OBJECT for
> panelMain and groupDB I didn't get any error message.
Yes, you are right. Every control on a form, even if they are onto any other
container control, belong directly to the form, and are declared in the form
class. So, in all metods you should use ::XXXX (e.g ::panelMain, ::groupDB,
etc.) to access any component or control of the form.
--
Regards,
Jose F. Gimenez