home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
g
/
gina15.zip
/
demos
/
ibtestappl.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-02-27
|
2KB
|
75 lines
/* @(#)ibtestappl.C 1.4 11/15/91 */
#include <Gina/Gina.h>
// Include IB files (specification + implementation)
#include "ib-test.h"
#include "ib-test.C"
// Define an alias for the new dialog class
#define DIALOG_CLASS GnDemoModelessDialog
#define IS_DOC_SHELL
// NO CHANGES AFTER HERE !!
// ============================================================================
class IbTestApplication : public GnApplication {
public:
virtual GnDocument *create_document ();
char * app_class () { return "IbTest" ; }
char * app_signature() { return "ibtest" ; }
char * app_file_type() { return ".ibtest" ; }
};
class IbTestDocument : public GnDocument {
public:
virtual void create_windows(int new_width = 0, int new_height = 0);
#ifndef IS_DOC_SHELL
protected:
DIALOG_CLASS *dialog;
void CallManage(caddr_t);
#endif
};
GnDocument *IbTestApplication ::
create_document()
{
return new IbTestDocument;
}
void IbTestDocument ::
create_windows(int new_width, int new_height)
{
#ifdef IS_DOC_SHELL
main_shell = new DIALOG_CLASS(this);
main_shell->create(APPLICATION->get_application_shell(), "main_shell");
#else
GnDocument::create_windows(new_width, new_height);
dialog = new DIALOG_CLASS(this);
dialog->create(main_shell, "dialog");
main_shell->add_menu_command("Dialog", "Manage",
CALLBACK(IbTestDocument, CallManage, this));
#endif
}
#ifndef IS_DOC_SHELL
void IbTestDocument::
CallManage(caddr_t)
{
dialog->manage();
}
#endif
int main (unsigned int argc, char ** argv)
{
IbTestApplication app;
app.run ( argc, argv );
}