home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-10-11 | 2.0 KB | 65 lines | [TEXT/CWIE] |
- // CTextBoxDialog.h
- // Copyright © 1995 by Michael F. Kamprath, All rights reserved.
- //
- // Contact information:
- // mailto:kamprat@leonardo.net
- // http://www.leonardo.net/kamprath
- //
- // License:
- // This code may be freely used in free and shareware products. Commercial product
- // users must supply me with a free, fully licensed copy of the product this code is
- // used in. In either case, users should notify me of their use of this code.
- //
- // This code may be freely distributed in it's non-modified form. It's original archive
- // should be kept intact.
- //
- // Version History:
- // v1.0.0 - Inititial release. Intended to be an example of how to use CModalDialog, but
- // it is useful in and of itself.
- //
-
- #pragma once
-
- #include "CModalDialog.h"
-
- class CTextBoxDialog : public CModalDialog
- {
-
- private:
- friend pascal void TextBoxItem( WindowPtr theWindow, short itemNo);
- friend pascal void TextScrollProc(ControlHandle theControl, ControlPartCode partCode);
-
- enum {
- kOK = 1,
- kScrollBar = 2,
- kTextBox = 3
- };
-
- UserItemUPP textBoxUPP;
- ControlActionUPP scrollProcUPP;
- TEHandle aboutTEH;
- short lastScrollValue;
-
- public:
- // Pass the DLOG resource ID and the resource ID for the TEXT and styl
- // resources (their IDs should be the same) to be displayed to the
- // constructor.
- CTextBoxDialog( short dlogResID, short textResID );
- virtual ~CTextBoxDialog();
-
- // These are the filter functions that CTextBoxDialog overrides from CModalDialog
-
- virtual Boolean KeyDownFilter( DialogPtr theDlg,
- EventRecord *theEvent,
- short *itemHit);
- virtual Boolean MouseDownFilter( DialogPtr theDlg,
- EventRecord* theEvent,
- short* itemHit );
-
- // DisplayTextBoxDialog() is the only function that needs to be called to display
- // a text box dialog with CTextBoxDialog. It handles the calls to
- // CModalDialog::DoOneModalLoop() for you.
-
- void DisplayTextBoxDialog( void );
- };
-