Пример #1
0
// ---------------------------------------------------------------------------
void pnlRxFE::Initialize()
{
    sendChanges = false;
    m_cMAddr = LMLL_RxFEGetAddr();
    FillComboBoxes();
    SetGuiDefaults();
    sendChanges = true;
};
Пример #2
0
/////////////////////////////////////////////////////////////////////////////
// FUNCTION....: InitDlgControl
//
// DESCRIPTION.:
//
/////////////////////////////////////////////////////////////////////////////
static BOOL InitDlgControl(
  HWND     hDlg,
  OBJECTID objID)
  {
  char        text[MENU_MAX_TEXT+1];
  LPMENUINFO  pMenuInfo;
  LPSTR       pTitle;

  pMenuInfo = (LPMENUINFO)AObjLockData(objID, MENU_INFO_DATA);

	AObjGetName(objID, text, MENU_MAX_TEXT);

	SetWindowText(hDlg, text);

	if ((pMenuInfo->status & MENU_NEVER_EDITED) == MENU_NEVER_EDITED)
    {
		AObjGetName(objID, text, MENU_MAX_TEXT);
		AObjSetData(objID, MENU_TITLE_DATA, text, (LONG)lstrlen(text)+1);
    pMenuInfo->status & (~MENU_NEVER_EDITED);
		}

  CheckRadioButton(hDlg, BTN_DISPLAYNAME, BTN_DISPLAYTITLE, BTN_DISPLAYNAME);
  CheckRadioButton(hDlg, BTN_SHOWMENUS, BTN_SHOWITEMS, BTN_SHOWITEMS);

  if ((pMenuInfo->status & MENU_DISABLED) == MENU_DISABLED)
    CheckRadioButton(hDlg, BTN_ENABLED, BTN_DISABLED, BTN_DISABLED);
  else
    CheckRadioButton(hDlg, BTN_ENABLED, BTN_DISABLED, BTN_ENABLED);

  if ((pMenuInfo->status & MENU_POPUP) == MENU_POPUP)
 	  CheckRadioButton(hDlg, BTN_NORMAL, BTN_POPUP, BTN_POPUP);
  else
 	  CheckRadioButton(hDlg, BTN_NORMAL, BTN_POPUP, BTN_NORMAL);

  pTitle = (LPSTR)AObjLockData(objID, MENU_TITLE_DATA);
  if (pTitle)
    {
		SetDlgItemText(hDlg, SLE_TITLE, pTitle);
    AObjUnlockData(objID, MENU_TITLE_DATA);
    }

  FillComboBoxes(hDlg);

	SelectComboBox(hDlg, CB_TEXTTO,  pMenuInfo->sendText);
	SelectComboBox(hDlg, CB_INDEXTO, pMenuInfo->sendIndex);

	SetFocus(GetDlgItem(hDlg, SLE_TITLE));

	SendDlgItemMessage(hDlg, SLE_TITLE, EM_SETSEL, 0, MAKELONG(0, -1));

  //return false to set proper return value from dialog proc because of the
  //SetFocus call above

  AObjUnlockData(objID, MENU_INFO_DATA);

  return FALSE;

  }
Пример #3
0
void pnlRxLPF::Initialize(pnlADDC *ADDC)
{
	sendChanges = false;
	m_cMAddr = LMLL_RxLPFGetAddr();
	m_frmADDC = ADDC;
    FillComboBoxes();
	SetGuiDefaults();
	sendChanges = true;
};
Пример #4
0
// ---------------------------------------------------------------------------
void pnlTxRF::Initialize()
{
	sendChanges = false;
	m_cMAddr = LMLL_TxRfGetAddr();
	LMAL_GetVerRevMask(m_cVer, m_cRev, m_cMask);
	FillComboBoxes();
	SetGuiDefaults();
	sendChanges = true;
};
Пример #5
0
tResult cJuryModule::LoadManeuverList()
{
    // load the maneuver list
    // clear old list
    m_strManeuverList.clear();
    // use QDom for parsing
    QDomDocument oDoc("maneuver_list");
    QFile oFile(m_strManeuverFile);

    // open file
    if(!oFile.open(QIODevice::ReadOnly))
    {
        RETURN_ERROR(ERR_FILE_NOT_FOUND);
    }
    if (!oDoc.setContent(&oFile))
    {
        oFile.close();
        RETURN_ERROR(ERR_INVALID_FILE);
    }

    // get the root element
    QDomElement oRoot = oDoc.documentElement();

    // get all sectors from DOM
    QDomNodeList lstSectors = oRoot.elementsByTagName("AADC-Sector");

    // iterate over all sectors
    for (int nIdxSectors = 0; nIdxSectors < lstSectors.size(); ++nIdxSectors)
    {
        // get the ids and maneuver from sector
        QDomNode oNodeSector = lstSectors.item(nIdxSectors);
        QDomElement oElementSector = oNodeSector.toElement();
        QString strIdSector = oElementSector.attribute("id");
        tSector sSector;
        sSector.id = strIdSector.toInt();
        QDomNodeList lstManeuver = oElementSector.elementsByTagName("AADC-Maneuver");
        // iterate over all maneuver
        for (int nIdxManeuver = 0; nIdxManeuver < lstManeuver.size(); ++nIdxManeuver)
        {
            // get the id and the action
            QDomNode oNodeManeuver = lstManeuver.item(nIdxManeuver);
            QDomElement oElementManeuver = oNodeManeuver.toElement();
            QString strIdManeuver = oElementManeuver.attribute("id");
            tAADC_Maneuver sManeuver;
            sManeuver.nId = strIdManeuver.toInt();
            sManeuver.action = oElementManeuver.attribute("action").toStdString();
            // fill the internal maneuver list
            sSector.lstManeuvers.push_back(sManeuver);
        }

        // fill the internal sector list
        m_lstSections.push_back(sSector);
    }
   
    // check sector list
    if (m_lstSections.size() > 0)
    {
        SetLogText("Jury Module: Loaded Maneuver file successfully.");
    }
    else
    {
        SetLogText("Jury Module: no valid Maneuver Data found!");
    }

    // fill the combo boxes
    FillComboBoxes();
    // get the xml string for transmission
    m_strManeuverList = oDoc.toString().toStdString();
    // set the controls (enable/disable)
    SetControlState();
    
    RETURN_NOERROR;
}