home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of Windows 95.com 1996 December
/
WIN95_DEC_1996_3.ISO
/
addins
/
html101.ZIP
/
HTMLMODE.DAS
next >
Wrap
Text File
|
1996-02-29
|
40KB
|
1,511 lines
'********************************************************************
' HTML mode for Dana
' carty, 1995
'ver 1.00E rel. 95/11
'ver 1.01E rel. 96/02
'********************************************************************
Const WIN32S = False
'--------------------------------------------------------------------
' If you are running Dana on Win32s, set this True.
'--------------------------------------------------------------------
Const HTMLVER = 3
'--------------------------------------------------------------------
' Specify HTML version. Actually less than 2 just means 2.
'--------------------------------------------------------------------
Const NETSCAPE = True
'--------------------------------------------------------------------
' If you want to use NetScape extention, set this True.
' But, some very popular tags like <CENTER> can be used if you set
' this False
'--------------------------------------------------------------------
Const T_HEADSIZE1 = 1
Const T_HEADSIZE2 = 2
Const T_HEADSIZE3 = 3
Const T_HEADSIZE4 = 4
Const T_HEADSIZE5 = 5
Const T_HEADSIZE6 = 6
Const T_PREFORMAT = 7
Const T_CENTER = 8
Const T_BLINK = 9
Const T_COMMENT = 10
Const T_DIVISION = 11
Const T_BLOCKQUOTE= 12
Const T_EMPHASIS = 13
Const T_STRONG = 14
Const T_CITATION = 15
Const T_CODE = 16
Const T_SAMPLE = 17
Const T_KEYBOARD = 18
Const T_VARIABLE = 19
Const T_DEFINITION= 20
Const T_ADDRESS = 21
Const T_FONTSIZE1 = 31
Const T_FONTSIZE2 = 32
Const T_FONTSIZE3 = 33
Const T_FONTSIZE4 = 34
Const T_FONTSIZE5 = 35
Const T_FONTSIZE6 = 36
Const T_FONTSIZE7 = 37
Const T_FONTCOLOR = 38
Const T_FONTBOLD = 39
Const T_FONTITALIC= 40
Const T_FONTFIX = 41
Const T_FONTUNDER = 42
Const T_FONTSTRIKE= 43
Const T_FONTSUB = 44
Const T_FONTSUPER = 45
Const T_FONTBIG = 51
Const T_FONTSMALL = 52
Const T_FONTBASE1 = 61
Const T_FONTBASE2 = 62
Const T_FONTBASE3 = 63
Const T_FONTBASE4 = 64
Const T_FONTBASE5 = 65
Const T_FONTBASE6 = 66
Const T_FONTBASE7 = 67
Const T_REPEAT = 99
Const T_LINKHTTP = 101
Const T_LINKFTP = 102
Const T_LINKFILE = 103
Const T_LINKIMAGE = 111
Const T_LINKINLINE= 112
Const T_LIST = 201
Const T_NUMLIST = 202
Const T_MENULIST = 203
Const T_DIRLIST = 204
Const T_DEFLIST = 205
Const T_LISTITEM = 206
Const T_PARAGRAPH = 301
Const T_PARABREAK = 302
Const T_PARAHORZ = 303
Const T_LEFT = 401
Const T_RIGHT = 402
Const T_AMP = 403
Const T_QUOTE = 404
Const T_SPACE = 405
Const T_TRADEMARK = 406
Const T_COPYRIGHT = 407
Const T_TABLE = 501
Const T_TABLEHEAD = 502
Const T_TABLEDATA = 503
Const T_TABLEROW = 504
Const T_CAPTION = 505
Const T_FORM = 601
Const T_SUBMIT = 602
Const T_RESET = 603
Const T_TEXT = 604
Const T_PASSWORD = 605
Const T_CHECKBOX = 606
Const T_RADIO = 607
Const T_SELECT = 608
Const T_TEXTAREA = 609
Const T_MAILADDRESS = 901
Const T_HEADER = 902
Const T_TITLE = 903
Const T_BODY = 904
Const T_INPUTTAG = 990
Const T_TAGDELETE = 997
Const T_TEMPLATE = 998
Const T_EXIT = 999
Const VK_RBUTTON = &H02
Const VK_ESCAPE = &H1B
Const VK_RETURN = &H0D
Const MB_YESNO = &H04
Const MB_YESNOCANCEL = &H03
Const MB_ICONQUESTION = &H20
Const MB_DEFBUTTON1 = &H0
Const MB_DEFBUTTON2 = &H100
Const IDOK = 1
Const IDCANCEL = 2
Const IDYES = 6
Const IDNO = 7
Const STATE_INIT = 0
Const STATE_BEFORE_OPEN = 1
Const STATE_AFTER_OPEN = 2
Const STATE_BEFORE_SAVE = 4
Const STATE_AFTER_SAVE = 5
Const STATE_KEY_PRESS = 8
Const STATE_CHAR = 9
Dim hMenu%
Dim hMenuBase%
Dim hMenuChar%
Dim hMenuFont%
Dim hMenuForm%
Dim hMenuHead%
Dim hMenuLink%
Dim hMenuList%
Dim hMenuOther%
Dim hMenuPara%
Dim hMenuSize%
Dim hMenuSpec%
Dim hMenuTable%
Declare Proc ChooseColor Lib "ComDlg32" Alias "ChooseColorA" (cc%) As Integer
Declare Proc wsprintf Lib "User32" Alias "wsprintfA" (s$, fmt$, ..)
Declare Proc GetProfileString Lib "Kernel32" Alias "GetPrivateProfileStringA" (sec$, key$, def$, buf$, nbuf%, fname$)
Declare Proc WriteProfileString Lib "Kernel32" Alias "WritePrivateProfileStringA" (sec$, key$, def$, fname$)
Static address$ ' mail address
Static nNum% ' temporary counter
Static nRpt% ' previous tag
Main ()
Select Case .DanaState
Case STATE_INIT
MenuInit()
StayResident()
Case STATE_KEY_PRESS
OnKeyPress(.ParmA, .ParmB)
Case STATE_CHAR
OnChar(.ParmA)
Case STATE_AFTER_OPEN
OnAfterOpen()
Case STATE_BEFORE_SAVE
OnBeforeSave(.ParmStrA)
Case STATE_AFTER_SAVE
OnAfterSave()
Case Else
End Select
End
'/////////////////////////////////////////////////////////
' Message handlers
'///////////////////////////////
' Key pressed
Proc OnKeyPress(nKey%, nShift%)
Dim cmd$
cmd$ = KeyToCmd(nKey, nShift)
If nKey = VK_ESCAPE Or nKey = VK_RBUTTON Then
HTMLMain()
.ParmA = 0 ' Default key should be ignored.
Else If nKey = VK_RETURN Then
If nShift = &H20 Then
AddEnd("P")
.ParmA = 0
Else If nShift = &H40 Then
AddEnd("BR")
.ParmA = 0
End If
Else If cmd$ = "Repeat" Then
HTMLDispatch(T_REPEAT)
.ParmA = 0
End If
End Proc
'///////////////////////////////
' Char input
Proc OnChar(nChar%)
End Proc
'///////////////////////////////
' After open file
Proc OnAfterOpen()
End Proc
'///////////////////////////////
' Before save file
Proc OnBeforeSave(strName$)
End Proc
'///////////////////////////////
' After save file
Proc OnAfterSave()
End Proc
'//////////////////////////////////////////////////////////////////
' Initialize Main Menu
Proc MenuInit()
Dim fp%
Dim s$
address$ = Space(256)
GetProfileString("HTML", "Address", "", address$, 256, .HomePath + "DanaInet.INI")
If address$ = "" Then
GetProfileString("Mail", "Address", "", address$, 256, .HomePath + "DanaInet.INI")
End If
hMenu = NewMenu()
AddMenuItem(hMenu, "&Repeat", T_REPEAT)
hMenuChar = AddMenuItem(hMenu, "&Characters", 0)
hMenuHead = AddMenuItem(hMenuChar, "&Header", 0)
AddMenuItem(hMenuHead, "Size&1", T_HEADSIZE1)
AddMenuItem(hMenuHead, "Size&2", T_HEADSIZE2)
AddMenuItem(hMenuHead, "Size&3", T_HEADSIZE3)
AddMenuItem(hMenuHead, "Size&4", T_HEADSIZE4)
AddMenuItem(hMenuHead, "Size&5", T_HEADSIZE5)
AddMenuItem(hMenuHead, "Size&6", T_HEADSIZE6)
If HTMLVER >= 3 Then
AddMenuItem(hMenuChar, "&Division", T_DIVISION)
End If
AddMenuItem(hMenuChar, "&Pre formatted", T_PREFORMAT)
AddMenuItem(hMenuChar, "&Center", T_CENTER)
If NETSCAPE = True Then
AddMenuItem(hMenuChar, "B&link", T_BLINK)
End If
AddMenuItem(hMenuChar, "&Emphasis", T_EMPHASIS)
AddMenuItem(hMenuChar, "S&trong", T_STRONG)
AddMenuItem(hMenuChar, "Cit&ation", T_CITATION)
AddMenuItem(hMenuChar, "C&ode", T_CODE)
AddMenuItem(hMenuChar, "&Sample", T_SAMPLE)
AddMenuItem(hMenuChar, "&Keyboard", T_KEYBOARD)
AddMenuItem(hMenuChar, "&Variable", T_VARIABLE)
AddMenuItem(hMenuChar, "Co&mment", T_COMMENT)
hMenuFont = AddMenuItem(hMenu, "Fo&nt", 0)
If NETSCAPE = True Then
hMenuSize = AddMenuItem(hMenuFont, "Si&ze", 0)
AddMenuItem(hMenuSize, "Size&1", T_FONTSIZE1)
AddMenuItem(hMenuSize, "Size&2", T_FONTSIZE2)
AddMenuItem(hMenuSize, "Size&3", T_FONTSIZE3)
AddMenuItem(hMenuSize, "Size&4", T_FONTSIZE4)
AddMenuItem(hMenuSize, "Size&5", T_FONTSIZE5)
AddMenuItem(hMenuSize, "Size&6", T_FONTSIZE6)
AddMenuItem(hMenuSize, "Size&7", T_FONTSIZE7)
AddMenuItem(hMenuFont, "&Color...", T_FONTCOLOR)
End If
AddMenuItem(hMenuFont, "&Bold", T_FONTBOLD)
AddMenuItem(hMenuFont, "&Italic", T_FONTITALIC)
AddMenuItem(hMenuFont, "&Typewriter", T_FONTFIX)
If HTMLVER >= 3 Then
AddMenuItem(hMenuFont, "&Underline", T_FONTUNDER)
AddMenuItem(hMenuFont, "&Strikeout", T_FONTSTRIKE)
AddMenuItem(hMenuFont, "Subsc&ript", T_FONTSUB)
AddMenuItem(hMenuFont, "Su&perscript", T_FONTSUPER)
AddMenuItem(hMenuFont, "S&mall Font", T_FONTSMALL)
AddMenuItem(hMenuFont, "&Large Font", T_FONTBIG)
End If
If NETSCAPE = True Then
hMenuBase = AddMenuItem(hMenuFont, "B&ase Size", 0)
AddMenuItem(hMenuBase, "Size&1", T_FONTBASE1)
AddMenuItem(hMenuBase, "Size&2", T_FONTBASE2)
AddMenuItem(hMenuBase, "Size&3", T_FONTBASE3)
AddMenuItem(hMenuBase, "Size&4", T_FONTBASE4)
AddMenuItem(hMenuBase, "Size&5", T_FONTBASE5)
AddMenuItem(hMenuBase, "Size&6", T_FONTBASE6)
AddMenuItem(hMenuBase, "Size&7", T_FONTBASE7)
End If
hMenuLink = AddMenuItem(hMenu, "Lin&k", 0)
AddMenuItem(hMenuLink, "&HTTP...", T_LINKHTTP)
AddMenuItem(hMenuLink, "F&TP...", T_LINKFTP)
AddMenuItem(hMenuLink, "&File...", T_LINKFILE)
AddMenuItem(hMenuLink, "&Inline Image...", T_LINKIMAGE)
AddMenuItem(hMenuLink, "Inline &Source...", T_LINKINLINE)
hMenuList = AddMenuItem(hMenu, "&List", 0)
AddMenuItem(hMenuList, "Norma&l", T_LIST)
AddMenuItem(hMenuList, "&Numbered", T_NUMLIST)
AddMenuItem(hMenuList, "&Menu", T_MENULIST)
AddMenuItem(hMenuList, "Di&rectory", T_DIRLIST)
AddMenuItem(hMenuList, "&Defined", T_DEFLIST)
AddMenuItem(hMenuList, "List &Items", T_LISTITEM)
hMenuPara = AddMenuItem(hMenu, "&Paragraph", 0)
AddMenuItem(hMenuPara, "B&reak", T_PARABREAK)
AddMenuItem(hMenuPara, "&Paragraph", T_PARAGRAPH)
AddMenuItem(hMenuPara, "&Horizontal Line", T_PARAHORZ)
hMenuSpec = AddMenuItem(hMenu, "&Special Characters", 0)
AddMenuItem(hMenuSpec, "&<", T_LEFT)
AddMenuItem(hMenuSpec, "&>", T_RIGHT)
AddMenuItem(hMenuSpec, "&Ampersand", T_AMP)
AddMenuItem(hMenuSpec, Chr(34) + "(&Quote)", T_QUOTE)
AddMenuItem(hMenuSpec, "&Space", T_SPACE)
AddMenuItem(hMenuSpec, "&Registered Trademark", T_TRADEMARK)
AddMenuItem(hMenuSpec, "&Copyright", T_COPYRIGHT)
If HTMLVER >= 3 Then
hMenuTable = AddMenuItem(hMenu, "&Table", 0)
AddMenuItem(hMenuTable, "&Table...", T_TABLE)
AddMenuItem(hMenuTable, "Table &Row", T_TABLEROW)
AddMenuItem(hMenuTable, "&Caption", T_CAPTION)
AddMenuItem(hMenuTable, "Table &Header", T_TABLEHEAD)
AddMenuItem(hMenuTable, "Table &Data", T_TABLEDATA)
End If
hMenuForm = AddMenuItem(hMenu, "&Form", 0)
AddMenuItem(hMenuForm, "&Form...", T_FORM)
AddMenuItem(hMenuForm, "&Submit...", T_SUBMIT)
AddMenuItem(hMenuForm, "&Reset...", T_RESET)
AddMenuItem(hMenuForm, "&Text Box...", T_TEXT)
AddMenuItem(hMenuForm, "&Password...", T_PASSWORD)
AddMenuItem(hMenuForm, "&Check Box...", T_CHECKBOX)
AddMenuItem(hMenuForm, "Ra&dio Button...", T_RADIO)
AddMenuItem(hMenuForm, "&Selection Box...", T_SELECT)
AddMenuItem(hMenuForm, "Text &Area...", T_TEXTAREA)
hMenuOther = AddMenuItem(hMenu, "&Others", 0)
AddMenuItem(hMenuOther, "&Mail Address...", T_MAILADDRESS)
AddMenuItem(hMenuOther, "&Head", T_HEADER)
AddMenuItem(hMenuOther, "&Title", T_TITLE)
AddMenuItem(hMenuOther, "&Body", T_BODY)
AddMenuItem(hMenuOther, "&Input Tag...", T_INPUTTAG)
AddMenuItem(hMenu, "", -1)
AddMenuItem(hMenu, "R&emove Tags...", T_TAGDELETE)
AddMenuItem(hMenu, "Te&mplate...", T_TEMPLATE)
AddMenuItem(hMenu, "E&xit HTML mode", T_EXIT)
End Proc
'//////////////////////////////////////////////////////////////////
' HTML command call
Proc HTMLMain()
Dim nC%
Dim sCsr$
If .BlkDisp = False Then
Dim nSaveCol%
nSaveCol% = .Column
Silent()
nC = GetCurrentChar()
Do
If .CsrX > 0 Then
Command("CsrLeft")
Else
Exit Do
End If
nC = GetCurrentChar()
If nC = Asc(">") Then Exit Do
If nC = Asc("<") Then
Command("CsrRight")
sCsr$ = GetCursorWord()
NoSilent()
InTag(sCsr$)
GotoThere(0, nSaveCol)
Return
End If
Loop While True
GotoThere(0, nSaveCol)
NoSilent()
End If
Dim nRC%
nRC = DoMenu(hMenu)
HTMLDispatch(nRC)
End Proc
Proc HTMLDispatch(nRC%)
If nRC = T_REPEAT Then
nRC = nRpt
Else
If nRC <> -1 Then nRpt = nRC
End If
Select Case nRC
Case -1
Case T_HEADSIZE1
AddTag("H1")
Case T_HEADSIZE2
AddTag("H2")
Case T_HEADSIZE3
AddTag("H3")
Case T_HEADSIZE4
AddTag("H4")
Case T_HEADSIZE5
AddTag("H5")
Case T_HEADSIZE6
AddTag("H6")
Case T_PREFORMAT
AddParaTag("PRE")
Case T_CENTER
AddTag("CENTER")
Case T_BLINK
AddTag("BLINK")
Case T_DIVISION
AddTag("DIV")
Case T_BLOCKQUOTE
AddTag("BLOCKQUOTE")
Case T_EMPHASIS
AddTag("EM")
Case T_STRONG
AddTag("STRONG")
Case T_CITATION
AddTag("CITE")
Case T_CODE
AddTag("CODE")
Case T_SAMPLE
AddTag("SAMP")
Case T_KEYBOARD
AddTag("KBD")
Case T_VARIABLE
AddTag("VAR")
Case T_DEFINITION
AddTag("DFN")
Case T_ADDRESS
AddTag("ADDRESS")
Case T_COMMENT
AddCmt()
Case T_FONTSIZE1
AddFontSize(1)
Case T_FONTSIZE2
AddFontSize(2)
Case T_FONTSIZE3
AddFontSize(3)
Case T_FONTSIZE4
AddFontSize(4)
Case T_FONTSIZE5
AddFontSize(5)
Case T_FONTSIZE6
AddFontSize(6)
Case T_FONTSIZE7
AddFontSize(7)
Case T_FONTBASE1
AddBaseSize(1)
Case T_FONTBASE2
AddBaseSize(2)
Case T_FONTBASE3
AddBaseSize(3)
Case T_FONTBASE4
AddBaseSize(4)
Case T_FONTBASE5
AddBaseSize(5)
Case T_FONTBASE6
AddBaseSize(6)
Case T_FONTBASE7
AddBaseSize(7)
Case T_FONTCOLOR
AddFontColor()
Case T_FONTBOLD
AddTag("B")
Case T_FONTITALIC
AddTag("I")
Case T_FONTFIX
AddTag("TT")
Case T_FONTUNDER
AddTag("U")
Case T_FONTSTRIKE
AddTag("S")
Case T_FONTSUB
AddTag("SUB")
Case T_FONTSUPER
AddTag("SUP")
Case T_FONTBIG
AddTag("BIG")
Case T_FONTSMALL
AddTag("SMALL")
Case T_LIST
AddList("UL")
Case T_NUMLIST
AddList("OL")
Case T_MENULIST
AddList("MENU")
Case T_DIRLIST
AddList("DIR")
Case T_DEFLIST
AddDefList()
Case T_LISTITEM
AddTops("LI")
Case T_PARABREAK
AddEnd("BR")
Case T_PARAGRAPH
AddEnd("P")
Case T_PARAHORZ
InsertString("<HR>" + Chr(10))
Case T_LEFT
InsertString("<")
Case T_RIGHT
InsertString(">")
Case T_AMP
InsertString("&")
Case T_QUOTE
InsertString(""")
Case T_SPACE
InsertString(" ")
Case T_TRADEMARK
InsertString("®")
Case T_COPYRIGHT
InsertString("©")
Case T_TABLE
AddTable()
Case T_TABLEHEAD
AddTag("TH")
Case T_TABLEDATA
AddTag("TD")
Case T_TABLEROW
AddParaTag("TR")
Case T_FORM
AddForm()
Case T_SUBMIT
AddButton("SUBMIT")
Case T_RESET
AddButton("RESET")
Case T_TEXT
AddText("TEXT")
Case T_PASSWORD
AddText("PASSWORD")
Case T_CHECKBOX
AddCheck("CHECKBOX")
Case T_RADIO
AddCheck("RADIO")
Case T_SELECT
AddSelect()
Case T_TEXTAREA
AddTextArea()
Case T_LINKHTTP
AddRef(InputBox("Input URL", "", "http://"))
Case T_LINKFTP
AddRef(InputBox("Input URL", "", "ftp://"))
Case T_LINKFILE
AddRef(GetOpenFile("*.*"))
Case T_LINKIMAGE
AddImage()
Case T_LINKINLINE
AddInline()
Case T_MAILADDRESS
AddAddress()
Case T_HEADER
AddParaTag("HEAD")
Case T_TITLE
AddTag("TITLE")
Case T_BODY
AddParaTag("BODY")
Case T_INPUTTAG
AddTag(InputBox("Input tag", "", ""))
Case T_TAGDELETE
TagDelete()
Case T_TEMPLATE
AddTemplate()
Case T_EXIT
WriteProfileString("HTML", "Address", address$, .HomePath + "DanaInet.INI")
DiscardMenu(hMenu)
Terminate()
End Select
End Proc
'//////////////////////////////////////////////////////////////////
' Delete Tags
Proc TagDelete()
Dim s$, t$
s$ = GetSelected()
If s$ = "" Then Return
If MsgBox("Are you sure to delete all the tags in the selection?", "", MB_YESNO) = IDNO Then
Return
End If
t$ = s$
Dim Is%, It%, nC%
Dim bInTag%
Is = 0
It = 0
While True
nC = LodB(s$, Is)
Is = Is + 1
If nC = &H00 Then
StoB(t$, It, nC)
Exit While
End If
If bInTag = True Then
If nC = &H3E Then
bInTag = False
End If
Else
If nC = &H3C Then '<
bInTag = True
Else
StoB(t$, It, nC)
It = It + 1
End If
End If
Wend
DelSelect()
InsertString(t$)
End Proc
'//////////////////////////////////////////////////////////////////
' Template
Proc AddTemplate()
Dim mask$
Dim title$
mask$ = ".html"
If WIN32S Then mask$ = ".htm"
Dim n%
Dim f$
f$ = GetOpenFile("*" + mask$)
n = InStr(f$, ".")
If n Then
n = n - 1
Else
n = Len(f$)
f$ = f$ + mask$
End If
FileOpen(f$)
Dim rc%
If .TotLine > 1 Then
rc = MsgBox("It is not a new file" + Chr(10) + "Do you clear it?", "", MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2)
If rc = IDYES Then
Command("SelectAll")
DelSelect()
Else
Return
End If
End If
title$ = Left(.FileName, n)
title$ = InputBox("Input title", "", title$ + " Home Page")
address$ = InputBox("Input your E-Mail address", "", address$)
InsertString("<HTML>" + Chr(10) + "<HEAD>" + Chr(10) + "<TITLE>" + title$ + "</TITLE>" + Chr(10) + "</HEAD>" + Chr(10))
InsertString("<BODY>" + Chr(10))
InsertString("<CENTER><H2>Welcome to " + title$ + "</H2></CENTER><P>" + Chr(10))
InsertString("<HR>" + Chr(10))
InsertString(Chr(10) + "<!-- Main Subject -->" + Chr(10) + "<P>" + Chr(10) + Chr(10))
InsertString("<HR>" + Chr(10))
InsertString("<ADDRESS><A HREF=" + Chr(34) + "mailto:" + address$ + Chr(34) + ">")
InsertString("<" + address$ + "></A></ADDRESS><BR>" + Chr(10))
InsertString("</BODY>" + Chr(10) + "</HTML>")
FindBack("<!-- Main Subject -->", "")
Command("CsrLeft")
Command("CsrRight")
End Proc
'//////////////////////////////////////////////////////////////////
' Add Table
Proc AddTable()
If .BlkDisp = False Then
InsertString("<TABLE>" + Chr(10) + Chr(10) + "</TABLE>" + Chr(10))
Return
End If
Dim bCap%
Dim bHead%
If MsgBox("Do you want to make the first line a caption?", "", MB_YESNO | MB_ICONQUESTION) = IDYES Then
bCap = True
Else
bCap = False
End If
If MsgBox("Do you want to make the first line in each text block a header?", "", MB_YESNO | MB_ICONQUESTION) = IDYES Then
bHead = True
Else
bHead = False
End If
Silent()
Dim nTopL%, nBotL%, nLine%, I%
nTopL = .BlkBegL
nBotL = .BlkEndL
If .BlkEndC = 1 Then nBotL = nBotL-1
JumpLine(nTopL)
GotoThere(0, 1)
InsertString("<TABLE>" + Chr(10))
nLine = nTopL + 1
nBotL = nBotL + 1
Dim hLine%, sLine$
hLine = GetCurrentLine()
If bCap = True Then
sLine$ = LoadThisLine(hLine)
sLine$ = "<CAPTION>" + sLine$ + "</CAPTION>"
Command("DeleteAfter")
InsertString(sLine$)
nLine = nLine + 1
JumpLine(nLine)
GotoThere(0, 1)
End If
Dim bInBlock%
Dim TD$
bInBlock = False
Do While nLine <= nBotL
TD$ = "TD"
If bInBlock = False Then
InsertString("<TR>" + Chr(10))
bInBlock = True
nLine = nLine + 1
nBotL = nBotL + 1
If bHead = True Then
TD$ = "TH"
End If
End If
hLine = GetCurrentLine()
sLine$ = LoadThisLine(hLine)
If sLine$ = "" Then
sLine$ = "</TR>"
bInBlock = False
Else
sLine$ = "<" + TD$ + ">" + sLine$ + "</"+ TD$ + ">"
End If
Command("DeleteAfter")
InsertString(sLine$)
nLine = nLine + 1
JumpLine(nLine)
GotoThere(0, 1)
Loop
If bInBlock = True Then
InsertString("</TR>" + Chr(10))
End If
InsertString("</TABLE>")
NoSilent()
SelectCancel()
Refresh()
End Proc
'//////////////////////////////////////////////////////////////////
' Add Form
Proc AddForm()
Dim Action$
Dim Form$
Dim nTopL%, nBotL%
Silent()
If .BlkDisp = True Then
nTopL = .BlkBegL
nBotL = .BlkEndL
If .BlkEndC = 1 Then nBotL = nBotL-1
Else
nTopL = .LineNoL
nBotL = .LineNoL
End If
JumpLine(nTopL)
Command("BegLine")
Action$ = InputBox("Input action", "", "mailto:" + address$)
Form$ = "<FORM METHOD=" + Chr(34) + "POST" + Chr(34) + " "
Form$ = Form$ + "ACTION=" + Chr(34) + Action$ + Chr(34) + ">" + Chr(10)
InsertString(Form$)
nBotL = nBotL + 1
JumpLine(nBotL)
SelectCancel()
Command("InsertAft")
Form$ = "</FORM>"
InsertString(Form$)
NoSilent()
Command("MakeMid")
End Proc
'//////////////////////////////////////////////////////////////////
' Add Submit/Cancel Button
Proc AddButton(t$)
Dim s$
Dim v$
v$ = InputBox("Input caption", "", "")
s$ = "<INPUT TYPE=" + Chr(34) + t$ + Chr(34)
If v$ <> "" Then
s$ = s$ + " VALUE=" + Chr(34) + v$ + Chr(34)
End If
s$ = s$ + "><P>" + Chr(10)
InsertString(s$)
End Proc
'//////////////////////////////////////////////////////////////////
' Add Text Box
Proc AddText(t$)
Dim s$
Dim n$, v$
nNum = nNum + 1
n$ = InputBox("Input a name of the field", "", t$ + Str(nNum))
v$ = InputBox("Input initial value", "", "")
s$ = "<INPUT NAME=" + Chr(34) + n$ + Chr(34) + " TYPE=" + Chr(34) + t$ + Chr(34)
If v$ <> "" Then
s$ = s$ + " VALUE=" + Chr(34) + v$ + Chr(34)
End If
s$ = s$ + "><P>" + Chr(10)
InsertString(s$)
End Proc
'//////////////////////////////////////////////////////////////////
' Add Check Box
Proc AddCheck(t$)
Dim s$
Dim n$, v$
nNum = nNum + 1
n$ = InputBox("Input a name of the field", "", t$ + Str(nNum))
v$ = InputBox("Input initial value", "", "True")
s$ = "<INPUT NAME=" + Chr(34) + n$ + Chr(34) + " TYPE=" + Chr(34) + t$ + Chr(34)
If v$ <> "" Then
s$ = s$ + " VALUE=" + Chr(34) + v$ + Chr(34)
End If
s$ = s$ + ">"
InsertString(s$)
End Proc
'//////////////////////////////////////////////////////////////////
' Add Text Area
Proc AddTextArea()
Dim n$, s$
nNum = nNum + 1
n$ = InputBox("Input a name of the field", "", "TextArea" + Str(nNum))
s$ = "<TEXTAREA NAME=" + Chr(34) + n$ + Chr(34)
s$ = s$ + "></TEXTAREA><P>" + Chr(10)
InsertString(s$)
End Proc
'//////////////////////////////////////////////////////////////////
' Add Selection Box
Proc AddSelect()
Dim nTopL%, nBotL%
Silent()
If .BlkDisp = True Then
nTopL = .BlkBegL
nBotL = .BlkEndL
If .BlkEndC = 1 Then nBotL = nBotL-1
Else
nTopL = .LineNoL
nBotL = .LineNoL
End If
JumpLine(nTopL)
Command("BegLine")
Dim n$, z$
Dim Items%
nNum = nNum + 1
n$ = InputBox("Input a name of the field", "", "Select" + Str(nNum))
Items% = (nBotL-nTopL) + 1
If Items > 10 Then Items = 10
Dim s$
s$ = "<SELECT NAME=" + Chr(34) + n$ + Chr(34) + ">" + Chr(10)
InsertString(s$)
nBotL = nBotL + 1
Dim nLine%
nLine = nTopL + 1
While nLine <= nBotL
JumpLine(nLine)
Command("BegLine")
If nLine = nTopL + 1 Then
InsertString("<OPTION SELECTED>")
Else
InsertString("<OPTION>")
End If
nLine = nLine + 1
Wend
SelectCancel()
Command("InsertAft")
InsertString("</SELECT><P>")
NoSilent()
Command("MakeMid")
End Proc
'//////////////////////////////////////////////////////////////////
' Add List
Proc AddList(Mode$)
Silent()
AddString("<LI>")
GotoThere(.BlkBeg, 1)
InsertString("<" + Mode$ + ">" + Chr(10))
JumpLine(.BlkEndL)
Command("EndLine")
InsertString(Chr(10) + "</" + Mode$ + ">")
SelectCancel()
NoSilent()
Command("MakeMid")
End Proc
'//////////////////////////////////////////////////////////////////
' Add Defined List
Proc AddDefList()
Dim nTopL%, nBotL%
Silent()
If .BlkDisp = True Then
nTopL = .BlkBegL
nBotL = .BlkEndL
If .BlkEndC = 1 Then nBotL = nBotL-1
Else
nTopL = .LineNoL
nBotL = .LineNoL
End If
JumpLine(nTopL)
Command("BegLine")
InsertString("<DL>" + Chr(10))
nBotL = nBotL + 1
Dim nLine%
nLine = nTopL + 1
Dim hLine%
Dim sLine$
While nLine <= nBotL
hLine = GetThisLine(nLine)
sLine$ = LoadThisLine(hLine)
Dim nC%, nIdx
nC = Asc(Left(sLine$, 1))
If nC = &H20 Or nC = &H09 Then
sLine$ = "<DD>" + LTrim(sLine$)
Else
sLine$ = "<DT>" + sLine$
End If
SaveThisLine(hLine, sLine$)
nLine = nLine + 1
Wend
JumpLine(nBotL)
SelectCancel()
Command("InsertAft")
InsertString("</DL>")
NoSilent()
Command("MakeMid")
End Proc
'//////////////////////////////////////////////////////////////////
' Add Top of Line(s)
Proc AddTops(tag$)
Dim s$
s$ = "<" + tag$ + ">"
If .BlkDisp = False Then
Command("BegLine")
InsertString(s$)
Else
AddString(s$)
End If
End Proc
'//////////////////////////////////////////////////////////////////
' Add End of Line
Proc AddEnd(tag$)
Dim s$
s$ = GetSelected()
If s$ = "" Then
Command("EndLine")
Else
DelSelect()
End If
s$ = s$ + "<" + tag$ + ">"
InsertString(s$)
End Proc
'//////////////////////////////////////////////////////////////////
' Add Front And End of Paragraph
Proc AddParaTag(tag$)
Dim s$
s$ = GetSelected()
s$ = "<" + tag$ + ">" + Chr(10) + s$ + "</" + tag$ + ">" + Chr(10)
DelSelect()
InsertString(s$)
End Proc
'//////////////////////////////////////////////////////////////////
' Add Font Size
Proc AddFontSize(size%)
Dim s$
s$ = GetSelected()
s$ = "<FONT SIZE=" + Str$(size) + ">" + s$ + "</FONT>"
DelSelect()
InsertString(s$)
End Proc
Proc AddBaseSize(size%)
Dim s$
s$ = "<FONT SIZE=" + Str$(size) + ">" + Chr(10)
InsertString(s$)
End Proc
'//////////////////////////////////////////////////////////////////
' Add Font Color
Proc AddFontColor()
Dim s$
s$ = GetSelected()
s$ = "<FONT" + GetColorString("COLOR") + ">" + s$ + "</FONT>"
DelSelect()
InsertString(s$)
End Proc
'//////////////////////////////////////////////////////////////////
' Add Tag
Proc AddTag(tag$)
Dim s$
s$ = GetSelected()
s$ = "<" + tag$ + ">" + s$ + "</" + tag$ + ">"
DelSelect()
InsertString(s$)
End Proc
'//////////////////////////////////////////////////////////////////
' Add Address
Proc AddAddress()
Dim s$
s$ = GetSelected()
If s$ = "" Then s$ = address$
s$ = InputBox("Input a E-Mail address", "", s$)
s$ = "<ADDRESS><A HREF=" + Chr(34) + "mailto:" + s$ + Chr(34) + ">" + s$ + "</A></ADDRESS>"
DelSelect()
InsertString(s$)
End Proc
'//////////////////////////////////////////////////////////////////
' Add Inline Image
Proc AddImage()
Dim s$
s$ = GetOpenFile("*.gif")
s$ = "<IMG SRC=" + Chr(34) + s$ + Chr(34) + ">"
InsertString(s$)
End Proc
Proc AddInline()
Dim s$
s$ = InputBox("Input a source of a image", "", "")
s$ = "<IMG SRC=" + Chr(34) + s$ + Chr(34) + ">"
InsertString(s$)
End Proc
'//////////////////////////////////////////////////////////////////
' Add Comment
Proc AddCmt()
Dim s$
s$ = GetSelected()
s$ = "<!--" + s$ + "-->"
DelSelect()
InsertString(s$)
End Proc
'//////////////////////////////////////////////////////////////////
' Add Reference Tag
Proc AddRef(ref$)
Dim s$
s$ = GetSelected()
s$ = "<A HREF=" + Chr(34) + ref$ + Chr(34)+ ">" + s$ + "</A>"
DelSelect()
InsertString(s$)
End Proc
'//////////////////////////////////////////////////////////////////
' In tag situation
Const V_ALIGNLEFT = 1
Const V_ALIGNCENTER = 2
Const V_ALIGNRIGHT = 3
Const V_ALIGNTOP = 4
Const V_ALIGNMIDDLE = 5
Const V_ALIGNBOTTOM = 6
Const V_ALIGNJUST = 7
Const V_BKGNDGIF = 8
Const V_BKGNDCOL = 9
Const V_TEXTCOL = 10
Const V_LINKCOL = 11
Const V_VLINKCOL = 12
Const V_ALINKCOL = 13
Const V_WIDTH = 101
Const V_PWIDTH = 102
Const V_SIZE = 103
Const V_NOSHADE= 104
Const V_COLOR = 105
Const V_TYPETEXT = 201
Const V_TYPEPASS = 202
Const V_TYPECHECK = 203
Const V_TYPERADIO = 204
Const V_TYPEIMAGE = 205
Const V_TYPEHIDDEN = 206
Const V_TYPESUBMIT = 207
Const V_TYPERESET = 208
Const V_NAME = 209
Const V_VALUE = 210
Const V_CHECK = 211
Const V_SIZE = 212
Const V_MAXLENGTH = 213
Const V_MULTIPLE = 214
Const V_ROWS = 215
Const V_COLS = 216
Const V_OFF = 217
Const V_VIRTUAL = 218
Const V_PHYSICAL = 219
Const V_SELECTED = 220
Const V_BORDER = 251
Const V_CELLSPACING = 252
Const V_CELLPADDING = 253
Const V_VALIGNTOP = 254
Const V_VALIGNMIDDLE = 255
Const V_VALIGNBOTTOM = 256
Const V_NOWRAP = 257
Const V_COLSPAN = 258
Const V_ROWSPAN = 259
Const V_TYPE_DISC = 300
Const V_TYPE_CIRCLE = 301
Const V_TYPE_SQUARE = 302
Const V_TYPE_A = 311
Const V_TYPE_SA = 312
Const V_TYPE_I = 313
Const V_TYPE_SI = 314
Const V_TYPE_N = 315
Const V_VALUENUM = 316
Proc InTag(sCsr$)
Dim hMenuX%, hMenuXAlign%, hMenuXAlign2%, hMenuXType%
hMenuX = NewMenu()
sCsr$ = UCase(sCsr$)
If Left(sCsr$, 1) = "H" Then
Dim nVal%
nVal = Val(Mid(sCsr$, 2, 1))
If nVal >= 1 And nVal <= 6 Then
hMenuXAlign = AddMenuItem(hMenuX, "&Align", 0)
AddMenuItem(hMenuXAlign, "&Left", V_ALIGNLEFT)
AddMenuItem(hMenuXAlign, "&Center", V_ALIGNCENTER)
AddMenuItem(hMenuXAlign, "&Right", V_ALIGNRIGHT)
Else If sCsr$ = "HR" Then
hMenuXAlign = AddMenuItem(hMenuX, "&Align", 0)
AddMenuItem(hMenuXAlign, "&Left", V_ALIGNLEFT)
AddMenuItem(hMenuXAlign, "&Center", V_ALIGNCENTER)
AddMenuItem(hMenuXAlign, "&Right", V_ALIGNRIGHT)
AddMenuItem(hMenuX, "&Width(pixel)...", V_WIDTH)
AddMenuItem(hMenuX, "Width(&percentage)...", V_PWIDTH)
AddMenuItem(hMenuX, "Si&ze...", V_SIZE)
AddMenuItem(hMenuX, "&No Shade...", V_NOSHADE)
End If
Else
If sCsr$ = "DIV" Then
hMenuXAlign = AddMenuItem(hMenuX, "&Align", 0)
AddMenuItem(hMenuXAlign, "&Left", V_ALIGNLEFT)
AddMenuItem(hMenuXAlign, "&Center", V_ALIGNCENTER)
AddMenuItem(hMenuXAlign, "&Right", V_ALIGNRIGHT)
AddMenuItem(hMenuXAlign, "&Jusify", V_ALIGNJUST)
Else If sCsr$ = "PRE" Then
AddMenuItem(hMenuX, "&Width...", V_WIDTH)
Else If sCsr$ = "IMG" Then
hMenuXAlign = AddMenuItem(hMenuX, "&Align", 0)
AddMenuItem(hMenuXAlign, "&Top", V_ALIGNTOP)
AddMenuItem(hMenuXAlign, "&Middle", V_ALIGNMIDDLE)
AddMenuItem(hMenuXAlign, "&Bottom", V_ALIGNBOTTOM)
If NETSCAPE = True Then
AddMenuItem(hMenuXAlign, "&Left", V_ALIGNLEFT)
AddMenuItem(hMenuXAlign, "&Center", V_ALIGNCENTER)
AddMenuItem(hMenuXAlign, "&Right", V_ALIGNRIGHT)
End If
Else If sCsr$ = "BODY" Then
AddMenuItem(hMenuX, "Background &GIF...", V_BKGNDGIF)
AddMenuItem(hMenuX, "Background &Color...", V_BKGNDCOL)
AddMenuItem(hMenuX, "&Text Color...", V_TEXTCOL)
AddMenuItem(hMenuX, "&Link Color...", V_LINKCOL)
If NETSCAPE = True Then
AddMenuItem(hMenuX, "&Visited Link Color...", V_VLINKCOL)
AddMenuItem(hMenuX, "&Active Link Color...", V_ALINKCOL)
End If
Else If sCsr$ = "FONT" Then
If NETSCAPE = True Then
AddMenuItem(hMenuX, "&Color...", V_COLOR)
AddMenuItem(hMenuX, "Si&ze...", V_SIZE)
End If
Else If sCsr$ = "FORM" Then
Else If sCsr$ = "INPUT" Then
hMenuXType = AddMenuItem(hMenuX, "&Type...", 0)
AddMenuItem(hMenuXType, "&Text Box", V_TYPETEXT)
AddMenuItem(hMenuXType, "&Password", V_TYPEPASS)
AddMenuItem(hMenuXType, "&Check Box", V_TYPECHECK)
AddMenuItem(hMenuXType, "&Radio Button", V_TYPERADIO)
AddMenuItem(hMenuXType, "&Image", V_TYPEIMAGE)
AddMenuItem(hMenuXType, "&Hidden", V_TYPEHIDDEN)
AddMenuItem(hMenuXType, "&Submit", V_TYPESUBMIT)
AddMenuItem(hMenuXType, "R&eset", V_TYPERESET)
AddMenuItem(hMenuX, "&Name...", V_NAME)
AddMenuItem(hMenuX, "&Value...", V_VALUE)
AddMenuItem(hMenuX, "&Check(CHECKBOX/RADIO)...", V_CHECK)
AddMenuItem(hMenuX, "&Visible Length(TEXT/PASSWORD)...", V_SIZE)
AddMenuItem(hMenuX, "&Max Length(TEXT/PASSWORD)...", V_MAXLENGTH)
Else If sCsr$ = "SELECT" Then
AddMenuItem(hMenuX, "&Name...", V_NAME)
AddMenuItem(hMenuX, "&Visible Height...", V_SIZE)
AddMenuItem(hMenuX, "&Multiple Select...", V_MULTIPLE)
Else If sCsr$ = "TEXTAREA" Then
AddMenuItem(hMenuX, "&Name...", V_NAME)
AddMenuItem(hMenuX, "&Rows...", V_ROWS)
AddMenuItem(hMenuX, "&Columns...", V_COLS)
If NETSCAPE = True Then
hMenuXType = AddMenuItem(hMenuX, "&Word Wrap...", 0)
AddMenuItem(hMenuXType, "O&ff", V_OFF)
AddMenuItem(hMenuXType, "&Virtual", V_VIRTUAL)
AddMenuItem(hMenuXType, "&Physical", V_PHYSICAL)
End If
Else If sCsr$ = "OPTION" Then
AddMenuItem(hMenuX, "&Selected...", V_SELECTED)
Else If sCsr$ = "TABLE" Then
AddMenuItem(hMenuX, "&Border...", V_BORDER)
AddMenuItem(hMenuX, "Cell &Spacing...", V_CELLSPACING)
AddMenuItem(hMenuX, "Cell Pa&dding...", V_CELLPADDING)
AddMenuItem(hMenuX, "&Width(pixel)...", V_WIDTH)
AddMenuItem(hMenuX, "Width(&percentage)...", V_PWIDTH)
Else If sCsr$ = "TR" Or sCsr$ = "TD" Or sCsr$ = "TH" Then
hMenuXAlign = AddMenuItem(hMenuX, "&Align", 0)
AddMenuItem(hMenuXAlign, "&Left", V_ALIGNLEFT)
AddMenuItem(hMenuXAlign, "&Center", V_ALIGNCENTER)
AddMenuItem(hMenuXAlign, "&Right", V_ALIGNRIGHT)
hMenuXAlign2 = AddMenuItem(hMenuX, "&Vertical Align", 0)
AddMenuItem(hMenuXAlign2, "&Top", V_VALIGNTOP)
AddMenuItem(hMenuXAlign2, "&Middle", V_VALIGNMIDDLE)
AddMenuItem(hMenuXAlign2, "&Bottom", V_VALIGNBOTTOM)
If sCsr$ = "TD" Or sCsr$ = "TH" Then
AddMenuItem(hMenuX, "No &Wrap...", V_NOWRAP)
AddMenuItem(hMenuX, "C&olumn Span...", V_COLSPAN)
AddMenuItem(hMenuX, "Row &Span...", V_ROWSPAN)
AddMenuItem(hMenuX, "&Width(pixel)...", V_WIDTH)
AddMenuItem(hMenuX, "Width(&percentage)...", V_PWIDTH)
End If
Else If sCsr$ = "CAPTION" Then
hMenuXAlign = AddMenuItem(hMenuX, "&Align", 0)
AddMenuItem(hMenuXAlign, "&Top", V_ALIGNTOP)
AddMenuItem(hMenuXAlign, "&Bottom", V_ALIGNBOTTOM)
Else If sCsr$ = "P" Then
hMenuXAlign = AddMenuItem(hMenuX, "&Align", 0)
AddMenuItem(hMenuXAlign, "&Left", V_ALIGNLEFT)
AddMenuItem(hMenuXAlign, "&Center", V_ALIGNCENTER)
AddMenuItem(hMenuXAlign, "&Right", V_ALIGNRIGHT)
Else If sCsr$ = "UL" Then
hMenuXType = AddMenuItem(hMenuX, "&Type", 0)
AddMenuItem(hMenuXType, "&Disc", V_TYPE_DISC)
AddMenuItem(hMenuXType, "&Circle", V_TYPE_CIRCLE)
AddMenuItem(hMenuXType, "&Square", V_TYPE_SQUARE)
Else If sCsr$ = "OL" Then
hMenuXType = AddMenuItem(hMenuX, "&Type", 0)
AddMenuItem(hMenuXType, "&A", V_TYPE_A)
AddMenuItem(hMenuXType, "&a", V_TYPE_SA)
AddMenuItem(hMenuXType, "&I", V_TYPE_I)
AddMenuItem(hMenuXType, "&i", V_TYPE_SI)
AddMenuItem(hMenuXType, "&1", V_TYPE_N)
AddMenuItem(hMenuX, "&Beginnig Number...", V_VALUENUM)
Else If sCsr$ = "LI" Then
End If
End If
Dim nRC%
Dim sAdd$
nRC = DoMenu(hMenuX)
DiscardMenu(hMenuX)
Select Case nRC
Case -1 ' Canceled
Return
Case V_ALIGNLEFT
sAdd$ = " ALIGN=LEFT"
Case V_ALIGNCENTER
sAdd$ = " ALIGN=CENTER"
Case V_ALIGNRIGHT
sAdd$ = " ALIGN=RIGHT"
Case V_ALIGNTOP
sAdd$ = " ALIGN=TOP"
Case V_ALIGNMIDDLE
sAdd$ = " ALIGN=MIDDLE"
Case V_ALIGNBOTTOM
sAdd$ = " ALIGN=BOTTOM"
Case V_ALIGNJUST
sAdd$ = " ALIGN=JUSTIFY"
Case V_TYPE_DISC
sAdd$ = SetType("DISC")
Case V_TYPE_CIRCLE
sAdd$ = SetType("CIRCLE")
Case V_TYPE_SQUARE
sAdd$ = SetType("SQUARE")
Case V_TYPE_A
sAdd$ = SetType("A")
Case V_TYPE_SA
sAdd$ = SetType("a")
Case V_TYPE_I
sAdd$ = SetType("I")
Case V_TYPE_SI
sAdd$ = SetType("i")
Case V_TYPE_N
sAdd$ = SetType("1")
Case V_VALUENUM
sAdd$ = GetSizeString("VALUE")
Case V_BKGNDGIF
sAdd$ = GetOpenFileString("*.gif", "BACKGROUND")
Case V_BKGNDCOL
sAdd$ = GetColorString("BGCOLOR")
Case V_COLOR
sAdd$ = GetColorString("COLOR")
Case V_TEXTCOL
sAdd$ = GetColorString("TEXT")
Case V_LINKCOL
sAdd$ = GetColorString("LINK")
Case V_VLINKCOL
sAdd$ = GetColorString("VLINK")
Case V_ALINKCOL
sAdd$ = GetColorString("ALINK")
Case V_WIDTH
sAdd$ = GetSizeString("WIDTH")
Case V_PWIDTH
sAdd$ = GetSizeString("WIDTH")
If Right(sAdd$, 1) <> "=" Then sAdd$ = sAdd$ + "%"
Case V_SIZE
sAdd$ = GetSizeString("SIZE")
Case V_NOSHADE
sAdd$ = " NOSHADE"
Case V_TYPETEXT
sAdd$ = " TYPE=" + Chr(34) + "TEXT" + Chr(34)
Case V_TYPEPASS
sAdd$ = " TYPE=" + Chr(34) + "PASSWORD" + Chr(34)
Case V_TYPECHECK
sAdd$ = " TYPE=" + Chr(34) + "CHECKBOX" + Chr(34)
Case V_TYPERADIO
sAdd$ = " TYPE=" + Chr(34) + "RADIO" + Chr(34)
Case V_TYPEIMAGE
sAdd$ = " TYPE=" + Chr(34) + "IMAGE" + Chr(34)
Case V_TYPEHIDDEN
sAdd$ = " TYPE=" + Chr(34) + "HIDDEN" + Chr(34)
Case V_TYPESUBMIT
sAdd$ = " TYPE=" + Chr(34) + "SUBMIT" + Chr(34)
Case V_TYPERESET
sAdd$ = " TYPE=" + Chr(34) + "RESET" + Chr(34)
Case V_NAME
sAdd$ = GetNameString("NAME")
Case V_VALUE
sAdd$ = GetNameString("VALUE")
Case V_CHECK
sAdd$ = " CHECKED"
Case V_MAXLENGTH
sAdd$ = GetSizeString("MAXLENGTH")
Case V_MULTIPLE
sAdd$ = " MULTIPLE"
Case V_ROWS
sAdd$ = GetSizeString("ROWS")
Case V_COLS
sAdd$ = GetSizeString("COLS")
Case V_OFF
sAdd$ = " WRAP=OFF"
Case V_VIRTUAL
sAdd$ = " WRAP=VIRTUAL"
Case V_PHYSICAL
sAdd$ = " WRAP=PHYSICAL"
Case V_SELECTED
sAdd$ = " SELECTED"
Case V_BORDER
sAdd$ = " BORDER"
Case V_CELLSPACING
sAdd$ = GetSizeString("CELLSPACING")
Case V_CELLPADDING
sAdd$ = GetSizeString("CELLPADDING")
Case V_VALIGNTOP
sAdd$ = " VALIGN=TOP"
Case V_VALIGNMIDDLE
sAdd$ = " VALIGN=MIDDLE"
Case V_VALIGNBOTTOM
sAdd$ = " VALIGN=BOTTOM"
Case V_NOWRAP
sAdd$ = " NOWRAP"
Case V_COLSPAN
sAdd$ = GetSizeString("COLSPAN")
Case V_ROWSPAN
sAdd$ = GetSizeString("ROWSPAN")
End Select
If sAdd$ = "" Then
Return
End If
If Right(sAdd$, 1) = "=" Then
If MsgBox("Are you sure to set this default?", "", MB_ICONQUESTION | MB_YESNO) = IDNO Then
Return
End If
End If
Dim l$
l$ = Left(sAdd$, InStr(sAdd$, "="))
If l$ = "" Then
l$ = sAdd$
End If
Dim nC%
Dim sSel$
Silent()
Command("SelectBegin")
nC = GetCurrentChar()
While nC <> Asc(">")
Command("CsrRight")
nC = GetCurrentChar()
Wend
sSel$ = GetSelected()
NoSilent()
Dim nBeg%, nEnd%
nBeg% = InStr(sSel$, l$)
If Right(sAdd$, 1) = "=" Then
sAdd$ = ""
Else If sAdd$ = l$ Then
If MsgBox("Do you want to set this?(Yes:set / No:reset)", "", MB_YESNO | MB_ICONQUESTION) = IDNO Then
sAdd$ = ""
End If
End If
If nBeg Then
nEnd = nBeg
Dim sTmp$
While True
nEnd = nEnd + 1
sTmp$ = Mid(sSel$, nEnd, 1)
If sTmp$ = " " Or sTmp$ = Chr(&H09) Or sTmp$ = ">" Or sTmp$ = "" Then
Exit
End If
Wend
sAdd$ = Left(sSel$, nBeg - 1) + sAdd$ + Mid(sSel$, nEnd, Len(sSel$))
DelSelect()
InsertString(sAdd$)
Else
SelectCancel()
InsertString(sAdd$)
End If
Refresh()
End Proc
'/////////////////////////////////////////////////////////////////////
' Input Library
Proc SetType(t$) As String
Return " TYPE=" + t$
End Proc
Proc GetSizeString(size$) As String
Dim z$
z$ = InputBox("Input value", "", "")
z$ = " " + size$ + "=" + z$
Return z$
End Proc
Proc GetNameString(name$) As String
Dim n$
n$ = InputBox("Input string", "", "")
If n$ <> "" Then
n$ = " " + name$ + "=" + Chr(34) + n$ + Chr(34)
Else
n$ = " " + name$ + "="
End If
Return n$
End Proc
Proc GetColorString(col$) As String
Dim c$
Static lpCol%(16)
Dim cc%(9)
cc(1) = 36
cc(2) = .hMainWnd
cc(3) = 0
cc(4) = 0
cc(5) = lpCol
cc(6) = 0
cc(7) = 0
cc(8) = 0
cc(9) = 0
If ChooseColor(cc) = True Then
Dim r%, g%, b%
r = cc(4) & &HFF
g = (cc(4) >> 8) & &HFF
b = (cc(4) >> 16) & &HFF
c$ = Space$(10)
wsprintf(c$, "%02X%02X%02X", r, g, b)
c$ = InputBox("Adjust RGB value", "", c$)
If c$ <> "" Then
c$ = " " + col$ + "=" + Chr(34) + "#" + c$ + Chr(34)
Else
c$ = " " + col$ + "="
End If
End If
Return c$
End Proc
Proc GetOpenFileString(filt$, item$)
Dim o$
o$ = GetOpenFile(filt$)
o$ = " " + item$ + "=" + Chr(34) + o$ + Chr(34)
Return o$
End Proc