flagobj.cpp
changeset 580 8099ebaf4515
parent 425 7014be3ac7d0
child 655 d4b49c6c6069
     1.1 --- a/flagobj.cpp	Mon Feb 12 09:28:46 2007 +0000
     1.2 +++ b/flagobj.cpp	Thu Aug 09 18:34:07 2007 +0000
     1.3 @@ -30,11 +30,13 @@
     1.4  void FlagObj::init ()
     1.5  {
     1.6  	name="undefined";
     1.7 -	group="undefined";
     1.8 +	unsetGroup();
     1.9  
    1.10  	icon=new ImageObj (scene);
    1.11  	icon->setPos (absPos.x(), absPos.y() );
    1.12  	state=false;
    1.13 +	used=false;
    1.14 +	avis=true;
    1.15  	action=NULL;
    1.16  }
    1.17  
    1.18 @@ -45,6 +47,8 @@
    1.19  	group=other->group;
    1.20  	tooltip=other->tooltip;
    1.21  	state=other->state;
    1.22 +	avis=other->avis;
    1.23 +	used=other->used;
    1.24  	icon->copy(other->icon);
    1.25  	action=other->action;
    1.26  	setVisibility (other->isVisibleObj() );
    1.27 @@ -105,6 +109,11 @@
    1.28  	return group;
    1.29  }
    1.30  
    1.31 +void FlagObj::unsetGroup()
    1.32 +{
    1.33 +	group="undefined";
    1.34 +}
    1.35 +
    1.36  void FlagObj::setToolTip(const QString &n)
    1.37  {
    1.38  	tooltip=n;
    1.39 @@ -127,7 +136,22 @@
    1.40  
    1.41  void FlagObj::updateAction ()
    1.42  {
    1.43 -	if (action) action->setChecked(state);
    1.44 +	if (action) 
    1.45 +	{
    1.46 +		action->setChecked(state);
    1.47 +		if (!avis)
    1.48 +			action->setVisible(state);
    1.49 +	}
    1.50 +}
    1.51 +
    1.52 +void FlagObj::setAlwaysVisible(bool b)
    1.53 +{
    1.54 +	avis=b;
    1.55 +}
    1.56 +
    1.57 +bool FlagObj::isAlwaysVisible()
    1.58 +{
    1.59 +	return avis;
    1.60  }
    1.61  
    1.62  bool FlagObj::isActive()