Example #1
0
ScrollBar::ScrollBar(  Widget* parent, const Rect& rectangle,
                             bool horizontal, int id, bool noclip)
: Widget( parent, id, rectangle ),
	_dragging(false), _isSliderHovered( false ), _lastSliderHovered( true ), _horizontal( horizontal ),
    _draggedBySlider(false), _trayClick(false),
    _overrideBgColorEnabled( false ), _visibleFilledArea( true ),
    _overrideBgColor( 0 ), _value(0), _sliderPos(0), _lastSliderPos( 0 ),
    _drawLenght(0), _minValue(0), _maxVallue(100),
    _smallStep(10), _largeStep(50), _desiredPos(0), _lastTimeChange(0),
	_d( new Impl )
{
	_d->upButton = 0;
	_d->downButton = 0;

  _d->sliderPictureUp = Picture::load( ResourceGroup::panelBackground, 59 );
  _d->sliderPictureDown = Picture::load( ResourceGroup::panelBackground, 51 );

#ifdef _DEBUG
   setDebugName("ScrollBar");
#endif

  refreshControls_();

	setNotClipped(noclip);

	// this element can be tabbed to
	setTabStop(true);
	setTabOrder(-1);

	setPos(0);
}
Example #2
0
	//! constructor
	CGUIMenu::CGUIMenu(IGUIEnvironment* environment, IGUIElement* parent,
		SINT32 id, rect<SINT32> rectangle)
		: CGUIContextMenu(environment, parent, id, rectangle, false, true)
	{
#ifdef _DEBUG
		setDebugName("CGUIMenu");
#endif

		Type = EGUIET_MENU;

		setNotClipped(false);

		recalculateSize();
	}
Example #3
0
//! constructor
MainMenu::MainMenu( Widget* parent, const Rect& rectangle, const int id )
	: ContextMenu( parent, rectangle, id, false, true)
{
  setCloseHandling( cmIgnore );
#ifdef _DEBUG
	setDebugName( "MainMenu" );
#endif

	//const ElementStyle& style = getStyle().getSubStyle( NES_ITEM );
	setTextAlignment( alignCenter, alignCenter );

	setNotClipped(false);

	recalculateSize_();
}
//! constructor
CGUIButton::CGUIButton(IGUIEnvironment* environment, IGUIElement* parent,
			s32 id, core::rect<s32> rectangle, bool noclip)
: IGUIButton(environment, parent, id, rectangle),
	SpriteBank(0), OverrideFont(0),
	ClickTime(0), HoverTime(0), FocusTime(0),
	IsPushButton(false), Pressed(false),
	UseAlphaChannel(false), DrawBorder(true), ScaleImage(false)
{
	#ifdef _DEBUG
	setDebugName("CGUIButton");
	#endif
	setNotClipped(noclip);

	// This element can be tabbed.
	setTabStop(true);
	setTabOrder(-1);
}
Example #5
0
//! constructor
CGUIContextMenu::CGUIContextMenu(IGUIEnvironment* environment,
				IGUIElement* parent, s32 id,
				core::rect<s32> rectangle, bool getFocus, bool allowFocus)
	: IGUIContextMenu(environment, parent, id, rectangle), EventParent(0), LastFont(0),
		CloseHandling(ECMC_REMOVE), HighLighted(-1), ChangeTime(0), AllowFocus(allowFocus)
{
	#ifdef _DEBUG
	setDebugName("CGUIContextMenu");
	#endif

	Pos = rectangle.UpperLeftCorner;
	recalculateSize();

	if (getFocus)
		Environment->setFocus(this);

	setNotClipped(true);
}
Example #6
0
//! constructor
CGUIButton::CGUIButton(IGUIEnvironment* environment, IGUIElement* parent,
                       s32 id, core::rect<s32> rectangle, bool noclip)
    : IGUIButton(environment, parent, id, rectangle), Pressed(false),
      IsPushButton(false), UseAlphaChannel(false), Border(true),
      ClickTime(0), SpriteBank(0), OverrideFont(0), Image(0), PressedImage(0)
{
#ifdef _DEBUG
    setDebugName("CGUIButton");
#endif
    setNotClipped(noclip);

    // Initialize the sprites.
    for (u32 i=0; i<EGBS_COUNT; ++i)
        ButtonSprites[i].Index = -1;

    // This element can be tabbed.
    setTabStop(true);
    setTabOrder(-1);
}
	//! constructor
	CGUIScrollBar::CGUIScrollBar(bool horizontal, IGUIEnvironment* environment,
		IGUIElement* parent, SINT32 id,
		rect<SINT32> rectangle, bool noclip)
		: IGUIScrollBar(environment, parent, id, rectangle), UpButton(0),
		DownButton(0), Dragging(false), Horizontal(horizontal),
		DraggedBySlider(false), TrayClick(false), Pos(0), DrawPos(0),
		DrawHeight(0), Min(0), Max(100), SmallStep(10), LargeStep(50), DesiredPos(0),
		LastChange(0)
	{
#ifdef _DEBUG
		setDebugName("CGUIScrollBar");
#endif

		refreshControls();

		setNotClipped(noclip);

		// this element can be tabbed to
		setTabStop(true);
		setTabOrder(-1);

		setPos(0);
	}