home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / bpos2i.zip / PMMLE.PAS < prev    next >
Pascal/Delphi Source File  |  1994-05-31  |  9KB  |  241 lines

  1. (* ====================================================== *)
  2. (*                         PMMLE.PAS                      *)
  3. (*      Implementation of the MLE window styles           *)
  4. (*       Translated to Pascal by wr/toolbox mag           *)
  5. (* ====================================================== *)
  6. {$IFNDEF OS2}
  7.   Error: Wrong target/Compiler not patched
  8. {$ENDIF}
  9.  
  10. UNIT PmMle;
  11.  
  12. INTERFACE
  13.  
  14. USES Os2Def;
  15.  
  16. (**********************************************************
  17. * MLE Window styles ( in addition to WS_* )
  18. \**********************************************************)
  19. CONST
  20.   MLS_WORDWRAP      = $00000001;
  21.   MLS_BORDER        = $00000002;
  22.   MLS_VSCROLL       = $00000004;
  23.   MLS_HSCROLL       = $00000008;
  24.   MLS_READONLY      = $00000010;
  25.   MLS_IGNORETAB     = $00000020;
  26.  
  27. (***********************************************************
  28. * MLE External Data Types
  29. \**********************************************************)
  30. TYPE
  31.   Ipt  = LongInt;  (* insertion point      *)
  32.   pIpt = ^Ipt;     (* insertion point      *)
  33.   Pix  = LongInt;  (* pixel                *)
  34.   Line = LongInt;  (* Line number          *)
  35.  
  36. TYPE
  37.   (* MLEFRD format rectangle data  *)
  38.   MLEformatRect = RECORD
  39.     cxFormat : LongInt;     (* format rectangle width    *)
  40.     cyFormat : LongInt;     (* format rectangle height    *)
  41.   END;
  42.  
  43.   (* MLECTL control data      *)
  44.   MLECtlData = RECORD
  45.     cbCtlData  : WORD;         (* Length of the MLECTLDATA structure  *)
  46.     afIEFormat : WORD;         (* import/export format     *)
  47.     cchText    : LongInt;      (* text limit        *)
  48.     iptAnchor  : Ipt;          (* beginning of selection    *)
  49.     iptCursor  : Ipt;          (* ending of selection      *)
  50.     cxFormat   : LongInt;      (* format rectangle width    *)
  51.     cyFormat   : LongInt;      (* format rectangle height    *)
  52.     afFormatFlags  : LongInt;  (* formatting rectangle flags    *)
  53.   END;
  54.  
  55. (***********************************************************
  56. * afFormatFlags mask
  57. \**********************************************************)
  58. CONST MLFFMTRECT_LIMITHORZ    = $00000001;
  59. CONST MLFFMTRECT_LIMITVERT    = $00000002;
  60. CONST MLFFMTRECT_MATCHWINDOW  = $00000004;
  61. CONST MLFFMTRECT_FORMATRECT   = $00000007;
  62. (***********************************************************
  63. * afIEFormat - Import/Export Format flags
  64. \**********************************************************)
  65. CONST MLFIE_CFTEXT     = 0;
  66. CONST MLFIE_NOTRANS    = 1;
  67. CONST MLFIE_WINFMT     = 2;
  68. CONST MLFIE_RTF        = 3;
  69.  
  70. (***********************************************************
  71. * MLN_OVERFLOW structure
  72. \**********************************************************)
  73. TYPE
  74.   MLEOverFlow = RECORD (* MLEOVR overflow structure        *)
  75.     afErrInd     : LongInt;   (* see mask below          *)
  76.     nBytesOver   : LongInt;  (* number of bytes overflowed        *)
  77.     pixHorzOver  : LongInt;  (* number of pixels horizontally overflowed *)
  78.     pixVertOver  : LongInt;  (* number of pixels vertically overflowed   *)
  79.   END;
  80.  
  81. (***********************************************************
  82. * afErrInd - error format rectangle flags
  83. \**********************************************************)
  84. CONST MLFEFR_RESIZE     = $00000001;
  85. CONST MLFEFR_TABSTOP    = $00000002;
  86. CONST MLFEFR_FONT       = $00000004;
  87. CONST MLFEFR_TEXT       = $00000008;
  88. CONST MLFEFR_WORDWRAP   = $00000010;
  89. CONST MLFETL_TEXTBYTES  = $00000020;
  90.  
  91. (***********************************************************
  92. * MLN_MARGIN structure
  93. \**********************************************************)
  94.  
  95. TYPE
  96.   MLEMargStruct = RECORD (* MLEMRG margin structure     *)
  97.     afMargins : WORD;    (* margin indicator       *)
  98.     usMouMsg  : WORD;    (* mouse message       *)
  99.     iptNear   : Ipt;     (* geometrically nearest insertion point *)
  100.   END;
  101.  
  102. (***********************************************************
  103. * afFlags - margin notification indicators
  104. \**********************************************************)
  105. CONST MLFMARGIN_LEFT    = 0001;
  106. CONST MLFMARGIN_BOTTOM  = 0002;
  107. CONST MLFMARGIN_RIGHT   = 0003;
  108. CONST MLFMARGIN_TOP     = 0004;
  109.  
  110. (***********************************************************
  111. * MLM_QUERYSELECTION flags
  112. \**********************************************************)
  113. CONST MLFQS_MINMAXSEL   = 0;
  114. CONST MLFQS_MINSEL      = 1;
  115. CONST MLFQS_MAXSEL      = 2;
  116. CONST MLFQS_ANCHORSEL   = 3;
  117. CONST MLFQS_CURSORSEL   = 4;
  118.  
  119. (***********************************************************
  120. * MLN_CLPBDFAIL flags
  121. \**********************************************************)
  122. CONST MLFCLPBD_TOOMUCHTEXT  = $00000001;
  123. CONST MLFCLPBD_ERROR        = $00000002;
  124.  
  125. (***********************************************************
  126. * MLM_SEARCH structure
  127. \**********************************************************)
  128. TYPE
  129.   MLE_SearchData = RECORD (* mlesrch *)
  130.     cb          : WORD;    (* size of search spec structure  *)
  131.     pchFind     : pCh;     (* string to search for     *)
  132.     pchReplace  : pCh;     (* string to replace with    *)
  133.     cchFind     : INTEGER;  (* length of pchFindString    *)
  134.     cchReplace  : INTEGER;  (* length of replace string    *)
  135.     iptStart    : Ipt;    (* point at which to start search  *)
  136.           (* (negative indicates cursor pt)  *)
  137.           (* becomes pt where string found  *)
  138.     iptStop    : Ipt;     (* point at which to stop search  *)
  139.           (* (negative indicates EOT)    *)
  140.     cchFound  : WORD;  (* Length of found string at iptStart  *)
  141.   END;
  142.  
  143. (********************************       ********************
  144. * MLM_SEARCH style flags
  145. \********************************       *******************)
  146. CONST MLFSEARCH_CASESENSITIVE   = $00000001;
  147. CONST MLFSEARCH_SELECTMATCH     = $00000002;
  148. CONST MLFSEARCH_CHANGEALL       = $00000004;
  149.  
  150. (********************************       ********************
  151. * MLE messages - MLM from = 01b0 to = 01de; MLN from = 0001 to = 000f
  152. \**********************************************************)
  153. (* formatting messages *)
  154. CONST MLM_SETTEXTLIMIT    = $01B0;
  155. CONST MLM_QUERYTEXTLIMIT  = $01B1;
  156. CONST MLM_SETFORMATRECT   = $01B2;
  157. CONST MLM_QUERYFORMATRECT = $01B3;
  158. CONST MLM_SETWRAP         = $01B4;
  159. CONST MLM_QUERYWRAP       = $01B5;
  160. CONST MLM_SETTABSTOP      = $01B6;
  161. CONST MLM_QUERYTABSTOP    = $01B7;
  162. CONST MLM_SETREADONLY     = $01B8;
  163. CONST MLM_QUERYREADONLY   = $01B9;
  164.  
  165. (* text content manipulation and queries messages *)
  166. CONST MLM_QUERYCHANGED    = $01BA;
  167. CONST MLM_SETCHANGED      = $01BB;
  168. CONST MLM_QUERYLINECOUNT  = $01BC;
  169. CONST MLM_CHARFROMLINE    = $01BD;
  170. CONST MLM_LINEFROMCHAR    = $01BE;
  171. CONST MLM_QUERYLINELENGTH = $01BF;
  172. CONST MLM_QUERYTEXTLENGTH = $01C0;
  173.  
  174. (* text import and export messages *)
  175. CONST MLM_FORMAT                = $01C1;
  176. CONST MLM_SETIMPORTEXPORT       = $01C2;
  177. CONST MLM_IMPORT                = $01C3;
  178. CONST MLM_EXPORT                = $01C4;
  179. CONST MLM_DELETE                = $01C6;
  180. CONST MLM_QUERYFORMATLINELENGTH = $01C7;
  181. CONST MLM_QUERYFORMATTEXTLENGTH = $01C8;
  182. CONST MLM_INSERT                = $01C9;
  183.  
  184. (* selection messages *)
  185. CONST MLM_SETSEL                = $01CA;
  186. CONST MLM_QUERYSEL              = $01CB;
  187. CONST MLM_QUERYSELTEXT          = $01CC;
  188.  
  189. (* undo and redo messages *)
  190. CONST MLM_QUERYUNDO             = $01CD;
  191. CONST MLM_UNDO                  = $01CE;
  192. CONST MLM_RESETUNDO             = $01CF;
  193.  
  194. (* text attributes messages *)
  195. CONST MLM_QUERYFONT             = $01D0;
  196. CONST MLM_SETFONT               = $01D1;
  197. CONST MLM_SETTEXTCOLOR          = $01D2;
  198. CONST MLM_QUERYTEXTCOLOR        = $01D3;
  199. CONST MLM_SETBACKCOLOR          = $01D4;
  200. CONST MLM_QUERYBACKCOLOR        = $01D5;
  201.  
  202. (* scrolling messages *)
  203. CONST MLM_QUERYFIRSTCHAR        = $01D6;
  204. CONST MLM_SETFIRSTCHAR          = $01D7;
  205.  
  206. (* clipboard messages *)
  207. CONST MLM_CUT                   = $01D8;
  208. CONST MLM_COPY                  = $01D9;
  209. CONST MLM_PASTE                 = $01DA;
  210. CONST MLM_CLEAR                 = $01DB;
  211.  
  212. (* display manipulation messages *)
  213. CONST MLM_ENABLEREFRESH         = $01DC;
  214. CONST MLM_DISABLEREFRESH        = $01DD;
  215.  
  216. (* search message *)
  217. CONST MLM_SEARCH                = $01DE;
  218. CONST MLM_QUERYIMPORTEXPORT     = $01DF;
  219.  
  220. (* notification messages *)
  221. CONST MLN_OVERFLOW              = $0001;
  222. CONST MLN_PIXHORZOVERFLOW       = $0002;
  223. CONST MLN_PIXVERTOVERFLOW       = $0003;
  224. CONST MLN_TEXTOVERFLOW          = $0004;
  225. CONST MLN_VSCROLL               = $0005;
  226. CONST MLN_HSCROLL               = $0006;
  227. CONST MLN_CHANGE                = $0007;
  228. CONST MLN_SETFOCUS              = $0008;
  229. CONST MLN_KILLFOCUS             = $0009;
  230. CONST MLN_MARGIN                = $000A;
  231. CONST MLN_SEARCHPAUSE           = $000B;
  232. CONST MLN_MEMERROR              = $000C;
  233. CONST MLN_UNDOOVERFLOW          = $000D;
  234. CONST MLN_CLPBDFAIL             = $000F;
  235.  
  236. IMPLEMENTATION
  237. END.
  238.  
  239. (* ====================================================== *)
  240. (*                      Ende von PMMLE.PAS                *)
  241.