示例#1
0
bool CSVPlanSet::triggerSlot(WObject *sender, const WSlot_ *slot, void **args)
{
  if (slot == slots_ + 0) {
    sender_ = sender;    hidePlanList();
    return true;
  }
  if (slot == slots_ + 1) {
    sender_ = sender;    showPlanList();
    return true;
  }
  if (slot == slots_ + 2) {
    sender_ = sender;    Save();
    return true;
  }
  if (slot == slots_ + 3) {
    sender_ = sender;    AddPlan();
    return true;
  }
  if (slot == slots_ + 4) {
    sender_ = sender;    BeforeDelPlan();
    return true;
  }
  if (slot == slots_ + 5) {
    sender_ = sender;    DelPlan();
    return true;
  }
  if (slot == slots_ + 6) {
    sender_ = sender;    SelAll();
    return true;
  }
  if (slot == slots_ + 7) {
    sender_ = sender;    EditPlan(*((const std::string *)args[0]));
    return true;
  }
  if (slot == slots_ + 8) {
    sender_ = sender;    hidePlanList1();
    return true;
  }
  if (slot == slots_ + 9) {
    sender_ = sender;    showPlanList1();
    return true;
  }
  if (slot == slots_ + 10) {
    sender_ = sender;    Save1();
    return true;
  }
  if (slot == slots_ + 11) {
    sender_ = sender;    AddPlan1();
    return true;
  }
  if (slot == slots_ + 12) {
    sender_ = sender;    BeforeDelPlan1();
    return true;
  }
  if (slot == slots_ + 13) {
    sender_ = sender;    DelPlan1();
    return true;
  }
  if (slot == slots_ + 14) {
    sender_ = sender;    SelAll1();
    return true;
  }
  if (slot == slots_ + 15) {
    sender_ = sender;    EditPlan1(*((const std::string *)args[0]));
    return true;
  }
  if (slot == slots_ + 16) {
    sender_ = sender;    SelNone();
    return true;
  }
  if (slot == slots_ + 17) {
    sender_ = sender;    SelNone1();
    return true;
  }
  if (slot == slots_ + 18) {
    sender_ = sender;    SelInvert();
    return true;
  }
  if (slot == slots_ + 19) {
    sender_ = sender;    SelInvert1();
    return true;
  }
  if (slot == slots_ + 20) {
    sender_ = sender;    AdjustAbsDelState();
    return true;
  }
  if (slot == slots_ + 21) {
    sender_ = sender;    AdjustRangeDelState();
    return true;
  }
  return WContainerWidget::triggerSlot(sender, slot, args);
}
示例#2
0
void CSVPlanSet::InitFlexTable(std::string strTitle1, std::string strTitle2)
{
	ReceiveAddrSetTable = new WSVFlexTable(pMainTable->GetContentTable()->elementAt(1,0), List, strTitle1);

	//new WText("\n<SCRIPT language='JavaScript' src='/basic.js'></SCRIPT>", this);
	//WTable * m_pGeneral4 = new WTable(this);
	//WTable * m_pGeneral = new WTable( this );
	//m_pGeneral ->setStyleClass("t2");
    //if ( m_pGeneral )

	ReceiveAddrSetTable->SetDivId("listpan1");
	if(ReceiveAddrSetTable->GetContentTable()!=NULL)
    {
		strListHeights += "200";
		strListHeights += ",";
		strListPans += ReceiveAddrSetTable->GetDivId();
		strListPans += ",";
		strListTitles +=  ReceiveAddrSetTable->dataTitleTable->formName();
		strListTitles += ",";
		
		ReceiveAddrSetTable->AppendColumn("", WLength(5, WLength::Percentage));
		ReceiveAddrSetTable->SetDataRowStyle("table_data_grid_item_img");
		ReceiveAddrSetTable->AppendColumn(m_FormShowText.szColName, WLength(70, WLength::Percentage));
		ReceiveAddrSetTable->SetDataRowStyle("table_data_grid_item_img");
		ReceiveAddrSetTable->AppendColumn(m_FormShowText.szColMod, WLength(25, WLength::Percentage));
		ReceiveAddrSetTable->SetDataRowStyle("table_data_grid_item_text");
		
//older list table header
//		// 列表
//		ContainerReceiveAddrSetTable = new WTable((WContainerWidget *) m_pGeneral->elementAt(1,0));
//		ContainerReceiveAddrSetTable -> setStyleClass("t3");
//		ReceiveAddrSetTable = new WTable((WContainerWidget *) ContainerReceiveAddrSetTable->elementAt(0,0));
//		nullTable = new WTable((WContainerWidget *) ContainerReceiveAddrSetTable->elementAt(1, 0));
//
//		ReceiveAddrSetTable->setStyleClass("t3");
//		ReceiveAddrSetTable->setCellPadding(0);
//		ReceiveAddrSetTable->setCellSpaceing(0);
//		nullTable -> setStyleClass("t8");
//
//		// 添加表头
//		// 全选  clicked 事件处理 函数 SelAll
////		new WText(m_FormShowText.szColStatus, (WContainerWidget*)ReceiveAddrSetTable->elementAt(0, 0));
//		new WText("", (WContainerWidget*)ReceiveAddrSetTable->elementAt(0, 0));
//		new WText(m_FormShowText.szColName, (WContainerWidget*)ReceiveAddrSetTable->elementAt(0, 1));
////		new WText(m_FormShowText.szColType, (WContainerWidget*)ReceiveAddrSetTable->elementAt(0, 2));
//		new WText(m_FormShowText.szColMod, (WContainerWidget*)ReceiveAddrSetTable->elementAt(0, 2));
//		ReceiveAddrSetTable->elementAt(0, 0)->setStyleClass("t3title");
//		ReceiveAddrSetTable->elementAt(0, 1)->setStyleClass("t3title");
//		ReceiveAddrSetTable->elementAt(0, 2)->setStyleClass("t3title");
//		ReceiveAddrSetTable->elementAt(0, 3)->setStyleClass("t3title");

		updateRangeSchedule();
	}

	if(ReceiveAddrSetTable->GetActionTable()!=NULL)
	{
		ReceiveAddrSetTable->AddStandardSelLink(m_FormShowText.szTipSelAll , m_FormShowText.szTipNotSelAll, m_FormShowText.szTipInvSel );
		WObject::connect(ReceiveAddrSetTable->pSelAll, SIGNAL(clicked()), this, SLOT(SelAll()));
		WObject::connect(ReceiveAddrSetTable->pSelNone, SIGNAL(clicked()), this, SLOT(SelNone()));
		WObject::connect(ReceiveAddrSetTable->pSelReverse, SIGNAL(clicked()), this, SLOT(SelInvert()));

		WTable *pTbl;
		ReceiveAddrSetTable->GetActionTable()->elementAt(0,1)->setContentAlignment(AlignCenter);
		ReceiveAddrSetTable->GetActionTable()->elementAt(0,1)->setStyleClass("textbold");

		pTbl = new WTable(ReceiveAddrSetTable->GetActionTable()->elementAt(0,1));
		pTbl->setStyleClass("widthauto");
		WSVButton * DelBtn = new WSVButton(pTbl->elementAt(0,0),m_FormShowText.szTipDel,"button_bg_del.png",m_FormShowText.szTipDel, false);
		connect(DelBtn, SIGNAL(clicked()) ,this, SLOT(BeforeDelPlan()));

		pTbl = new WTable(ReceiveAddrSetTable->GetActionTable()->elementAt(0,2));
		ReceiveAddrSetTable->GetActionTable()->elementAt(0,2)->setContentAlignment(AlignRight);
		WSVButton * btn = new WSVButton(ReceiveAddrSetTable->GetActionTable()->elementAt(0,2),m_FormShowText.szAddRelPlanBut,"button_bg_add_black.png",m_FormShowText.szAddRelPlanBut, true);
		connect(btn, SIGNAL(clicked()), this, SLOT(AddPlan()));
	

//
		//ft = new CFlexTable();
		//ft->AddGroupOperate(m_pGeneral,m_FormShowText.szValDel);
		//ft->AddGroupAddBtn(m_pGeneral,m_FormShowText.szAddRelPlanBut);
		//WObject::connect(ft->pSelAll, SIGNAL(clicked()), this, SLOT(SelAll()));
		//WObject::connect(ft->pSelNone, SIGNAL(clicked()), this, SLOT(SelNone()));
		//WObject::connect(ft->pSelinvert, SIGNAL(clicked()), this, SLOT(SelInvert()));
  //      WObject::connect(ft->pDel , SIGNAL(clicked()) ,this, SLOT(BeforeDelPlan()));
		//WObject::connect(ft->pAdd, SIGNAL(clicked()), this, SLOT(AddPlan()));

		connect(&m_signalMapper, SIGNAL(mapped(const std::string)), this, SLOT(EditPlan(const std::string)));
		
		//ReceiveAddrSetTable->SetNullTipInfo(strSepPlanNull);


		ReceiveAddrSetTable->SetNullTipInfo(strSepPlanNull);

		if(m_pListPlan.size() <= 0)
		{
			//OutputDebugString("---------------- NO S ------------------\n");
			//OutputDebugString(("---------------- NO S"+ strSepPlanNull + " ------------------\n").c_str());
			ReceiveAddrSetTable->ShowNullTip();
		}
		else
		{
			//OutputDebugString("---------------- Yes S------------------\n");
			ReceiveAddrSetTable->HideNullTip();
		}

		//隐藏按钮
		pHideBut = new WPushButton("hide button",this);
		if(pHideBut)
		{
			pHideBut->setToolTip("Hide Button");
			connect(pHideBut,SIGNAL(clicked()),this,SLOT(DelPlan()));
			pHideBut->hide();
		}

		//隐藏按钮
		pHideBut1 = new WPushButton("hide button",this);
		if(pHideBut1)
		{
			pHideBut1->setToolTip("Hide Button");
			connect(pHideBut1,SIGNAL(clicked()),this,SLOT(DelPlan1()));
			pHideBut1->hide();
		}
	}