Clean up and refactoring of pie menu

Fri, 15 Apr 2016 21:58:22 +0200

author
Ansariel
date
Fri, 15 Apr 2016 21:58:22 +0200
changeset 48948
6811e15aeb67
parent 48947
e05528d6c2a7
child 48949
1cd8af2124d0

Clean up and refactoring of pie menu

indra/newview/piemenu.cpp file | annotate | diff | revisions
indra/newview/piemenu.h file | annotate | diff | revisions
indra/newview/pieseparator.cpp file | annotate | diff | revisions
indra/newview/pieseparator.h file | annotate | diff | revisions
indra/newview/pieslice.cpp file | annotate | diff | revisions
indra/newview/pieslice.h file | annotate | diff | revisions
     1.1 --- a/indra/newview/piemenu.cpp	Fri Apr 15 19:27:11 2016 +0200
     1.2 +++ b/indra/newview/piemenu.cpp	Fri Apr 15 21:58:22 2016 +0200
     1.3 @@ -33,11 +33,10 @@
     1.4  #include "llviewercontrol.h"
     1.5  #include "llviewerwindow.h"
     1.6  
     1.7 -// copied from LLMenuGL - Remove these lines over there when finished
     1.8 -const S32 PIE_INNER_SIZE = 20;		// radius of the inner pie circle
     1.9 +const S32 PIE_INNER_SIZE = 20;			// radius of the inner pie circle
    1.10  const F32 PIE_POPUP_FACTOR = 1.7f;		// pie menu size factor on popup
    1.11  const F32 PIE_POPUP_TIME = 0.25f;		// time to shrink from popup size to regular size
    1.12 -const S32 PIE_OUTER_SIZE = 96;		// radius of the outer pie circle
    1.13 +const S32 PIE_OUTER_SIZE = 96;			// radius of the outer pie circle
    1.14  
    1.15  // register the pie menu globally as child widget
    1.16  static LLDefaultChildRegistry::Register<PieMenu> r1("pie_menu");
    1.17 @@ -58,18 +57,22 @@
    1.18  	LLMenuGL(p),
    1.19  	mCurrentSegment(-1)
    1.20  {
    1.21 -	LL_DEBUGS() << "PieMenu::PieMenu()" << LL_ENDL;
    1.22 +	LL_DEBUGS("Pie") << "PieMenu::PieMenu()" << LL_ENDL;
    1.23 +
    1.24  	// radius, so we need this *2
    1.25  	reshape(PIE_OUTER_SIZE * 2, PIE_OUTER_SIZE * 2, FALSE);
    1.26 +	
    1.27  	// set up the font for the menu
    1.28  	mFont = LLFontGL::getFont(LLFontDescriptor("SansSerif", "Pie", LLFontGL::NORMAL));
    1.29  	if (!mFont)
    1.30  	{
    1.31 -		LL_WARNS() << "Could not find font size for Pie menu, falling back to Small font." << LL_ENDL;
    1.32 +		LL_WARNS("Pie") << "Could not find font size for Pie menu, falling back to Small font." << LL_ENDL;
    1.33  		mFont = LLFontGL::getFont(LLFontDescriptor("SansSerif", "Small", LLFontGL::NORMAL));
    1.34  	}
    1.35 +	
    1.36  	// set slices pointer to our own slices
    1.37  	mSlices = &mMySlices;
    1.38 +	
    1.39  	// this will be the first click on the menu
    1.40  	mFirstClick = true;
    1.41  
    1.42 @@ -129,12 +132,12 @@
    1.43  		// get the angle of the mouse pointer from the center in radians
    1.44  		F32 angle = acos(mouseVector.mV[VX] / distance);
    1.45  		// if the mouse is below the middle of the pie, reverse the angle
    1.46 -		if (mouseVector.mV[VY] < 0)
    1.47 +		if (mouseVector.mV[VY] < 0.f)
    1.48  		{
    1.49 -			angle = F_PI * 2 - angle;
    1.50 +			angle = F_PI * 2.f - angle;
    1.51  		}
    1.52  		// rotate the angle slightly so the slices' centers are aligned correctly
    1.53 -		angle += F_PI / 8;
    1.54 +		angle += F_PI / 8.f;
    1.55  
    1.56  		// calculate slice number from the angle
    1.57  		mCurrentSegment = (S32) (8.f * angle / (F_PI * 2.f)) % 8;
    1.58 @@ -156,7 +159,7 @@
    1.59  	// play a sound
    1.60  	make_ui_sound("UISndPieMenuAppear");
    1.61  
    1.62 -	LL_DEBUGS() << "PieMenu::show(): " << x << " " << y << LL_ENDL;
    1.63 +	LL_DEBUGS("Pie") << "PieMenu::show(): " << x << " " << y << LL_ENDL;
    1.64  
    1.65  	// make sure the menu is always the correct size
    1.66  	reshape(PIE_OUTER_SIZE * 2, PIE_OUTER_SIZE * 2, FALSE);
    1.67 @@ -185,6 +188,7 @@
    1.68  
    1.69  	// move the mouse pointer into the center of the menu
    1.70  	LLUI::setMousePositionLocal(getParent(), x, y);
    1.71 +
    1.72  	// set our drawing origin to the center of the menu
    1.73  	setOrigin(x - PIE_OUTER_SIZE, y - PIE_OUTER_SIZE);
    1.74  
    1.75 @@ -193,6 +197,7 @@
    1.76  
    1.77  	// this was the first click for the menu
    1.78  	mFirstClick = true;
    1.79 +
    1.80  	// set up the slices pointer to the menu's own slices
    1.81  	mSlices = &mMySlices;
    1.82  
    1.83 @@ -226,7 +231,7 @@
    1.84  	// make a sound when hiding
    1.85  	make_ui_sound("UISndPieMenuHide");
    1.86  
    1.87 -	LL_DEBUGS() << "Clearing selections" << LL_ENDL;
    1.88 +	LL_DEBUGS("Pie") << "Clearing selections" << LL_ENDL;
    1.89  
    1.90  	mCurrentSegment = -1;
    1.91  	mSlices = &mMySlices;
    1.92 @@ -292,7 +297,7 @@
    1.93  	LLVector2 scale = gViewerWindow->getDisplayScale();
    1.94  
    1.95  	// move origin point to the center of our rectangle
    1.96 -	gGL.translatef(r.getWidth() / 2 * scale.mV[VX], r.getHeight() / 2 * scale.mV[VY], 0);
    1.97 +	gGL.translatef(r.getWidth() / 2.f * scale.mV[VX], r.getHeight() / 2.f * scale.mV[VY], 0.f);
    1.98  
    1.99  	// draw the general pie background
   1.100  	gl_washer_2d(PIE_OUTER_SIZE * factor, PIE_INNER_SIZE, 32, bgColor, borderColor);
   1.101 @@ -303,6 +308,7 @@
   1.102  
   1.103  	// clear current slice pointer
   1.104  	mSlice = NULL;
   1.105 +
   1.106  	// current slice number is 0
   1.107  	S32 num = 0;
   1.108  	bool wasAutohide = false;
   1.109 @@ -338,7 +344,7 @@
   1.110  				currentSlice->setEnabled(slice_visible);
   1.111  				if (!slice_visible)
   1.112  				{
   1.113 -				//	LL_DEBUGS() << label << " is not visible" << LL_ENDL;
   1.114 +				//	LL_DEBUGS("Pie") << label << " is not visible" << LL_ENDL;
   1.115  					label = "";
   1.116  				}
   1.117  
   1.118 @@ -391,7 +397,7 @@
   1.119  				currentSlice->updateEnabled();
   1.120  				if (!currentSlice->getEnabled())
   1.121  				{
   1.122 -					LL_DEBUGS() << label << " is disabled" << LL_ENDL;
   1.123 +					LL_DEBUGS("Pie") << label << " is disabled" << LL_ENDL;
   1.124  					// fade the item color alpha to mark the item as disabled
   1.125  					itemColor %= 0.3f;
   1.126  				}
   1.127 @@ -458,13 +464,13 @@
   1.128  
   1.129  BOOL PieMenu::appendContextSubMenu(PieMenu* menu)
   1.130  {
   1.131 -	LL_DEBUGS() << "PieMenu::appendContextSubMenu()" << LL_ENDL;
   1.132 +	LL_DEBUGS("Pie") << "PieMenu::appendContextSubMenu()" << LL_ENDL;
   1.133  	if (!menu)
   1.134  	{
   1.135  		return FALSE;
   1.136  	}
   1.137  
   1.138 -	LL_DEBUGS() << "PieMenu::appendContextSubMenu() appending " << menu->getLabel() << " to " << getLabel() << LL_ENDL;
   1.139 +	LL_DEBUGS("Pie") << "PieMenu::appendContextSubMenu() appending " << menu->getLabel() << " to " << getLabel() << LL_ENDL;
   1.140  
   1.141  	// add the submenu to the list of items
   1.142  	mSlices->push_back(menu);
   1.143 @@ -579,7 +585,6 @@
   1.144  		{
   1.145  			factor = PIE_POPUP_FACTOR - (PIE_POPUP_FACTOR - 1.f) * elapsedTime / PIE_POPUP_TIME;
   1.146  		}
   1.147 -//		setRect(r);  // obsolete?
   1.148  	}
   1.149  
   1.150  #endif
     2.1 --- a/indra/newview/piemenu.h	Fri Apr 15 19:27:11 2016 +0200
     2.2 +++ b/indra/newview/piemenu.h	Fri Apr 15 21:58:22 2016 +0200
     2.3 @@ -37,76 +37,76 @@
     2.4  
     2.5  class PieMenu : public LLMenuGL
     2.6  {
     2.7 -	public:
     2.8 -		// parameter block for the XUI factory
     2.9 -		struct Params : public LLInitParam::Block<Params, LLMenuGL::Params>
    2.10 +public:
    2.11 +	// parameter block for the XUI factory
    2.12 +	struct Params : public LLInitParam::Block<Params, LLMenuGL::Params>
    2.13 +	{
    2.14 +		Optional<std::string> name;
    2.15 +
    2.16 +		Params()
    2.17  		{
    2.18 -			Optional<std::string> name;
    2.19 +			visible = false;
    2.20 +		}
    2.21 +	};
    2.22  
    2.23 -			Params()
    2.24 -			{
    2.25 -				visible = false;
    2.26 -			}
    2.27 -		};
    2.28 +	// PieChildRegistry contains a list of allowed child types for the XUI definition
    2.29 +	typedef PieChildRegistry child_registry_t;
    2.30  
    2.31 -		// PieChildRegistry contains a list of allowed child types for the XUI definition
    2.32 -		typedef PieChildRegistry child_registry_t;
    2.33 +	PieMenu(const LLMenuGL::Params& p);
    2.34  
    2.35 -		PieMenu(const LLMenuGL::Params& p);
    2.36 +	/*virtual*/ void setVisible(BOOL visible);
    2.37  
    2.38 -		/*virtual*/ void setVisible(BOOL visible);
    2.39 +	// adding and removing "child" slices to the pie
    2.40 +	/*virtual*/ bool addChild(LLView* child, S32 tab_group = 0);
    2.41 +	/*virtual*/ void removeChild(LLView* child);
    2.42  
    2.43 -		// adding and removing "child" slices to the pie
    2.44 -		/*virtual*/ bool addChild(LLView* child, S32 tab_group = 0);
    2.45 -		/*virtual*/ void removeChild(LLView* child);
    2.46 +	/*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
    2.47 +	/*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
    2.48 +	/*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask);
    2.49  
    2.50 -		/*virtual*/ BOOL handleHover(S32 x,S32 y,MASK mask);
    2.51 -		/*virtual*/ BOOL handleMouseUp(S32 x,S32 y,MASK mask);
    2.52 -		/*virtual*/ BOOL handleRightMouseUp(S32 x,S32 y,MASK mask);
    2.53 +	// does all the hard work of bringing the menu on the screen
    2.54 +	void draw();
    2.55  
    2.56 -		// does all the hard work of bringing the menu on the screen
    2.57 -		void draw();
    2.58 +	// showing/hiding the menu
    2.59 +	void show(S32 x, S32 y, LLView* spawning_view = NULL);
    2.60 +	void hide();
    2.61  
    2.62 -		// showing/hiding the menu
    2.63 -		void show(S32 x, S32 y, LLView* spawning_view = NULL);
    2.64 -		void hide();
    2.65 +	// our item list type definition
    2.66 +	typedef std::list<LLView*> slice_list_t;
    2.67 +	// the actual item list
    2.68 +	slice_list_t mMySlices;
    2.69 +	// pointer to the currently used list
    2.70 +	slice_list_t* mSlices;
    2.71  
    2.72 -		// our item list type definition
    2.73 -		typedef std::list<LLView*> slice_list_t;
    2.74 -		// the actual item list
    2.75 -		slice_list_t mMySlices;
    2.76 -		// pointer to the currently used list
    2.77 -		slice_list_t* mSlices;
    2.78 +	// appends a sub pie menu to the current pie
    2.79 +	BOOL appendContextSubMenu(PieMenu* menu);
    2.80  
    2.81 -		// appends a sub pie menu to the current pie
    2.82 -		BOOL appendContextSubMenu(PieMenu* menu);
    2.83 +	// we never rearrange our menu
    2.84 +	void needsArrange() {};
    2.85 +	// arranging does nothing
    2.86 +	virtual void arrange( void ) {};
    2.87 +	// arranging does nothing
    2.88 +	void arrangeAndClear( void ) {};
    2.89  
    2.90 -		// we never rearrange our menu
    2.91 -		void needsArrange() {};
    2.92 -		// arranging does nothing
    2.93 -		virtual void arrange( void ) {};
    2.94 -		// arranging does nothing
    2.95 -		void arrangeAndClear( void ) {};
    2.96 +protected:
    2.97 +	// general mouse button handling
    2.98 +	BOOL handleMouseButtonUp(S32 x, S32 y, MASK mask);
    2.99 +	// font used for the menu
   2.100 +	const LLFontGL* mFont;
   2.101 +	// currently highlighted item, must be tested if it's a slice or submenu
   2.102 +	LLView* mSlice;
   2.103 +	// used to play UI sounds only once on hover slice change, do not dereference!
   2.104 +	LLView* mOldSlice;
   2.105  
   2.106 -	protected:
   2.107 -		// general mouse button handling
   2.108 -		BOOL handleMouseButtonUp(S32 x, S32 y, MASK mask);
   2.109 -		// font used for the menu
   2.110 -		const LLFontGL* mFont;
   2.111 -		// currently highlighted item, must be tested if it's a slice or submenu
   2.112 -		LLView* mSlice;
   2.113 -		// used to play UI sounds only once on hover slice change, do not dereference!
   2.114 -		LLView* mOldSlice;
   2.115 +	// timer for visual popup effect
   2.116 +	LLFrameTimer mPopupTimer;
   2.117  
   2.118 -		// timer for visual popup effect
   2.119 -		LLFrameTimer mPopupTimer;
   2.120 +	// this is TRUE when the first mouseclick came to display the menu, used for borderless menu
   2.121 +	bool mFirstClick;
   2.122  
   2.123 -		// this is TRUE when the first mouseclick came to display the menu, used for borderless menu
   2.124 -		bool mFirstClick;
   2.125 +	F32 getScaleFactor();
   2.126  
   2.127 -		F32 getScaleFactor();
   2.128 -
   2.129 -		S32 mCurrentSegment;
   2.130 +	S32 mCurrentSegment;
   2.131  };
   2.132  
   2.133  #endif // PIEMENU_H
     3.1 --- a/indra/newview/pieseparator.cpp	Fri Apr 15 19:27:11 2016 +0200
     3.2 +++ b/indra/newview/pieseparator.cpp	Fri Apr 15 21:58:22 2016 +0200
     3.3 @@ -33,7 +33,7 @@
     3.4  PieSeparator::PieSeparator(const PieSeparator::Params& p) :
     3.5  	LLUICtrl(p)
     3.6  {
     3.7 -	LL_DEBUGS() << "PieSeparator::PieSeparator()" << LL_ENDL;
     3.8 +	LL_DEBUGS("Pie") << "PieSeparator::PieSeparator()" << LL_ENDL;
     3.9  }
    3.10  
    3.11  // pick up parameters from the XUI definition
     4.1 --- a/indra/newview/pieseparator.h	Fri Apr 15 19:27:11 2016 +0200
     4.2 +++ b/indra/newview/pieseparator.h	Fri Apr 15 21:58:22 2016 +0200
     4.3 @@ -33,14 +33,14 @@
     4.4  // a pie slice that does nothing and is not highlighting by mouse hover
     4.5  class PieSeparator : public LLUICtrl
     4.6  {
     4.7 -	public:
     4.8 -		// parameter block for the XUI factory
     4.9 -		struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
    4.10 -		{
    4.11 -			Params();
    4.12 -		};
    4.13 +public:
    4.14 +	// parameter block for the XUI factory
    4.15 +	struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
    4.16 +	{
    4.17 +		Params();
    4.18 +	};
    4.19  
    4.20 -		PieSeparator(const Params& p);
    4.21 +	PieSeparator(const Params& p);
    4.22  };
    4.23  
    4.24  #endif // PIESEPARATOR_H
     5.1 --- a/indra/newview/pieslice.cpp	Fri Apr 15 19:27:11 2016 +0200
     5.2 +++ b/indra/newview/pieslice.cpp	Fri Apr 15 21:58:22 2016 +0200
     5.3 @@ -26,8 +26,19 @@
     5.4   */
     5.5  
     5.6  #include "llviewerprecompiledheaders.h"
     5.7 +
     5.8  #include "pieslice.h"
     5.9  
    5.10 +// pick up parameters from the XUI definition
    5.11 +PieSlice::Params::Params() :
    5.12 +	on_click("on_click"),
    5.13 +	on_visible("on_visible"),
    5.14 +	on_enable("on_enable"),
    5.15 +	start_autohide("start_autohide", false),
    5.16 +	autohide("autohide", false),
    5.17 +	check_enable_once("check_enable_once", false)
    5.18 +{
    5.19 +}
    5.20  
    5.21  // create a new slice and memorize the XUI parameters
    5.22  PieSlice::PieSlice(const PieSlice::Params& p) :
    5.23 @@ -36,21 +47,9 @@
    5.24  	mStartAutohide(p.start_autohide),
    5.25  	mAutohide(p.autohide),
    5.26  	mCheckEnableOnce(p.check_enable_once),
    5.27 -	mDoUpdateEnabled(TRUE)
    5.28 +	mDoUpdateEnabled(true)
    5.29  {
    5.30 -
    5.31 -	LL_DEBUGS() << "PieSlice::PieSlice(): " << mLabel << " " << mAutohide << " " << mCheckEnableOnce << LL_ENDL;
    5.32 -}
    5.33 -
    5.34 -// pick up parameters from the XUI definition
    5.35 -PieSlice::Params::Params() :
    5.36 -	on_click("on_click"),
    5.37 -	on_visible("on_visible"),
    5.38 -	on_enable("on_enable"),
    5.39 -	start_autohide("start_autohide", FALSE),
    5.40 -	autohide("autohide", FALSE),
    5.41 -	check_enable_once("check_enable_once", FALSE)
    5.42 -{
    5.43 +	LL_DEBUGS("Pie") << "PieSlice::PieSlice(): " << mLabel << " " << mAutohide << " " << mCheckEnableOnce << LL_ENDL;
    5.44  }
    5.45  
    5.46  // initialize parameters
    5.47 @@ -142,18 +141,18 @@
    5.48  }
    5.49  
    5.50  // accessor
    5.51 -BOOL PieSlice::getStartAutohide()
    5.52 +bool PieSlice::getStartAutohide()
    5.53  {
    5.54  	return mStartAutohide;
    5.55  }
    5.56  
    5.57  // accessor
    5.58 -BOOL PieSlice::getAutohide()
    5.59 +bool PieSlice::getAutohide()
    5.60  {
    5.61  	return mStartAutohide | mAutohide;
    5.62  }
    5.63  
    5.64  void PieSlice::resetUpdateEnabledCheck()
    5.65  {
    5.66 -	mDoUpdateEnabled = TRUE;
    5.67 +	mDoUpdateEnabled = true;
    5.68  }
     6.1 --- a/indra/newview/pieslice.h	Fri Apr 15 19:27:11 2016 +0200
     6.2 +++ b/indra/newview/pieslice.h	Fri Apr 15 21:58:22 2016 +0200
     6.3 @@ -34,71 +34,71 @@
     6.4  // parameter to be execued when the user clicks on this item
     6.5  class PieSlice : public LLUICtrl
     6.6  {
     6.7 -	public:
     6.8 -		// parameter block for the XUI factory
     6.9 -		struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
    6.10 -		{
    6.11 -			// register an on_click callback we can use in the XML definition
    6.12 -			Optional<CommitCallbackParam > on_click;
    6.13 -			// register an on_enable callback we can use in the XML definition
    6.14 -			Optional<EnableCallbackParam > on_enable;
    6.15 -			// register an on_visible callback which does the same as on_enable
    6.16 -			Optional<EnableCallbackParam > on_visible;
    6.17 +public:
    6.18 +	// parameter block for the XUI factory
    6.19 +	struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
    6.20 +	{
    6.21 +		// register an on_click callback we can use in the XML definition
    6.22 +		Optional<CommitCallbackParam > on_click;
    6.23 +		// register an on_enable callback we can use in the XML definition
    6.24 +		Optional<EnableCallbackParam > on_enable;
    6.25 +		// register an on_visible callback which does the same as on_enable
    6.26 +		Optional<EnableCallbackParam > on_visible;
    6.27  
    6.28 -			// autohide feature to hide a disabled pie slice (NOTE: <bool> is not <BOOL>)
    6.29 -			Optional<bool> start_autohide;
    6.30 -			// next item in an autohide chain
    6.31 -			Optional<bool> autohide;
    6.32 -			// only do the enable check once
    6.33 -			Optional<bool> check_enable_once;
    6.34 -			// parameter "constructor" function to pick up the parameters from the XUI system
    6.35 -			Params();
    6.36 -		};
    6.37 +		// autohide feature to hide a disabled pie slice (NOTE: <bool> is not <BOOL>)
    6.38 +		Optional<bool> start_autohide;
    6.39 +		// next item in an autohide chain
    6.40 +		Optional<bool> autohide;
    6.41 +		// only do the enable check once
    6.42 +		Optional<bool> check_enable_once;
    6.43 +		// parameter "constructor" function to pick up the parameters from the XUI system
    6.44 +		Params();
    6.45 +	};
    6.46  
    6.47 -		PieSlice(const Params& p);
    6.48 +	PieSlice(const Params& p);
    6.49  
    6.50 -		// call these before checking on enabled/visible status
    6.51 -		void updateEnabled();
    6.52 -		void updateVisible();
    6.53 +	// call these before checking on enabled/visible status
    6.54 +	void updateEnabled();
    6.55 +	void updateVisible();
    6.56  
    6.57 -		// initialisation, taking care of optional parameters and setting up the callback
    6.58 -		void initFromParams(const Params& p);
    6.59 +	// initialisation, taking care of optional parameters and setting up the callback
    6.60 +	void initFromParams(const Params& p);
    6.61  
    6.62 -		// accessor to expose the label to the outside (value is the same as label)
    6.63 -		std::string getLabel() const;
    6.64 -		void setLabel(const std::string newLabel);
    6.65 -		LLSD getValue() const;
    6.66 -		void setValue(const LLSD& value);
    6.67 +	// accessor to expose the label to the outside (value is the same as label)
    6.68 +	std::string getLabel() const;
    6.69 +	void setLabel(const std::string newLabel);
    6.70 +	LLSD getValue() const;
    6.71 +	void setValue(const LLSD& value);
    6.72  
    6.73 -		// accessor to expose the autohide feature
    6.74 -		BOOL getStartAutohide();
    6.75 -		BOOL getAutohide();
    6.76 +	// accessor to expose the autohide feature
    6.77 +	bool getStartAutohide();
    6.78 +	bool getAutohide();
    6.79  
    6.80 -		// callback connection for the onCommit method to launch the specified function
    6.81 -		boost::signals2::connection setClickCallback(const commit_signal_t::slot_type& cb)
    6.82 -		{
    6.83 -			return setCommitCallback(cb);
    6.84 -		}
    6.85 +	// callback connection for the onCommit method to launch the specified function
    6.86 +	boost::signals2::connection setClickCallback(const commit_signal_t::slot_type& cb)
    6.87 +	{
    6.88 +		return setCommitCallback(cb);
    6.89 +	}
    6.90  
    6.91 -		// callback connection for the onEnable method to enable/disable menu items
    6.92 -		boost::signals2::connection setEnableCallback( const enable_signal_t::slot_type& cb )
    6.93 -		{
    6.94 -			return mEnableSignal.connect(cb);
    6.95 -		}
    6.96 +	// callback connection for the onEnable method to enable/disable menu items
    6.97 +	boost::signals2::connection setEnableCallback(const enable_signal_t::slot_type& cb)
    6.98 +	{
    6.99 +		return mEnableSignal.connect(cb);
   6.100 +	}
   6.101  
   6.102 -		void resetUpdateEnabledCheck();
   6.103 +	void resetUpdateEnabledCheck();
   6.104  
   6.105 -	protected:
   6.106 -		// accessor store
   6.107 -		std::string mLabel;
   6.108 -		BOOL mStartAutohide;
   6.109 -		BOOL mAutohide;
   6.110 -		BOOL mCheckEnableOnce;
   6.111 -		BOOL mDoUpdateEnabled;
   6.112 +protected:
   6.113 +	// accessor store
   6.114 +	std::string mLabel;
   6.115 +	bool mStartAutohide;
   6.116 +	bool mAutohide;
   6.117 +	bool mCheckEnableOnce;
   6.118 +	bool mDoUpdateEnabled;
   6.119  
   6.120 -	private:
   6.121 -		enable_signal_t mEnableSignal;
   6.122 -		enable_signal_t mVisibleSignal;
   6.123 +private:
   6.124 +	enable_signal_t mEnableSignal;
   6.125 +	enable_signal_t mVisibleSignal;
   6.126  };
   6.127  
   6.128  #endif // PIESLICE_H

mercurial