![]() |
|
![]() |
procedure DefaultSageInit; stdcall; exports DefaultSageInit name 'DisplayW_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); stdcall;
exports SageInit name 'DisplayW_SageInit';
//*
// 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 : Windows.TWndClass); stdcall;
exports SetClassDefaults name 'DisplayW_SetClassDefaults';
procedure SetStyleDefaults
(var winStyles : Windows.DWORD); stdcall;
exports SetStyleDefaults name 'DisplayW_SetStyleDefaults';
procedure SetPositionDefaults
(var winPos : DWSpec.WindowPosition); stdcall;
exports SetPositionDefaults name 'DisplayW_SetPositionDefaults';
procedure SetParentDefault
(var parentHwnd : Windows.Hwnd); stdcall;
exports SetParentDefault name 'DisplayW_SetParentDefault';
function SetDefaultStatusBar
(const FormID : cardinal;
const controlID : cardinal;
const index : cardinal) : boolean; stdcall;
exports SetDefaultStatusBar name 'DisplayW_SetDefaultStatusBar';
//*
// SetDefaultStatusBar - Sets one of the 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); stdcall;
exports SetDefaultEditIOProcs name 'DisplayW_SetDefaultEditIOProcs';
//*
// 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); stdcall;
exports SetDefaultExceptionProc name 'DisplayW_SetDefaultExceptionProc';
function SetMenu
(const windowID : cardinal;
const menu : cardinal) : boolean; stdcall;
exports SetMenu name 'DisplayW_SetMenu';
//*
// 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.
//
function SetPopupMenu
(const FormID : cardinal;
const menu : cardinal) : boolean; stdcall;
exports SetPopupMenu name 'DisplayW_SetPopupMenu';
//*
// 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.
//
function SetIcon
(const windowID : cardinal;
const icon : cardinal) : boolean; stdcall;
exports SetIcon name 'DisplayW_SetIcon';
//*
// 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.
//
function SetAccelerators
(const accelerator : cardinal) : boolean; stdcall;
exports SetAccelerators name 'DisplayW_SetAccelerators';
//*
// 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.
//
function SetCursor
(const windowID : cardinal;
const cursor : cardinal) : boolean; stdcall;
exports SetCursor name 'DisplayW_SetCursor';
//*
// 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.
//
function SetStatusBar
(const windowID : cardinal;
const parts : cardinal;
const partArray : array of DWSpec.SageSBarCellType) : boolean; stdcall;
exports SetStatusBar name 'DisplayW_SetStatusBar';
//*
// 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 theInstance : Windows.hInst); stdcall;
exports GetInstance name 'DisplayW_GetInstance';
procedure SetInstance
(const theInstance : Windows.hInst); stdcall;
exports SetInstance name 'DisplayW_SetInstance';
//*
// 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 -
//
// TheInstance : Windows.Hinst
// 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); stdcall;
exports SetVisibility name 'DisplayW_SetVisibility';
//*
// 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); stdcall;
exports SetDisplayMode name 'DisplayW_SetDisplayMode';
//*
// 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.
//
function SetTitle
(const windowID : cardinal;
const Title : array of char) : boolean; overload; stdcall;
exports SetTitle (const windowID : cardinal;
const Title : array of char) name 'DisplayW_SetTitle';
//*
// 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.
//
function SetTitle
(const windowID : cardinal;
const Title : string) : boolean; overload; stdcall;
exports SetTitle (const windowID : cardinal;
const Title : string) name 'DisplayW_STRSetTitle';
//*
// STRSetTitle - See documentation of SetTitle.
//
function SetParentHwnd
(const child : Windows.Hwnd;
const Parent : Windows.Hwnd) : Windows.Hwnd; stdcall;
exports SetParentHwnd name 'DisplayW_SetParentHwnd';
//*
// 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.
//
function SetParentID
(const childID : cardinal;
const newParentID : cardinal) : cardinal; stdcall;
exports SetParentID name 'DisplayW_SetParentID';
//*
// 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.
//
function MessageW
(const msgType : DisplayMessageType;
const msgData : pointer) : boolean; stdcall;
exports MessageW name 'DisplayW_MessageW';
//*
// MessageW - Handles all messages to DisplayW.
//
//
// Allows application programs to invoke behaviors of their programs
// objects.
//
// CALLING SEQUENCE -
//
// b := MessageW (msgType, msgData)
//
// 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 - pointer;
// 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 : DWSpec.DisplayMessageType;
const msgData : pointer;
var done : boolean); stdcall;
exports DefaultProcedure name 'DisplayW_Defaultprocedure';
//*
// 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
// Windows.IDOK and IDCANCEL.
//
function DisplayFormExtra
(const FormID : cardinal;
const FormProcedure : DWSpec.ActionProc;
const extra : pointer) : cardinal; stdcall;
exports DisplayFormExtra name 'DisplayW_DisplayFormExtra';
function DisplayFormContinueExtra
(const FormID : cardinal;
const FormProcedure : DWSpec.ActionProc;
const extra : pointer) : cardinal; stdcall;
exports DisplayFormContinueExtra name 'DisplayW_DisplayFormContinueExtra';
function DisplayCustomForm
(const dHandle : DWSpec.DlgHandle;
const dialogID : cardinal;
const modal : boolean;
const FormProcedure : ActionProc) : cardinal; stdcall;
exports DisplayCustomForm name 'DisplayW_DisplayCustomForm';
function DisplayForm
(const Form : cardinal;
const FormProcedure : ActionProc) : cardinal; stdcall;
exports DisplayForm name 'DisplayW_DisplayForm';
//*
// 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 : pointer
// 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.
//
function DisplayFormDefaultProc
(const Form : cardinal) : cardinal; stdcall;
exports DisplayFormDefaultProc name 'DisplayW_DisplayFormDefaultProc';
//*
// DisplayFormDefaultProc - Displays the form using the default procedure.
//
//
// See documentation of DisplayForm. This procedure does the
// same thing except instead of supplying an ActionProc the DefaultProcedure
// is used.
//
function DisplayFormContinue
(const Form : cardinal;
const FormProcedure : ActionProc) : cardinal; stdcall;
exports DisplayFormContinue name 'DisplayW_DisplayFormContinue';
//*
// 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 : pointer;
// 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.
//
function DisplayFormContinueDefaultProc
(const Form : cardinal) : cardinal; stdcall;
exports DisplayFormContinueDefaultProc name 'DisplayW_DisplayFormContinueDefaultProc';
//*
// DisplayFormContinueDefaultProc - Displays the form using the default procedure.
//
//
// See documentation of DisplayFormContinue. This procedure does the
// same thing except instead of supplying an ActionProc the DefaultProcedure
// is used.
//
function DisplayHelp
(const FormID : cardinal;
const controlID : cardinal;
const helpType : DisplayHelpType;
const Data : cardinal;
const helpStr : array of char;
const FileName : array of char) : boolean; overload; stdcall;
exports DisplayHelp (const FormID : cardinal;
const controlID : cardinal;
const helpType : DisplayHelpType;
const Data : cardinal;
const helpStr : array of char;
const FileName : array of char) name 'DisplayW_DisplayHelp';
//*
// 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.
//
function DisplayHelp
(const FormID : cardinal;
const controlID : cardinal;
const helpType : DisplayHelpType;
const Data : cardinal;
const helpStr : string;
const FileName : string) : boolean; overload; stdcall;
exports DisplayHelp (const FormID : cardinal;
const controlID : cardinal;
const helpType : DisplayHelpType;
const Data : cardinal;
const helpStr : string;
const FileName : string) name 'DisplayW_STRDisplayHelp';
//*
// STRDisplayHelp - See documentation of DisplayHelp.
//
function ApplicationInProgress
() : boolean; stdcall;
exports ApplicationInProgress name 'DisplayW_ApplicationInProgress';
function DisplayCustomWindow
(const wHandle : DWSpec.WinHandle;
const windowID : cardinal;
const Title : array of char;
const menuNum : cardinal;
const WndProcedure : ActionProc) : cardinal; overload; stdcall;
exports DisplayCustomWindow (const wHandle : DWSpec.WinHandle;
const windowID : cardinal;
const Title : array of char;
const menuNum : cardinal;
const WndProcedure : ActionProc) name 'DisplayW_DisplayCustomWindow';
function DisplayCustomWindow
(const wHandle : DWSpec.WinHandle;
const windowID : cardinal;
const Title : string;
const menuNum : cardinal;
const WndProcedure : ActionProc) : cardinal; overload; stdcall;
exports DisplayCustomWindow (const wHandle : DWSpec.WinHandle;
const windowID : cardinal;
const Title : string;
const menuNum : cardinal;
const WndProcedure : ActionProc) name 'DisplayW_STRDisplayCustomWindow';
function DisplayWindow
(const windowID : cardinal;
const Title : array of char;
const menuNum : cardinal;
const WndProcedure : ActionProc) : cardinal; overload; stdcall;
exports DisplayWindow (const windowID : cardinal;
const Title : array of char;
const menuNum : cardinal;
const WndProcedure : ActionProc) name 'DisplayW_DisplayWindow';
function DisplayWindow
(const windowID : cardinal;
const Title : string;
const menuNum : cardinal;
const WndProcedure : ActionProc) : cardinal; overload; stdcall;
exports DisplayWindow (const windowID : cardinal;
const Title : string;
const menuNum : cardinal;
const WndProcedure : ActionProc) name 'DisplayW_STRDisplayWindow';
//*
// 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
// The Wndprocedure must be of type -
//
// This procedure is used to handle messages sent to the
// window. The user can choose whether or not to respond to
// these messages in the Wndprocedure.
//
// The parameters for this 'Wndprocedure' are -
//
// messageType - DisplayMessageType
// The message being received from the system. Will be one
// of the DisplayMessageTypes as follows:
//
// Initialize The Main Window is being initialized
// SysCommand A system event has occured
// Terminate The Main Window is about to terminate
//
// messageValue - pointer
// 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
//
// done - boolean
// Set to True if the message was handled, False otherwise.
//
// 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 : pointer;
// var done : boolean)
//
// var
// sysMsg : DisplayW.BaseMessagePointer;
//
// begin
// if (messageType = DisplayW.Initialize) then begin
// DisplayW.SetIcon (1, icon);
// DisplayW.SetAccelerator (1, accelerator);
// done := True;
// end else if (messageType = DisplayW.SysCommand) then begin
// sysMsg := messageValue;
// if (sysMsg.resourceID = MENU_EXIT) then begin
// DisplayW.DisplayForm (FINAL_FORM, FormProc);
// end;
// end;
// end; // MyMainProc
//
// begin
// Sage.OpenSystem ('WTEST.DFL', 5, 5, 5000);
// if (Sage.SageError = SageErrs.OpOk) then begin
// DisplayW.DisplayWindow (1, 'My Window', menu, MyMainProc);
// Sage.CloseSystem;
// end;
// end; // MTest
//
procedure GetDisplaySize
(var width : cardinal;
var height : cardinal); stdcall;
exports GetDisplaySize name 'DisplayW_GetDisplaySize';
//*
// 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.
//
function GetActiveForm
() : cardinal; stdcall;
exports GetActiveForm name 'DisplayW_GetActiveForm';
//*
// 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.
//
function GetOriginalDialogID
(const dialogID : cardinal) : cardinal; stdcall;
exports GetOriginalDialogID name 'DisplayW_GetOriginalDialogID';
//*
// 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.
//
function DisplayBackgroundW
(const windowID : cardinal;
const bitmapID : cardinal;
const Format : DWSpec.BackgroundFormat) : boolean; stdcall;
exports DisplayBackgroundW name 'DisplayW_DisplayBackgroundW';
//*
// 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 (windowId, bitmapID, format)
//
// ENTRY -
//
// WindowId : 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); overload; stdcall;
exports DisplayMessage (const Message : array of char;
const Bell : boolean) name 'DisplayW_DisplayMessage';
//*
// 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 DisplayMessage
(const Message : string;
const Bell : boolean); overload; stdcall;
exports DisplayMessage (const Message : string;
const Bell : boolean) name 'DisplayW_STRDisplayMessage';
procedure ProcessMessages; stdcall; exports ProcessMessages name 'DisplayW_ProcessMessages'; //* // ProcessMessages - Causes all messages in application queue to be processed. // // // This procedure causes all messages in the applications message queue to be // processed. // // CALLING SEQUENCE - // // ProcessMessages //
function DisplayMessageW
(const Title : array of char;
const Message : array of char;
const Bell : boolean;
const timeOut : cardinal;
const messageType : MessageBoxFormat;
const defaultButton : MessageBoxDefault) : MessageBoxResponse; overload; stdcall;
exports DisplayMessageW (const Title : array of char;
const Message : array of char;
const Bell : boolean;
const timeOut : cardinal;
const messageType : MessageBoxFormat;
const defaultButton : MessageBoxDefault) name 'DisplayW_DisplayMessageW';
//*
// 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 : Windows.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 : Windows.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 : Windows.MessageBoxResponse
// One of the following identifiers depending on which button option was
// uesed 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
//
function DisplayMessageW
(const Title : string;
const Message : string;
const Bell : boolean;
const timeOut : cardinal;
const messageType : MessageBoxFormat;
const defaultButton : MessageBoxDefault) : MessageBoxResponse; overload; stdcall;
exports DisplayMessageW (const Title : string;
const Message : string;
const Bell : boolean;
const timeOut : cardinal;
const messageType : MessageBoxFormat;
const defaultButton : MessageBoxDefault) name 'DisplayW_STRDisplayMessageW';
//*
// STRDisplayMessageW - See documentation of DisplayMessageW.
//
function RegisterSageDialog
(const dHandle : DWSpec.DlgHandle;
const FormID : cardinal;
const FormProcedure : DWSpec.ActionProc) : cardinal; stdcall;
exports RegisterSageDialog name 'DisplayW_RegisterSageDialog';
// For use by Prop Sheet object
function DlgProc
(const hwndDlg : Windows.Hwnd;
const Message : Windows.UINT;
const WParam : Windows.WParam;
const LParam : Windows.LParam) : Windows.BOOL; stdcall;
exports DlgProc name 'DisplayW_DlgProc';
// For use by Prop Sheet object
function FindActiveWindow
() : Windows.Hwnd; stdcall;
exports FindActiveWindow name 'DisplayW_FindActiveWindow';
// For use by Prop Sheet object
procedure SetQuitFlag
(const quit : boolean); stdcall;
exports SetQuitFlag name 'DisplayW_SetQuitFlag';
//*
// 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); stdcall;
exports GetKeyboardLocales name 'DisplayW_GetKeyboardLocales';
procedure GetLocaleNameAndCountry
(const lcid : cardinal;
var LocaleName : array of char;
var country : array of char); overload; stdcall;
exports GetLocaleNameAndCountry (const lcid : cardinal;
var LocaleName : array of char;
var country : array of char) name 'DisplayW_GetLocaleNameAndCountry';
procedure GetLocaleNameAndCountry
(const lcid : cardinal;
var LocaleName : string;
var country : string); overload; stdcall;
exports GetLocaleNameAndCountry (const lcid : cardinal;
var LocaleName : string;
var country : string) name 'DisplayW_STRGetLocaleNameAndCountry';
Send mail to
warren.merrill@inl.gov
with questions or comments about this web site.
Copyright © 1989-2006 Battelle Energy Alliance