Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
DEFINE CLASS myform AS form
Caption = "Form1"
Name = "Form1"
ADD OBJECT label1 AS label WITH ;
Caption = "myLabel", ;
Height = 17, ;
Left = 84, ;
Top = 60, ;
Width = 84, ;
Name = "Label1"
ENDDEFINE
********************************************************
******** Windows Routines
PROCEDURE AtSay
LPARAMETER pnRow, pnCol, pcText, pcFormat, pcFont, pnSize, pcName
LOCAL lcOFont,lnOSize, lcAlign, lnEndX, lnWidth, lcFormat
LOCAL llOBold, llOItalic, llOUnderline, llOStrike, loForm, llOForeColor, llODrawMode
* pcFormat can contain the normal format characters:
* B=Bold, I=Italic, U=Underline, S=Strikeout
* and additional Alignment characters:
* L=Left, R=Right, C=Center, O=Opaque (transparent is default)
* D=Disabled
lcFormat = upper( iif( VarType(pcFormat)='C', pcFormat, '' ) )
do case
case 'L' $ lcFormat
lcAlign = 'L'
case 'R' $ lcFormat
lcAlign = 'R'
case 'C' $ lcFormat
lcAlign = 'C'
other
lcAlign = 'L'
endcase
if Type(wOutput())='O'
loForm = Eval( wOutput() )
else
loForm = _SCREEN.ActiveForm
endif
*v10.00 if Type('loForm.PageFrame1.Page1')='O'
*v10.00 if loForm.PageFrame1.ActivePage = 0
*v10.00 loForm.PageFrame1.ActivePage = 1
*v10.00 endif
*v10.00 loCont = loForm.PageFrame1.Page1
*v10.00 else
loCont = loForm
*v10.00 endif
WITH loCont
if VarType(pcName)='C'
lcName = pcName
if Type('.'+lcName)='O'
.RemoveObject(lcName)
endif
else
lcName = 'lbl'+sys(2015)
endif
.AddObject(lcName,'Label')
loLbl = Eval('.'+lcName)
lnX = loForm.TextWidth( Space(pnCol) )
loLbl.Top = -100
loLbl.Visible = .T.
loLbl.Width = 0
loLbl.Caption = pcText
loLbl.AutoSize = .T.
loLbl.BackColor = RGB(0,0,192) && 192,192,192)
loLbl.FontName = iif(VarType(pcFont)='C',pcFont,'Arial' )
loLbl.FontSize = iif(VarType(pnSize)='N',pnSize,loForm.FontSize)
lnWidth = loForm.TextWidth( pcText )
lnNewWidth = FontMetric( 6, loLbl.FontName, loLbl.FontSize, ChrTran(lcFormat,'OLRC','') ) * ;
TxtWidth( pcText, loLbl.FontName, loLbl.FontSize, ChrTran(lcFormat,'OLRC','') )
loLbl.BackStyle = iif( 'O'$lcFormat,1,0) && Opaque
do case
case lcAlign='L'
loLbl.Left = lnX
case lcAlign='R'
loLbl.Left = lnX + lnWidth - lnNewWidth
case lcAlign='C'
loLbl.Left = lnX - ( lnNewWidth / 2 )
endcase
loLbl.Enabled = NOT ('D' $ lcFormat)
loLbl.FontBold = 'B' $ lcFormat
loLbl.FontItalic = 'I' $ lcFormat
loLbl.FontUnderline = 'U' $ lcFormat
loLbl.FontStrikethru = 'S' $ lcFormat
loLbl.BorderStyle = 0 && 1
loLbl.AutoSize = .F.
loLbl.Height = loLbl.Height - 2
loLbl.Top = loForm.TextHeight( ' ' )*pnRow
ENDWITH
ENDPROC
procedure PermText
parameter cLabelName, nTop, nLeft, cText, cFont, nSize, nColor
private lcLabel
if type( "_Screen."+cLabelName ) <> "O"
_screen.AddObject( cLabelName, 'Label' ) && 'AutoResizeLabel' )
endif
lcLabel = "_Screen."+cLabelName
with &lcLabel
.BackStyle = 0 && Transparent = 0
.AutoSize = .T.
* .height = hig
* .width = _screen.width
.FontName = cFont
.FontSize = nSize
.FontItalic = .t.
.ForeColor = nColor
.Top = int( nTop )
.Left = int( nLeft )
*v7.13w .atOffset = _screen.Height - .Top && v7.13w wgcs
*v7.13w .alOffset = _screen.Width - .Left && v7.13w wgcs
.Caption = cText
.Visible = .t.
endwith
return
** @ -srows()/6,0 say "c:\computer\images\BB_BB.bmp" BITMAP size sRows()*2, sCols() ISOMETRIC
procedure PermImage
parameter cLabelName, cFileName
private lcLabel
if type( "_Screen."+cLabelName ) <> "O"
_screen.AddObject( cLabelName, 'image' )
endif
lcLabel = "_Screen."+cLabelName
with &lcLabel
.BackStyle = 1 && 1=Opaque; Transparent = 0
.height = _screen.height*2
.width = _screen.width
.Top = 0 - int( _screen.height / 3 )
.Left = 0
.Stretch = 1 && Isometric
.Picture = cFileName
.Visible = .t.
endwith
return