//=======================================================================
//@V@:Note: This file generated by vgen V1.04 (12:03:15 22 Jun 1998).
//	sboxapp.cpp:	Source for sboxApp class
//=======================================================================

#include "sboxapp.h"		// Header file

//=========================>>> sboxApp::sboxApp <<<==========================
  sboxApp::sboxApp(char* name, int sdi, int h, int w) : vApp(name, sdi, h, w)
  {
    // Constructor

   _sboxCmdWin = 0;
  }

//=========================>>> sboxApp::sboxApp <<<==========================
  sboxApp::~sboxApp()
  {
    // Destructor
  }

//=====================>>> sboxApp::NewAppWin <<<==========================
  vWindow* sboxApp::NewAppWin(vWindow* win, char* name,
    int w, int h, vAppWinInfo* winInfo)
  {
    vAppWinInfo* awinfo = winInfo;
    char *appname = name;

    if (!*name)
      {
	 appname = "Spin Box";		// Default name
      }
	
    UserDebug1(Build,"sboxApp::NewAppWin(%s)\n",appname);

    // Create the first window using provided CmdWindow

    _sboxCmdWin = (sboxCmdWindow*) win;
    if (!_sboxCmdWin)
      {
	_sboxCmdWin = new sboxCmdWindow(appname, w, h);
      }

    if (!awinfo)
	awinfo = new vAppWinInfo(appname);

    return vApp::NewAppWin(_sboxCmdWin, appname, w, h, awinfo);
  }

//============================>>> sboxApp::Exit <<<===========================
  void sboxApp::Exit(void)
  {
    // This is called to close all windows.

    UserDebug(Build,"sboxApp::Exit()\n");

    vApp::Exit();		// Default behavior
  }

//======================>>> sboxApp::CloseAppWin <<<===========================
  int sboxApp::CloseAppWin(vWindow* win)
  {
    // This will be called BEFORE a window has been unregistered or
    // closed.  Default behavior: unregister and close the window.

    UserDebug(Build,"sboxApp::CloseAppWin()\n");

    return vApp::CloseAppWin(win);
  }

//=====================>>> sboxApp::AppCommand <<<==============================
  void sboxApp::AppCommand(vWindow* win, ItemVal id, ItemVal val, CmdType cType)
  {
    // Commands not processed by the window will be passed here

    UserDebug1(Build,"sboxApp::AppCmd(ID: %d)\n",id);
    vApp::AppCommand(win, id, val, cType);
  }

//=========================>>> sboxApp::KeyIn <<<==============================
  void sboxApp::KeyIn(vWindow* win, vKey key, unsigned int shift)
  {
    // Key strokes not processed by the window will be passed here

    vApp::KeyIn(win, key, shift);
  }

//###########################################################################

  static sboxApp sbox_App("Spin Box",1);	// The instance of the app

//============================>>> AppMain <<<==============================
  int AppMain(int argc, char** argv)
  {
    // Use AppMain to create the main window

   (void) theApp->NewAppWin(0, "Spin Box", 300, 300);

    return 0;
  }
