PCToledo escreveu:
But it has as define the size of the fields and the position of labels and
fields?
Remove the widget QFormLayout and use <widget>:move(x,y). To define the
length, use the method <widget>:setMaxLength(nLength).
See sample below:
[code]
STATIC FUNCTION PassWord()
Local oDialog
Local oLabelMessage
Local oLabelUser
Local oLineEditUser
Local oLabelPassword
Local oLineEditPassword
Local oButtonOk
Local r
oDialog := QDialog():New()
oDialog:setWindowTitle("Login")
oDialog:resize(210,130)
oLabelMessage := QLabel():New( QT_PTROF(oDialog) )
oLabelMessage:setText("Enter your password...")
oLabelMessage:move(10,10)
oLabelUser := QLabel():New( QT_PTROF(oDialog) )
oLabelUser:setText("User")
oLabelUser:move(10,30)
oLineEditUser := QLineEdit():New( QT_PTROF(oDialog) )
oLineEditUser:setMaxLength(15)
oLineEditUser:move(60,30)
oLabelPassword := QLabel():New( QT_PTROF(oDialog) )
oLabelPassword:setText("Password")
oLabelPassword:move(10,60)
oLineEditPassWord := QLineEdit():New( QT_PTROF(oDialog) )
oLineEditPassWord:setEchoMode(2)
oLineEditPassWord:setMaxLength(15)
oLineEditPassword:move(60,60)
oButtonOk := QPushButton():New(QT_PTROF( oDialog ))
oButtonOk:setText("OK")
oButtonOk:move(100,90)
Qt_Connect_Signal( QT_PTROF(oButtonOk), "clicked()",
{||IIF(oLineEditUser:text()=="user".and.oLineEditPassword:text()=="password",oDialog:done(1),oDialog:done(0))
})
r := oDialog:exec()
Return IIF(r==1,.t.,.f.)
[/code]
--
Regards,
Marcos Antonio Gambeta
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour