//========================>>> vYNReplyDialog::AskYN <<<=======================
  int vYNReplyDialog::AskYN(VCONST char* msg)
  {
    //	Show a message, ask user Yes/No/Cancel
    //	returns < 0 for cancel, 0 for No, 1 for Yes

    int id, val;

    YNDialog[2].title = msg;		// V:1.13
    if (!added)
      {
	AddDialogCmds(YNDialog);		// Set up standard dialog
	added = 1;
      }
    id = ShowModalDialog(msg, val);	// show and wait
    switch (id)				// convert to our system
      {
	case M_Yes:
	    return 1;

	case M_No:
	    return 0;

	case M_Cancel:
	    return -1;
      };
    return -1;
  }
//======================>>> CNewProjMDlg::CNewProjMDlg <<<==================
  CNewProjMDlg::CNewProjMDlg(makefileMaker* m,
   vBaseWindow* bw, char* title) : vModalDialog(bw, title)
  {
    mm = m;
    cmdw = (videCmdWindow*) bw;
    AddDialogCmds(WCmds);		// add the predefined commands
  }
예제 #3
0
//======================>>> OscCalibDialog::OscCalibAction <<<======================
int OscCalibDialog::OscCalibAction(long &cLoc, bool &cMemType, BYTE &cVal)
{
	cLoc = (cLoc < 0) ? 0 : cLoc;

	char str1[MAXNUMDIGIT];
	char str3[MAXNUMDIGIT];

	sprintf(str1, "0x%04lX", cLoc);
	sprintf(str3, "%d", cVal);
	SetCommandLabel(txiLoc, str1, OscCalibCmds);
	SetCommandLabel(txiVal, str3, OscCalibCmds);

	SetCommandObject(chkMemOffset, cMemType, OscCalibCmds);

	AddDialogCmds(OscCalibCmds);		// add the predefined commands

	ItemVal ans,rval;
	ans = ShowModalDialog("",rval);
	if (ans == M_Cancel)
		return 0;

	char str[MAXNUMDIGIT];
	GetTextIn(txiLoc, str, 10);
	cLoc = strtol(str,NULL,0);

	GetTextIn(txiVal, str, 10);
	cVal = (BYTE)strtol(str,NULL,0);

	cMemType = GetValue(chkMemOffset) ? true : false;

	return (ans == M_OK);
}
//===================>>> JavaProjectDialog::JavaProjectDialog <<<====================
  JavaProjectDialog::JavaProjectDialog(videJava* vjv, vBaseWindow* bw, char* title)
   	: vModalDialog(bw, title)
  {
    vj = vjv;			// save parent class
    cmdw = (videCmdWindow*) bw;
    ta = 0;
    AddDialogCmds(PCmds);
  }
예제 #5
0
int SerNumDialog::SerNumAction(long &cLoc, bool &cMemType, bool &cAutoInc, FmtEndian &cFmt, int &cLen, DWORD &cVal)
{
	cLoc = (cLoc < 0) ? 0 : cLoc;
	cLen = (cLen < 0 || cLen > 4) ? 4 : cLen;
	cMemType = (cMemType == 0 || cMemType == 1) ? cMemType : 0;

	char str1[MAXNUMDIGIT];
	char str2[MAXNUMDIGIT];
	char str3[MAXNUMDIGIT];

	snprintf(str1, MAXNUMDIGIT, "0x%04lX", cLoc);
	snprintf(str2, MAXNUMDIGIT, "%d", cLen);
	snprintf(str3, MAXNUMDIGIT, "%ld", cVal);
	SetCommandLabel(txiLoc, str1, DefaultCmds);
	SetCommandLabel(txiLen, str2, DefaultCmds);
	SetCommandLabel(txiVal, str3, DefaultCmds);

	SetCommandObject(chkMemOffset, cMemType, DefaultCmds);
	SetCommandObject(chkAutoInc, cAutoInc, DefaultCmds);

	if (cFmt == FMT_LITTLE_ENDIAN)
	{
		SetCommandObject(rdbLittleEnd, 1, DefaultCmds);
		SetCommandObject(rdbBigEnd, 0, DefaultCmds);
	}
	else
	{
		SetCommandObject(rdbLittleEnd, 0, DefaultCmds);
		SetCommandObject(rdbBigEnd, 1, DefaultCmds);
	}

	AddDialogCmds(DefaultCmds);		// add the predefined commands

	ItemVal ans,rval;
	ans = ShowModalDialog("",rval);
	if (ans == M_Cancel)
		return 0;

	char str[MAXNUMDIGIT];
	GetTextIn(txiLoc, str, 10);
	cLoc = strtol(str,NULL,0);

	GetTextIn(txiLen, str, 10);
	cLen = strtol(str,NULL,0);

	GetTextIn(txiVal, str, 10);
	cVal = strtol(str,NULL,0);

	if ( GetValue(rdbLittleEnd) )
		cFmt = FMT_LITTLE_ENDIAN;
	else
		cFmt = FMT_BIG_ENDIAN;

	cMemType = GetValue(chkMemOffset) ? true : false;
	cAutoInc = GetValue(chkAutoInc) ? true : false;

	return ans == M_OK;
}
예제 #6
0
파일: e2dlg.cpp 프로젝트: bieli/avr_jokes
int e2Dialog::DialogAction(char *msg)
{
	UserDebug1(UserApp1, "e2Dialog::DialogAction() IN *** M_Cancel=%d\n", M_Cancel);

	SetCommandObject(chkPol1, (THEAPP->GetPolarity() & RESETINV) ? 1 : 0, DefaultCmds);
	SetCommandObject(chkPol2, (THEAPP->GetPolarity() & CLOCKINV) ? 1 : 0, DefaultCmds);
	SetCommandObject(chkPol3, (THEAPP->GetPolarity() & DININV) ? 1 : 0, DefaultCmds);
	SetCommandObject(chkPol4, (THEAPP->GetPolarity() & DOUTINV) ? 1 : 0, DefaultCmds);

	AddDialogCmds(DefaultCmds);		// add the predefined commands

	ItemVal ans, rval;
	ans = ShowModalDialog(msg, rval);
	if (ans == M_Cancel)
		return 0;

	// *** Add code to process dialog values here
	if (GetValue(chkPol1))
		THEAPP->SetPolarity(THEAPP->GetPolarity() | (UBYTE)RESETINV);
	else
		THEAPP->SetPolarity(THEAPP->GetPolarity() & (UBYTE)~RESETINV);

	if (GetValue(chkPol2))
		THEAPP->SetPolarity(THEAPP->GetPolarity() | (UBYTE)CLOCKINV);
	else
		THEAPP->SetPolarity(THEAPP->GetPolarity() & (UBYTE)~CLOCKINV);

	if (GetValue(chkPol3))
		THEAPP->SetPolarity(THEAPP->GetPolarity() | (UBYTE)DININV);
	else
		THEAPP->SetPolarity(THEAPP->GetPolarity() & (UBYTE)~DININV);

	if (GetValue(chkPol4))
		THEAPP->SetPolarity(THEAPP->GetPolarity() | (UBYTE)DOUTINV);
	else
		THEAPP->SetPolarity(THEAPP->GetPolarity() & (UBYTE)~DOUTINV);

	bool set_port = false;
	if (port_no != THEAPP->GetPort())
		set_port = true;
	if (interf_type != THEAPP->GetInterfaceType())
	{
		THEAPP->ClosePort();
		THEAPP->SetInterfaceType(interf_type);
		set_port = true;
	}
	if (set_port)
		THEAPP->SetPort(port_no);

	//Store values in the INI file
	THEAPP->SetParInterfType(interf_type);
	THEAPP->SetParPortNo(port_no);
	THEAPP->SetPolarityControl(THEAPP->GetPolarity());

	return ans == M_OK;
}
예제 #7
0
파일: e2dlg.cpp 프로젝트: bieli/avr_jokes
e2ProgressDialog::e2ProgressDialog(vBaseWindow* bw, char* title) :
		vDialog(bw, 0, title),
			pbr_value(0)
{
	UserDebug(Constructor,"e2ProgressDialog::e2ProgressDialog()\n")

	_myCmdWin = (e2CmdWindow*) bw;
	last_msg[0] = '\0';

	AddDialogCmds(ProgressDlg);
}
//======================>>> abtvideModalDialog::abtvideModalDialog <<<==================
  abtvideModalDialog::abtvideModalDialog(vBaseWindow* bw, char* title) :
    vModalDialog(bw, title)
  {
    AddDialogCmds(About);		// add the predefined commands
  }