mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-09 01:03:51 +01:00
59fc4401f1
The commit also establishes a precedent of leaving off the `virtual` keyword in overrides. Although not strictly necessary, I believe this is good for readability because it makes it clear it is an override and not a pure virtual function, and it helps keep line lengths shorter. We should move towards eliminating the macro altogether, but the definition has been left in with a note on deprecation so that in-progress work will not suffer merge conflicts.
66 lines
1.6 KiB
C++
66 lines
1.6 KiB
C++
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
|
// This file is part of the "Irrlicht Engine".
|
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
|
|
|
#ifndef __C_GUI_CHECKBOX_H_INCLUDED__
|
|
#define __C_GUI_CHECKBOX_H_INCLUDED__
|
|
|
|
#include "IrrCompileConfig.h"
|
|
#ifdef _IRR_COMPILE_WITH_GUI_
|
|
|
|
#include "IGUICheckBox.h"
|
|
|
|
namespace irr
|
|
{
|
|
namespace gui
|
|
{
|
|
|
|
class CGUICheckBox : public IGUICheckBox
|
|
{
|
|
public:
|
|
|
|
//! constructor
|
|
CGUICheckBox(bool checked, IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle);
|
|
|
|
//! set if box is checked
|
|
void setChecked(bool checked) override;
|
|
|
|
//! returns if box is checked
|
|
bool isChecked() const override;
|
|
|
|
//! Sets whether to draw the background
|
|
void setDrawBackground(bool draw) override;
|
|
|
|
//! Checks if background drawing is enabled
|
|
/** \return true if background drawing is enabled, false otherwise */
|
|
bool isDrawBackgroundEnabled() const override;
|
|
|
|
//! Sets whether to draw the border
|
|
void setDrawBorder(bool draw) override;
|
|
|
|
//! Checks if border drawing is enabled
|
|
/** \return true if border drawing is enabled, false otherwise */
|
|
bool isDrawBorderEnabled() const override;
|
|
|
|
//! called if an event happened.
|
|
bool OnEvent(const SEvent& event) override;
|
|
|
|
//! draws the element and its children
|
|
void draw() override;
|
|
|
|
private:
|
|
|
|
u32 CheckTime;
|
|
bool Pressed;
|
|
bool Checked;
|
|
bool Border;
|
|
bool Background;
|
|
};
|
|
|
|
} // end namespace gui
|
|
} // end namespace irr
|
|
|
|
#endif // __C_GUI_CHECKBOX_H_INCLUDED__
|
|
|
|
#endif // _IRR_COMPILE_WITH_GUI_
|