本文整理汇总了C++中Icon类的典型用法代码示例。如果您正苦于以下问题:C++ Icon类的具体用法?C++ Icon怎么用?C++ Icon使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Icon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: needsStaff
PaletteCell* Palette::add(int idx, Element* s, const QString& name, QString tag, qreal mag)
{
if (s) {
s->setPos(0.0, 0.0);
s->setUserOff(QPointF());
s->setReadPos(QPointF());
}
PaletteCell* cell = new PaletteCell;
if (idx < cells.size()) {
delete cells[idx];
}
else {
for (int i = cells.size(); i <= idx; ++i)
cells.append(0);
}
cells[idx] = cell;
cell->element = s;
cell->name = name;
cell->tag = tag;
cell->drawStaff = needsStaff(s);
cell->xoffset = 0;
cell->yoffset = 0;
cell->mag = mag;
cell->readOnly = false;
update();
if (s && s->type() == Element::ICON) {
Icon* icon = static_cast<Icon*>(s);
connect(getAction(icon->action()), SIGNAL(toggled(bool)), SLOT(actionToggled(bool)));
}
示例2: init
bool IconSprite::init(const Icon &icon) {
if (!DynamicSprite::init(icon.getTexture(), icon.getTextureRect(), icon.getDensity())) {
return false;
}
_icon = icon;
return true;
}
示例3: prop_cb
void prop_cb(Fl_Widget*, void* ic)
{
Icon* icon = (Icon*)ic;
assert(icon != NULL);
IconDialog id(icon->icon_settings(), icon->icon_image());
printf("%s\n", icon->icon_settings()->name.c_str());
id.exec();
}
示例4: string
int* IconSet::getIcon(int index)
{
if (index < 0 || index > numIcons)
throw string("Icon index not in range");
BOOL result;
//Clear the DC
memset(pixels, 0x0, width * height * sizeof(UINT));
memset(mask, 0x0, width * height * sizeof(UINT));
Icon icon = icons[index];
//Paint the icon onto the DC
result = DrawIconEx(iconContext, 0, 0, icon.getIcon(), icon.getWidth(), icon.getHeight(), 0, NULL, DI_NORMAL);
checkResult(result, "Failed to draw icon into memory");
//Paint the icon onto the DC
result = DrawIconEx(maskContext, 0, 0, icon.getIcon(), icon.getWidth(), icon.getHeight(), 0, NULL, DI_MASK);
checkResult(result, "Failed to draw icon alpha mask into memory");
//pixels and mask now contain the data
int *dimensions = new int[2];
dimensions[0] = icon.getWidth();
dimensions[1] = icon.getHeight();
return dimensions;
}
示例5: stborder
Mcascade::Mcascade()
{
Icon *i;
stborder(new Mborder());
redge(0);
i=new Icon();
i->st(picrtarw);
add(i);
ledge(0);
auxrtol(i,0);
}
示例6: Icon
void CasualtiesList::addCasualty( GenericFightUnit * unit )
{
if( unit ) {
_none->hide();
QString f;
f.sprintf( "units/face_%i_%i.png", unit->getRace(), unit->getLevel() );
Icon * photo = new Icon( _present, "photo" );
photo->setPixmap( QPixmap( IMAGE_PATH + f ) );
_layPresent->addWidget( photo );
_layPresent->addStretch( 2 );
}
}
示例7: Icon
void Button::AddIcon(Renderer* pRenderer, const std::string &fileName, int texWidth, int texHeight, int width, int height, int xOffset, int yOffset, float depth)
{
// texWidth and texHeight should always be a power of 2.
Icon* lpNewIcon = new Icon(pRenderer, fileName, texWidth, texHeight);
lpNewIcon->SetDimensions(xOffset, yOffset, width, height);
lpNewIcon->SetDepth(depth);
m_vpAddedComponentList.push_back(lpNewIcon);
Add(lpNewIcon);
}
示例8: addmoduleicon
void MenuModule::addmoduleicon(int type,int state){
QPixmap pixmap;
Icon icon = imageReader::icon(type, state);
module_icon = new QLabel(this); //模块图标
pixmap = icon.getPixmap();
module_icon->setPixmap(pixmap);
QString tips = icon.getText();
module_icon->move(20, 18);
module_icon->setToolTip(tips);
}
示例9: Unload
void Style::Unload()
{
for( unsigned int i = 0; i < tools.Count(); i++ ) {
Tool* tool = (Tool*) tools.Item( i );
tool->Unload();
}
for( unsigned int i = 0; i < icons.Count(); i++ ) {
Icon* icon = (Icon*) icons.Item( i );
icon->Unload();
}
}
示例10: create_new_dnd_icon
int create_new_dnd_icon(int x, int y, char *filename) //create icon from dnd data
{
if (filename)
{
char config[FL_PATH_MAX];
const char *name = fl_file_filename(filename);
snprintf(config, sizeof(config)-1, "%s/.ede/desktop/%s.desktop", getenv("HOME"), name);
if (!fl_file_exists((char*)config))
{
char val[FL_PATH_MAX];
Fl_Config checkconf(filename, true, false);
if(!checkconf.get("Desktop Entry", "Exec", val, 0, sizeof(val)))
{
Fl_Config cfg(config);
cfg.set_section("Desktop Entry");
checkconf.get("Desktop Entry", "Icon", val, "no icon", sizeof(val));
cfg.write("Icon", val);
cfg.write("X", x);
cfg.write("Y", y);
cfg.write(get_localized_string(), get_localized_name(checkconf));
checkconf.get("Desktop Entry", "Exec", val, filename, sizeof(val));
cfg.write("Exec", val);
cfg.flush();
}
else
{
Fl_Config cfg(config);
cfg.set_section("Desktop Entry");
cfg.write("Icon", "no icon");
cfg.write("X", x);
cfg.write("Y", y);
cfg.write(get_localized_string(), name);
cfg.write("Exec", filename);
cfg.flush();
}
desktop->begin();
Icon *icon = new Icon((char*)config);
icon->show();
desktop->end();
desktop->redraw();
}
else
{
fl_alert(_("The icon with the same name already exists."));
}
}
return 0;
}
示例11: child
void Desktop::update_icons()
{
for(int n=0; n<children(); n++) {
Fl_Widget *w = child(n);
if(w==popup) continue;
Icon *i = (Icon *)w;
i->update_all();
}
if(auto_arr)
auto_arrange();
Fl::flush();
}
示例12: populateIconPalette
static void populateIconPalette(Palette* p, const IconAction* a)
{
while (a->subtype != -1) {
Icon* ik = new Icon(gscore);
ik->setSubtype(a->subtype);
Shortcut* s = getShortcut(a->action);
QAction* action = getAction(s);
QIcon icon(action->icon());
ik->setAction(a->action, icon);
p->append(ik, s->help);
++a;
}
}
示例13: populateIconPalette
void populateIconPalette(Palette* p, const IconAction* a)
{
while (a->subtype != IconType::NONE) {
Icon* ik = new Icon(gscore);
ik->setIconType(a->subtype);
Shortcut* s = Shortcut::getShortcut(a->action);
QAction* action = s->action();
QIcon icon(action->icon());
ik->setAction(a->action, icon);
p->append(ik, s->help());
++a;
}
}
示例14:
void
IconImpl::mouse_up (const CL_InputEvent& event)
{
if (is_enabled)
{
down = false;
parent->release_mouse();
if (parent->has_mouse_over())
{
sig_on_click();
}
}
}
示例15: icon
Icon Icon::getMediaIcon(const QString &name)
{
static QList<QIcon::Mode> modes=QList<QIcon::Mode>() << QIcon::Normal << QIcon::Disabled << QIcon::Active << QIcon::Selected;
Icon icn;
Icon icon(name);
foreach (QIcon::Mode mode, modes) {
icn.addPixmap(icon.pixmap(QSize(64, 64), mode).scaled(QSize(28, 28), Qt::KeepAspectRatio, Qt::SmoothTransformation), mode);
icn.addPixmap(icon.pixmap(QSize(48, 48), mode), mode);
icn.addPixmap(icon.pixmap(QSize(32, 32), mode), mode);
icn.addPixmap(icon.pixmap(QSize(24, 24), mode), mode);
icn.addPixmap(icon.pixmap(QSize(22, 22), mode), mode);
icn.addPixmap(icon.pixmap(QSize(16, 16), mode), mode);
}