'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
' TX4VBB.TXT
'
'       Declarations for VisualWriter Pro
'
' Copyright (c) 1994, VisualTools Inc.
'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Const WM_USER = &H400

' messages:
Global Const TX_FIRST = (WM_USER + 100)
Global Const TX_GETCARETEXT = (WM_USER + 100)
Global Const TX_GETCARETPOS = (WM_USER + 101)
Global Const TX_GETFONTATTR = (WM_USER + 102)
Global Const TX_GETFORMAT = (WM_USER + 103)
Global Const TX_GETHANDLE = (WM_USER + 104)
Global Const TX_GETLINEANDCOL = (WM_USER + 105)
Global Const TX_GETMODE = (WM_USER + 106)
Global Const TX_GETRECT = (WM_USER + 107)
Global Const TX_GETSEL = (WM_USER + 108)
Global Const TX_GETTABS = (WM_USER + 109)
Global Const TX_GETTEXTEXTENT = (WM_USER + 110)
Global Const TX_GETTEXTLIMITS = (WM_USER + 111)
Global Const TX_GETTEXTSIZE = (WM_USER + 112)
Global Const TX_GETBASELINE = (WM_USER + 113)
Global Const TX_GETLINESPACING = (WM_USER + 114)
Global Const TX_GETLINECOUNT = (WM_USER + 115)
Global Const TX_LINEINDEX = (WM_USER + 116)
Global Const TX_LINEFROMCHAR = (WM_USER + 117)
Global Const TX_LINEFROMPOINT = (WM_USER + 118)
Global Const TX_GETIMAGE = (WM_USER + 119)
Global Const TX_GETINDENTS = (WM_USER + 120)
Global Const TX_GETFONT = (WM_USER + 121)
Global Const TX_GETESCAPEMENT = (WM_USER + 122)
Global Const TX_GETLINKWND = (WM_USER + 123)
Global Const TX_GETZOOM = (WM_USER + 124)
Global Const TX_GETLINERECT = (WM_USER + 125)
Global Const TX_GETTEXTCOLOR = (WM_USER + 126)
Global Const TX_GETMODEEX = (WM_USER + 127)
Global Const TX_GETBKGNDCOLOR = (WM_USER + 128)
Global Const TX_GETPGFRAME = (WM_USER + 129)

Global Const TX_SETFONTATTR = (WM_USER + 130)
Global Const TX_SETFORMAT = (WM_USER + 131)
Global Const TX_SETHANDLE = (WM_USER + 132)
Global Const TX_SETMODE = (WM_USER + 133)
Global Const TX_SETSEL = (WM_USER + 134)
Global Const TX_SETTABS = (WM_USER + 135)
Global Const TX_SETBASELINE = (WM_USER + 136)
Global Const TX_SETLINESPACING = (WM_USER + 137)
Global Const TX_SETIMAGE = (WM_USER + 138)
Global Const TX_SETINDENTS = (WM_USER + 139)
Global Const TX_SETFONT = (WM_USER + 140)
Global Const TX_SETESCAPEMENT = (WM_USER + 141)
Global Const TX_SETLINKWND = (WM_USER + 142)
Global Const TX_SETWORDDIVISION = (WM_USER + 143)
Global Const TX_SETTEXTCOLOR = (WM_USER + 144)
Global Const TX_SETMODEEX = (WM_USER + 145)
Global Const TX_SETBKGNDCOLOR = (WM_USER + 146)
Global Const TX_SETPGFRAME = (WM_USER + 147)
Global Const TX_SETTEXTAREA = (WM_USER + 148)

Global Const TX_ADJUSTCLIPBOARD = (WM_USER + 150)
Global Const TX_CREATEIMAGE = (WM_USER + 151)
Global Const TX_DEVMODECHANGE = (WM_USER + 152)
Global Const TX_ENLARGEFONT = (WM_USER + 153)
Global Const TX_FONTDIALOG = (WM_USER + 154)

Global Const TX_LIMITTEXT = (WM_USER + 156)
Global Const TX_LIMITLINE = (WM_USER + 157)
Global Const TX_PARAGRAPHDIALOG = (WM_USER + 158)
Global Const TX_GETTEXTAREA = (WM_USER + 159)
Global Const TX_SELTEST = (WM_USER + 160)
Global Const TX_IMPORTTEXTBUFFER = (WM_USER + 161)
Global Const TX_IMPORTTEXTFILE = (WM_USER + 162)
Global Const TX_EXPORTTEXT = (WM_USER + 163)
Global Const TX_GETBASELINEPOS = (WM_USER + 164)
Global Const TX_GETSUPPORTEDFONTS = (WM_USER + 165)
Global Const TX_GETSUPPORTEDSIZES = (WM_USER + 166)
Global Const TX_GETIMAGEFILTERS = (WM_USER + 167)
Global Const TX_GETSCROLLPOS = (WM_USER + 168)
Global Const TX_REPLACESEL = (WM_USER + 169)
Global Const TX_GETCHARRECT = (WM_USER + 170)
Global Const TX_PRINTPAGE = (WM_USER + 171)
Global Const TX_GETPAGECOUNT = (WM_USER + 172)
Global Const TX_GETTEXTWIDTH = (WM_USER + 173)
Global Const TX_GETTEXTHEIGHT = (WM_USER + 174)
Global Const TX_GETIMAGEFORMAT = (WM_USER + 175)
Global Const TX_SETIMAGEFORMAT = (WM_USER + 176)

Global Const TX_FIELD_CHANGETEXT = (WM_USER + 200)
Global Const TX_FIELD_GETATTR = (WM_USER + 201)
Global Const TX_FIELD_GETCURRENT = (WM_USER + 202)
Global Const TX_FIELD_GETTEXT = (WM_USER + 203)
Global Const TX_FIELD_GETPOSITION = (WM_USER + 204)
Global Const TX_FIELD_INSERT = (WM_USER + 205)
Global Const TX_FIELD_SETATTR = (WM_USER + 206)
Global Const TX_FIELD_DELETE = (WM_USER + 207)

Global Const TX_COPYDATA = (WM_USER + 1000)
Global Const TX_GETDATASIZE = (WM_USER + 1001)
Global Const TX_LOAD = (WM_USER + 1002)
Global Const TX_PASTEDATA = (WM_USER + 1003)
Global Const TX_PRINT = (WM_USER + 1004)
Global Const TX_SAVE = (WM_USER + 1005)
Global Const TX_ZOOM = (WM_USER + 1006)
Global Const TX_CANUNDO = (WM_USER + 1007)
Global Const TX_UNDO = (WM_USER + 1008)
Global Const TX_PAINT = (WM_USER + 1009)
Global Const TX_GETLANGUAGE = (WM_USER + 1010)
Global Const TX_SETLANGUAGE = (WM_USER + 1011)
Global Const TX_GETDEVICE = (WM_USER + 1012)
Global Const TX_SETDEVICE = (WM_USER + 1013)
'Global Const TX_GETZOOM       = (WM_USER+1014)
Global Const TX_EMPTYUNDOBUFFER = (WM_USER + 1015)
Global Const TX_REDO = (WM_USER + 1016)

' ruler messages
Global Const RM_SETUNITS = (WM_USER + 200)
Global Const RM_SETBUTTONBAR = (WM_USER + 201)
Global Const RM_PAINT = (WM_USER + 1009)

' ruler styles
Global Const RS_TABULATORS = &H1
Global Const RS_LEFTINDENT = &H2
Global Const RS_FIRSTINDENT = &H4
Global Const RS_RIGHTINDENT = &H8
Global Const RS_POSITION = &H10
Global Const RS_NOBORDER = &H20
Global Const RS_INDENTS = (RS_LEFTINDENT + RS_FIRSTINDENT + RS_RIGHTINDENT)

' status bar messages
Global Const STB_SETSTYLE = (WM_USER + 100)
Global Const STB_SETSTRINGS = (WM_USER + 101)
Global Const STB_PAINT = (WM_USER + 1009)

' status bar style flags
Global Const STS_LEFTALIGN = &H1
Global Const STS_RIGHTALIGN = &H2
Global Const STS_NOBORDER = &H4
Global Const STS_NOPAGE = &H8
Global Const STS_NOLINE = &H10
Global Const STS_NOCOLUMN = &H20
Global Const STS_NOZOOM = &H40
Global Const STS_NOKEYSTATES = &H80

' notification codes:
Global Const TN_FIRST = &H700
Global Const TN_CARETOUTLEFT = &H700
Global Const TN_CARETOUTTOP = &H701
Global Const TN_CARETOUTRIGHT = &H702
Global Const TN_CARETOUTBOTTOM = &H703
Global Const TN_SETFOCUS = &H704
Global Const TN_KILLFOCUS = &H705
Global Const TN_ERRCODE = &H706
Global Const TN_CHANGED = &H707
Global Const TN_POSCHANGED = &H708
Global Const TN_HEXPAND = &H709
Global Const TN_AUTOSCROLL = &H70A
Global Const TN_HMOVED = &H70B
Global Const TN_CHARFORMATCHANGED = &H70C
Global Const TN_PGFORMATCHANGED = &H70D
Global Const TN_FIELD_SETCURSOR = &H70E
Global Const TN_ZOOMED = &H70F
Global Const TN_VEXPAND = &H710
Global Const TN_CARETOUT = &H711
Global Const TN_FIELD_CLICKED = &H712
Global Const TN_FIELD_CREATED = &H713
Global Const TN_FIELD_DBLCLICKED = &H714
Global Const TN_FIELD_DELETED = &H715
Global Const TN_FIELD_CHANGED = &H716
Global Const TN_PGCHANGED = &H717
Global Const TN_AUTOLINK = &H718
Global Const TN_HSCROLL = &H719
Global Const TN_VSCROLL = &H71A
Global Const TN_KEYSTATECHANGED = &H71B
Global Const TN_IMAGECLICKED = &H71C
Global Const TN_FIELD_ENTERED = &H71D
Global Const TN_LAST = &H71D


' return values:
Global Const TR_ERR = 0
Global Const TR_UNCHANGED = 1
Global Const TR_CHANGED = 2
Global Const TR_IGNORED = &H8000


' definitions:
Global Const TF_LEFT = &H1
Global Const TF_RIGHT = &H2
Global Const TF_CENTER = &H3
Global Const TF_BLOCK = &H4
Global Const TF_NOCOMMONS = &H5

' scroll flags:
Global Const TF_HSCROLL = &H1
Global Const TF_VSCROLL = &H2
Global Const TF_THUMBTRACK = &H4
Global Const TF_NOHSCROLL = &H8000
Global Const TF_NOVSCROLL = &H4000
Global Const TF_THUMBPOSITION = &H2000
Global Const TF_NOTEXTWIDTH = &H1000
Global Const TF_NOTEXTHEIGHT = &H800

' frame styles:
Global Const BF_LEFTLINE = &H1
Global Const BF_RIGHTLINE = &H2
Global Const BF_TOPLINE = &H4
Global Const BF_BOTTOMLINE = &H8
Global Const BF_BOX = BF_LEFTLINE Or BF_RIGHTLINE Or BF_TOPLINE Or BF_BOTTOMLINE
Global Const BF_TABLINES = &H10
Global Const BF_TABLE = BF_BOX Or BF_TABLINES
Global Const BF_SINGLE = &H20
Global Const BF_DOUBLE = &H40
Global Const BF_STYLES = BF_SINGLE Or BF_DOUBLE
Global Const BF_BOXCONNECT = &H80
Global Const BF_CONNECTEDBOX = BF_BOX Or BF_BOXCONNECT
Global Const BF_NOLEFTLINE = &H100
Global Const BF_NORIGHTLINE = &H200
Global Const BF_NOTOPLINE = &H400
Global Const BF_NOBOTTOMLINE = &H800
Global Const BF_NOTABLINES = &H1000

' mode flags:
Global Const TF_OPAQUE = &H1
Global Const TF_KEEPSEL = &H2
Global Const TF_OVERWRITE = &H4
Global Const TF_FRAMED = &H8
Global Const TF_SHOWWHITESPACE = &H10
Global Const TF_SHOWSELNA = &H20
Global Const TF_AUTOEXPAND = &H40
Global Const TF_TRANSPARENT = &H8000
Global Const TF_REPLACESEL = &H4000
Global Const TF_INSERT = &H2000
Global Const TF_NOTFRAMED = &H1000
Global Const TF_HIDEWHITESPACE = &H800
Global Const TF_HIDESELNA = &H400
Global Const TF_FIXED = &H200

' ext. mode flags:
Global Const TF_DISPLAY = &H1
Global Const TF_NOWAITCURSOR = &H2
Global Const TF_TOPINDENTFIRSTPG = &H4
Global Const TF_EDIT = &H8000
Global Const TF_WAITCURSOR = &H4000
Global Const TF_NOTOPINDENTFIRSTPG = &H2000

' field mode flags:
Global Const TF_UNDELETEABLE = &H1
Global Const TF_UNCHANGEABLE = &H2
Global Const TF_FIELDFRAMED = &H4
Global Const TF_DELETEABLE = &H8000
Global Const TF_CHANGEABLE = &H4000
Global Const TF_FIELDUNFRAMED = &H2000

Global Const TF_PRINTCOLORS = &H2
Global Const TF_PRINTSCALED = &H4

Global Const TF_SCREEN = 1
Global Const TF_STANDARD = 2
Global Const TF_PRINTER = 3

Global Const TF_REDUCE = 0
Global Const TF_ENLARGE = 1

' font attribute flags:
Global Const FA_NOCOMMONS = &H1
Global Const FA_STANDARD = &H2
Global Const FA_BOLD = &H4
Global Const FA_ITALIC = &H8
Global Const FA_UNDERLINE = &H10
Global Const FA_STRIKEOUT = &H20
Global Const FA_NOBOLD = &H400
Global Const FA_NOITALIC = &H800
Global Const FA_NOUNDERLINE = &H1000
Global Const FA_NOSTRIKEOUT = &H2000
Global Const FA_TOGGLE = &H8000
Global Const FA_PARTIALNORMAL = &H200
Global Const FA_PARTIALBOLD = &H400
Global Const FA_PARTIALITALIC = &H800
Global Const FA_PARTIALUNDERLINE = &H1000
Global Const FA_PARTIALSTRIKEOUT = &H2000


Global Const FA_SUPERSCRIPT = &H4
Global Const FA_SUBSCRIPT = &H8

' tabs:
Global Const NTABS = 14
Global Const UF_PIXEL = 0
Global Const UF_TWIPS = 1
Global Const UF_MM = 2

Global Const LEFTTAB = 1
Global Const RIGHTTAB = 2
Global Const CENTERTAB = 3
Global Const DECIMALTAB = 4

' linked windows:
Global Const GWTX_HWNDFIRST = 1
Global Const GWTX_HWNDLAST = 2
Global Const GWTX_HWNDNEXT = 3
Global Const GWTX_HWNDPREV = 4
Global Const GWTX_HWNDFIRSTSEL = 5
Global Const GWTX_HWNDLASTSEL = 6
Global Const GWTX_HWNDTEXTEND = 7
Global Const GWTX_ISPREVWND = 8
Global Const GWTX_ISFOLLOWINGWND = 9
Global Const GWTX_GETCOUNT = 10
Global Const GWTX_GETNUMBER = 11
Global Const GWTX_FROMOFFSET = 12
Global Const GWTX_GETOFFSET = 13

' text import/export filter error codes:
Global Const FE_NO_ERROR = 0   ' no error
Global Const FE_NOT_MY_FILE = 1   ' wrong file type
Global Const FE_BAD_TOKEN = 2   ' logical error in input file
Global Const FE_NO_MEM = 3   ' unable to allocate enough global memory
Global Const FE_READ_DATA = 4   ' file read error
Global Const FE_WRITE_DATA = 5   ' file write error
Global Const FE_OPEN_FILE = 6   ' unable to open file
Global Const FE_FILE_TOO_BIG = 7   ' input file is too big
Global Const FE_UNSUPP = 8   ' currently not supported
Global Const FE_INTERNAL = 9   ' unspecified internal error
					
' flag values:
Global Const ICF_GRAYED = &H1
Global Const ICF_LEFTALIGNED = &H2
Global Const ICF_RIGHTALIGNED = &H4
Global Const ICF_CENTERED = &H8
Global Const ICF_ALIGNMENT = &HE


' Clip property
Global Const CLIP_CUT = 1
Global Const CLIP_COPY = 2
Global Const CLIP_PASTE = 3
Global Const CLIP_CLEAR = 4

' File types
Global Const TXM_FILE = 1
Global Const RTF_FILE = 2

'Color values
Global Const COLOR_TEXT = 1
Global Const COLOR_BACK = 2

'Ruler scale values
Global Const SCALE_MM = 0
Global Const SCALE_CM = 1
Global Const SCALE_INCH = 2

' Undo/Redo
Global Const UNDO_INSERT = 1
Global Const UNDO_DELETE = 2
Global Const UNDO_FORMAT = 3
Global Const REDO_INSERT = 10
Global Const REDO_DELETE = 11
Global Const REDO_FORMAT = 12

' Indents
Global Const INDENT_LEFT = 1
Global Const INDENT_RIGHT = 2
Global Const INDENT_FIRST = 3
Global Const INDENT_TOP = 4
Global Const INDENT_BOTTOM = 5
Global Const INDENT_NOCOMMON = &H8000

' ImageAttr property array
Global Const IC_XSIZE = 1
Global Const IC_YSIZE = 2
Global Const IC_SCALE = 3
Global Const IC_GRAY = 4

' Error event messages
Global Const EVERR_GLOBALMEM = "Insufficient global memory."
Global Const EVERR_LOCALMEM = "Insufficient local memory."
Global Const EVERR_INTERNAL = "Internal error."
Global Const EVERR_FILE = "File read/write error."
Global Const EVERR_64K_TEXT = "Item larger than 64 KB."
Global Const EVERR_CLIPBOARD = "Clipboard operation failed."
Global Const EVERR_MODULE = "Module not found."
Global Const EVERR_FORMAT = "Unknown format."
Global Const EVERR_TXT_FORMAT = "Text filter: Unknown format."
Global Const EVERR_TXT_TOKEN = "Text filter: Illegal token."
Global Const EVERR_TXT_READ = "Text filter: File read error."
Global Const EVERR_TXT_WRITE = "Text filter: File write error."
Global Const EVERR_TXT_OPEN = "Text filter: File cannot be opened."
Global Const EVERR_TXT_SIZE = "Text filter: File contents too large."
Global Const EVERR_TXT_UNSUPPORTED = "Text filter: Unsupported format."
Global Const EVERR_IMG_INTERFACE = "Image filter: Unknown interface."
Global Const EVERR_IMG_OPEN = "Image filter: File cannot be opened."
Global Const EVERR_IMG_SIZE = "Image filter: File contents too large."
Global Const EVERR_IMG_FORMAT = "Image filter: Unknown format."
Global Const EVERR_IMG_UNSUPPORTED = "Image filter: Unsupported format."
Global Const EVERR_IMG_ABORT = "Image filter: Import aborted."


'The errors can be trapped with the on error statement
Global Const ERR_SMALLWIDTH = 20000  ' Page width too small.
Global Const ERR_LARGEWIDTH = 20001   'Page width too large.
Global Const ERR_SMALLHEIGHT = 20002 ' Page height too small.
Global Const ERR_LARGEHEIGHT = 20003  'Page height too large.
Global Const ERR_LEFTMARGIN = 20004  ' Left margin too large.
Global Const ERR_RIGHTMARGIN = 20005   'Right margin too large.
Global Const ERR_TOPMARGIN = 20006    'Top margin too large.
Global Const ERR_BOTTOMMARGIN = 20007     'Bottom margin too large.
Global Const ERR_EVENT = 20008    'Text-Control sends an error event to specify what kind of error has occured.
Global Const ERR_WINTOOSMALL = 20009 ' The window is too small to load the requested data.
Global Const ERR_PRINT = 20010   ' Failure of page print.
Global Const ERR_OPENFILE = 20011     'OpenFile() failed.
Global Const ERR_IMG_MEM = 20012 'Image-Control: Insufficient memory.
Global Const ERR_IMG_BADFILE = 20013 'Image-Control: Non-existent file.
Global Const ERR_IMG_UNKNOWN = 20014 'Image-Control: Unknown file type.
Global Const ERR_IMG_UNSUPPORTED = 20015 'Image-Control: Unsupported compression type.
Global Const ERR_IMG_BADFILTER = 20016 'Image-Control: Filter not found.
Global Const ERR_IMG_UNSUPPFILTER = 20017 'Image-Control: Unsupported filter type.
Global Const ERR_NOLOCALMEM = 20018  'Out of string space.
Global Const ERR_ALIGNINVALID = 20019     'Invalid alignment value ( > 3).
Global Const ERR_FIELDNUM = 20020     'Invalid macro field number
Global Const ERR_BOUND_NOTXDATA = 20021   'Database record does not contain TX data
Global Const ERR_NOGLOBALMEM = 20022  'Insufficient Global memory
Global Const ERR_TABNUM = 20023   'Invalid tab number in TabCurrent property
Global Const ERR_TABTYPE = 20024  'Invalid tab type
Global Const ERR_TYPEOFNULLTAB = 20025    'Attempt to set type of null tab
Global Const ERR_ZOOMVAL = 20026  'Invalid zoom value
Global Const ERR_SPELL_DICT = 20027   'Spellchecker dictionary not found
Global Const ERR_INDENT = 20028   'Invalid indent setting
Global Const ERR_RTF = 20029  'RTF filter error
Global Const ERR_ICINI = 20030    'IC.INI not found or invalid
Global Const ERR_PROP_IS_READONLY = 20031     'Property is read-only
Global Const ERR_IMGNUM = 20032   'Invalid image number in ImageCurrent property
Global Const ERR_TXDATA_INVALID = 20033   'Attempt to load invalid Text-Control data
Global Const ERR_BOUND_NOASCIIDATA = 20034'Database record does not contain

