* **************************************************
*
*  COMPONENT:  STD_FORM
*
* **************************************************
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Clientwidth(783) Clientheight(438) Componentversion(2) Left(997) Top(258) Layoutmanager(#AttachLayout1)

* Layout
Define_Com Class(#PRIM_ATLM) Name(#AttachLayout1)
Define_Com Class(#PRIM_ATLI) Name(#AttachItem1) Manage(#Button_ActiveX) Parent(#AttachLayout1) Attachment(Bottom)
Define_Com Class(#PRIM_ATLI) Name(#AttachItem2) Manage(#Button_inBrowser) Parent(#AttachLayout1) Attachment(Bottom)
Define_Com Class(#PRIM_ATLI) Name(#AttachItem3) Manage(#DF_WEBAC) Parent(#AttachLayout1) Attachment(Center)

* Components
Define_Com Class(#DF_WEBAC.WebBrowser) Name(#DF_WEBAC) Displayposition(1) Height(388) Left(0) Parent(#COM_OWNER) Tabposition(1) Top(0) Width(783)
Define_Com Class(#PRIM_PHBN) Name(#Button_ActiveX) Displayposition(2) Left(0) Parent(#COM_OWNER) Tabposition(2) Top(388) Width(783) Caption('Show in ActiveX')
Define_Com Class(#PRIM_PHBN) Name(#Button_inBrowser) Caption('Show in Browser') Displayposition(3) Left(0) Parent(#COM_OWNER) Tabposition(3) Top(413) Width(783)

Evtroutine Handling(#com_owner.CreateInstance)

Set Com(#com_owner) Caption(*component_desc)

Endroutine

Evtroutine Handling(#Button_ActiveX.Click)
Define_Com Class(#prim_alph) Name(#tgt_file)

#tgt_file := *Temp_Dir + GanntChart2_with_Metatag.htm
#DF_WEBAC.Navigate Url(#tgt_file)

Endroutine
Evtroutine Handling(#Button_inBrowser.Click)
Define_Com Class(#prim_alph) Name(#tgt_file)

#tgt_file := *Temp_Dir + GanntChart2_with_Metatag.htm

Use Builtin(SYSTEM_COMMAND) With_Args(H #tgt_file) To_Get(#VF_ELNUM)

Endroutine

Mthroutine Name(HowtoWriteAHtmlFile)
Define_Com Class(#prim_alph) Name(#tgt_file)
Define_Com Class(#prim_alph) Name(#uLine)

Define Field(#FILENO) Type(*DEC) Length(3) Decimals(0) Desc('Allocated file number')
Define Field(#OPTIONS) Type(*CHAR) Length(256) Desc('Options for stream file open')
Define Field(#RETC) Type(*Char) Length(2) Desc('Return Code')

#tgt_file := *Temp_Dir + GanntChart2_with_Metatag.htm
#OPTIONS := '''Write'''

Use Builtin(STM_FILE_OPEN) With_Args(#tgt_file #OPTIONS) To_Get(#FILENO #RETC)
If (#RETC = OK)

* Write out the lines of  the html file (including the data)
Use Builtin(STM_FILE_WRITE) With_Args(#FILENO #uLine) To_Get(#RETC)

Endif
Use Builtin(STM_FILE_CLOSE) With_Args(#FILENO)

Endroutine
End_Com
