//=======================================================================
//@V@:Note: This file generated by vgen V1.07 (10:55:46 14 Nov 1999).
//	gdbdlg.cpp:	Source for jdbDialog class
//=======================================================================
#include "videapp.h"
#include "videcmdw.h"
#include "gdbdlg.h"
#include "vdbcmdw.h"
#include <v/vnotice.h>

//@V@:BeginIDs
    enum {
    lblCmds = 3000,
    lblData,
    lblBPs,
    frmO
  };
//@V@:EndIds

//@V@:BeginDialogCmd DefaultCmds
    static DialogCmd DefaultCmds[] =
      {
	{C_Frame, frmO, 0, "", NoList,CA_NoBorder | CA_NoSpace,isSens,NoFrame, 0,0},

	{C_Label, lblCmds, 0, "Commands",NoList,CA_None,
	    isSens,frmO,0, 0, 0 },

	{C_Button, m_DBRun, 0, "  RUN ",NoList,CA_None,
	    isSens,frmO,0, lblCmds, 0, "Run Program (debug)" },
	{C_Button, m_Continue, 0, " Cont ",NoList,CA_None,
	    isSens,frmO,m_DBRun, lblCmds, 0, "Continue execution from current point" },

	{C_Button, m_StepInto, 0, " Step ",NoList,CA_None,
	    isSens,frmO,0, m_DBRun, 0, "Step into current line" },
	{C_Button, m_StepOver, 0, " Next ",NoList,CA_None,
	    isSens,frmO,m_DBRun, m_DBRun, 0, "Step over current line to Next line" },

	{C_Button, m_jdbStepUp, 0, "StepUp",NoList,CA_None,
	    isSens,frmO,0, m_StepInto, 0, "Step out of current method" },
	{C_Button, m_Up, 0, "  Up  ",NoList,CA_None,
	    isSens,frmO,m_DBRun, m_StepInto, 0, "Move Up a Thread's Stack" },

	{C_Button, m_DBHelp, 0, " Help ",NoList,CA_None,
	    isSens,frmO,0, m_jdbStepUp, 0, "Show jdb's help" },
	{C_Button, m_Down, 0, " Down ",NoList,CA_None,
	    isSens,frmO,m_DBRun, m_jdbStepUp, 0, "Move Down a Thread's Stack" },

	{C_Label, lblData, 0, "Display Values",NoList,CA_None,
	    isSens,frmO,0, m_DBHelp, 0 },

	{C_Button, m_Inspect, 0, " Print",NoList,CA_None,
	    isSens,frmO,0, lblData, 0, "Print value of highlighted expression" },
	{C_Button, m_jdbClasses, 0, " Class",NoList,CA_None,
	    isSens,frmO,m_DBRun, lblData, 0, "Show defined classes" },

	{C_Button, m_jdbLocals, 0, "Locals",NoList,CA_None,
	    isSens,frmO,0, m_Inspect, 0, "Show local variabales" },
	{C_Button, m_CallStack, 0, " Stack",NoList,CA_None,
	    isSens,frmO,m_DBRun, m_Inspect, 0, "Show stack" },

	{C_Button, m_jdbMemory, 0, "Memory",NoList,CA_None,
	    isSens,frmO,0, m_jdbLocals, 0, "Show Java Memory usage" },

	{C_Label, lblBPs, 0, "Breakpoints",NoList,CA_None,
	    isSens,frmO,0, m_jdbMemory, 0 },

	{C_Button, m_SetBP, 0, " Set  ",NoList,CA_None,
	    isSens,frmO,0, lblBPs, 0, "Set breakpoint at current line" },
	{C_Button, m_DeleteBP, 0, "Delete",NoList,CA_None,
	    isSens,frmO,m_DBRun, lblBPs, 0, "Delete breakpoint at current line" },

	{C_Button, m_DeleteBreakpoints, 0, "DelAll",NoList,CA_None,
	    isSens,frmO,0, m_SetBP, 0, "Delete all breakpoints" },
	{C_Button, m_ShowBreakpoints, 0, " Show ",NoList,CA_None,
	    isSens,frmO,m_DBRun, m_SetBP, 0, "Show current preakpoints" },

#ifdef XXX
	{C_Button, m_XXXX, 0, "  XXXX  ",NoList,CA_None,
	    isSens,frmO,0, 0, 0, "XXXX" },
	{C_Button, m_XXXX, 0, "  XXXX  ",NoList,CA_None,
	    isSens,frmO,m_DBRun, 0, 0, "XXXX" },

	{C_Button, m_XXXX, 0, "  XXXX  ",NoList,CA_None,
	    isSens,frmO,0, 0, 0, "XXXX" },
	{C_Button, m_XXXX, 0, "  XXXX  ",NoList,CA_None,
	    isSens,frmO,m_DBRun, 0, 0, "XXXX" },

	{C_Button, m_XXXX, 0, "  XXXX  ",NoList,CA_None,
	    isSens,frmO,0, 0, 0, "XXXX" },
	{C_Button, m_XXXX, 0, "  XXXX  ",NoList,CA_None,
	    isSens,frmO,m_DBRun, 0, 0, "XXXX" },
#endif


	{C_EndOfList,0,0,0,0,CA_None,0,0,0}
    };
//@V@:EndDialogCmd


//=========================>>> jdbDialog::jdbDialog <<<====================
  jdbDialog::jdbDialog(vBaseWindow* bw, char* title) :
    vDialog(bw, 0, title)
  {
      UserDebug(Constructor,"jdbDialog::jdbDialog()\n")

    AddDialogCmds(DefaultCmds);		// add the predefined commands
  }

//========================>>> jdbDialog::~jdbDialog <<<====================
  jdbDialog::~jdbDialog()
  {
    UserDebug(Destructor,"jdbDialog::~jdbDialog() destructor\n")
  }

//====================>>> jdbDialog::DialogCommand <<<=======================
  void jdbDialog::DialogCommand(ItemVal id, ItemVal retval, CmdType ctype)
  {
    // Dialog commands to here

    // find the current window

    videCmdWindow* vcw = ((videApp*)theApp)->getCurCmdWin();
    if (!vcw)
	vcw = ((videApp*)theApp)->GetMsgWindow();	// try this one
    if (!vcw)
	return;

    ((videApp*)theApp)->debugCommand(vcw,id);	// and pass to the debugger
  }

