Ejemplo n.º 1
0
//////////////////////////////////////////////////////////////////////////////////
// start receive widget element at
CSVMainForm::CSVMainForm(WContainerWidget * parent):
WTable(parent)
{
	//Resource
	OBJECT objRes=LoadResource("default", "localhost");  
	if( objRes !=INVALID_VALUE )
	{	
		MAPNODE ResNode=GetResourceNode(objRes);
		if( ResNode != INVALID_VALUE )
		{
			FindNodeValue(ResNode,"IDS_Report_Edit",strEditReport);
			FindNodeValue(ResNode,"IDS_Report_Add",strAddReport);
		}
		CloseResource(objRes);
	}



	setStyleClass("t6");

    m_pfrSmsSend = NULL;
    m_pfrAddPhone = NULL;

	
	//elementAt(1, 0)->setContentAlignment(AlignCenter);
	elementAt(1, 0)->setVerticalAlignment(AlignTop);
    m_pmainStack = new WStackedWidget(elementAt(1, 0));
    m_pmainStack->setPadding(WLength(0));
    //m_pmainStack->addWidget(m_pfrSmsSet = new CSVTopnReportSet());

	m_pfrSmsSet = new CSVTopnReportSet();
	
	//m_pmainStack->addWidget(m_pfrSmsSet);
	//OutputDebugString("------CSVMainForm0---------\n");
	//m_pmainStack->addWidget(m_pfrSmsSet = new CSVTopnReportSet());
	//OutputDebugString("------CSVMainForm1---------\n");
   
	if (!m_pfrAddPhone)
    {
        m_pmainStack->addWidget(m_pfrAddPhone = new CSVAddTopnReport());
        WObject::connect(m_pfrAddPhone, SIGNAL(BackTo(std::string)), this, SLOT(ShowSetForm(std::string)));
        WObject::connect(m_pfrAddPhone, SIGNAL(SaveTopnReport(SAVE_REPORT_LIST)), 
            this, SLOT(Save_Phone(SAVE_REPORT_LIST)));
        WObject::connect(m_pfrAddPhone, SIGNAL(ExChangeAddEvent()), this, SLOT(ExChangeRefresh()));
    }

	WObject::connect(m_pfrSmsSet, SIGNAL(AddNewPhone()), this, SLOT(ShowAddForm()));  
    WObject::connect(m_pfrSmsSet, SIGNAL(EditPhone(SAVE_REPORT_LIST)), this, 
        SLOT(Edit_Phone(SAVE_REPORT_LIST)));
	WObject::connect(m_pfrSmsSet, SIGNAL(ExChangeEvent()), this, SLOT(ExChangeRefresh()));  


	m_pmainStack->addWidget(m_pfrSmsSet);

    showSmsSet();
}
Ejemplo n.º 2
0
bool CSVMainForm::triggerSlot(WObject *sender, const WSlot_ *slot, void **args)
{
  if (slot == slots_ + 0) {
    sender_ = sender;    ShowSetForm();
    return true;
  }
  if (slot == slots_ + 1) {
    sender_ = sender;    ShowSmsForm();
    return true;
  }
  if (slot == slots_ + 2) {
    sender_ = sender;    ShowAddForm();
    return true;
  }
  if (slot == slots_ + 3) {
    sender_ = sender;    Save_Phone(*((SAVE_PHONE_LIST *)args[0]));
    return true;
  }
  if (slot == slots_ + 4) {
    sender_ = sender;    Edit_Phone(*((SAVE_PHONE_LIST *)args[0]));
    return true;
  }
  if (slot == slots_ + 5) {
    sender_ = sender;    ExChangeRefresh();
    return true;
  }
  return WTable::triggerSlot(sender, slot, args);
}
Ejemplo n.º 3
0
void CSVMainForm::Edit_Phone(SAVE_REPORT_LIST phone)
{
	if (!m_pfrAddPhone)
    {
        m_pmainStack->addWidget(m_pfrAddPhone = new CSVAddTopnReport());
		WObject::connect(m_pfrAddPhone, SIGNAL(BackTo(std::string)), this, SLOT(ShowSetForm(std::string)));
        WObject::connect(m_pfrAddPhone, SIGNAL(SaveTopnReport(SAVE_REPORT_LIST)), 
            this, SLOT(Save_Phone(SAVE_REPORT_LIST)));
        WObject::connect(m_pfrAddPhone, SIGNAL(ExChangeAddEvent()), this, SLOT(ExChangeRefresh()));
    }

    if ( m_pfrAddPhone)
    {
        m_pfrAddPhone->setProperty(&phone);
		m_pfrSmsSet ->m_pConnErr ->hide();
    }
	m_pfrAddPhone->upData();
	m_pfrAddPhone->chgstr = phone.chgstr;
//	m_pfrAddPhone->m_pReportTable->pTitleTxt->setText(strEditReport);
	
    showAddPhone();
	m_pfrAddPhone->setGroupRightCheck(phone.szGroupRight);
	

}
Ejemplo n.º 4
0
void CSVMainForm::ShowAddForm()
{
    if (!m_pfrAddPhone)
    {
        m_pmainStack->addWidget(m_pfrAddPhone = new CSVAddTopnReport());
        WObject::connect(m_pfrAddPhone, SIGNAL(BackTo(std::string)), this, SLOT(ShowSetForm(std::string)));
        WObject::connect(m_pfrAddPhone, SIGNAL(SaveTopnReport(SAVE_REPORT_LIST)), 
            this, SLOT(Save_Phone(SAVE_REPORT_LIST)));
        WObject::connect(m_pfrAddPhone, SIGNAL(ExChangeAddEvent()), this, SLOT(ExChangeRefresh()));
    }

    m_pfrAddPhone->clearData();
//	m_pfrAddPhone->m_pReportTable->pTitleTxt->setText(strAddReport);
    showAddPhone();

}