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 >
C/C++ Source or Header  |  1992-02-27  |  2KB  |  75 lines

  1. /* @(#)ibtestappl.C    1.4 11/15/91 */
  2.  
  3. #include <Gina/Gina.h>
  4.  
  5. // Include IB files (specification + implementation)
  6.  
  7. #include "ib-test.h"
  8. #include "ib-test.C"
  9.  
  10. // Define an alias for the new dialog class
  11.  
  12. #define DIALOG_CLASS GnDemoModelessDialog
  13. #define IS_DOC_SHELL
  14.  
  15. // NO CHANGES AFTER HERE !!
  16. // ============================================================================
  17.  
  18. class IbTestApplication : public GnApplication {
  19.   public:
  20.     virtual GnDocument *create_document ();
  21.  
  22.     char * app_class () { return "IbTest" ; }
  23.     char * app_signature() { return "ibtest" ; }
  24.     char * app_file_type() { return ".ibtest" ; }
  25. };
  26.  
  27.  
  28. class IbTestDocument : public GnDocument {
  29.   public:
  30.     virtual void create_windows(int new_width = 0, int new_height = 0);
  31. #ifndef IS_DOC_SHELL
  32.   protected:
  33.     DIALOG_CLASS *dialog;
  34.     void CallManage(caddr_t);
  35. #endif
  36. };
  37.  
  38. GnDocument *IbTestApplication ::
  39. create_document()
  40.     return new IbTestDocument;
  41. }
  42.  
  43. void IbTestDocument ::
  44. create_windows(int new_width, int new_height)
  45. {
  46. #ifdef IS_DOC_SHELL
  47.     main_shell = new DIALOG_CLASS(this);
  48.     main_shell->create(APPLICATION->get_application_shell(), "main_shell");
  49. #else
  50.     GnDocument::create_windows(new_width, new_height);
  51.  
  52.     dialog = new DIALOG_CLASS(this);
  53.     dialog->create(main_shell, "dialog");
  54.  
  55.     main_shell->add_menu_command("Dialog", "Manage",
  56.                  CALLBACK(IbTestDocument, CallManage, this));
  57. #endif
  58. }
  59.  
  60. #ifndef  IS_DOC_SHELL
  61. void IbTestDocument::
  62. CallManage(caddr_t)
  63. {
  64.     dialog->manage();
  65. }
  66. #endif
  67.  
  68. int main (unsigned int argc, char ** argv)
  69. {
  70.     IbTestApplication app;
  71.  
  72.     app.run ( argc, argv );
  73. }
  74.