Category : Recently Uploaded Files
Archive   : DOSUIT07.ZIP
Filename : DIALOG.HPP

 
Output of file : DIALOG.HPP contained in archive : DOSUIT07.ZIP

// Standard Dialog box
#ifndef DIALOG_HPP
#define DIALOG_HPP
#ifndef WINDOW_HPP
#include "window.hpp"
#endif

/*
The basic user-interaction dialog box. A Dialog has a box round it,
with a title bar containing its name. The enter method for a basic Dialog
returns immediately, before user interaction occurs. If you want to
do some processing at the end of the Dialog, you can either attach
functions to the CloseButton and the CancelButton, or you can use a
ModalDialog (see below).
*/
class Dialog : public Window {
public:
Dialog(VObject *v,const char *name);
// Create a Dialog containing the VObject contents. The Dialog will be
// positioned automatically in the centre of the screen.
Dialog(const coord l,const coord t,const coord r,const coord b,
VObject *v,const char *name);
// Create a Dialog in a specific place on the screen.

void realign();
virtual void paint(Rectangle r);

protected:
void realign(VObject *v);
};

/*
The classic modal dialog. A ModalDialog has a box round it, with a
title bar containing its name. The enter method for a ModalDialog shows
the dialog, and interacts with the user immediately. It does not return
until the user closes the dialog.
*/
class ModalDialog : public Dialog {
public:
ModalDialog(VObject *v,const char *name);
// Create a ModalDialog containing the VObject contents. The
// ModalDialog will be positioned automatically in the centre of the
// screen.
ModalDialog(const coord l,const coord t,const coord r,const coord b,
VObject *v,const char *name);
// Create a ModalDialog in a specific place on the screen.

int enter();
// Display the Dialog on the screen, and make it the focus. This
// function displays the Dialog, and completes user interaction before
// returning. Note that all events will be passed to the ModalDialog
// until it is closed, which makes it a modal dialog.
virtual int closeok();
virtual int cancelok();

private:
int closetype;
};

#endif