Sage-ST ä

Displayw

Documentation

ApplicationInProgress DefaultProcedure DefaultSageInit DisplayBackgroundW
DisplayCustomForm DisplayCustomWindow DisplayForm DisplayFormContinue
DisplayFormContinueDefaultProc DisplayFormContinueExtra DisplayFormDefaultProc DisplayFormExtra
DisplayHelp DisplayMessage DisplayMessageW DisplayWindow
DlgProc FindActiveWindow GetActiveForm GetDisplaySize
GetInstance GetKeyboardLocales GetLocaleNameAndCountry GetOriginalDialogID
MessageW ProcessMessages RegisterSageDialog SageInit
SetAccelerators SetClassDefaults SetCursor SetDefaultEditIOProcs
SetDefaultExceptionProc SetDefaultStatusBar SetDisplayMode SetIcon
SetInstance SetMenu SetParentDefault SetParentHwnd
SetParentID SetPopupMenu SetPositionDefaults SetQuitFlag
SetStatusBar SetStyleDefaults SetTitle SetVisibility




  PROCEDURE DefaultSageInit;

  (**
      DefaultSageInit - Reset calls defined by SageInit to original defaults.
  *)




  PROCEDURE SageInit
             (CONST pf : PutFieldType;
              CONST GF : GetFieldType;
              CONST se : SageErrorType;
              CONST Cv : CharIsValidType;
              CONST fv : FieldIsValidType;
              CONST ge : GetEnumType);

  (**
      SageInit - Initializes Sage Database calls.


      This procedure allows the user to indicate which procedures will perform
      the functions PutFieldA, GetFieldA, SageError, and CharIsValidType.

      CALLING SEQUENCE -

        SageInit (pf, gf, se, cv)

      ENTRY -

        pf : PutFieldType
          The procedure to replace Sage.PutFieldA.

        gf : GetFieldType
          The procedure to replace Sage.GetFieldA.

        se : SageErrorType
          The procedure to replace Sage.GetSageError.

        cv : CharIsValidType
          The procedure to replace InfoLib.CharIsValid

        fv : FieldIsValidType
          The procedure to replace InfoLib.ValidateField

        ge : GetEnumType
          The procedure which replaces InfoLib.ShowFieldEnumeration.
  *)




  PROCEDURE SetClassDefaults
             (VAR   WNDCLASS : WINUSER.WNDCLASS);




  PROCEDURE SetStyleDefaults
             (VAR   winStyles : WIN32.DWORD);




  PROCEDURE SetPositionDefaults
             (VAR   winPos : DWSpec.WindowPosition);




  PROCEDURE SetParentDefault
             (VAR   parentHwnd : WIN32.HWND);




  PROCEDURE SetDefaultStatusBar
             (CONST FormID    : CARDINAL;
              CONST controlID : CARDINAL;
              CONST index     : CARDINAL) : BOOLEAN;

  (**
      SetDefaultStatusBar - Sets one a status bars to receive all DisplayMessages.


      This procedure allows the user to specidfy which status bar will
      display the DisplayMessage messages.  Sage.SageError messages will also
      be linked to this status bar.

      CALLING SEQUENCE -

        SetDefaultStatusBar (formID, controlID, index)

      ENTRY -

        formID : CARDINAL
          The form containing the status bar.

        controlID : CARDINAL
          The ID of the status bar.  Set to 0 if the status bar is
          on a window.

        index : CARDINAL
          The index (1 .. n) of the cell in the status bar to display the
          message.
  *)




  PROCEDURE SetDefaultEditIOProcs
             (CONST pb : DWSpec.PutBlockType;
              CONST gb : DWSpec.GetBlockType;
              CONST tb : DWSpec.TruncateBlockType);

  (**
      SetDefaultEditIOProcs - Initializes Sage IO Stream calls.


      This procedure allows the user to indicate which procedures will perform
      the functions PutBlock and  GetBlock.

      CALLING SEQUENCE -

        SageInit (pb, gb)

      ENTRY -

        pb : PutBlockType
          The procedure to replace Sage.PutBlock.

        gb : GetBlockType
          The procedure to replace Sage.GetBlock.

        tb : TruncateBlockType
          The procedure to replace Sage.TruncateBlock
  *)




  PROCEDURE SetDefaultExceptionProc
             (CONST exProc : DWSpec.ExceptionProcType);




  PROCEDURE SetMenu
             (CONST windowID : CARDINAL;
              CONST menu     : CARDINAL) : BOOLEAN;

  (**
      SetMenu - Sets the menu for the specified window.


      This procedure sets the specified window's menu to the specified
      menu.  The menu must have been previosly defined in the resource
      file.  Messages for items selected on the menu will be sent to the
      MessageProcedure of the window.

      CALLING SEQUENCE -

        b := SetMenu (windowID, menu)

      ENTRY -

        windowID : CARDINAL
          The ID of the window.

        menu : CARDINAL
          Identifier of menu to display.  A value of 0 will result in no
          menu being displayed.

      EXIT -

        b : BOOLEAN
          True if the menu was set.
  *)




  PROCEDURE SetPopupMenu
             (CONST FormID : CARDINAL;
              CONST menu   : CARDINAL) : BOOLEAN;

  (**
      SetPopupMenu - Sets the Popup menu for the main window or a form.


      This procedure allows the user to set a popup menu for the main window or
      a form.  A right mouse click anywhere in the form will cause the popup menu
      to appear.  The ID of the selected item in the popup menu will be sent as
      the resourceID of a SysCommand message to the Action Proc of the form.
      For a Main Window, SetPopupMenu can be called at any point in the
      application.  For forms, SetPopupMenu can only be called after the form
      has been created ..

      CALLING SEQUENCE -

        b := SetMenu (form, menu)

      ENTRY -

        form : CARDINAL
          Identifier of the form to contain the popup menu.

        menu : CARDINAL
          Identifier of menu to display.  A value of 0 will disable the
          popup menu for the form.

      EXIT -

        b : BOOLEAN
          True if the menu was set.
  *)




  PROCEDURE SetIcon
             (CONST windowID : CARDINAL;
              CONST icon     : CARDINAL) : BOOLEAN;

  (**
      SetIcon - Sets the specified window's icon.


      This procedure sets the specified window's icon.  The icon must have
      been defined in the resource file, or be one of the predefined icons.

      CALLING SEQUENCE -

        b := SetIcon (windowID, icon)

      ENTRY -

        windowID : CARDINAL
          The ID of the window.

        icon : CARDINAL
          Identifier of the icon to set.  The identifier should not be
          greater than 0x6FFF (28671) or it will conflict with icon ID's
          that have been reserved by Microsoft for standard (predefined)
          icons.  A value of zero will set the applications icon to be the
          stanard Windows application icon.  The following is a list of
          predefined icons which may be used with SetIcon -

              ApplicationIcon    White box with black frame
              HandIcon           Stop sign
              QuestionIcon       White ? in green circle
              ExclamationIcon    Black ! in yellow circle
              AsteriskIcon       White i in blue circle
              WinLogoIcon
              WarningIcon        Black ! in yellow circle
              ErrorIcon          Stop sign
              InformationIcon    White i in blue circle

      EXIT -

        b : BOOLEAN
          True if the icon was set.
  *)




  PROCEDURE SetAccelerators
             (CONST accelerator : CARDINAL) : BOOLEAN;

  (**
      SetAccelerators - Sets the main window's accelerator table.


      This procedure sets the main window's accelerator table.  The
      accelerator table must have been previosly defined in the resource
      file.

      CALLING SEQUENCE -

        b := SetAccelerator (accelerator)

      ENTRY -

        accelerator : CARDINAL
          Identifier of accelerator table to set.

      EXIT -

        b : BOOLEAN
          True if the accelerator table was set.
  *)




  PROCEDURE SetCursor
             (CONST windowID : CARDINAL;
              CONST cursor   : CARDINAL) : BOOLEAN;

  (**
      SetCursor - Sets the specified window's cursor.


      This procedure sets the specified window's cursor.  The cursor must
      have been defined in the resource file, or be one of the predefined
      Windows cursors.

      CALLING SEQUENCE -

        b := SetCursor (windowID, cursor)

      ENTRY -

        windowID : CARDINAL
          The ID of the window.

        cursor : CARDINAL
          Identifier of cursor to set.  The identifier should not be
          greater than 0x6FFF (28671) or it will conflict with cursor ID's
          that have been reserved by Microsoft for standard (predefined)
          cursors.  A value of zero will result in the ArrowCursor becoming
          the current cursor.  The following is a list of predefined cursors
          which may be used with SetCursor -

              ArrowCursor      Standard arrow
              IBeamCursor      I Beam for text editing
              WaitCursor       Hourglass
              CrossCursor      Crosshairs
              UpArrowCursor    Large arrow pointing straight up
              SizeCursor       4 arrows pointing away from middle
              IconCursor       White square on a black field
              SizeNWSECursor   2 arrows pointing up&left and down&right
              SizeNESWCursor   2 arrows pointing up&right and down&left
              SizeWECursor     2 arrows pointing right and left
              SizeNSCursor     2 arrows pointing up and down
              SizeAllCursor    same as SizeCursor - 4 arrows
              NoCursor         Black circle with slash through it
              AppStartCursor   Arrow with hourglass next to it
              HelpCursor

      EXIT -

        b : BOOLEAN
          True if the cursor was set.
  *)




  PROCEDURE SetStatusBar
             (CONST windowID  : CARDINAL;
              CONST parts     : CARDINAL;
              CONST partArray : ARRAY OF DWSpec.SageSBarCellType) : BOOLEAN;

  (**
      SetStatusBar - Sets the specified window's status bar.


      This procedure sets up the specified window's status bar.

      CALLING SEQUENCE -

        b := SetStatusBar (windowID, parts, partArray)

      ENTRY -

        windowID : CARDINAL
          The ID of the window.

        parts : CARDINAL
          The number of parts for the status bar.  The maximum supported is
          10.

        partArray : ARRAY OF DWSpec.SageSBarCellType
          An array containing an element for each part of the status bar.
          SageSBarCellType is defined as -
              Raised    (Y = Raised, N = Lowered)
              Percent   The percent of the total status bar that this part will
                        take up (0.100)
              PType     (N = Normal, S = Display Message, F = Fatal Error)

      EXIT -

        b : BOOLEAN
          True if the status bar was set up.
  *)




  PROCEDURE GetInstance
             (VAR   hInstance : WIN32.HINSTANCE);




  PROCEDURE SetInstance
             (CONST hInstance : WIN32.HINSTANCE);

  (**
      SetInstance - Sets the DisplayW instance.


      This procedure sets the instance for DisplayW.  This is usefull if
      DisplayW will be loading resources from another Instance.

      CALLING SEQUENCE -

        b := SetCursor (cursor)

      ENTRY -

        hInstance : HINSTANCE
          The new instance to become the DisplayW instance.

      EXIT -

        b : BOOLEAN
          True if the instance was set.
  *)




  PROCEDURE SetVisibility
             (CONST windowID : CARDINAL;
              CONST visible  : BOOLEAN);

  (**
      SetVisibility - Sets the visbility of the specified window.


      This procedure sets the visibility of the specified Window.

      CALLING SEQUENCE -

        SetVisibility (windowID, visible)

      ENTRY -

        windowID : CARDINAL
          The ID of the window.

        visible : BOOLEAN
          The visibility status for the window.
  *)




  PROCEDURE SetDisplayMode
             (CONST windowID  : CARDINAL;
              CONST Minimized : BOOLEAN;
              CONST Maximized : BOOLEAN);

  (**
      SetDisplayMode - Sets the display mode (max, min, normal) of the specified window.


      This procedure sets the display mode of the specified Window.

      CALLING SEQUENCE -

        SetDisplayMode (windowID, Minimized, Maximized)

      ENTRY -

        windowID : CARDINAL
          The ID of the window.

        Minimized : BOOLEAN
          Should the window be changed to a minimized window?

        Maximized : BOOLEAN
          Should the window be changed to a maximized window?

      NOTE - If both Minimized and Maximized are set to FALSE then the
             window is changed to a Normal window.
  *)




  PROCEDURE SetTitle
             (CONST windowID : CARDINAL;
              CONST Title    : ARRAY OF CHAR) : BOOLEAN;

  (**
      SetTitle - Sets the specified window title.


      This procedure sets the main window's title.

      CALLING SEQUENCE -

        b := SetTitle (windowID, title)

      ENTRY -

        windowID : CARDINAL
          The ID of the window.

        title : ARRAY OF CHAR
          Title for the Window.

      EXIT -

        b : BOOLEAN
          True if the title was set.
  *)




  PROCEDURE SetParentHwnd
             (CONST child  : WIN32.HWND;
              CONST Parent : WIN32.HWND) : WIN32.HWND;

  (**
      SetParentHwnd - Assigns a parent to a child window or dialog by hwnd.


      This procedure assigns a parent to a child window or dialog, using
      the hwnds as identifiers.  This is useful if one or both of
      the windows/dialogs are not Sage windows/dialogs.  If the
      child and parent are Sage windows/dialogs, use SetParentID instead.
      This function returns the hwnd of the previously assigned parent.  The
      child window/dialog must currently exist.  If the parent does not
      currently exist, the child will be made a top level window.
      The child and parent can be any combination of dialogs and windows.

      CALLING SEQUENCE -

        oldHwnd := SetParentHwnd (childHwnd, parentHwnd)

      ENTRY -

        child : CARDINAL
          The hwnd of the child window or dialog.

        parent : CARDINAL
          The hwnd of the parent window or dialog.

      EXIT -

        oldHwnd : CARDINAL
          The hwnd of the previous parent window or dialog.
  *)




  PROCEDURE SetParentID
             (CONST childID     : CARDINAL;
              CONST newParentID : CARDINAL) : CARDINAL;

  (**
      SetParentID - Assigns a parent to a child window or dialog by id.


      This procedure assigns a parent to a child window or dialog, and
      returns the ID of the previously assigned parent.  The child
      window or dialog must currently exist.  If the parent does not
      currently exist, the child will be made a top level window.
      Windows can be parents of both windows and dialogs, as can dialogs.

      CALLING SEQUENCE -

        oldID := SetParentID (childID, parentID)

      ENTRY -

        childID : CARDINAL
          The ID of the child window or dialog.

        parentID : CARDINAL
          The ID of the parent window or dialog.

      EXIT -

        oldID : CARDINAL
          The ID of the previous parent window or dialog.
  *)




  PROCEDURE MessageW
             (CONST message     : DisplayMessageType;
              CONST messageData : SYSTEM.ADDRESS) : BOOLEAN;

  (**
      MessageW - Handles all messages to DisplayW.


      Allows application programs to invoke behaviors of their programs
      objects.

      CALLING SEQUENCE -

        b := MessageW (message, messageData)

      ENTRY -

        message : DisplayMessageType
          One of the predefined messages as follows -

          message --       Check
          Purpose --       Checks a check box or radio button control.
          messageData Type -- BaseMessageInfo
          Uses--             CheckBox, RadioButton, SageCBox, SageRBtn
          Entry --
              dialogID -- The number of the dialog box containing the control.
              resourceID -- The control number of the control to check.
          Exit --
              <none>

          message --       CheckGray
          Purpose --       Grays a three state check box control.
          messageData Type -- BaseMessageInfo
          Uses--             CheckBox, SageCBox
          Entry --
                  dialogID    The ID of the window containing the control.
                  resourceID  The ID of the control to gray.
          Exit --
              <none>

          message --       Disable
          Purpose --       Disables a control.
          messageData Type -- BaseMessageInfo
          Uses--             Button,   CheckBox, Edit,     RadioButton,
                              SageBttn, SageCBox, SageEdit, SageList,
                              SageRBtn, SageStat, Static
          Entry --
              dialogID -- The number of the dialog box containing the control.
              resourceID -- The control number of the control to disable.
          Exit --
              <none>

          message --       Enable
          Purpose --       Enables a control.
          messageData Type -- BaseMessageInfo
          Uses--             Button,   CheckBox, Edit,     RadioButton,
                              SageBttn, SageCBox, SageEdit, SageList,
                              SageRBtn, SageStat, Static
          Entry --
              dialogID -- The number of the dialog box containing the control.
              resourceID -- The control number of the control to enable.
          Exit --
              <none>

          message --       GetText
          Purpose --       Get the text from a control.
          messageData Type -- msgData ControlTextInfo
          Uses--             Button,   CheckBox, Edit,     RadioButton,
                              SageBttn, SageCBox, SageEdit, SageRBtn,
                              SageStat,    Static
          Entry --
              dialogID -- The number of the dialog box containing the control.
              controlID -- The control number of the control from which to
                         get text.
          Exit --
              text --   The text retrieved from the control.

          message --       GiveFocus
          Purpose --       Gives the focus to a conttrol.
          messageData Type -- BaseMessageInfo
          Uses--             Button,   CheckBox, Edit,     RadioButton,
                              SageBttn, SageCBox, SageEdit, SageList,
                              SageRBtn, SageStat, Static
          Entry --
              dialogID -- The number of the dialog box containing the control.
              resourceID -- The control number of the control to give focus to.
          Exit --
              <none>

          message --       Hide
          Purpose --       Make a control invisible.
          messageData Type -- BaseMessageInfo
          Uses--             Button,   CheckBox, Edit,     RadioButton,
                              SageBttn, SageCBox, SageEdit, SageList,
                              SageRBtn, SageStat, Static
          Entry --
              dialogID -- The number of the dialog box containing the control.
              resourceID -- The control number of the control to hide.
          Exit --
              <none>

          message --       IsChecked
          Purpose --       Test to see if a check box or radio button is
                              checked.
          messageData Type -- BaseMessageInfo
          Uses--             CheckBox, RadioButton, SageCBox, SageRBtn
          Entry --
              dialogID -- The number of the dialog box containing the control.
              resourceID -- The control number of the control to test.
          Exit --
              <none>

          message --       IsEnabled
          Purpose --       Tests the status of a conttrol.
          messageData Type -- BaseMessageInfo
          Uses--             Button,   CheckBox, Edit,     RadioButton,
                              SageBttn, SageCBox, SageEdit, SageList,
                              SageRBtn, SageStat, Static
          Entry --
              dialogID -- The number of the dialog box containing the control.
              resourceID -- The control number of the control to test.
          Exit --
              <none>

          message --       LookUp
          Purpose --       Returns the Windows handle to a control.
          messageData Type -- LookUpData
          Uses--             Button,   CheckBox, Edit,     RadioButton,
                              SageBttn, SageCBox, SageEdit, SageList,
                              SageRBtn, SageStat, Static
          Entry --
              dialogID -- The number of the dialog box containing the control.
              controlD -- The control number of the control to look up.  If
                        zero, then the handle of the dialog is returned.
          Exit --
              hwnd --  The Windows handle to the control.

          message --       MakeDefault
          Purpose --       Makes a button control the default button. (The
                              button that is activated when the user presses
                              Enter)
          messageData Type -- BaseMessageInfo
          Uses--             Button, SageBttn
          Entry --
              dialogID -- The number of the dialog box containing the button.
              resourceID -- The control number of the button to make default.
          Exit --
              <none>

          message --       ReDraw
          Purpose --       Causes a control to redraw.
          messageData Type -- BaseMessageInfo
          Uses--             Button,   CheckBox, Edit,     RadioButton,
                              SageBttn, SageCBox, SageEdit, SageList,
                              SageRBtn, SageStat, Static
          Entry --
              dialogID -- The number of the dialog box containing the control.
              resourceID -- The control number of the control to redraw.
          Exit --
              <none>

          message --       SageFlush
          Purpose --       Causes a Sage control to flush its contents to
                              its associated memory record.
          messageData Type -- BaseMessageInfo
          Uses--             SageCBox, SageEdit, SageList, SageRBtn
          Entry --
              dialogID -- The number of the dialog box that contains the
                          control to flush.  If set to 0, all dialog boxes
                          will be flushed.
              resourceID -- The control number of the control to flush.  If set
                          to zero, all controls on the specified dialog box
                          will be flushed
          Exit --
              <none>

          message --       SageReset
          Purpose --       Tell a Sage Control to reset its data from
                              its associated memory record.
          messageData Type -- BaseMessageInfo
          Uses--             SageCBox, SageEdit, SageList, SageRBtn, SageStat
          Entry --
              dialogID -- The number of the dialog box that contains the
                          control to reset.  If set to 0, all dialog boxes
                          will be reset.
              resourceID -- The control number of the control to reset.  If set
                          to zero, all controls on the specified dialog box
                          will be reset
          Exit --
              <none>

          message --       SetText
          Purpose --       Set the text of a control.
          messageData Type -- ControlTextInfo
          Uses--             Button, CheckBox, Edit, RadioButton, SageBttn,
                              SageCBox, SageEdit, SageRBtn, SageStat, Static
          Entry --
              dialogID -- The number of the dialog box containing the control.
              controlID -- The control number which is to receive text.
              text --   The text to place in the control.
          Exit --
              <none>

          message --       Show
          Purpose --       Make a control visible.
          messageData Type -- BaseMessageInfo
          Uses--             Button,   CheckBox, Edit,     RadioButton,
                              SageBttn, SageCBox, SageEdit, SageList,
                              SageRBtn, SageStat, Static
          Entry --
              dialogID -- The number of the dialog box containing the control.
              resourceID -- The control number of the control to show.
          Exit --
              <none>

          message --       Terminate
          Purpose --       Terminates a dialog box or the main window.
          messageData Type -- BaseMessageInfo
          Entry --
              dialogID -- The number of the dialog box to terminate or
                        one (1) for the main window to terminate the whole
                        application.
          Exit --
              <none>

          message --       UnCheck
          Purpose --       Unchecks a check box or radio button control.
          messageData Type -- BaseMessageInfo
          Uses              CheckBox, RadioButton, SageCBox, SageRBtn
          Entry --
              dialogID -- The number of the dialog box containing the control.
              resourceID -- The control number the control to uncheck.
          Exit --
              <none>

        messageData : SYSTEM.ADDRESS
          The address of the data structure containing information for the
          the message.  See above to determine which data structure is used
          for a particular message.

      EXIT -

        b : BOOLEAN
          True if the message was handled.
  *)




  PROCEDURE DefaultProcedure
             (CONST msgType : DisplayMessageType;
              CONST msgData : SYSTEM.ADDRESS;
              VAR   done    : BOOLEAN);

  (**
      DefaultProcedure - A generic Action Procedure.


      This procedure can be used for the Action Procedure of DisplayForm and
      DisplayFormContinue for which the only option is to exit the form.
      The DefaultProcedure will handle exit buttons with identifiers
      WINUSER.IDOK and IDCANCEL.
  *)




  PROCEDURE DisplayFormExtra
             (CONST FormID        : CARDINAL;
              CONST FormProcedure : DWSpec.ActionProc;
              CONST extra         : SYSTEM.ADDRESS) : CARDINAL;




  PROCEDURE DisplayFormContinueExtra
             (CONST FormID        : CARDINAL;
              CONST FormProcedure : DWSpec.ActionProc;
              CONST extra         : SYSTEM.ADDRESS) : CARDINAL;




  PROCEDURE DisplayCustomForm
             (CONST dHandle      : DWSpec.DlgHandle;
              CONST dialogID     : CARDINAL;
              CONST modal        : BOOLEAN;
              CONST DlgProcedure : ActionProc) : CARDINAL;




  PROCEDURE DisplayForm
             (CONST Form          : CARDINAL;
              CONST FormProcedure : ActionProc) : CARDINAL;

  (**
      DisplayForm - Displays the form using a supplied procedure.


      The function displays a form and sets up an Action procedure to
      handle messages to the form.  The Form identifier must be greater
      than 1 since this is reserved for the Main Window.  The user
      will not be able to access any forms underneath this one until
      it is closed.

      This procedure is passed an action procedure which appears as follows -

      procedure FormProc
           (    messageType : DisplayMessageType;
                                 messageValue : SYSTEM.ADDRRESS;
                             VAR done : BOOLEAN);

      FormProc is a user supplied function for DisplayForm which handles
      messages sent to the form.  The user can choose whether or not
      to respond to these messages in the FormProc.

      All messages can expect 'messageValue' to be set to point to a
      BaseMessageInfo structure. For DrawItem, the ADDRESS will be a
      pointer to a DrawItemInfo.  LookUp is a user-called command to
      MessageW and the user must set 'messageValue' to a LookUpInfo structure
      or bad things will happen.

      Upon exit, the procedure should RETURN TRUE if it handled the message
      and FALSE if it did not, unless the DisplayMessageType was Initialize
      for a dialog, in which case the procedure should return FALSE if it set
      the focus to a specific control with SetFocus, and TRUE if Windows
      should set initial focus to the first button.  In addition, for
      DrawItem, the user should place the bitmap ID# in the structure for
      the button ID passed in SubType and the state in the structure.

      Please see the beginning of this document for information on messages
      from Windows and Custom controls.

      Values used by the 'FormProc' are :

      messageType : DisplayMessageType
        The message being received from the system.  Will be one of the
        DisplayMessageTypes as follows:

            Initialize  The form is being initialized
            SysCommand  A system event has occured
            Terminate   The form is about to terminate
            DrawItem    An item on the form needs to be redrawn
            SageList    A SageList control on a form has sent a message
            SageEdit    A SageEdit control on a form has sent a message
            SageCBox    A SageCBox control on a form has sent a message
            SageBttn    A SageBttn control on a form has sent a message
            SageRbtn    A SageRbtn control on a form has sent a message
            SageTree    A SageTree control on a form has sent a message
            SageComb    A SageComb control on a form has sent a message
            Edit        A Windows Edit control on a form has sent a message
            Button      A Windows Button control on a form has sent a message
            Scroll      A Windows Scroll control on a form has sent a message

      messageValue : SYSTEM.ADDRESS
        The address of the data structure containing information for the
        message.  The type of structure will depend on which of the
        DisplayMessageTypes has been sent as follows:

            Message       Structure
            ----------    ----------------
            Initialize    BaseMessageInfo
            SysCommand    BaseMessageInfo
            Terminate     BaseMessageInfo
            DrawItem      DrawItemInfo
            SageList      SageListInfo
            SageEdit      SageEditInfo
            SageTree      SageTreeInfo
            SageCBox      ButtonInfo
            SageBttn      ButtonInfo
            SageRbtn      ButtonInfo
            SageComb      SageCombInfo
            Edit          EditInfo
            Button        ButtonInfo
            Scroll        ScrollInfo

      CALLING SEQUENCE -

        b := DisplayW.DisplayForm (form, formProcedure);

      ENTRY -

        form : CARDINAL
          Identifier of the form to display.

        formProcedure : ActionProc
          The procedure to receive messages for the form.

      EXIT -

        b : CARDINAL
          The dialogID of the displayed dialog.  Same as 'dialogID' is
          the first one, or a new ID.
  *)




  PROCEDURE DisplayFormDefaultProc
             (CONST Form : CARDINAL) : CARDINAL;

  (**
      DisplayFormDefaultProc - Displays the form using the default procedure.


      See documentation of the DisplayForm routine.  This procedure does the
      same thing except instead of supplying an ActionProc the DefaultProcedure
      is used.
  *)




  PROCEDURE DisplayFormContinue
             (CONST Form          : CARDINAL;
              CONST FormProcedure : ActionProc) : CARDINAL;

  (**
      DisplayFormContinue - Displays the specified form.


      The function displays a form and sets up an Action procedure to
      handle messages to the form.  The form (dialog) is displayed as
      a modeless dialog box which causes a return to you code, but the
      form remains active and the associated 'FormContinueProc' is
      called until the form is taken down by sending a terminate message
      from the associated 'FormContinueProc'.

      The Form identifier must be greater than 1 since this is reserved
      for the Main Window.  The user will be able to access any forms
      underneath this one.

      This procedure is passed an action procedure which appears as follows:

      PROCUEDURE FormContinueProc (    messageType : DisplayMessageType;
                                        messageValue : SYSTEM.ADDRESS;
                                    VAR done : BOOLEAN);

      The 'FormContinueProc' is a user supplied function for which
      handles messages sent to the form.  The user can choose whether
      or not to respond to these messages please refer to the documentation
      on FormProc for an explaination of how to handle messages sent
      to the procedure

      Please see the beginning of this document for information on messages
      from Windows and Custom controls.

      CALLING SEQUENCE -

        b := DisplayW.DisplayFormContinue (Form, FormProcedure);

      ENTRY -

        Form : CARDINAL
          Identifier of the form to display.

        FormProcecure : ActionProc
          The procedure to receive messages for the form.

      EXIT -

        b : CARDINAL
          The dialogID of the displayed dialog.  Same as 'dialogID' is
          the first one, or a new ID.
  *)




  PROCEDURE DisplayFormContinueDefaultProc
             (CONST Form : CARDINAL) : CARDINAL;

  (**
      DisplayFormContinueDefaultProc - Displays the form using the default procedure.


      See documentation of the DisplayFormContinue routine.  This procedure does the
      same thing except instead of supplying an ActionProc the DefaultProcedure
      is used.
  *)




  PROCEDURE DisplayHelp
             (CONST FormID    : CARDINAL;
              CONST controlID : CARDINAL;
              CONST helpType  : DisplayHelpType;
              CONST Data      : CARDINAL;
              CONST helpStr   : ARRAY OF CHAR;
              CONST FileName  : ARRAY OF CHAR) : BOOLEAN;

  (**
      DisplayHelp - Displays the specified help file.


      This function is used to Display a help file

      CALLING SEQUENCE -

        b := DisplayHelp (Form, controlID, helpType, data, helpStr, fileName)

      ENTRY -

        Form : CARDINAL
          The number of the dialog box associated with the help.

        controlID : CARDINAL
          The control number associated with the help.

        helpType : DisplayHelpType
          Contents
          HelpOnHelp
          Search
          TopicIndex
          TopicSearch

        data : CARDINAL
          Some data to associate with the help.

        helpStr : ARRAY OF CHAR
          Some string to associate with the help.

        fileName : ARRAY OF CHAR
          The name of the help file to display.

      EXIT -

        b : BOOLEAN
          True if all is well, else false.
  *)




  PROCEDURE ApplicationInProgress
             () : BOOLEAN;




  PROCEDURE DisplayCustomWindow
             (CONST wHandle      : DWSpec.WinHandle;
              CONST windowID     : CARDINAL;
              CONST Title        : ARRAY OF CHAR;
              CONST menuNum      : CARDINAL;
              CONST WndProcedure : ActionProc) : CARDINAL;




  PROCEDURE DisplayWindow
             (CONST windowID     : CARDINAL;
              CONST Title        : ARRAY OF CHAR;
              CONST menuNum      : CARDINAL;
              CONST WndProcedure : ActionProc) : CARDINAL;

  (**
      DisplayWindow - Creates a window.


      This routine displays a window and sets up an Action
      procedure to handle messages to the window.

      If resources such as menus are to be used from a resource file in the
      application, the programmer must include the module WinInit.  If
      WinInit is not included, then the application will not be able to find
      the resources and they will not be displayed.

      Note : A window must be created before other calls to DisplayW such
             as DisplayForm are called.

      CALLING SEQUENCE -

        b := DisplayW.DisplayWindow (windowID, title, menuNum, WndProcedure);

      ENTER -

        windowID : CARDINAL
          The ID of the window.

        title : ARRAY OF CHAR
          The title of the window.

        menuNum : CARDINAL
          The resource ID of the menu for the window.

        WndProcedure : ActionProc
          An action procedure to handle messages.

      EXIT -

        b : CARDINAL
          The ID of the window displayed or zero if not done.  If this
          is a duplicate window, the ID will be different than 'windowID',
          otherwise it will be the same.

      EXAMPLE -

        IMPORT Sage;
        IMPORT DisplayW;
        IMPORT WinInit;  -- Needed if resources such as menus are to be used

        MENU_EXIT   := 123;  /* control ID of menu option   */
        FINAL_FORM  := 321;  /* control ID of dialog (form) */

        b : BOOLEAN;

        PROCEDURE MyMainProc
                     (    messageType : DisplayMessageType;
                          messageValue : SYSTEM.ADDRESS;
                      VAR done : BOOLEAN)

        VAR
            sysMsg : DisplayW.BaseMessagePointer;

        BEGIN
            IF (messageType = DisplayW.Initialize) THEN
              DisplayW.SetIcon (1, icon);
              DisplayW.SetAccelerator (1, accelerator);
              done := TRUE;
            ELSIF (messageType = DisplayW.SysCommand) THEN
              sysMsg := messageValue;
              IF (sysMsg.resourceID = MENU_EXIT) THEN
                DisplayW.DisplayForm (FINAL_FORM, FormProc);
              END;
            END;
        END MyMainProc;

        BEGIN
        Sage.OpenSystem ("WTEST.DFL", 5, 5, 5000);
        IF (Sage.SageError () = SageErrs.OpOk) THEN
            DisplayW.DisplayWindow (1, "My Window", menu, MyMainProc);
            Sage.CloseSystem;
        END;
        END MTest;
  *)




  PROCEDURE GetDisplaySize
             (VAR   width  : CARDINAL;
              VAR   height : CARDINAL);

  (**
      GetDisplaySize - Get the width and height of the display area.


      This routine returns the width and height (in pixels) of the current
      display resolution.

      CALLING SEQUENCE -

        GetDisplaySize (width, height)

      ENTRY -

        None
          N/A

      EXIT -

        width : CARDINAL
          The current width of the display area in pixels.

        height : CARDINAL
          The current height of the display area in pixels.
  *)




  PROCEDURE GetActiveForm
             () : CARDINAL;

  (**
      GetActiveForm - Get the ID of the active form.


      This routine returns the ID of the active form (the one with
      highlighted title bars).

      CALLING SEQUENCE -

        formID := GetDisplaySize ()

      ENTRY -

        None
          N/A

      EXIT -

        formID : CARDINAL
          The ID of the active form.  A value of 1 indicates the Main Window
          is active.  Returns 0 on error or no form is active.
  *)




  PROCEDURE GetOriginalDialogID
             (CONST dialogID : CARDINAL) : CARDINAL;

  (**
      GetOriginalDialogID - Retrieves the resource ID of a dialog.

      Given the run-time assigned number of a dialog, this routine returns
      the resource ID that was used to create the dialog.

      CALLING SEQUENCE -

        dialogID := OriginalDialogID (msgData)

      ENTRY -

        dialogID : CARDINAL
          The unique dialog ID for an instance of a dialog.

      EXIT -

        resourceID : CARDINAL
          The ID of the resource used to create the instance of the dialogID.
  *)




  PROCEDURE DisplayBackgroundW
             (CONST Form     : CARDINAL;
              CONST bitmapID : CARDINAL;
              CONST Format   : DWSpec.BackgroundFormat) : BOOLEAN;

  (**
      DisplayBackgroundW - Places a bitmap on the main window.


      A bitmap is drawn in the client area of the specified window according
      to the format option supplied.

      CALLING SEQUENCE -

        b := DisplayBackgroundW (form, bitmapID, format)

      ENTRY -

        form : CARDINAL
          The identifier of the form on which to draw the bitmap.

        bitmapID : CARDINAL
          The identifier from the resource of the bitmap to draw.

        format : BackgroundFormat
          The style by which the bitmap will be drawn.  Must be one of the
          following -

              BF_Center        Centers the bitmap in the form
              BF_Tile          Tiles the bitmap in the form
              BF_Fill_Window   Stretches the bitmap to fill the form
              BF_Size_Window   Resizes the form to fit the bitmap exactly
              BF_CenteredSize  Stretches the bitmap to fill the form only if
                               the form is larger than the bitmap.
              BF_None          Clears the form

      EXIT -

        b : BOOLEAN
          True if the bitmap was drawn.
  *)




  PROCEDURE DisplayMessage
             (CONST message : ARRAY OF CHAR;
              CONST Bell    : BOOLEAN);

  (**
      DisplayMessage - Displays a message in a box.


      If the main window is not yet up, the message will be displayed
      in a box with an OK button, and processing will not continue
      until the user presses OK.  If the main window is up, a box is
      displayed, but processing can continue.  The user can choose close
      on the system menu (top left corner of the box) to close it, or the
      program can call DisplayMessage ('', FALSE) to close the box.  The box
      will position itself where it was last closed or near the top left
      of the screen if opened for the first time in the application.
      If a DisplayMessageW box is up, this will change the text
      in the box to message and turn off any timer.

      CALLING SEQUENCE -

        DisplayMessage (message, bell)

      ENTRY -

        message : ARRAY OF CHAR
          The message to display in the box.

        bell : BOOLEAN
          Set to TRUE to beep when the message is displayed.
  *)




  PROCEDURE ProcessMessages;

  (**
      ProcessMessages - Causes all messages in the application queue to be processed.


      This procedure causes all messages in the applications message queue to be
      processed.

      CALLING SEQUENCE -

        ProcessMessages

      EXIT -

        None
          N/A
  *)




  PROCEDURE DisplayMessageW
             (CONST Title         : ARRAY OF CHAR;
              CONST message       : ARRAY OF CHAR;
              CONST Bell          : BOOLEAN;
              CONST timeOut       : CARDINAL;
              CONST messageType   : MessageBoxFormat;
              CONST defaultButton : MessageBoxDefault) : MessageBoxResponse;

  (**
      DisplayMessageW - Displays a multifunction message box.


      Behavior depends on the messageType parameter.  If messageType is
      MBF_Normal, a message box exactly like the one resulting from a
      call to DisplayMessage pops up, and the procedure will return
      MR_Null.  If messageType is MBF_Timed, the message box from
      DisplayMessage will pop up except that it will disappear after
      approximately timeOut milliseconds (1/1000 second).  The remaining
      options do not return immediately (without waiting for user input)
      like MBF_Normal and MBF_Timed do.  They display a message box with
      the indicated buttons, wait for user response, and return the value
      of the button pressed.  The defaultButton parameter indicates which
      button should be highlighted when the dialog comes up.

      CALLING SEQUENCE -

        m := MessageW (msgType, msgData)

      ENTRY -

        title : ARRAY OF CHAR
          The title of the message box to be displayed.

        message : ARRAY OF CHAR
          The message to appear in the message box.

        bell : BOOLEAN
          Set to TRUE to beep when the message is displayed.

        timeOut : CARDINAL
          The amount of time (in miliseconds) the message box is to be
          displayed.  A value of 1000 = 1 second.

        messageType : WINUSER.MessageBoxFormat
          The format for the message box.  Must be one of the following -

              MBF_Normal            Standard message box
              MBF_Timed             Timed message box
              MBF_Ok                Message box with OK button
              MBF_OkCancel          Message box with OK and Cancel buttons
              MBF_YesNo             Message box with Yes and No buttons
              MBF_YesNoCancel       Message box with Yes, No, and Cancel buttons
              MBF_RetryCancel       Message box with Retry and Cancel buttons
              MBF_AbortRetryIgnore  Message box with Abort, Retry, and Ignore
                                    buttons

        defaultButton : WINUSER.MessageBoxDefault
          Specifies which button on a multi button message box will
          receive the focus.  Must be one of the following -

              MBD_1   Give focus to the first button
              MBD_2   Give focus to the second button
              MBD_3   Give focus to the third button

      EXIT -

        m : WINUSER.MessageBoxResponse
          One of the following identifiers depending on which button option was
          used to exit the box -
              MBR_Null    The message box was closed without pressing a button
              MBR_Abort   The Abort button was pressed
              MBR_Cancel  The Cancel button was pressed
              MBR_Ignore  The Ignore button was pressed
              MBR_No      The No button was pressed
              MBR_Ok      The Ok button was pressed
              MBR_Retry   The Retry button was pressed
              MBR_Yes     The Yes button was pressed
  *)




  PROCEDURE RegisterSageDialog
             (CONST dHandle       : DWSpec.DlgHandle;
              CONST FormID        : CARDINAL;
              CONST FormProcedure : DWSpec.ActionProc) : CARDINAL;

  (* For use by Prop Sheet object *)




  PROCEDURE DlgProc
             (      hwndDlg : WIN32.HWND;
                    Message : WIN32.UINT;
                    wParam  : WIN32.WPARAM;
                    lParam  : WIN32.LPARAM) : WIN32.BOOL [EXPORT];

  (* For use by Prop Sheet object *)




  PROCEDURE FindActiveWindow
             () : WIN32.HWND;

  (* For use by Prop Sheet object *)




  PROCEDURE SetQuitFlag
             (CONST quit : BOOLEAN);

  (**
      SetQuitFlag - Set the PostQuitMessage flag for DisplayW.


      If the user does not want DisplayW to issue the PostQuitMessage when
      the final window is destroyed, then set this flag to false.  If true, then
      DisplayW will issue the PostQuitMessage when the final window is destroyed.
      This is normally set to false if the a routine is being called by
      another app that has control nad will do the PostQuitMessage.

      CALLING SEQUENCE -

        SeqQuitFlag (quit)

      ENTRY -

        quit : BOOLEAN
          The setting of the quit flag.  True will issue the PostQuitMessage command.
  *)




  PROCEDURE GetKeyboardLocales
             (CONST numLocales : INTEGER;
              VAR   localeBuf  : ARRAY OF CARDINAL;
              VAR   NumItems   : INTEGER);




  PROCEDURE GetLocaleNameAndCountry
             (CONST lcid       : CARDINAL;
              VAR   LocaleName : ARRAY OF CHAR;
              VAR   country    : ARRAY OF CHAR);




Send mail to   warren.merrill@inl.gov with questions or comments about this web site.
Copyright © 1989-2006 Battelle Energy Alliance