home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / dtx9202 / apisearc / wobject.dat < prev    next >
Encoding:
Text File  |  1991-11-29  |  24.6 KB  |  673 lines

  1.  wm_First    = $0000;            { $0000-$7FFF window messages }
  2.  id_First    =    $8000;          { $8000-$8FFF child id messages }
  3.  id_Internal = $8F00;            { $8F00-$8FFF reserved for internal use }
  4.  nf_First    =    $9000;          { $9000-$9FFF notification messages }
  5.  nf_Internal = $9F00;            { $9F00-$9FFF reserved for internal use }
  6.  cm_First    =    $A000;          { $A000-$FFFF command messages }
  7.  cm_Internal =    $FF00;            { $FF00-$FFFF reserved for internal use }
  8.  wm_Count    =    $8000;            { Number of window messages }
  9.  id_Count    =    $1000;            { Number of child ID messages }
  10.  nf_Count    =    $1000;            { Number of notification messages }
  11.  cm_Count    =    $6000;            { Number of command messages }
  12.  { Standard child ID messages }
  13.  id_Reserved      = id_Internal - id_First;
  14.  id_FirstMDIChild = id_Reserved + 1;
  15.  id_MDIClient     = id_Reserved + 2;
  16.  { Standard command messages }
  17.  cm_Reserved        = cm_Internal - cm_First;
  18.  cm_EditCut         = cm_Reserved + 0;
  19.  cm_EditCopy        = cm_Reserved + 1;
  20.  cm_EditPaste       = cm_Reserved + 2;
  21.  cm_EditDelete      = cm_Reserved + 3;
  22.  cm_EditClear       = cm_Reserved + 4;
  23.  cm_EditUndo        = cm_Reserved + 5;
  24.  cm_EditFind        = cm_Reserved + 6;
  25.  cm_EditReplace     = cm_Reserved + 7;
  26.  cm_EditFindNext    = cm_Reserved + 8;
  27.  cm_FileNew         = cm_Reserved + 9;
  28.  cm_FileOpen        = cm_Reserved + 10;
  29.  cm_MDIFileNew      = cm_Reserved + 11;
  30.  cm_MDIFileOpen     = cm_Reserved + 12;
  31.  cm_FileSave        = cm_Reserved + 13;
  32.  cm_FileSaveAs      = cm_Reserved + 14;
  33.  cm_ArrangeIcons    = cm_Reserved + 15;
  34.  cm_TileChildren    = cm_Reserved + 16;
  35.  cm_CascadeChildren = cm_Reserved + 17;
  36.  cm_CloseChildren   = cm_Reserved + 18;
  37.  cm_CreateChild     = cm_Reserved + 19;
  38.  cm_Exit            = cm_Reserved + 20;
  39.  { TWindowsObject Flags masks }
  40.  wb_KBHandler    = $01;
  41.  wb_FromResource = $02;
  42.  wb_AutoCreate   = $04;
  43.  wb_MDIChild     = $08;
  44.  wb_Transfer     = $10;
  45.  { TWindowsObject Status codes }
  46.  em_InvalidWindow     = -1;
  47.  em_OutOfMemory       = -2;
  48.  em_InvalidClient     = -3;
  49.  em_InvalidChild      = -4;
  50.  em_InvalidMainWindow = -5;
  51.  { TWindowsObject Transfer codes }
  52.  tf_SizeData =    0;
  53.  tf_GetData  =    1;
  54.  tf_SetData  =    2;
  55.  { TCheckBox check states }
  56.  bf_Unchecked = 0;
  57.  bf_Checked   = 1;
  58.  bf_Grayed    = 2;
  59.  { TStream access modes }
  60.  stCreate    = $3C00;          { Create new file }
  61.  stOpenRead  = $3D00;          { Read access only }
  62.  stOpenWrite = $3D01;          { Write access only }
  63.  stOpen      = $3D02;          { Read and write access }
  64.  { TStream error codes }
  65.  stOk         =  0;            { No error }
  66.  stError      = -1;            { Access error }
  67.  stInitError  = -2;            { Cannot initialize stream }
  68.  stReadError  = -3;            { Read beyond end of stream }
  69.  stWriteError = -4;            { Cannot expand stream }
  70.  stGetError   = -5;            { Get of unregistered object type }
  71.  stPutError   = -6;            { Put of unregistered object type }
  72.  { Maximum TCollection size }
  73.  MaxCollectionSize = 65520 div SizeOf(Pointer);
  74.  { TCollection error codes }
  75.  coIndexError = -1;            { Index out of range }
  76.  coOverflow   = -2;            { Overflow }
  77.  type
  78.  { String pointer }
  79.  PString = ^String;
  80.  { Type conversion records }
  81.  WordRec = record Lo, Hi: Byte end;
  82.  LongRec = record Lo, Hi: Word end;
  83.  PtrRec = record Ofs, Seg: Word end;
  84.  { General arrays }
  85.  PByteArray = ^TByteArray;
  86.  TByteArray = array[0..32767] of Byte;
  87.  PWordArray = ^TWordArray;
  88.  TWordArray = array[0..16383] of Word;
  89.  { TObject base object }
  90.  PObject = ^TObject;
  91.  TObject = object
  92.  constructor Init;
  93.  procedure Free;
  94.  destructor Done; virtual;
  95.  end;
  96.  { TStreamRec }
  97.  PStreamRec = ^TStreamRec;
  98.  TStreamRec = record
  99.  ObjType: Word;
  100.  VmtLink: Word;
  101.  Load: Pointer;
  102.  Store: Pointer;
  103.  Next: Word;
  104.  { TStream }
  105.  PStream = ^TStream;
  106.  TStream = object(TObject)
  107.  Status: Integer;
  108.  ErrorInfo: Integer;
  109.  procedure CopyFrom(var S: TStream; Count: Longint);
  110.  procedure Error(Code, Info: Integer); virtual;
  111.  procedure Flush; virtual;
  112.  function Get: PObject;
  113.  function GetPos: Longint; virtual;
  114.  function GetSize: Longint; virtual;
  115.  procedure Put(P: PObject);
  116.  procedure Read(var Buf; Count: Word); virtual;
  117.  function ReadStr: PString;
  118.  procedure Reset;
  119.  procedure Seek(Pos: Longint); virtual;
  120.  function StrRead: PChar;
  121.  procedure StrWrite(P: PChar);
  122.  procedure Truncate; virtual;
  123.  procedure Write(var Buf; Count: Word); virtual;
  124.  procedure WriteStr(P: PString);
  125.  { TDosStream }
  126.  PDosStream = ^TDosStream;
  127.  TDosStream = object(TStream)
  128.  Handle: Word;
  129.  constructor Init(FileName: PChar; Mode: Word);
  130.  { TBufStream }
  131.  PBufStream = ^TBufStream;
  132.  TBufStream = object(TDosStream)
  133.  Buffer: Pointer;
  134.  BufSize: Word;
  135.  BufPtr: Word;
  136.  BufEnd: Word;
  137.  constructor Init(FileName: PChar; Mode, Size: Word);
  138.  { TEmsStream }
  139.  PEmsStream = ^TEmsStream;
  140.  TEmsStream = object(TStream)
  141.  PageCount: Word;
  142.  Size: Longint;
  143.  Position: Longint;
  144.  constructor Init(MinSize, MaxSize: Longint);
  145.  { TCollection types }
  146.  PItemList = ^TItemList;
  147.  TItemList = array[0..MaxCollectionSize - 1] of Pointer;
  148.  { TCollection object }
  149.  PCollection = ^TCollection;
  150.  TCollection = object(TObject)
  151.  Items: PItemList;
  152.  Count: Integer;
  153.  Limit: Integer;
  154.  Delta: Integer;
  155.  constructor Init(ALimit, ADelta: Integer);
  156.  constructor Load(var S: TStream);
  157.  function At(Index: Integer): Pointer;
  158.  procedure AtDelete(Index: Integer);
  159.  procedure AtFree(Index: Integer);
  160.  procedure AtInsert(Index: Integer; Item: Pointer);
  161.  procedure AtPut(Index: Integer; Item: Pointer);
  162.  procedure Delete(Item: Pointer);
  163.  procedure DeleteAll;
  164.  function FirstThat(Test: Pointer): Pointer;
  165.  procedure ForEach(Action: Pointer);
  166.  procedure Free(Item: Pointer);
  167.  procedure FreeAll;
  168.  procedure FreeItem(Item: Pointer); virtual;
  169.  function GetItem(var S: TStream): Pointer; virtual;
  170.  function IndexOf(Item: Pointer): Integer; virtual;
  171.  procedure Insert(Item: Pointer); virtual;
  172.  function LastThat(Test: Pointer): Pointer;
  173.  procedure Pack;
  174.  procedure PutItem(var S: TStream; Item: Pointer); virtual;
  175.  procedure SetLimit(ALimit: Integer); virtual;
  176.  procedure Store(var S: TStream);
  177.  { TSortedCollection object }
  178.  PSortedCollection = ^TSortedCollection;
  179.  TSortedCollection = object(TCollection)
  180.  Duplicates: Boolean;
  181.  function Compare(Key1, Key2: Pointer): Integer; virtual;
  182.  function KeyOf(Item: Pointer): Pointer; virtual;
  183.  function Search(Key: Pointer; var Index: Integer): Boolean; virtual;
  184.  { TStringCollection object }
  185.  PStringCollection = ^TStringCollection;
  186.  TStringCollection = object(TSortedCollection)
  187.  { TStrCollection object }
  188.  PStrCollection = ^TStrCollection;
  189.  TStrCollection = object(TSortedCollection)
  190.  { TMessage windows message record }
  191.  PMessage = ^TMessage;
  192.  TMessage = record
  193.  Receiver: HWnd;
  194.  { ObjectWindows pointer types }
  195.  PWindowsObject = ^TWindowsObject;
  196.  PWindow        = ^TWindow;
  197.  PDialog     = ^TDialog;
  198.  PDlgWindow     = ^TDlgWindow;
  199.  PMDIWindow     = ^TMDIWindow;
  200.  PControl     = ^TControl;
  201.  PButton      = ^TButton;
  202.  PCheckBox     = ^TCheckBox;
  203.  PRadioButton     = ^TRadioButton;
  204.  PGroupBox     = ^TGroupBox;
  205.  PStatic     = ^TStatic;
  206.  PEdit             = ^TEdit;
  207.  PListBox     = ^TListBox;
  208.  PComboBox     = ^TComboBox;
  209.  PScrollBar     = ^TScrollBar;
  210.  PMDIClient     = ^TMDIClient;
  211.  PScroller     = ^TScroller;
  212.  PApplication     = ^TApplication;
  213.  { TWindowsObject object }
  214.  TWindowsObject = object(TObject)
  215.  HWindow: HWnd;
  216.  Parent, ChildList: PWindowsObject;
  217.  TransferBuffer: Pointer;
  218.  Instance: TFarProc;
  219.  Flags: Byte;
  220.  constructor Init(AParent: PWindowsObject);
  221.  procedure DefWndProc(var Msg: TMessage); virtual {index 8};
  222.  procedure DefCommandProc(var Msg: TMessage); virtual {index 12};
  223.  procedure DefChildProc(var Msg: TMessage); virtual {index 16};
  224.  procedure DefNotificationProc(var Msg: TMessage); virtual {index 20};
  225.  procedure SetFlags(Mask: Byte; OnOff: Boolean);
  226.  function IsFlagSet(Mask: Byte): Boolean;
  227.  function FirstThat(Test: Pointer): PWindowsObject;
  228.  function Next: PWindowsObject;
  229.  function Previous: PWindowsObject;
  230.  procedure EnableKBHandler;
  231.  procedure EnableAutoCreate;
  232.  procedure DisableAutoCreate;
  233.  procedure EnableTransfer;
  234.  procedure DisableTransfer;
  235.  function Register: Boolean; virtual;
  236.  function Create: Boolean; virtual;
  237.  procedure Destroy; virtual;
  238.  function GetId: Integer; virtual;
  239.  function ChildWithId(Id: Integer): PWindowsObject;
  240.  function GetClassName: PChar; virtual;
  241.  function GetClient: PMDIClient; virtual;
  242.  procedure GetChildPtr(var S: TStream; var P);
  243.  procedure PutChildPtr(var S: TStream; P: PWindowsObject);
  244.  procedure GetSiblingPtr(var S: TStream; var P);
  245.  procedure PutSiblingPtr(var S: TStream; P: PWindowsObject);
  246.  procedure GetWindowClass(var AWndClass: TWndClass); virtual;
  247.  procedure SetupWindow; virtual;
  248.  procedure Show(ShowCmd: Integer);
  249.  function CanClose: Boolean;  virtual;
  250.  function Transfer(DataPtr: Pointer; TransferFlag: Word): Word; virtual;
  251.  procedure TransferData(Direction: Word); virtual;
  252.  procedure DispatchScroll(var Msg: TMessage); virtual;
  253.  procedure CloseWindow;
  254.  procedure GetChildren(var S: TStream);
  255.  procedure PutChildren(var S: TStream);
  256.  function CreateChildren: Boolean;
  257.  procedure WMVScroll(var Msg: TMessage); virtual wm_First + wm_VScroll;
  258.  procedure WMHScroll(var Msg: TMessage); virtual wm_First + wm_HScroll;
  259.  procedure WMCommand(var Msg: TMessage); virtual wm_First + wm_Command;
  260.  procedure WMClose(var Msg: TMessage); virtual wm_First + wm_Close;
  261.  procedure WMDestroy(var Msg: TMessage); virtual wm_First + wm_Destroy;
  262.  procedure WMNCDestroy(var Msg: TMessage); virtual wm_First + wm_NCDestroy;
  263.  procedure WMActivate(var Msg: TMessage); virtual wm_First + wm_Activate;
  264.  procedure WMQueryEndSession(var Msg: TMessage);
  265.  virtual wm_First + wm_QueryEndSession;
  266.  procedure CMExit(var Msg: TMessage); virtual cm_First + cm_Exit;
  267.  private
  268.  CreateOrder: Word;
  269.  SiblingList: PWindowsObject;
  270.  procedure AddChild(AChild: PWindowsObject);
  271.  procedure RemoveChild(AChild: PWindowsObject);
  272.  function IndexOf(P: PWindowsObject): Integer;
  273.  function At(I: Integer): PWindowsObject;
  274.  { TWindow creation attributes }
  275.  TWindowAttr = record
  276.  Title: PChar;
  277.  Style: LongInt;
  278.  ExStyle: LongInt;
  279.  X, Y, W, H: Integer;
  280.  Param: Pointer;
  281.  0: (Menu: HMenu);         { Menu handle }
  282.  1: (Id: Integer);         { Child identifier }
  283.  { TWindow object }
  284.  TWindow = object(TWindowsObject)
  285.  Attr: TWindowAttr;
  286.  DefaultProc: TFarProc;
  287.  Scroller: PScroller;
  288.  FocusChildHandle: THandle;
  289.  constructor Init(AParent: PWindowsObject; ATitle: PChar);
  290.  constructor InitResource(AParent: PWindowsObject; ResourceID: Word);
  291.  procedure SetCaption(ATitle: PChar);
  292.  procedure DefWndProc(var Msg: TMessage); virtual;
  293.  procedure WMActivate(var Msg: TMessage);
  294.  virtual wm_First + wm_Activate;
  295.  procedure WMCreate(var Msg: TMessage);
  296.  virtual wm_First + wm_Create;
  297.  procedure WMHScroll(var Msg: TMessage);
  298.  virtual wm_First + wm_HScroll;
  299.  procedure WMVScroll(var Msg: TMessage);
  300.  virtual wm_First + wm_VScroll;
  301.  procedure WMPaint(var Msg: TMessage);
  302.  virtual wm_First + wm_Paint;
  303.  procedure Paint(PaintDC: HDC; var PaintInfo: TPaintStruct); virtual;
  304.  procedure WMSize(var Msg: TMessage);
  305.  virtual wm_First + wm_Size;
  306.  procedure WMMove(var Msg: TMessage);
  307.  virtual wm_First + wm_Move;
  308.  procedure WMLButtonDown(var Msg: TMessage);
  309.  virtual wm_First + wm_LButtonDown;
  310.  { TDialog creation attributes }
  311.  TDialogAttr = record
  312.  Name: PChar;
  313.  Param: LongInt;
  314.  { TDialog object }
  315.  TDialog = object(TWindowsObject)
  316.  Attr: TDialogAttr;
  317.  IsModal: Boolean;
  318.  constructor Init(AParent: PWindowsObject; AName: PChar);
  319.  function Execute: Integer; virtual;
  320.  procedure EndDlg(ARetValue: Integer); virtual;
  321.  function GetItemHandle(DlgItemID: Integer): HWnd;
  322.  function SendDlgItemMsg(DlgItemID: Integer; AMsg, WParam: Word;
  323.  LParam: LongInt): LongInt;
  324.  procedure Ok(var Msg: TMessage); virtual id_First + id_Ok;
  325.  procedure Cancel(var Msg: TMessage); virtual id_First + id_Cancel;
  326.  procedure WMInitDialog(var Msg: TMessage);
  327.  virtual wm_First + wm_InitDialog;
  328.  procedure WMClose(var Msg: TMessage);
  329.  virtual wm_First + wm_Close;
  330.  { TDlgWindow object }
  331.  TDlgWindow = object(TDialog)
  332.  { TMDIWindow object }
  333.  TMDIWindow = object(TWindow)
  334.  ClientWnd:  PMDIClient;
  335.  ChildMenuPos: Integer;
  336.  constructor Init(ATitle: PChar; AMenu: HMenu);
  337.  procedure InitClientWindow; virtual;
  338.  function InitChild: PWindowsObject; virtual;
  339.  function CreateChild: PWindowsObject; virtual;
  340.  procedure CMCreateChild(var Msg: TMessage);
  341.  virtual cm_First + cm_CreateChild;
  342.  procedure TileChildren; virtual;
  343.  procedure CascadeChildren; virtual;
  344.  procedure ArrangeIcons; virtual;
  345.  procedure CloseChildren; virtual;
  346.  procedure CMTileChildren(var Msg: TMessage);
  347.  virtual cm_First + cm_TileChildren;
  348.  procedure CMCascadeChildren(var Msg: TMessage);
  349.  virtual cm_First + cm_CascadeChildren;
  350.  procedure CMArrangeIcons(var Msg: TMessage);
  351.  virtual cm_First + cm_ArrangeIcons;
  352.  procedure CMCloseChildren(var Msg: TMessage);
  353.  virtual cm_First + cm_CloseChildren;
  354.  { TControl object }
  355.  TControl = object(TWindow)
  356.  constructor Init(AParent: PWindowsObject; AnId: Integer;
  357.  ATitle: PChar; X, Y, W, H: Integer);
  358.  procedure WMPaint(var Msg: TMessage); virtual wm_First + wm_Paint;
  359.  { TButton object }
  360.  TButton = object(TControl)
  361.  AText: PChar; X, Y, W, H: Integer; IsDefault: Boolean);
  362.  { TCheckBox object }
  363.  TCheckBox = object(TButton)
  364.  Group: PGroupBox;
  365.  constructor Init(AParent: PWindowsObject; AnID: Integer;
  366.  ATitle: PChar; X, Y, W, H: Integer; AGroup: PGroupBox);
  367.  procedure Check;
  368.  procedure Uncheck;
  369.  procedure Toggle;
  370.  function GetCheck: Word;
  371.  procedure SetCheck(CheckFlag: Word);
  372.  procedure BNClicked(var Msg: TMessage);
  373.  virtual nf_First + bn_Clicked;
  374.  { TRadioButton object }
  375.  TRadioButton = object(TCheckBox)
  376.  { TGroupBox object }
  377.  TGroupBox = object(TControl)
  378.  NotifyParent: Boolean;
  379.  AText: PChar; X, Y, W, H: Integer);
  380.  procedure SelectionChanged(ControlId: Integer); virtual;
  381.  { TStatic object }
  382.  TStatic = object(TControl)
  383.  TextLen: Word;
  384.  ATitle: PChar; X, Y, W, H: Integer; ATextLen: Word);
  385.  constructor InitResource(AParent: PWindowsObject; ResourceID: Word;
  386.  ATextLen: Word);
  387.  function GetText(ATextString: PChar; MaxChars: Integer): Integer;
  388.  procedure SetText(ATextString: PChar);
  389.  procedure Clear;
  390.  { TEdit object }
  391.  TEdit = object(TStatic)
  392.  constructor Init(AParent: PWindowsObject; AnId: Integer; ATitle: PChar;
  393.  X, Y, W, H: Integer; ATextLen: Word; Multiline: Boolean);
  394.  procedure Undo;
  395.  function CanUndo: Boolean;
  396.  procedure Paste;
  397.  procedure Copy;
  398.  procedure Cut;
  399.  function GetNumLines: Integer;
  400.  function GetLineLength(LineNumber: Integer): Integer;
  401.  function GetLine(ATextString: PChar;
  402.  StrSize, LineNumber: Integer): Boolean;
  403.  procedure GetSubText(ATextString: PChar; StartPos, EndPos: Integer);
  404.  function DeleteSubText(StartPos, EndPos: Integer): Boolean;
  405.  function DeleteLine(LineNumber: Integer): Boolean;
  406.  procedure GetSelection(var StartPos, EndPos: Integer);
  407.  function DeleteSelection: Boolean;
  408.  function IsModified: Boolean;
  409.  procedure ClearModify;
  410.  function GetLineFromPos(CharPos: Integer): Integer;
  411.  function GetLineIndex(LineNumber: Integer): Integer;
  412.  procedure Scroll(HorizontalUnit, VerticalUnit: Integer);
  413.  function SetSelection(StartPos, EndPos: Integer): Boolean;
  414.  procedure Insert(ATextString: PChar);
  415.  function Search(StartPos: Integer; AText: PChar; CaseSensitive: Boolean): Integer;
  416.  procedure CMEditCut(var Msg: TMessage);
  417.  virtual  cm_First + cm_EditCut;
  418.  procedure CMEditCopy(var Msg: TMessage);
  419.  virtual  cm_First + cm_EditCopy;
  420.  procedure CMEditPaste(var Msg: TMessage);
  421.  virtual  cm_First + cm_EditPaste;
  422.  procedure CMEditDelete(var Msg: TMessage);
  423.  virtual  cm_First + cm_EditDelete;
  424.  procedure CMEditClear(var Msg: TMessage);
  425.  virtual  cm_First + cm_EditClear;
  426.  procedure CMEditUndo(var Msg: TMessage);
  427.  virtual  cm_First + cm_EditUndo;
  428.  { TListBox message name type }
  429.  TMsgName = (
  430.  mn_AddString, mn_InsertString, mn_DeleteString,
  431.  mn_ResetContent, mn_GetCount, mn_GetText,
  432.  mn_GetTextLen, mn_SelectString, mn_SetCurSel,
  433.  mn_GetCurSel);
  434.  { Multiple selction transfer record }
  435.  PMultiSelRec = ^TMultiSelRec;
  436.  TMultiSelRec = record
  437.  Selections: array[0..32760] of Integer;
  438.  { TListBox object }
  439.  TListBox = object(TControl)
  440.  X, Y, W, H: Integer);
  441.  function AddString(AString: PChar): Integer;
  442.  function InsertString(AString: PChar; Index: Integer): Integer;
  443.  function DeleteString(Index: Integer): Integer;
  444.  procedure ClearList;
  445.  function GetCount: Integer;
  446.  function GetString(AString: PChar; Index: Integer): Integer;
  447.  function GetStringLen(Index: Integer): Integer;
  448.  function GetSelString(AString: PChar; MaxChars: Integer): Integer;
  449.  function SetSelString(AString: PChar; Index: Integer): Integer;
  450.  function GetSelIndex: Integer;
  451.  function SetSelIndex(Index: Integer): Integer;
  452.  function GetMsgID(AMsg: TMsgName): Word; virtual;
  453.  { TComboBox object }
  454.  TComboBox = object(TListBox)
  455.  X, Y, W, H: Integer; AStyle: Word; ATextLen: Word);
  456.  constructor InitResource(AParent: PWindowsObject; ResourceID: Integer;
  457.  procedure ShowList;
  458.  procedure HideList;
  459.  { TScrollBar transfer record }
  460.  TScrollBarTransferRec = record
  461.  LowValue: Integer;
  462.  HighValue: Integer;
  463.  Position: Integer;
  464.  { TScrollBar object }
  465.  TScrollBar = object(TControl)
  466.  LineMagnitude, PageMagnitude: Integer;
  467.  X, Y, W, H: Integer; IsHScrollBar: Boolean);
  468.  procedure GetRange(var LoVal, HiVal: Integer);
  469.  function GetPosition: Integer;
  470.  procedure SetRange(LoVal, HiVal: Integer);
  471.  procedure SetPosition(ThumbPos: Integer);
  472.  function DeltaPos(Delta: Integer): Integer;
  473.  procedure SBLineUp(var Msg: TMessage); virtual nf_First + sb_LineUp;
  474.  procedure SBLineDown(var Msg: TMessage); virtual nf_First + sb_LineDown;
  475.  procedure SBPageUp(var Msg: TMessage); virtual nf_First + sb_PageUp;
  476.  procedure SBPageDown(var Msg: TMessage); virtual nf_First + sb_PageDown;
  477.  procedure SBThumbPosition(var Msg: TMessage); virtual nf_First + sb_ThumbPosition;
  478.  procedure SBThumbTrack(var Msg: TMessage); virtual nf_First + sb_ThumbTrack;
  479.  procedure SBTop(var Msg: TMessage); virtual nf_First + sb_Top;
  480.  procedure SBBottom(var Msg: TMessage); virtual nf_First + sb_Bottom;
  481.  { TMDIClient object }
  482.  TMDIClient = object(TControl)
  483.  ClientAttr: TClientCreateStruct;
  484.  constructor Init(AParent: PMDIWindow);
  485.  { TScroller object }
  486.  TScroller = object(TObject)
  487.  Window: PWindow;
  488.  XPos: LongInt;    { current horizontal pos in horz scroll units }
  489.  YPos: LongInt;    { current vertical pos in vert scroll units }
  490.  XUnit: Integer;    { logical device units per horz scroll unit }
  491.  YUnit: Integer;    { logical device units per vert scroll unit }
  492.  XRange: LongInt;    { # of scrollable horz scroll units }
  493.  YRange: LongInt;    { # of scrollable vert scroll units }
  494.  XLine: Integer;    { # of horz scroll units per line }
  495.  YLine: Integer;    { # of vert scroll units per line }
  496.  XPage: Integer;    { # of horz scroll units per page }
  497.  YPage: Integer;    { # of vert scroll units per page }
  498.  AutoMode: Boolean;  { auto scrolling mode  }
  499.  TrackMode: Boolean; { track scroll mode    }
  500.  AutoOrg: Boolean;   { AutoOrg indicates Scroller offsets origin }
  501.  HasHScrollBar: Boolean;
  502.  HasVScrollBar: Boolean;
  503.  constructor Init(TheWindow: PWindow; TheXUnit, TheYUnit: Integer;
  504.  TheXRange, TheYRange: LongInt);
  505.  procedure SetUnits(TheXUnit, TheYUnit: LongInt);
  506.  procedure SetPageSize; virtual;
  507.  procedure SetSBarRange; virtual;
  508.  procedure SetRange(TheXRange, TheYRange: LongInt);
  509.  procedure BeginView(PaintDC: HDC; var PaintInfo: TPaintStruct); virtual;
  510.  procedure EndView; virtual;
  511.  procedure VScroll(ScrollRequest: Word; ThumbPos: Integer); virtual;
  512.  procedure HScroll(ScrollRequest: Word; ThumbPos: Integer); virtual;
  513.  procedure ScrollTo(X, Y: LongInt);
  514.  procedure ScrollBy(Dx, Dy: LongInt);
  515.  procedure AutoScroll; virtual;
  516.  function IsVisibleRect(X, Y: LongInt; XExt, YExt: Integer): Boolean;
  517.  function XScrollValue(ARangeUnit: Longint): Integer;
  518.  function YScrollValue(ARangeUnit: Longint): Integer;
  519.  function XRangeValue(AScrollUnit: Integer): Longint;
  520.  function YRangeValue(AScrollUnit: Integer): Longint;
  521.  { TApplication object }
  522.  TApplication = object(TObject)
  523.  MainWindow: PWindowsObject;
  524.  HAccTable: THandle;
  525.  KBHandlerWnd: PWindowsObject;
  526.  constructor Init(AName: PChar);
  527.  procedure InitApplication; virtual;
  528.  procedure InitInstance; virtual;
  529.  procedure InitMainWindow; virtual;
  530.  procedure Run; virtual;
  531.  procedure SetKBHandler(AWindowsObject: PWindowsObject);
  532.  procedure MessageLoop; virtual;
  533.  function ProcessAppMsg(var Message: TMsg): Boolean; virtual;
  534.  function ProcessDlgMsg(var Message: TMsg): Boolean; virtual;
  535.  function ProcessAccels(var Message: TMsg): Boolean; virtual;
  536.  function ProcessMDIAccels(var Message: TMsg): Boolean; virtual;
  537.  function MakeWindow(AWindowsObject: PWindowsObject): PWindowsObject; virtual;
  538.  function ExecDialog(ADialog: PWindowsObject): Integer; virtual;
  539.  function ValidWindow(AWindowsObject: PWindowsObject): PWindowsObject; virtual;
  540.  procedure Error(ErrorCode: Integer); virtual;
  541.  function CanClose: Boolean; virtual;
  542.  { Abstract notification procedure }
  543.  procedure Abstract;
  544.  { Memory management routines }
  545.  function LowMemory: Boolean;
  546.  procedure RestoreMemory;
  547.  function MemAlloc(Size: Word): Pointer;
  548.  function GetObjectPtr(HWindow: HWnd): PWindowsObject;
  549.  function NewStr(S: String): PString;
  550.  procedure DisposeStr(P: PString);
  551.  { Multi-selection support routines }
  552.  function AllocMultiSel(Size: Integer): PMultiSelRec;
  553.  procedure FreeMultiSel(P: PMultiSelRec);
  554.  { Stream routines }
  555.  procedure RegisterType(var S: TStreamRec);
  556.  procedure RegisterWObjects;
  557.  { Longint inline routines }
  558.  function LongMul(X, Y: Integer): Longint;
  559.  inline($5A/$58/$F7/$EA);
  560.  function LongDiv(X: Longint; Y: Integer): Integer;
  561.  inline($59/$58/$5A/$F7/$F9);
  562.  { Application object pointer }
  563.  const
  564.  Application: PApplication = nil;
  565.  { Safety pool size }
  566.  SafetyPoolSize: Word = 8192;
  567.  { Stream error procedure }
  568.  StreamError: Pointer = nil;
  569.  { EMS stream state variables }
  570.  EmsCurHandle: Word = $FFFF;
  571.  EmsCurPage: Word = $FFFF;
  572.  { Stream registration records }
  573.  RCollection: TStreamRec = (
  574.  ObjType: 50;
  575.  VmtLink: Ofs(TypeOf(TCollection)^);
  576.  Load:    @TCollection.Load;
  577.  Store:   @TCollection.Store);
  578.  RStringCollection: TStreamRec = (
  579.  ObjType: 51;
  580.  VmtLink: Ofs(TypeOf(TStringCollection)^);
  581.  Load:    @TStringCollection.Load;
  582.  Store:   @TStringCollection.Store);
  583.  RWindowsObject: TStreamRec = (
  584.  ObjType: 52;
  585.  VmtLink: Ofs(TypeOf(TWindowsObject)^);
  586.  Load:    @TWindowsObject.Load;
  587.  Store:   @TWindowsObject.Store);
  588.  RWindow: TStreamRec = (
  589.  ObjType: 53;
  590.  VmtLink: Ofs(TypeOf(TWindow)^);
  591.  Load:    @TWindow.Load;
  592.  Store:   @TWindow.Store);
  593.  RDialog: TStreamRec = (
  594.  ObjType: 54;
  595.  VmtLink: Ofs(TypeOf(TDialog)^);
  596.  Load:    @TDialog.Load;
  597.  Store:   @TDialog.Store);
  598.  RDlgWindow: TStreamRec = (
  599.  ObjType: 55;
  600.  VmtLink: Ofs(TypeOf(TDlgWindow)^);
  601.  Load:    @TDlgWindow.Load;
  602.  Store:   @TDlgWindow.Store);
  603.  RControl: TStreamRec = (
  604.  ObjType: 56;
  605.  VmtLink: Ofs(TypeOf(TControl)^);
  606.  Load:    @TControl.Load;
  607.  Store:   @TControl.Store);
  608.  RMDIWindow: TStreamRec = (
  609.  ObjType: 57;
  610.  VmtLink: Ofs(TypeOf(TMDIWindow)^);
  611.  Load:    @TMDIWindow.Load;
  612.  Store:   @TMDIWindow.Store);
  613.  RMDIClient: TStreamRec = (
  614.  ObjType: 58;
  615.  VmtLink: Ofs(TypeOf(TMDIClient)^);
  616.  Load:    @TMDIClient.Load;
  617.  Store:   @TMDIClient.Store);
  618.  RButton: TStreamRec = (
  619.  ObjType: 59;
  620.  VmtLink: Ofs(TypeOf(TButton)^);
  621.  Load:    @TButton.Load;
  622.  Store:   @TButton.Store);
  623.  RCheckBox: TStreamRec = (
  624.  ObjType: 60;
  625.  VmtLink: Ofs(TypeOf(TCheckBox)^);
  626.  Load:    @TCheckBox.Load;
  627.  Store:   @TCheckBox.Store);
  628.  RRadioButton: TStreamRec = (
  629.  ObjType: 61;
  630.  VmtLink: Ofs(TypeOf(TRadioButton)^);
  631.  Load:    @TRadioButton.Load;
  632.  Store:   @TRadioButton.Store);
  633.  RGroupBox: TStreamRec = (
  634.  ObjType: 62;
  635.  VmtLink: Ofs(TypeOf(TGroupBox)^);
  636.  Load:    @TGroupBox.Load;
  637.  Store:   @TGroupBox.Store);
  638.  RListBox: TStreamRec = (
  639.  ObjType: 63;
  640.  VmtLink: Ofs(TypeOf(TListBox)^);
  641.  Load:    @TListBox.Load;
  642.  Store:   @TListBox.Store);
  643.  RComboBox: TStreamRec = (
  644.  ObjType: 64;
  645.  VmtLink: Ofs(TypeOf(TComboBox)^);
  646.  Load:    @TComboBox.Load;
  647.  Store:   @TComboBox.Store);
  648.  RScrollBar: TStreamRec = (
  649.  ObjType: 65;
  650.  VmtLink: Ofs(TypeOf(TScrollBar)^);
  651.  Load:    @TScrollBar.Load;
  652.  Store:   @TScrollBar.Store);
  653.  RStatic: TStreamRec = (
  654.  ObjType: 66;
  655.  VmtLink: Ofs(TypeOf(TStatic)^);
  656.  Load:    @TStatic.Load;
  657.  Store:   @TStatic.Store);
  658.  REdit: TStreamRec = (
  659.  ObjType: 67;
  660.  VmtLink: Ofs(TypeOf(TEdit)^);
  661.  Load:    @TEdit.Load;
  662.  Store:   @TEdit.Store);
  663.  RScroller: TStreamRec = (
  664.  ObjType: 68;
  665.  VmtLink: Ofs(TypeOf(TScroller)^);
  666.  Load:    @TScroller.Load;
  667.  Store:   @TScroller.Store);
  668.  RStrCollection: TStreamRec = (
  669.  ObjType: 69;
  670.  VmtLink: Ofs(TypeOf(TStrCollection)^);
  671.  Load:    @TStrCollection.Load;
  672.  Store:   @TStrCollection.Store);
  673.