home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (C) 1993 Marc Stern (internet: stern@mble.philips.be) */
-
- #define Uses_TProgram
- #define Uses_TDeskTop
- #define Uses_TDialog
- #define Uses_TRect
- #define Uses_TStaticText
- #include "tvtools.h"
-
- #include <stdarg.h>
- #include <stdio.h>
-
-
- static TDialog *TheStatusBox = 0;
-
- Boolean existStatusBox()
- {
- return TheStatusBox != 0;
- }
-
-
-
- void RemoveStatusBox()
- {
- if ( TheStatusBox )
- {
- TObject::destroy(TheStatusBox) ;
- TheStatusBox = 0;
- }
- }
-
-
-
- void StatusBox( const char *msg )
- {
- RemoveStatusBox();
-
- TheStatusBox = new TDialog( TRect(0, 0, 40, 9), "Please Wait" );
- TheStatusBox->options |= ofCentered;
- TheStatusBox->flags &= ~wfClose;
- TheStatusBox->insert( new TStaticText(TRect(3 , 2 , TheStatusBox->size.x - 2 ,
- TheStatusBox->size.y - 1) ,
- msg)
- );
-
- TProgram::deskTop->insert( TheStatusBox );
- }
-
-
- void StatusBoxf( const char *fmt, ... )
- {
- char buffer[256];
-
- vsprintf( buffer , fmt , ... );
- StatusBox( buffer );
- }
-
-