• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ WImage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中WImage的典型用法代码示例。如果您正苦于以下问题:C++ WImage类的具体用法?C++ WImage怎么用?C++ WImage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了WImage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: numRows

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 创建标题
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CEccBaseTable::createTitle(bool bHasHelp)
{
    int nRow = numRows();
    // 标题表
    WTable *pTitle = new WTable(elementAt(nRow, 0));
    if(pTitle)
    {
        pTitle->setStyleClass("padding_2");
    
        m_pTitle = new WText("Title", pTitle->elementAt(0, 0));
        if(m_pTitle)
            m_pTitle->setStyleClass("textbold");

        // 是否创建帮助
        if(bHasHelp)
        {
            // 创建帮助
            // 2007.1.23 Kevin Yang
            // 将help.gif修改为help.png
            WImage *pHelp = new WImage("../Images/help.png", pTitle->elementAt(0, 1));
            pTitle->elementAt(0, 1)->setContentAlignment(AlignRight);
            if(pHelp)
            {
                pHelp->setStyleClass("hand");
                WObject::connect(pHelp, SIGNAL(clicked()), this, SLOT(ShowHideHelp()));
            }
        }
    }
    elementAt(nRow, 0)->setStyleClass("padding_top");
}
开发者ID:,项目名称:,代码行数:33,代码来源:


示例2: WSprite

void SpritesDemo::Load() {
	m_sprites[0] = new WSprite(m_app);
	m_sprites[0]->Load();
	WImage* img = new WImage(m_app);
	img->Load("Media/dummy.bmp");
	m_sprites[0]->SetImage(img);
	img->RemoveReference();

	m_sprites[1] = new WSprite(m_app);
	m_sprites[1]->Load();
	img = new WImage(m_app);
	img->Load("Media/checker.bmp");
	m_sprites[1]->SetImage(img);
	img->RemoveReference();
	m_sprites[1]->SetPosition(100, 100);
	m_sprites[1]->SetAlpha(0.5f);

	m_sprites[2] = new WSprite(m_app);
	WShader* pixel_shader = new CustomSpritePS(m_app);
	pixel_shader->Load();
	WEffect* fx = m_app->SpriteManager->CreateSpriteEffect(pixel_shader);
	pixel_shader->RemoveReference();
	WMaterial* mat = new WMaterial(m_app);
	mat->SetEffect(fx);
	fx->RemoveReference();
	m_sprites[2]->SetMaterial(mat);
	mat->RemoveReference();
	m_sprites[2]->Load();
	m_sprites[2]->SetPosition(200, 200);
	m_sprites[2]->SetSize(200, 200);
}
开发者ID:Hasan-Jawaheri,项目名称:Wasabi,代码行数:31,代码来源:Sprites.cpp


示例3: clear

void EtagStore::update_image() {
    clear();
    WImage* image = new WImage(resource_->url());
    addWidget(image);
    image->resize(0, 0);
    wApp->triggerUpdate();
}
开发者ID:starius,项目名称:wt-classes,代码行数:7,代码来源:EtagStore.cpp


示例4: WImage

void SVConditionParam::createShowButton(int nRow)
{
    WImage * pSet = new WImage("../icons/set.gif", (WContainerWidget*)elementAt(nRow,1));
    if(pSet)
    {
        pSet->setStyleClass("imgbutton");
        WObject::connect(pSet, SIGNAL(clicked()), this, SLOT(showAddCondition()));
    }
}
开发者ID:,项目名称:,代码行数:9,代码来源:


示例5: GetIniFileSections

void CSVReportSet::addPhoneListNew()
{

	std::list<string> sectionlist;
	std::list<string>::iterator m_sItem;
	GetIniFileSections(sectionlist, "reportset.ini");

	int numRow = 1;
	for(m_sItem = sectionlist.begin(); m_sItem != sectionlist.end(); m_sItem++)
	{
		m_pReportListTable->InitRow(numRow);

		std::string section = *m_sItem;

		string ret = "error";

		WCheckBox * pCheck = new WCheckBox("", (WContainerWidget*)m_pReportListTable->GeDataTable()->elementAt(numRow, 0));
		m_pReportListTable->GeDataTable()->elementAt(numRow, 0)->setContentAlignment(AlignCenter);
		// 名称
		std::string strlinkname;
		std::string hrefstr = RepHrefStr(section);
		strlinkname ="<a href=/fcgi-bin/startsreportlist.exe?id="+hrefstr+">"+section+"</a>";
		WText *pName = new WText(strlinkname, (WContainerWidget*)m_pReportListTable->GeDataTable()->elementAt(numRow , 2));
		m_pReportListTable->GeDataTable()->elementAt(numRow, 2)->setContentAlignment(AlignCenter);

		std::string szPeriod = GetIniFileString(section, "Period", ret, "reportset.ini");
		if(strcmp(szPeriod.c_str(), "error") == 0)
		{
		}

		WText *pPeriod = new WText(szPeriod, (WContainerWidget*)m_pReportListTable->GeDataTable()->elementAt(numRow, 4));
		m_pReportListTable->GeDataTable()->elementAt(numRow, 4)->setContentAlignment(AlignCenter);

		WImage *pEdit = new WImage("/Images/edit.gif", (WContainerWidget*)m_pReportListTable->GeDataTable()->elementAt(numRow ,6));
		m_pReportListTable->GeDataTable()->elementAt(numRow, 6)->setContentAlignment(AlignCenter);
		pEdit->decorationStyle().setCursor(WCssDecorationStyle::Pointer);   
		connect(pEdit, SIGNAL(clicked()), &m_signalMapper, SLOT(map()));
		m_signalMapper.setMapping(pEdit, section);

		REPORT_LIST list;

		list.pSelect = pCheck;
		list.pName = pName;
		list.pPeriod = pPeriod;
		list.pEdit = pEdit;
		m_pListReport.push_back(list);

		numRow++;
	}
}
开发者ID:,项目名称:,代码行数:50,代码来源:


示例6: WImage

void WDatePicker::createDefault(WLineEdit *forEdit)
{
  WImage *icon = new WImage(WApplication::relativeResourcesUrl() 
			    + "calendar_edit.png");
  icon->resize(16, 16);
  icon->setVerticalAlignment(AlignMiddle);

  if (!forEdit) {
    forEdit = new WLineEdit();
    create(icon, forEdit);
    layout_->insertWidget(0, forEdit);
  } else
    create(icon, forEdit);
}
开发者ID:LifeGo,项目名称:wt,代码行数:14,代码来源:WDatePicker.C


示例7: WLength

void WSVFlexTable::InitRow(int nRow)
{
	for(int i = 1,j = 0; i < dataTitleTable->numColumns() + 1; i+=2, j++)
	{
		dataGridTable->elementAt(nRow, i)->resize(WLength(4), WLength());
		WImage * pTmpImage = new WImage("/Images/space.gif", "", (WContainerWidget *)dataGridTable->elementAt(nRow, i));
		pTmpImage->resize(WLength(4), WLength());
		dataGridTable->elementAt(nRow, i - 1)->resize(m_pColumnWidth[j], WLength());
		dataGridTable->elementAt(nRow, i - 1)->setStyleClass(m_pRowDataCss[j]);
	}
	
	if((nRow%2) == 0)
		dataGridTable->GetRow(nRow)->setStyleClass("table_data_grid_item_bg");
}
开发者ID:,项目名称:,代码行数:14,代码来源:


示例8: strcpy

WSTreeAndPanTable::WSTreeAndPanTable(WContainerWidget * parent)
:WTable(parent)
{
	this->setStyleClass("panel_view");
	
	this->elementAt(0, 0)->setStyleClass("tree_bg");
	
	//TreeTable 可以在引用时再添加
	//new WText("<div id='tree_panel' name='tree_panel' class='panel_tree'>", this->elementAt(0, 0));
	//new WText("</div>", this->elementAt(0, 0));

	//DragTable Cell
	this->elementAt(0, 1)->setStyleClass("resize");
	strcpy(this->elementAt(0, 1)->contextmenu_, "onMouseDown='this.setCapture()' onMouseUp='this.releaseCapture();'");
	WImage * pTmpImage = new WImage("/Images/space.gif", this->elementAt(0, 1));
	pTmpImage->resize(WLength(5), WLength());

	//PanTable Cell 可以在引用时再添加
	//new WText("<div id='view_panel' class='panel_view'>", this->elementAt(0, 2));
	//new WText("</div>", this->elementAt(0, 2));
}
开发者ID:,项目名称:,代码行数:21,代码来源:


示例9: setCondition

void AuthWidget::createOAuthLoginView()
{
  if (!model_->oAuth().empty()) {
    setCondition("if:oauth", true);

    WContainerWidget *icons = new WContainerWidget();
    icons->setInline(isInline());

    for (unsigned i = 0; i < model_->oAuth().size(); ++i) {
      const OAuthService *auth = model_->oAuth()[i];

      WImage *w = new WImage("css/oauth-" + auth->name() + ".png", icons);
      w->setToolTip(auth->description());
      w->setStyleClass("Wt-auth-icon");
      w->setVerticalAlignment(AlignMiddle);

      OAuthProcess *const process 
	= auth->createProcess(auth->authenticationScope());
#ifndef WT_TARGET_JAVA
      w->clicked().connect(process, &OAuthProcess::startAuthenticate);
#else
      process->connectStartAuthenticate(w->clicked());
#endif

      process->authenticated().connect
	(boost::bind(&AuthWidget::oAuthDone, this, process, _1));

      WObject::addChild(process);
    }

    bindWidget("icons", icons);
  }
}
开发者ID:913862627,项目名称:wt,代码行数:33,代码来源:AuthWidget.C


示例10: IndexContainerWidget

WImage *WItemDelegate::iconWidget(WidgetRef& w,
                                  const WModelIndex& index, bool autoCreate)
{
  WImage *image = dynamic_cast<WImage *>(w.w->find("i"));
  if (image || !autoCreate)
    return image;

  IndexContainerWidget *wc =
      dynamic_cast<IndexContainerWidget *>(w.w->find("a"));

  if (!wc)
    wc = dynamic_cast<IndexContainerWidget *>(w.w->find("o"));

  if (!wc) {
    wc = new IndexContainerWidget(index);
    wc->setObjectName("o");
    wc->addWidget(w.w);
    w.w = wc;
  }

  image = new WImage();
  image->setObjectName("i");
  image->setStyleClass("icon");
  wc->insertWidget(wc->count() - 1, image);

  // IE does not want to center vertically without this:
  if (wApp->environment().agentIsIE()) {
    WImage *inv = new WImage(wApp->onePixelGifUrl());
    inv->setStyleClass("rh w0 icon");
    inv->resize(0, WLength::Auto);
    wc->insertWidget(wc->count() -1, inv);
  }

  return image;
}
开发者ID:Brasil,项目名称:wt,代码行数:35,代码来源:WItemDelegate.C


示例11: CloneFrom

 // Clone an image which reallocates the image if of a different dimension.
 void CloneFrom(const WImage<T>& src) {
     Allocate(src.Width(), src.Height(), src.Channels());
     CopyFrom(src);
 }
开发者ID:09beezahmad,项目名称:opencv,代码行数:5,代码来源:wimage.hpp


示例12: WContainerWidget

DetailManipulation::DetailManipulation(bool enhance, WContainerWidget *parent)
	: WContainerWidget(parent), onlySmooth(!enhance)
{

	resize(WLength::Auto, WLength::Auto);

	// Image bar
	prepareInputImages();
	WContainerWidget *imageBar = new WContainerWidget;
	WVBoxLayout *imageBarLayout = new WVBoxLayout();
	for (size_t i = 0; i < inputImages.size(); ++i) {
		WImage *img = inputImages[i]->getOriginalImage();
		img->setStyleClass("image_button");
		img->resize(160, 120);
		img->setAttributeValue("onMouseOver", "this.width=192; this.height=144;");
		img->setAttributeValue("onMouseOut", "this.width=160; this.height=120;");
		img->clicked().connect(
				boost::bind(&DetailManipulation::selectImage,
							this,
							i
							)
		);
		imageBarLayout->addWidget(img);
	}
	imageBar->resize(200, WLength::Auto);
	imageBar->setLayout(imageBarLayout);
	selectedImageId = 0;

	// Main component
	imageTab = new WTabWidget();
	imageTab->addTab(inputImages[selectedImageId]->getOriginalImage(), "Original");
	if (onlySmooth) {
		imageTab->addTab(new WImage(smoothedResult[selectedImageId].second), smoothedResult[selectedImageId].first);
	}
	else {
		imageTab->addTab(new WImage(enhancedResult[selectedImageId].second), enhancedResult[selectedImageId].first);
	}
	imageTab->resize(600, WLength::Auto);


	WGridLayout *controllerLayout = new WGridLayout();
	WSlider *rSlider = new WSlider(Wt::Vertical);
	rSlider->setRange(SLIDER_MINIMUM, SLIDER_MAXIMUM);
	rSlider->setTickPosition(Wt::WSlider::TicksBothSides);
	WDoubleSpinBox *rSpinBox = new WDoubleSpinBox();
	rSpinBox->setMinimum(R_MINIMUM);
	rSpinBox->setMaximum(R_MAXIMUM);
	rSlider->sliderMoved().connect(
			boost::bind(&DetailManipulation::changeDoubleSpinBoxValue,
						this,
						rSpinBox,
						true,
						_1)
	);
	rSpinBox->valueChanged().connect(
			boost::bind(&DetailManipulation::changeSliderValue,
						this,
						rSlider,
						1.f/(R_MAXIMUM-R_MINIMUM),
						_1)
	);
	controllerLayout->addWidget(rSlider, 2, 0, 6, 1);
	controllerLayout->addWidget(rSpinBox, 9, 0);
	controllerLayout->addWidget(new WText("radius"), 10, 0);


	WSlider *epsSlider = new WSlider(Wt::Vertical);
	epsSlider->setMinimum(SLIDER_MINIMUM);
	epsSlider->setMaximum(SLIDER_MAXIMUM);
	epsSlider->setRange(SLIDER_MINIMUM, SLIDER_MAXIMUM);
	epsSlider->setTickPosition(WSlider::TicksBothSides);
	WDoubleSpinBox *epsSpinBox = new WDoubleSpinBox();
	epsSpinBox->setMinimum(EPS_MINIMUM);
	epsSpinBox->setMaximum(EPS_MAXIMUM);
	epsSlider->sliderMoved().connect(
			boost::bind(&DetailManipulation::changeDoubleSpinBoxValue,
						this,
						epsSpinBox,
						false,
						_1)
	);
	epsSpinBox->valueChanged().connect(
			boost::bind(&DetailManipulation::changeSliderValue,
						this,
						epsSlider,
						1.f/(EPS_MAXIMUM-EPS_MINIMUM),
						_1)
	);
	controllerLayout->addWidget(epsSlider, 2, 1, 6, 1);
	controllerLayout->addWidget(epsSpinBox, 9, 1);
	controllerLayout->addWidget(new WText("epsilon"), 10, 1);

	WPushButton *apply = new WPushButton("Apply");
	apply->clicked().connect(
			boost::bind(&DetailManipulation::applyEnhancement,
					this,
					rSpinBox,
					epsSpinBox
					)
	);
//.........这里部分代码省略.........
开发者ID:mingyc,项目名称:edge-aware-filtering,代码行数:101,代码来源:project1.cpp


示例13: PrintDebugString

void CSVReportSet::AddGroupOperate(WTable * pTable)
{
	PrintDebugString("begin Init AddOperator function\n");

    m_pGroupOperate = new WTable((WContainerWidget *)pTable->elementAt( 8, 0));
   
	if ( m_pGroupOperate )
    {

        WImage * pSelAll = new WImage("../icons/selall.gif", (WContainerWidget *)m_pGroupOperate->elementAt(0, 1));
        if (pSelAll)
        {
            pSelAll->setStyleClass("imgbutton");
			pSelAll->setToolTip(m_formText.szTipSelAll1);
			connect(pSelAll, SIGNAL(clicked()), this, SLOT(SelAll()));
        }

        WImage * pSelNone = new WImage("../icons/selnone.gif", (WContainerWidget *)m_pGroupOperate->elementAt(0, 2));
        if (pSelAll)
        {
            pSelNone->setStyleClass("imgbutton");
			pSelNone->setToolTip(m_formText.szTipSelNone);
			connect(pSelNone, SIGNAL(clicked()), this, SLOT(SelNone()));
        }

        WImage * pSelinvert = new WImage("../icons/selinvert.gif", (WContainerWidget *)m_pGroupOperate->elementAt(0, 3));
        if (pSelinvert)
        {
            pSelinvert->setStyleClass("imgbutton");
			pSelinvert->setToolTip(m_formText.szTipSelInv);
			connect(pSelinvert, SIGNAL(clicked()), this, SLOT(SelInvert()));
        }

		
		pDel = new WImage("../icons/del.gif", (WContainerWidget *)m_pGroupOperate->elementAt(0, 4));
		if(!GetUserRight("m_reportlistDel"))
			pDel->hide();
		else
			pDel->show();

        if (pDel)
        {
           
			pDel->setStyleClass("imgbutton");
			pDel->setToolTip(m_formText.szTipDel);
			connect(pDel , SIGNAL(clicked()),this, SLOT(BeforeDelPhone()));
        }

		
		pAdd = new WPushButton(m_formText.szAddPhoneBut, (WContainerWidget *)m_pGroupOperate->elementAt(0, 6));
		pAdd->setStyleClass("wizardbutton");
		if(!GetUserRight("m_reportlistAdd"))
			pAdd->hide();
		else
			pAdd->show();

        if (pAdd)
        {
            pAdd->setToolTip(m_formText.szTipAddNew);
			WObject::connect(pAdd, SIGNAL(clicked()),"showbar();", this, SLOT(AddPhone())
				, WObject::ConnectionType::JAVASCRIPTDYNAMIC);
        }
		m_pGroupOperate->elementAt(0, 6)->resize(WLength(100,WLength::Percentage),WLength(100,WLength::Percentage));
		m_pGroupOperate->elementAt(0, 6)->setContentAlignment(AlignRight);
		
    }

	PrintDebugString("Init AddOperator function\n");

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

	PrintDebugString("Init AddOperator function finish\n");
}
开发者ID:,项目名称:,代码行数:80,代码来源:


示例14: getSVSEState

void SVSEView::addSVSEList(string &szName, string &szIndex)
{
    if(m_pSEList)
    {
        int nRow = m_pSEList->numRows();

        SVTableCell cell;

        sv_group_state groupState = getSVSEState(szIndex, m_pSVUser, m_szIDCUser, m_szIDCPwd);
        bool bHasEditRight = true;
        bool bHasDelRight = true;
        if(m_pSVUser)
        {
            bHasEditRight = m_pSVUser->haveUserRight(szIndex, "se_edit");
            bHasDelRight = m_pSVUser->haveUserRight(szIndex, "se_delse");
        }
        else
        {
            bHasEditRight = false;
            bHasDelRight = false;
        }
        // Ñ¡Ôñ
        //if(szIndex.compare("1") != 0)
        //{
        //    WCheckBox * pCheck = NULL;
        //    if(bHasEditRight || bHasDelRight) pCheck = new WCheckBox("", (WContainerWidget *)m_pSEList->elementAt(nRow, 0));
        //    if(pCheck)
        //    {
        //        cell.setType(adCheckBox);
        //        cell.setValue(pCheck);
        //        m_svSEList.WriteCell(szIndex, 0, cell);
        //    }
        //}
        // ÃèÊö
        WText *pDesc = new WText("", (WContainerWidget *)m_pSEList->elementAt(nRow, 0));
        if(pDesc)
        {
            char szState[512] = {0};
            sprintf(szState, "%s%d<BR>%s%d<BR>%s%d<BR>%s%d<BR>%s%d", 
                SVResString::getResString("IDS_Device_Count").c_str(), groupState.nDeviceCount,
                SVResString::getResString("IDS_Monitor_Count").c_str(), groupState.nMonitorCount, 
                SVResString::getResString("IDS_Monitor_Disable_Count").c_str(), groupState.nDisableCount,
                SVResString::getResString("IDS_Monitor_Error_Count").c_str(), groupState.nErrorCount, 
                SVResString::getResString("IDS_Monitor_Warn_Count").c_str(), groupState.nWarnCount);
            pDesc->setText(szState);
        }
        // Ãû³Æ
        WText *pName = new WText(szName, (WContainerWidget *)m_pSEList->elementAt(nRow, 1));
        if ( pName )
        {
            sprintf(pName->contextmenu_, "style='color:#669;cursor:pointer;' onmouseover='" \
                "this.style.textDecoration=\"underline\"' " \
                "onmouseout='this.style.textDecoration=\"none\"'");
            pName->setToolTip(szName);
            WObject::connect(pName, SIGNAL(clicked()), "showbar();", &m_wNameMapper, SLOT(map()), WObject::ConnectionType::JAVASCRIPTDYNAMIC);
            m_wNameMapper.setMapping(pName, szIndex);

            cell.setType(adText);
            cell.setValue(pName);

            m_svSEList.WriteCell(szIndex, 2, cell);
            SVTableRow *pRow = m_svSEList.Row(szIndex);
            if(pRow)
                pRow->setProperty(szIndex.c_str());
        }
        // ±à¼­
        WImage * pEdit = NULL;
        if(bHasEditRight) pEdit = new WImage("../icons/edit.gif", (WContainerWidget *)m_pSEList->elementAt(nRow, 2));
        if (pEdit)
        {
            pEdit->setToolTip(SVResString::getResString("IDS_Edit"));
            pEdit->setStyleClass("imgbutton");
            WObject::connect(pEdit, SIGNAL(clicked()), "showbar();", &m_wEditMapper, SLOT(map()), WObject::ConnectionType::JAVASCRIPTDYNAMIC);
            m_wEditMapper.setMapping(pEdit,szIndex);
        }

        if((nRow + 1) % 2 == 0)
            m_pSEList->GetRow(nRow)->setStyleClass("tr1");
        else
            m_pSEList->GetRow(nRow)->setStyleClass("tr2");
    }

}
开发者ID:,项目名称:,代码行数:83,代码来源:


示例15: GetGroup

bool CSVWholeview::enumGroups(const string &szGroupID, WTable *pTable)
{
    bool bShowGroup = false;
	bool gShowGroup = true;//jansion
	bool mShowGroup = true; //jansion
	pTable->setStyleClass("widthauto");
    if(!szGroupID.empty())
    {     
        OBJECT objGroup = GetGroup(szGroupID);
        if(objGroup != INVALID_VALUE)
        { 
			//PrintDebugString("In ------------------------------------\n");
            string szIndex(""), szName(""), szShowIndex(""), szContext("");
            string szShow(""), szHide(""), szSubTable("");
            string szShowText(""), szHideText("");
            bool bHasRight = true;
            int nIndex = 0, nRow = 0; 
            MAPNODE node = INVALID_VALUE;
            list<string> lsGroupID;
            list<string> lsDeviceID;
            list<string>::iterator lstItem;
			//list<string>::iterator bcompItem;

            if(GetSubGroupsIDByGroup(objGroup, lsGroupID))
            {
				
                map<int, base_param, less<int> > sortList;
                map<int, base_param, less<int> >::iterator lsItem;
				map<int, base_param, less<int> >::iterator bcompItem;

				//bool gShow = false;

                base_param group;
                OBJECT objSubGroup = INVALID_VALUE;
                for(lstItem = lsGroupID.begin(); lstItem != lsGroupID.end(); lstItem ++)
                {
					//PrintDebugString("In --------------- for ---------------------\n");
                    szIndex =(*lstItem);
                    bHasRight = true;
                    if(m_pSVUser)
                        bHasRight = m_pSVUser->haveGroupRight(szIndex, Tree_GROUP);
                    if(bHasRight)
                    {
                        objSubGroup = GetGroup(szIndex, m_szIDCUser, m_szIDCPwd);
                        if(objGroup != INVALID_VALUE)
                        {
                            node = GetGroupMainAttribNode(objSubGroup);
                            if(node != INVALID_VALUE)
                            { 
                                FindNodeValue(node, "sv_name", szName);
                                FindNodeValue(node, "sv_index", szShowIndex);
                                if(szShowIndex.empty())
                                    nIndex = FindIndexByID(szIndex);
                                else
                                    nIndex = atoi(szShowIndex.c_str());
                                group.szIndex = szIndex;
                                group.szName = szName;

                                lsItem = sortList.find(nIndex);
                                while(lsItem != sortList.end())
                                {
                                    nIndex ++;
                                    lsItem = sortList.find(nIndex);
                                }
                                sortList[nIndex] = group;
                            }							
							else
							{
								gShowGroup = false;
							}
                            CloseGroup(objSubGroup);
                        }
                    }
					else
					{
						gShowGroup =false;
					}
                }

				//if (lsGroupID.empty())
				//	PrintDebugString("In group is ====== false\n");

                for(lsItem = sortList.begin(); lsItem != sortList.end(); lsItem ++)
                {					
					//PrintDebugString("In emnuGroup " + lsItem->second.szName + "\n");

					//bool gShow = false;

                    nRow = pTable->numRows();
                    //WImage *pShow = new WImage("../Images/foldopen.gif", pTable->elementAt(nRow, 0));
                    //WImage *pHide = new WImage("../Images/foldclose.gif", pTable->elementAt(nRow, 0));
					//if(!enumGroups(lsItem->second.szIndex, pSub))
					//{
                    WImage *pShow = new WImage("/Images/cb1-unwrap.gif", pTable->elementAt(nRow, 0));
                    WImage *pHide = new WImage("/Images/cb1-fold.gif", pTable->elementAt(nRow, 0));
					//}


					new WText("&nbsp;",pTable->elementAt(nRow, 0));

//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


示例16: GetEntity

bool CSVWholeview::enumMonitors(const string &szDeviceID, const string &szDeviceName, WTableCell *pTableCell)
{
    map<int, base_param, less<int> > sortList;
    map<int, base_param, less<int> >::iterator lsItem;

    OBJECT objDevice = GetEntity(szDeviceID,  m_szIDCUser, m_szIDCPwd);
    if(objDevice != INVALID_VALUE)
    {
        list<string> lsMonitorID;
        list<string>::iterator lstItem;
        if (GetSubMonitorsIDByEntity(objDevice, lsMonitorID))
        {
            base_param monitor;
            string szMonitorId("");
            OBJECT objMonitor = INVALID_VALUE;
            MAPNODE node = INVALID_VALUE;

            string szName(""), szIndex("");

            int nIndex = 0;
            for(lstItem = lsMonitorID.begin(); lstItem != lsMonitorID.end(); lstItem ++)
            {
                szMonitorId = (*lstItem).c_str();
                objMonitor = GetMonitor(szMonitorId, m_szIDCUser, m_szIDCPwd);
                if(objMonitor != INVALID_VALUE)
                {
                    node = GetMonitorMainAttribNode(objMonitor);
                    if(node != INVALID_VALUE)
                    {
                        FindNodeValue(node, "sv_name", szName);
                        FindNodeValue(node, "sv_index", szIndex);
                        if(szIndex.empty())
                            nIndex = FindIndexByID(szMonitorId);
                        else
                            nIndex = atoi(szIndex.c_str());
                        monitor.szIndex = szMonitorId;
                        monitor.szName = szName;

                        lsItem = sortList.find(nIndex);
                        while(lsItem != sortList.end())
                        {
                            nIndex ++;//= nMax;
                            lsItem = sortList.find(nIndex);
                        }
                        sortList[nIndex] = monitor;
                    }
                    CloseMonitor(objMonitor);
                }
            }
        }
        CloseEntity(objDevice);
    }
    string szShowText(""), szContent("");
    int nState = dyn_normal;
    bool bShowDevice = false;

    for(lsItem = sortList.begin(); lsItem != sortList.end(); lsItem ++)
    {
        // get monitor's current state
        nState = getMonitorState(lsItem->second.szIndex, szShowText);
        WImage *pMonitor = NULL;
        if(m_nShowType == -1 || m_nShowType == nState || 
            (m_nShowType == dyn_normal && nState == dyn_no_data) ||
            (m_nShowType == dyn_error && nState == dyn_bad))
        {
            bShowDevice = true;
            pMonitor = new WImage("/Images/state_green.gif", pTableCell);
        }
        if(pMonitor)
        {   
            // change show image by state
            switch(nState)
            {
            case dyn_no_data:
                pMonitor->setImageRef("/Images/state_grey.gif");
                break;
            case dyn_normal:
                pMonitor->setImageRef("/Images/state_green.gif");
                break;
            case dyn_warnning:
                pMonitor->setImageRef("/Images/state_yellow.gif");
                break;
            case dyn_error:
            case dyn_bad:
                pMonitor->setImageRef("/Images/state_red.gif");
                break;
            case dyn_disable:
                pMonitor->setImageRef("/Images/state_stop.gif");
                break;
            }

            // monitor's style && onclick event
            szContent = "style='cursor:pointer;' onclick = 'window.open(\"SimpleReport.exe?id=" + lsItem->second.szIndex + "\");'";
            sprintf(pMonitor->contextmenu_, szContent.c_str());
            pMonitor->setToolTip(szDeviceName + ":" + lsItem->second.szName + "\r\n" + szShowText);
        }
    }
    return bShowDevice;
}
开发者ID:,项目名称:,代码行数:99,代码来源:


示例17: szRootname

void CSVWholeview::enumSVSE()
{
    if(!m_pContent)
        return;

    PAIRLIST selist;
    string szRootname("");
    int nRow = 0;

    WTable *pTable = m_pContent;
    if(GetIniFileInt("solover","solover",1,"general.ini") == 1)
    {       
        sv_pair svpair;
        svpair.name = "1";
        OBJECT objSE = GetSVSE("1");//, m_szIDCUser, m_szIDCPwd);
        if(objSE != INVALID_VALUE)
        {
            svpair.value = GetSVSELabel(objSE);
            CloseSVSE(objSE);
        }        
        selist.push_back(svpair);
    }
    else
    {
        GetAllSVSEInfo(selist);
        szRootname = GetIniFileString("segroup","name","","general.ini");
        if(szRootname.empty())
            szRootname = "SiteView ECC 7.0";        
        nRow = m_pContent->numRows();
        //WImage *pShow = new WImage("../Images/foldopen.gif", m_pContent->elementAt(nRow, 0));
        //WImage *pHide = new WImage("../Images/foldclose.gif", m_pContent->elementAt(nRow, 0));
        WImage *pShow = new WImage("/Images/cb1-unwrap.gif", m_pContent->elementAt(nRow, 0));
        WImage *pHide = new WImage("/Images/cb1-fold.gif", m_pContent->elementAt(nRow, 0));

		new WText("&nbsp;",m_pContent->elementAt(nRow, 0));

        //new WImage("../Images/home.gif", m_pContent->elementAt(nRow, 1));
		new WImage("/Images/cbb-2main.gif", m_pContent->elementAt(nRow, 1));

		new WText("&nbsp;",m_pContent->elementAt(nRow, 1));

        WText *pName = new WText(szRootname, m_pContent->elementAt(nRow, 2));
        if(pName)
        {
            sprintf(pName->contextmenu_, "style='color:#669;cursor:pointer;' onmouseover='" \
                "this.style.textDecoration=\"underline\"' " \
                "onmouseout='this.style.textDecoration=\"none\"'");
        }
        pTable = new WTable(m_pContent->elementAt(nRow + 1, 2));
		pTable->setStyleClass("widthauto");
        if(!pTable)
            return;
        else
        {
            if(pShow && pHide)
            {
                string szShow = "", szHide = "", szSubTable = "";
                szShow = pHide->formName();
                szHide = pShow->formName();
                szSubTable = pTable->formName();

                string szShowText = "onclick='showsubtable(\"" + szShow + "\", \"" + szHide + "\", \"" + szSubTable + "\")' " + "style='display:none;cursor:pointer'";
                string szHideText = "onclick='hidesubtable(\"" + szShow + "\", \"" + szHide + "\", \"" + szSubTable + "\")' " + "style='cursor:pointer'";
                sprintf(pShow->contextmenu_, szShowText.c_str());
                sprintf(pHide->contextmenu_, szHideText.c_str());            
            }
        }
    }

    PAIRLIST::iterator iSe;
    
    bool bHasRight = true;

    int  nChildCount = 0, nIndex = 0;

    OBJECT objSE = INVALID_VALUE;
    OBJECT objGroup = INVALID_VALUE;
    MAPNODE node = INVALID_VALUE;

    string szSEID(""), szSubGroupID(""), szEntityID("");
    string szName(""), szIndex("");
    string szContext(""), szShow(""), szHide(""), szSubTable("");
    string szShowText(""), szHideText("");

    list<string> lsGroupID;
    list<string> lsDeviceID;
    list<string>::iterator lstItem;

    for(iSe= selist.begin(); iSe!=selist.end(); iSe++)
    {
        szSEID = (*iSe).name;
        bHasRight = true;
        if(m_pSVUser)
            bHasRight = m_pSVUser->haveGroupRight(szSEID, Tree_SE);
        if(bHasRight)
        {
            nRow = pTable->numRows();
            //WImage *pShow = new WImage("../Images/foldopen.gif", pTable->elementAt(nRow, 0));
            //WImage *pHide = new WImage("../Images/foldclose.gif", pTable->elementAt(nRow, 0));
            WImage *pShow = new WImage("/Images/cb1-unwrap.gif", pTable->elementAt(nRow, 0));
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


示例18: WTable

//add  list function
void CSVReportSet::addPhoneList(WTable * table)
{
    m_ptbPhone = new WTable((WContainerWidget*)table->elementAt(7,0));
	nullTable = new WTable((WContainerWidget*)table->elementAt(8, 0));

	m_ptbPhone -> setStyleClass("t3");
	nullTable -> setStyleClass("t3");

    if (m_ptbPhone)
    {
        m_ptbPhone -> setCellPadding(0);   
		m_ptbPhone->setCellSpaceing(0);
		new WText("", (WContainerWidget*)m_ptbPhone->elementAt(0,0));
		new WText(m_formText.szColName, (WContainerWidget*)m_ptbPhone->elementAt(0, 1));
		new WText(m_formText.szColPeriod, (WContainerWidget*)m_ptbPhone->elementAt(0, 2));
		new WText(m_formText.szColEdit, (WContainerWidget*)m_ptbPhone->elementAt(0, 3));
		
		m_ptbPhone->elementAt(0, 0)->setStyleClass("t3title");
		m_ptbPhone->elementAt(0, 1)->setStyleClass("t3title");
		m_ptbPhone->elementAt(0, 2)->setStyleClass("t3title");
		m_ptbPhone->elementAt(0, 3)->setStyleClass("t3title");
		
    }

	std::list<string> sectionlist;
	std::list<string>::iterator m_sItem;
	GetIniFileSections(sectionlist, "reportset.ini");

	for(m_sItem = sectionlist.begin(); m_sItem != sectionlist.end(); m_sItem++)
	{
		int numRow = m_ptbPhone->numRows();
		std::string section = *m_sItem;

		string ret = "error";

		WCheckBox * pCheck = new WCheckBox("", (WContainerWidget*)m_ptbPhone->elementAt(numRow, 0));
		// 名称
		std::string strlinkname;
		std::string hrefstr = RepHrefStr(section);
		strlinkname ="<a href=/fcgi-bin/startsreportlist.exe?id="+hrefstr+">"+section+"</a>";
		WText *pName = new WText(strlinkname, (WContainerWidget*)m_ptbPhone->elementAt(numRow , 1));

		std::string szPeriod = GetIniFileString(section, "Period", ret, "reportset.ini");
		if(strcmp(szPeriod.c_str(), "error") == 0)
		{
		}
		
		WText *pPeriod = new WText(szPeriod, (WContainerWidget*)m_ptbPhone->elementAt(numRow, 2));
		
		WImage *pEdit = new WImage("../icons/edit.gif", (WContainerWidget*)m_ptbPhone->elementAt(numRow ,3));
		pEdit->decorationStyle().setCursor(WCssDecorationStyle::Pointer);   
	    connect(pEdit, SIGNAL(clicked()), &m_signalMapper, SLOT(map()));
		m_signalMapper.setMapping(pEdit, section);

		REPORT_LIST list;

		list.pSelect = pCheck;
		list.pName = pName;
		list.pPeriod = pPeriod;
		list.pEdit = pEdit;
		m_pListReport.push_back(list);
		
	}
	m_ptbPhone->adjustRowStyle("tr1","tr2");
	

	//m_pReportListTable->HideNullTip();
		
}
开发者ID:,项目名称:,代码行数:70,代码来源:


示例19: Edit_Phone

void CSVReportSet::SavePhone(SAVE_REPORT_LIST * report)
{
    //nullTable -> clear();

	if(strcmp(chgstr.c_str(), "") != 0)
    {
        Edit_Phone(report);
        return;
    }
    
	//judge report name/(ini section) is right
	
	std::list<string> sectionlist;
	std::list<string>::iterator Item;
	GetIniFileSections(sectionlist, "reportset.ini");
	bool bRe = false;

	for(Item = sectionlist.begin(); Item != sectionlist.end(); Item++)
	{
		std::string str = *Item;
		if(strcmp(str.c_str(), report->szTitle.c_str()) == 0)
		{
			bRe = true;
			break;
		}
	}

	if(bRe)//有重复
	{

		std::list<string> errorMsgList;
		errorMsgList.push_back(m_formText.szConnErr);
		m_pReportListTable->ShowErrorMsg(errorMsgList);		//show error msg


		//m_pConnErr ->setText(m_formText.szConnErr);
		//m_pConnErr ->show();	
	}
	else
	{
		//int numRow = m_ptbPhone->numRows();
		int numRow = m_pReportListTable->GeDataTable()->numRows();
		m_pReportListTable->InitRow(numRow);
		    
		WCheckBox * pCheck = new WCheckBox("", (WContainerWidget*)m_pReportListTable->GeDataTable()->elementAt(numRow, 0));
		m_pReportListTable->GeDataTable()->elementAt(numRow, 0)->setContentAlignment(AlignCenter);
	    
		std::string strlinkname;

		std::string hrefstr =  RepHrefStr(report->szTitle);
		strlinkname ="<a href=/fcgi-bin/statsreportlist.exe?id="+hrefstr+">"+report->szTitle+"</a>";

		WText *pName = new WText(strlinkname, (WContainerWidget*)m_pReportListTable->GeDataTable()->elementAt(numRow , 2));
		m_pReportListTable->GeDataTable()->elementAt(numRow, 2)->setContentAlignment(AlignCenter);
	    
		WText *pPeriod = new WText(report->szPeriod, (WContainerWidget*)m_pReportListTable->GeDataTable()->elementAt(numRow, 4));
		m_pReportListTable->GeDataTable()->elementAt(numRow, 4)->setContentAlignment(AlignCenter);

		WImage *pEdit = new WImage("/Images/edit.gif", (WContainerWidget*)m_pReportListTable->GeDataTable()->elementAt(numRow , 6));
		m_pReportListTable->GeDataTable()->elementAt(numRow, 6)->setContentAlignment(AlignCenter);
		pEdit->decorationStyle().setCursor(WCssDecorationStyle::Pointer);   
	    
		//m_ptbPhone->adjustRowStyle("tr1","tr2"); 

		m_signalMapper.setMapping(pEdit, report->szTitle);
	  
		bool isWriteIni = false;

		isWriteIni = WriteIniFileString(report->szTitle, "Title", report->szTitle, "reportset.ini");
		if(!isWriteIni)
		{

		}
		isWriteIni = WriteIniFileString(report->szTitle, "Descript", report->szDescript, "reportset.ini");
		if(!isWriteIni)
		{
		}

		isWriteIni = WriteIniFileString(report->szTitle, "Plan", report->szPlan, "reportset.ini");
		if(!isWriteIni)
		{
		}

		isWriteIni = WriteIniFileString(report->szTitle, "Period", report->szPeriod, "reportset.ini");
		if(!isWriteIni)
		{
		}

		isWriteIni = WriteIniFileString(report->szTitle, "StatusResult", report->szStatusresult, "reportset.ini");
		if(!isWriteIni)
		{
		}

		isWriteIni = WriteIniFileString(report->szTitle, "ErrorResult", report->szErrorresult, "reportset.ini");
		if(!isWriteIni)
		{
		}

		isWriteIni = WriteIniFileString(report->szTitle, "Graphic", report->szGraphic, "reportset.ini");
		if(!isWriteIni)
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


示例20: captcha


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ WKRetainPtr类代码示例发布时间:2022-05-31
下一篇:
C++ WINRECT类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap