home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
deans.zip
/
DIALOG.HPP
< prev
next >
Wrap
Text File
|
1994-08-26
|
7KB
|
182 lines
//
// NAME: CIDGui_Dialog.Hpp
//
// DESCRIPTION:
//
// This is the header for the CIDGui_Dialog.Cpp module. This module provides
// the DIALOGWND class. This class can create a modal dialog or a non-modal
// dialog that is like any other frame window, often used for creating main
// windows.
//
// This class does its thing by loading the dialog template manually and
// then interpreting it. It looks at the controls defined in the template
// and creates the equivilent CIDLib control window object. For each control,
// a callout method is called, which will allow derived classes to control
// the creation of controls. If the user passed a null pointer, then a local
// method will handle it. If the user function returns a 0 for a particular
// control, the local function is called to handle it.
//
// Note that the DIALOGWND class itself is of little use since the user has
// no access to the goings on inside it. The user must derive a class and
// override the _bCommand() and _bControl() methods (along with any others
// that are needed) in order to do meaningful work. In this version, the
// command messages will filter up to the default dialog proc, which will
// cause the dialog to be dismissed if it is being processed modally.
//
//
// The class hierarchy here is:
//
// CIDOBJECT
// │
// WINDOW
// │
// FRAMEWND
// │
// DIALOGWND
//
//
// AUTHOR: Dean Roddey
//
// CREATE DATE: 09/24/93
//
// COPYRIGHT: 1992..1994, 'CIDCorp
//
// CAVEATS/GOTCHAS:
//
// 1) The control creation callout will pass along control data for certain
// control types. A pointer and length is passed. If no control data then
// the pointer is 0 and the length is undefined. These are the classes that
// will have control data and what is in the data.
//
// a) ICONWND and BITMAPWND both get CARD4 value that contains the
// resource id of the icon or bitmap. The length is 4. Since the
// source facility cannot be indicated in the resource, this is left
// up to the creator. If the client app does not handle these
// controls, then the default is to assume the .Exe facility.
//
// MODIFICATION LOG:
//
// Avoid multiple inclusions
#if !defined(CIDGUI_DIALOGWND_HPP)
#define CIDGUI_DIALOGWND_HPP
// -----------------------------------------------------------------------------
// CLASS: DIALOGWND
// PREFIX: dlgw
//
// This is the primal dialog window class. It is the basis for all dialog
// window classes.
// -----------------------------------------------------------------------------
class DIALOGWND : public FRAMEWND
{
public :
// ---------------------------------------------------------------------
// Constructors and Destructors.
//
// DIALOGWND
// The default constructor is protected because it should only be
// available to derived classes. The available public constructor
// needs the owner window, the facility that contains the dialog
// resource, and the resource id of the dialog. The dialog
// definition defines all of the styles and size/pos of the
// dialog so they are not provided here.
//
// This constructor will call the passed function, pwndMakeCtrl()
// to create objects for all of the dialog controls.
//
// ~DIALOGWND
// Does any required clean up.
// ---------------------------------------------------------------------
DIALOGWND
(
const WINDOW& wndOwner
, tCIDLib::CARD4 c4RscId
, const CIDFAC& facSource
, tCIDGui::PFNMAKECTRL pwndMakeCtrl = 0
, tCIDLib::eBOOL bDefMenus = tCIDLib::eFALSE
);
~DIALOGWND();
// ---------------------------------------------------------------------
// Public, inherited methods
//
// FormatToStr
// Formats some debug info into the string.
// ---------------------------------------------------------------------
STDVPUBMETHODS(DIALOGWND,FRAMEWND,tCIDLib::eFALSE);
virtual tCIDLib::VOID FormatToStr
(
STRGBUF& strbDest
) const;
// ---------------------------------------------------------------------
// Public, non-virtual methods
//
// c4Process
// This method will process the dialog window modally. Upon
// return the return value will be the value returned when the
// dialog was dismissed.
//
// Dismiss
// This method will dismiss the dialog window, passing along the
// return status value to the caller. It is not relevant unless
// the dialog was processed via c4Process(). If it is called
// when the dialog is not being modally processed, then a fatal
// error is logged.
// ---------------------------------------------------------------------
tCIDLib::CARD4 c4Process();
tCIDLib::VOID Dismiss
(
tCIDLib::CARD4 c4RetStatus
);
protected :
// ---------------------------------------------------------------------
// Protected, non-virtual methods
//
// DIALOGWND
// The constructor is protected because it should only be
// available to derived classes. Client apps should not be able
// to create empty window objects.
// ---------------------------------------------------------------------
DIALOGWND() {}
// ---------------------------------------------------------------------
// Protected, inherited methods
//
// _bIsEqual
// This method is called from the public bIsEqual, which has
// determined that the objects are of comparable classes and are
// not the same object. It does the comparison down the class
// hierarchy.
// ---------------------------------------------------------------------
virtual tCIDLib::eBOOL _bIsEqual
(
const CIDOBJECT& objTarget
) const;
private :
// ---------------------------------------------------------------------
// Private data members
//
// __bModalProcessing
// Set to eTRUE by c4Process() to let anyone know later whether
// the dialog is being modally processed. It is cleared by
// Dismiss().
// ---------------------------------------------------------------------
tCIDLib::eBOOL __bModalProcessing;
};
#endif