PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: Box.h * 00003 * 00004 * Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLGUI_BOX_H__ 00024 #define __PLGUI_BOX_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLGui/Widgets/Widget.h" 00032 00033 00034 //[-------------------------------------------------------] 00035 //[ Namespace ] 00036 //[-------------------------------------------------------] 00037 namespace PLGui { 00038 00039 00040 //[-------------------------------------------------------] 00041 //[ Forward declarations ] 00042 //[-------------------------------------------------------] 00043 class LayoutBox; 00044 00045 00046 //[-------------------------------------------------------] 00047 //[ Classes ] 00048 //[-------------------------------------------------------] 00049 /** 00050 * @brief 00051 * Box container widget (using LayoutBox) 00052 */ 00053 class Box : public Widget { 00054 00055 00056 //[-------------------------------------------------------] 00057 //[ Class definition ] 00058 //[-------------------------------------------------------] 00059 pl_class(PLGUI_RTTI_EXPORT, Box, "PLGui", PLGui::Widget, "Box container widget (using LayoutBox)") 00060 // Attributes 00061 pl_attribute(Orientation, pl_enum_type(EOrientation), Horizontal, ReadWrite, GetSet, "Box orientation", "") 00062 // Constructors 00063 pl_constructor_0(DefaultConstructor, "Default constructor", "") 00064 pl_class_end 00065 00066 00067 //[-------------------------------------------------------] 00068 //[ Public functions ] 00069 //[-------------------------------------------------------] 00070 public: 00071 /** 00072 * @brief 00073 * Constructor 00074 * 00075 * @param[in] pParent 00076 * Pointer to parent widget 00077 * @param[in] nOrientation 00078 * Orientation 00079 */ 00080 PLGUI_API Box(Widget *pParent = nullptr, EOrientation nOrientation = Horizontal); 00081 00082 /** 00083 * @brief 00084 * Destructor 00085 */ 00086 PLGUI_API virtual ~Box(); 00087 00088 /** 00089 * @brief 00090 * Get orientation of box 00091 * 00092 * @return 00093 * Orientation 00094 */ 00095 PLGUI_API EOrientation GetOrientation() const; 00096 00097 /** 00098 * @brief 00099 * Set orientation of box 00100 * 00101 * @param[in] nOrientation 00102 * Orientation 00103 */ 00104 PLGUI_API void SetOrientation(EOrientation nOrientation); 00105 00106 00107 //[-------------------------------------------------------] 00108 //[ Private virtual Widget functions ] 00109 //[-------------------------------------------------------] 00110 private: 00111 virtual PLMath::Vector2i OnPreferredSize(const PLMath::Vector2i &vRefSize) const override; 00112 00113 00114 //[-------------------------------------------------------] 00115 //[ Protected data ] 00116 //[-------------------------------------------------------] 00117 protected: 00118 LayoutBox *m_pBoxLayout; /**< Box layout */ 00119 00120 00121 }; 00122 00123 00124 //[-------------------------------------------------------] 00125 //[ Namespace ] 00126 //[-------------------------------------------------------] 00127 } // PLGui 00128 00129 00130 #endif // __PLGUI_BOX_H__
|