$IFNDEF TRUE
$DEFINE True 1
$ENDIF
$IFNDEF FALSE
$DEFINE False 0
$ENDIF
DECLARE FUNCTION AboutExecute LIB "shell32.dll" ALIAS "ShellExecuteA" (hwnd AS LONG,lpOperation AS STRING,lpFile AS STRING,lpParameters AS STRING,lpDirectory AS STRING,nShowCmd AS LONG) AS LONG
TYPE QAbout EXTENDS QOBJECT
private:
form AS QFORM
BtOk AS QBUTTON
cadre AS QGROUPBOX
label1 AS QLABEL
label2 AS QLABEL
label3 AS QLABEL
label4 AS QLABEL
width AS SHORT
height AS SHORT
send AS STRING
public:
image AS QIMAGE
CAPTION AS STRING
AppName AS STRING
AppVersion AS STRING
text AS STRING
Email AS STRING
Web AS STRING
AppFont AS QFONT
TextFont AS QFONT
EmailFont AS QFONT
WebFont AS QFONT
SUB Show
WITH QAbout
.image.PARENT=.cadre
.image.top=15
.image.left=10
.image.autosize=true
.label1.autosize=true
.label1.left= 65
.AppFont.COLOR = &H004000
.label1.font=.AppFont
.label1.CAPTION=.AppName
.label1.LabelStyle = 2
IF .AppVersion<>"" THEN
IF .AppName<>"" THEN .label1.CAPTION=.label1.CAPTION+CHR$(32)
.label1.CAPTION=.label1.CAPTION+"Version "+.AppVersion
END IF
IF .image.height>.label1.height THEN
.label1.top=15
.height=.image.top+.image.height
ELSE
.label1.top=.image.top
.height=.label1.top+.label1.height
END IF
.label1.PARENT=.cadre
IF .text<>"" THEN
.TextFont.Name = "Arial"
.TextFont.Size = 10
.TextFont.COLOR = &HA00000
.label2.autosize=true
.label2.font=.TextFont
.label2.CAPTION=.text
.label2.left=10
.label2.top=35
.height=.label2.top+.label2.height
.label2.PARENT=.cadre
END IF
IF .Email<>"" THEN
.label3.autosize=true
.EmailFont.Size = 10
.label3.Font=.EmailFont
IF .label3.Font.COLOR=-2147483640 THEN .label3.Font.COLOR=&HFF0000
.label3.Cursor=-21
.label3.CAPTION="E-mail : "+.Email
.label3.LabelStyle = 1
.label3.left=10
.label3.top=.height+10
.height=.label3.top+.label3.height
.label3.PARENT=.cadre
END IF
IF .Web<>"" THEN
.label4.autosize=true
.label4.Font=.WebFont
IF .label4.Font.COLOR=-2147483640 THEN .label4.Font.COLOR=&HFF0000
.label4.Cursor=-21
.label4.CAPTION="Web : "+.Web
.label4.left=10
.label4.top=.height+10
.height=.label4.top+.label4.height
.label4.PARENT=.cadre
END IF
.cadre.top=5
.cadre.left=10
.width=(.label1.left+.label1.width)
IF .text<>"" THEN
IF (.label2.left+.label2.width)>.width THEN .width=(.label2.left+.label2.width)
END IF
IF .Email<>"" THEN
IF (.label3.left+.label3.width)>.width THEN .width=(.label3.left+.label3.width)
END IF
IF .Web<>"" THEN
IF (.label4.left+.label4.width)>.width THEN .width=(.label4.left+.label4.width)
END IF
.width=.width+20
.cadre.width=.width
.cadre.height=.height+10
.cadre.PARENT=.form
.label2.left=(.width-.label2.width)/2
.label3.left=(.width-.label3.width)/2
.label4.left=(.width-.label4.width)/2
.form.width=.cadre.left+.cadre.width+15
.form.height=.cadre.top+.cadre.height+60
.form.borderstyle=3
.form.CAPTION=.CAPTION
.form.center
.BtOk.PARENT=.form
.BtOk.CAPTION="Ok"
.BtOk.default=1
.BtOk.top=.form.clientheight-.BtOk.height-5
.BtOk.left=INT((.form.clientwidth-.BtOk.width)/2)
.form.SHOWMODAL
END WITH
END SUB
EVENT BtOk.OnClick
QAbout.form.modalresult=1
END EVENT
EVENT label3.OnClick
QAbout.send="mailto:"+QAbout.Email
AboutExecute(0,"open",QAbout.send,"","",1)
END EVENT
EVENT label4.OnClick
IF INSTR(LCASE$(QAbout.Web),"http")=0 THEN
QAbout.send="http://"+QAbout.Web
ELSE
QAbout.send=QAbout.Web
END IF
AboutExecute(0,"open",QAbout.send,"","",1)
END EVENT
CONSTRUCTOR
image.transparent=true
text=""
Email=""
Web=""
END CONSTRUCTOR
END TYPE
|