本文整理汇总了C++中WImage类的典型用法代码示例。如果您正苦于以下问题:C++ WImage类的具体用法?C++ WImage怎么用?C++ WImage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WImage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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");
}
示例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);
}
示例3: clear
void EtagStore::update_image() {
clear();
WImage* image = new WImage(resource_->url());
addWidget(image);
image->resize(0, 0);
wApp->triggerUpdate();
}
示例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()));
}
}
示例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++;
}
}
示例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);
}
示例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");
}
示例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));
}
示例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);
}
}
示例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;
}
示例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);
}
示例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
)
);
//.........这里部分代码省略.........
示例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");
}
示例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");
}
}
示例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(" ",pTable->elementAt(nRow, 0));
//.........这里部分代码省略.........