/* Dialog Box to get timestamp's zero frame */!!

inherit(Dialog, #TimestampZeroDlg, #(frame), 2, nil)!!

now(class(TimestampZeroDlg))!!

Def new(self | dlg)
{
  dlg := new(self:ancestor);
  ^dlg;
} !!

now(TimestampZeroDlg)!!

/* 6/29/1993 21:05 - Actor  
  Dialog box command processing. 
*/
Def command(self, wp, lp | val, bkptInput, errMsg )
{ 
  select
    case wp = IDCANCEL
      ^end(self, IDCANCEL);
    endCase
     
    case wp = IDOK
      frame := getItemText(self, START_FRAME_ID);
      ^end(self, IDOK);
    endCase

    case wp = IDHELP
      is contextNumber(TheHelpObject, hWnd, HELP_ENTRY_ZERO_TIMESTAMP);
    endCase           
  endSelect;
  ^GOOD;
}
!!

/* PUBLIC */
Def setZeroFrame(self,fm){ 
  frame := fm;
}!!

/* Initialize the dialog text */
Def initDialog(self, wp, lp) {
  registerF1Help(CLIULibraryClass$Inst, HI_MESSAGEBOXEX,
     getHWnd(self), HELP_ENTRY_ZERO_TIMESTAMP);
  setItemText(self, START_FRAME_ID, 
              asString(getTopLineFrameNumber(browser(parent))));
  ^1;
}!!

/* PUBLIC */
Def getZeroFrame(self | val){ 
  val := frame;
  /*if not(val) cor (size(val) = 0)
    val := trcTimestampZeroFrameGet(trace(parent));
  endif; -- Hera 12/16/97*/
  /* added by <Judy 9/2/97> */
  if (size(val) = 0)
     val := "0";
  endif;
  /* eof <Judy 9/2/97> */   
  ^val;
}!!
