Exemple #1
0
/**
 * @brief HM event controller
 */
void cmMyBlind::hmEventCol(uint8_t by3, uint8_t by10, uint8_t by11, uint8_t *data, uint8_t len) {
//	dbg << "hmEventCol >>>>>>> by3:" << by3 << " by10:" << by10 << " d:" << _HEX(data, len) << '\n'; _delay_ms(100);
	if      ((by3 == 0x00) && (by10 == 0x00)) poll();
	else if ((by3 == 0x00) && (by10 == 0x01)) setToggle();
	else if ((by3 == 0x00) && (by10 == 0x02)) firstStart();
	else if ((by3 == 0x01) && (by11 == 0x06)) configCngEvent();
	else if ((by3 == 0x11) && (by10 == 0x02)) pairSetEvent(data, len);			// set
	else if ((by3 == 0x11) && (by10 == 0x03)) pairSetEvent(data, 0);			// stop
	else if ((by3 == 0x01) && (by11 == 0x0E)) pairStatusReq();
	else if ((by3 == 0x01) && (by11 == 0x01)) peerAddEvent(data, len);
	else if  (by3 >= 0x3E)                    peerMsgEvent(by3, data, len);
	else return;
}
 void CollectionView::addTile(std::string imgPath, sf::Vector2f textureOffset, sf::Vector2f textureSize) {
     auto tile = std::make_shared<GUI::Button>();
     tile->setText("");
     tile->drawRect(true);
     tile->drawSprite(true);
     sf::Texture* texture = new sf::Texture();
     if (textureSize.x != -1){
         texture->loadFromFile(imgPath,sf::IntRect((int) textureOffset.x, (int) textureOffset.y,(int)textureSize.x, (int)textureSize.y));
     }
     else texture->loadFromFile(imgPath);
     tile->setNormalTexture(texture);
     tile->setPressedColor(sf::Color(75,131,204));
     tile->setToggle(true);
     mTiles.push_back(tile);
     updateGraphics();
 }
ThumbnailController::ThumbnailController( QWidget * parent, ThumbnailList * list )
    : KToolBar( parent, "ThumbsControlBar" )
{
    // change toolbar appearance
    setMargin( 3 );
    setFlat( true );
    setIconSize( 16 );
    setMovingEnabled( false );

    // insert a togglebutton [show only bookmarked pages]
    //insertSeparator();
    insertButton( "bookmark", FILTERB_ID, SIGNAL( toggled( bool ) ),
                  list, SLOT( slotFilterBookmarks( bool ) ),
                  true, i18n( "Show bookmarked pages only" ) );
    setToggle( FILTERB_ID );
    setButton( FILTERB_ID, KpdfSettings::filterBookmarks() );
    //insertLineSeparator();
}
void GlyphSliderGroup::addSlicesMap(int x, int y, int z, int alpha, int value)
{
	QVBoxLayout* tempOutLayout = new QVBoxLayout();
	QHBoxLayout* tempLayout = new QHBoxLayout();
	QPushButton* button = new QPushButton("Remove");
	QPushButton* buttonx = new QPushButton("X");
	QPushButton* buttony = new QPushButton("Y");
	QPushButton* buttonz = new QPushButton("Z");
	QPushButton* buttonv = new QPushButton("V");
	QPushButton* buttont = new QPushButton("Toggle");
	
	button -> setCheckable(1);
	buttonx -> setCheckable(1);
	buttony -> setCheckable(1);
	buttonz -> setCheckable(1);
	buttonv -> setCheckable(1);
	buttont -> setCheckable(1);
	buttonz -> setChecked(1);
	
	MapNode* current;
	QSlider* slider = new QSlider();
	current = cmaplist -> addMap(x, y, z, alpha, value);
	current -> setButtons(buttonx, buttony, buttonz, buttonv);
	slider -> setMaximum(256);
	slider -> setMinimum(1);
	slider -> setOrientation(Qt::Horizontal);
	connect(slider, SIGNAL(valueChanged(int)), current, SLOT(uValue(int)));
	connect(slider, SIGNAL(sliderPressed()), current, SLOT(setActive()));
	connect(button, SIGNAL(clicked()), button, SLOT(close()));
	connect(button, SIGNAL(clicked()), buttonx, SLOT(close()));
	connect(button, SIGNAL(clicked()), buttony, SLOT(close()));
	connect(button, SIGNAL(clicked()), buttonz, SLOT(close()));
	connect(button, SIGNAL(clicked()), buttonv, SLOT(close()));
	connect(button, SIGNAL(clicked()), buttont, SLOT(close()));
	connect(button, SIGNAL(clicked()), slider, SLOT(close()));
	
	
	connect(button, SIGNAL(clicked()), current, SLOT(selfDestruct()));
	connect(buttonx, SIGNAL(clicked()), current, SLOT(setX()));
	connect(buttony, SIGNAL(clicked()), current, SLOT(setY()));
	connect(buttonz, SIGNAL(clicked()), current, SLOT(setZ()));
	connect(buttonv, SIGNAL(clicked()), current, SLOT(setV()));
	connect(buttont, SIGNAL(clicked()), current, SLOT(setToggle()));
	
	connect(current, SIGNAL(closeMe()), button, SLOT(close()));
	connect(current, SIGNAL(closeMe()), buttonx, SLOT(close()));
	connect(current, SIGNAL(closeMe()), buttony, SLOT(close()));
	connect(current, SIGNAL(closeMe()), buttonz, SLOT(close()));
	connect(current, SIGNAL(closeMe()), buttonv, SLOT(close()));
	connect(current, SIGNAL(closeMe()), buttont, SLOT(close()));
	connect(current, SIGNAL(closeMe()), slider, SLOT(close()));
	
	//tempLayout->addWidget(slider);
	tempOutLayout->addWidget(slider);
	
	tempLayout->addWidget(buttonx);
	tempLayout->addWidget(buttony);
	tempLayout->addWidget(buttonz);
	tempLayout->addWidget(buttonv);
	tempLayout->addWidget(buttont);
	tempLayout->addWidget(button);
	tempOutLayout->addLayout(tempLayout);
	
	layout->addLayout(tempOutLayout);
	
	return;
}
Exemple #5
0
void KeyModifiers::setToggle()
{
	setToggle(m_info);
}
void ofxUIToggleMatrix::setToggleAndTrigger(int x, int y, bool _value)
{
    setToggle(x,y,_value);
    triggerEvent(toggles[x+y*rows]);
    
}