Esempio n. 1
0
int processUserInput() {

  if (sizeUpdate()) {
    isExpanded = 0;
  }

  return 0;
}
Esempio n. 2
0
void djvStyle::setSizeMetric(const SizeMetric & sizeMetric)
{
    if (sizeMetric == _p->sizeMetrics[_p->sizeMetricsIndex])
        return;
    
    _p->sizeMetrics[_p->sizeMetricsIndex] = sizeMetric;
    
    sizeUpdate();
    
    Q_EMIT sizeMetricsChanged();
}
Esempio n. 3
0
void djvStyle::setSizeMetrics(const QVector<SizeMetric> & sizeMetrics)
{
    if (sizeMetrics == _p->sizeMetrics)
        return;
    
    _p->sizeMetrics = sizeMetrics;
    
    sizeUpdate();

    Q_EMIT sizeMetricsChanged();
}
Esempio n. 4
0
void djvStyle::setSizeMetricsIndex(int index)
{
    if (index == _p->sizeMetricsIndex)
        return;
    
    _p->sizeMetricsIndex = index;
    
    sizeUpdate();
    
    Q_EMIT sizeMetricsChanged();
}
Esempio n. 5
0
size_t Sim2d::UiApplicationState::onEvent(uint32_t message_id
	,size_t param_0,size_t param_1)
	{
	switch(message_id)
		{
		case MessageSize:
			{
			auto size_min=sizeUpdate();
			auto size_this=sizeWindowGet();
			sizeAbsolute(std::max(size_this.x,size_min.x)
				,std::max(size_this.y,size_min.y));
			}
			break;
		}
	return WindowCustom::onEvent(message_id,param_0,param_1);
	}
/*
 * Load data back into the object we are configuring and quit
 */
void MasterConfigurationDialog::OKButtonCallback_real(Fl_Widget* w) {
	
	// get the data
	osg::Vec3 position = osg::Vec3( atof(positionXField->value()), atof(positionYField->value()), atof(positionZField->value()) );
	osg::Vec3 size = osg::Vec3( atof(sizeXField->value()), atof(sizeYField->value()), atof(sizeZField->value()) );
	osg::Vec3 spinVals = osg::Vec3( atof(spinXField->value()), atof(spinYField->value()), atof(spinZField->value()) );
	
	float zRotation = atof( rotationField->value() );
	osg::Vec3 rotation = osg::Vec3( 0.0, 0.0, zRotation );
	
	// get the transformations
	vector< osg::ref_ptr< BZTransform > > transforms = vector< osg::ref_ptr< BZTransform > >();
	
	if(transformations.size() != 0) {
		for(vector<TransformWidget*>::iterator i = transformations.end() - 1; i != transformations.begin() - 1; i--) {
			if( (*i)->active() ) {
				string widgetData = (*i)->toString();
				transforms.push_back( new BZTransform( widgetData ) );
			}
		}
	}
	
	// call updates
	UpdateMessage positionUpdate( UpdateMessage::SET_POSITION, &position );
	UpdateMessage sizeUpdate( UpdateMessage::SET_SCALE, &size );
	UpdateMessage rotationUpdate( UpdateMessage::SET_ROTATION, &rotation );
	UpdateMessage transformUpdate( UpdateMessage::SET_TRANSFORMATIONS, &transforms );
	
	if( object->isKey("position") || object->isKey("shift") )
		object->update( positionUpdate );
		
	if( object->isKey("size") || object->isKey("scale") )
		object->update( sizeUpdate );
		
	if( object->isKey("rotation") && !object->isKey("spin"))
		object->update( rotationUpdate );
		
	if( object->isKey("spin") ) {
		object->setRotation( spinVals );
	}
	object->update( transformUpdate );
	
	printf("data: \n|%s|\n", object->toString().c_str());
	
	Fl::delete_widget(this);	
}
Esempio n. 7
0
KPropColor::KPropColor( QWidget *parent, const char *buttontext, int perc, QColor mydefault, const char *key, const char *group, KConfig *config, const char *name )
	: QFrame( parent,name )
{
	setKConfig( config );
	setGroup( group );
	setKey( key );
	setFrameStyle( QFrame::NoFrame );
	setFontPropagation( NoChildren );
	defaultColor = mydefault;

	button = new QPushButton( buttontext, this );
	connect( button, SIGNAL( clicked() ), 
			this, SLOT( getColorDialog() ) );
	percentage = perc;

	sizeUpdate();
}
Esempio n. 8
0
// Adds the terrain mesh into the physics world for collision detection
// A flat plane is also placed below the terrain to catch any objects
// that might fall out of the broadphase limits, which could cause problems.
terrain::terrain(QString filename, MainGUI* parent, simGLView* glView)
:
simGLObject(glView),
m_parent(parent),
m_terrainVerts(0),
m_terrainColors(0),
m_terrainNormals(0),
m_terrainTriangles(0),
m_terrainMaxHeight(0),
m_terrainMinHeight(0),
m_pixelSize(100,100),
m_terrainModified(false)
{
    arena = physicsWorld::instance(); 					// get the physics world object
	tTool = new terrainTool(m_parent);
	
    connect(tTool, SIGNAL(sizeUpdate(btVector3)), this, SLOT(setTerrainSize(btVector3)));

	this->openTerrain(filename);
}
Esempio n. 9
0
int 
processUserInput() 
{

  int mouseX, mouseY, mouseButtons;
  char keyHit;

  inputUpdate(mouseX,mouseY,mouseButtons,keyHit);

  if( keyHit == 'q' )
    return -1;


  if (sizeUpdate()) 
    {
      isExpanded = 0;
    }

  return 0;
} // processUserInput()
Esempio n. 10
0
djvStyle::djvStyle(QObject * parent) :
    QObject(parent),
    _p(new djvStylePrivate)
{
    //DJV_DEBUG("djvStyle::djvStyle");
    
    // Load preferences.
    
    djvPrefs prefs("djvStyle", djvPrefs::SYSTEM);
    
    int paletteCount = 0;
    
    prefs.get("paletteCount", paletteCount);
    
    //DJV_DEBUG_PRINT("paletteCount = " << paletteCount);
    
    for (int i = 0; i < paletteCount; ++i)
    {
        Palette palette;
        prefs.get(QString("palette%1").arg(i), palette);
        
        //DJV_DEBUG_PRINT("palette = " << palette.name);
        
        int j = 0;
        
        for (; j < _p->palettes.count(); ++j)
        {
            if (palette.name == _p->palettes[j].name)
            {
                _p->palettes[j] = palette;
                
                break;
            }
        }
        
        if (j == _p->palettes.count())
        {
            _p->palettes += palette;
        }
    }
    
    prefs.get("palettesIndex", _p->palettesIndex);
    
    //DJV_DEBUG_PRINT("palettesIndex = " << _p->palettesIndex);

    int sizeMetricsCount = 0;
    
    prefs.get("sizeMetricsCount", sizeMetricsCount);
    
    for (int i = 0; i < sizeMetricsCount; ++i)
    {
        SizeMetric sizeMetric;
        
        prefs.get(QString("sizeMetric%1").arg(i), sizeMetric);
        
        int j = 0;
        
        for (; j < _p->sizeMetrics.count(); ++j)
        {
            if (sizeMetric.name == _p->sizeMetrics[j].name)
            {
                _p->sizeMetrics[j] = sizeMetric;
                
                break;
            }
        }
        
        if (j == _p->sizeMetrics.count())
        {
            _p->sizeMetrics += sizeMetric;
        }
    }
    
    prefs.get("sizeMetricsIndex", _p->sizeMetricsIndex);
    
    prefs.get("fonts", _p->fonts);
    
    //DJV_DEBUG_PRINT("sizeMetricsIndex = " << _p->sizeMetricsIndex);

    // Initialize.
    
    colorUpdate();
    sizeUpdate();
    fontsUpdate();
}
Esempio n. 11
0
void KPropColor::fontChange( const QFont & )
{
	sizeUpdate();
	getConfig();
}