64 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			64 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
// Copyright (c) 2023 Dominic Masters
 | 
						|
// 
 | 
						|
// This software is released under the MIT License.
 | 
						|
// https://opensource.org/licenses/MIT
 | 
						|
 | 
						|
#pragma once
 | 
						|
#include "ui/UIElement.hpp"
 | 
						|
 | 
						|
namespace Dawn {
 | 
						|
  class UIMenu final : public UIElement {
 | 
						|
    private:
 | 
						|
      int32_t x = 0;
 | 
						|
      int32_t y = 0;
 | 
						|
      int32_t columns = 1;
 | 
						|
      int32_t rows = 1;
 | 
						|
 | 
						|
    public:
 | 
						|
      Event<int32_t, int32_t> eventPositionChanged;
 | 
						|
 | 
						|
      /**
 | 
						|
       * Sets the position of this menu.
 | 
						|
       * 
 | 
						|
       * @param x The x position of this menu.
 | 
						|
       * @param y The y position of this menu.
 | 
						|
       */
 | 
						|
      void setPosition(int32_t x, int32_t y);
 | 
						|
 | 
						|
      /**
 | 
						|
       * Sets the size of this menu.
 | 
						|
       * 
 | 
						|
       * @param columns The number of columns in this menu.
 | 
						|
       * @param rows The number of rows in this menu.
 | 
						|
       */
 | 
						|
      void setSize(int32_t columns, int32_t rows);
 | 
						|
 | 
						|
      /**
 | 
						|
       * Gets the x position of this menu.
 | 
						|
       * 
 | 
						|
       * @return The x position of this menu.
 | 
						|
       */
 | 
						|
      int32_t getX();
 | 
						|
 | 
						|
      /**
 | 
						|
       * Gets the y position of this menu.
 | 
						|
       * 
 | 
						|
       * @return The y position of this menu.
 | 
						|
       */
 | 
						|
      int32_t getY();
 | 
						|
 | 
						|
      /**
 | 
						|
       * Gets the number of columns in this menu.
 | 
						|
       * 
 | 
						|
       * @return The number of columns in this menu.
 | 
						|
       */
 | 
						|
      int32_t getColumns();
 | 
						|
 | 
						|
      /**
 | 
						|
       * Gets the number of rows in this menu.
 | 
						|
       * 
 | 
						|
       * @return The number of rows in this menu.
 | 
						|
       */
 | 
						|
      int32_t getRows();
 | 
						|
  };
 | 
						|
} |