add doxygen via opencode
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
/*! \file piscreentile.h
|
||||
* \ingroup Console
|
||||
* \~\brief
|
||||
* \~english Basic PIScreen tile
|
||||
* \~russian Базовый тайл для PIScreen
|
||||
*/
|
||||
//! \file piscreentile.h
|
||||
//! \ingroup Console
|
||||
//! \brief
|
||||
//! \~english Basic PIScreen tile
|
||||
//! \~russian Базовый тайл для PIScreen
|
||||
//! \details
|
||||
//! \~english Base class for all screen tiles providing layout and event handling.
|
||||
//! \~russian Базовый класс для всех экранных тайлов, обеспечивающий компоновку и обработку событий.
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Basic PIScreen tile
|
||||
@@ -32,27 +34,89 @@
|
||||
|
||||
class PIScreenDrawer;
|
||||
|
||||
//! \brief
|
||||
//! \~english Base tile class for console screen
|
||||
//! \~russian Базовый класс тайла для консольного экрана
|
||||
|
||||
class PIP_CONSOLE_EXPORT PIScreenTile: public PIObject {
|
||||
friend class PIScreen;
|
||||
PIOBJECT_SUBCLASS(PIScreenTile, PIObject);
|
||||
|
||||
public:
|
||||
//! \brief
|
||||
//! \~english Constructs PIScreenTile
|
||||
//! \~russian Создает PIScreenTile
|
||||
//! \param n Tile name / Имя тайла
|
||||
//! \param d Layout direction / Направление компоновки
|
||||
//! \param p Size policy / Политика размера
|
||||
PIScreenTile(const PIString & n = PIString(),
|
||||
PIScreenTypes::Direction d = PIScreenTypes::Vertical,
|
||||
PIScreenTypes::SizePolicy p = PIScreenTypes::Preferred);
|
||||
|
||||
//! \brief
|
||||
//! \~english Destructor
|
||||
//! \~russian Деструктор
|
||||
virtual ~PIScreenTile();
|
||||
|
||||
//! \brief
|
||||
//! \~english Adds child tile
|
||||
//! \~russian Добавляет дочерний тайл
|
||||
void addTile(PIScreenTile * t);
|
||||
|
||||
//! \brief
|
||||
//! \~english Takes ownership of tile
|
||||
//! \~russian Забирает владение тайла
|
||||
void takeTile(PIScreenTile * t);
|
||||
|
||||
//! \brief
|
||||
//! \~english Removes child tile
|
||||
//! \~russian Удаляет дочерний тайл
|
||||
void removeTile(PIScreenTile * t);
|
||||
|
||||
//! \brief
|
||||
//! \~english Returns parent tile
|
||||
//! \~russian Возвращает родительский тайл
|
||||
PIScreenTile * parentTile() const { return parent; }
|
||||
|
||||
//! \brief
|
||||
//! \~english Returns child tiles
|
||||
//! \~russian Возвращает дочерние тайлы
|
||||
//! \param only_visible Only visible tiles / Только видимые тайлы
|
||||
PIVector<PIScreenTile *> children(bool only_visible = false);
|
||||
|
||||
//! \brief
|
||||
//! \~english Returns child under mouse position
|
||||
//! \~russian Возвращает тайл под мышью
|
||||
PIScreenTile * childUnderMouse(int x, int y);
|
||||
|
||||
//! \brief
|
||||
//! \~english Shows tile
|
||||
//! \~russian Показывает тайл
|
||||
void show() { visible = true; }
|
||||
|
||||
//! \brief
|
||||
//! \~english Hides tile
|
||||
//! \~russian Скрывает тайл
|
||||
void hide() { visible = false; }
|
||||
|
||||
//! \brief
|
||||
//! \~english Sets focus to this tile
|
||||
//! \~russian Устанавливает фокус на этот тайл
|
||||
void setFocus();
|
||||
|
||||
//! \brief
|
||||
//! \~english Checks if tile has focus
|
||||
//! \~russian Проверяет, имеет ли тайл фокус
|
||||
bool hasFocus() const { return has_focus; }
|
||||
|
||||
//! \brief
|
||||
//! \~english Sets all margins
|
||||
//! \~russian Устанавливает все отступы
|
||||
void setMargins(int m) { marginLeft = marginRight = marginTop = marginBottom = m; }
|
||||
|
||||
//! \brief
|
||||
//! \~english Sets individual margins
|
||||
//! \~russian Устанавливает отдельные отступы
|
||||
void setMargins(int l, int r, int t, int b) {
|
||||
marginLeft = l;
|
||||
marginRight = r;
|
||||
@@ -60,9 +124,24 @@ public:
|
||||
marginBottom = b;
|
||||
}
|
||||
|
||||
//! \brief
|
||||
//! \~english Returns tile X position
|
||||
//! \~russian Возвращает позицию X тайла
|
||||
int x() const { return x_; }
|
||||
|
||||
//! \brief
|
||||
//! \~english Returns tile Y position
|
||||
//! \~russian Возвращает позицию Y тайла
|
||||
int y() const { return y_; }
|
||||
|
||||
//! \brief
|
||||
//! \~english Returns tile width
|
||||
//! \~russian Возвращает ширину тайла
|
||||
int width() const { return width_; }
|
||||
|
||||
//! \brief
|
||||
//! \~english Returns tile height
|
||||
//! \~russian Возвращает высоту тайла
|
||||
int height() const { return height_; }
|
||||
|
||||
PIScreenTypes::Direction direction;
|
||||
@@ -77,29 +156,64 @@ public:
|
||||
bool visible;
|
||||
|
||||
protected:
|
||||
//! Returns desired tile size in "w" and "h"
|
||||
//! \brief
|
||||
//! \~english Returns desired tile size in "w" and "h"
|
||||
//! \~russian Возвращает желаемый размер тайла в "w" и "h"
|
||||
virtual void sizeHint(int & w, int & h) const;
|
||||
|
||||
//! Tile has been resized to "w"x"h"
|
||||
//! \brief
|
||||
//! \~english Tile has been resized to "w"x"h"
|
||||
//! \~russian Тайл был изменен на "w"x"h"
|
||||
virtual void resizeEvent(int w, int h) {}
|
||||
|
||||
//! Draw tile with drawer "d" in world-space coordinates
|
||||
//! \brief
|
||||
//! \~english Draw tile with drawer "d" in world-space coordinates
|
||||
//! \~russian Рисует тайл отрисовщиком "d" в мировых координатах
|
||||
virtual void drawEvent(PIScreenDrawer * d) {}
|
||||
|
||||
//! Return "true" if you process key
|
||||
//! \brief
|
||||
//! \~english Return "true" if you process key
|
||||
//! \~russian Возвращает "true" если вы обрабатываете клавишу
|
||||
virtual bool keyEvent(PIKbdListener::KeyEvent key) { return false; }
|
||||
|
||||
//! Return "true" if you process event
|
||||
//! \brief
|
||||
//! \~english Return "true" if you process event
|
||||
//! \~russian Возвращает "true" если вы обрабатываете событие
|
||||
virtual bool mouseEvent(PIKbdListener::MouseEvent me) { return false; }
|
||||
|
||||
//! Return "true" if you process wheel
|
||||
//! \brief
|
||||
//! \~english Return "true" if you process wheel
|
||||
//! \~russian Возвращает "true" если вы обрабатываете колесо
|
||||
virtual bool wheelEvent(PIKbdListener::WheelEvent we) { return false; }
|
||||
|
||||
//! \brief
|
||||
//! \~english Raises tile event
|
||||
//! \~russian Вызывает событие тайла
|
||||
void raiseEvent(PIScreenTypes::TileEvent e);
|
||||
|
||||
//! \brief
|
||||
//! \~english Sets screen reference
|
||||
//! \~russian Устанавливает ссылку на экран
|
||||
void setScreen(PIScreenTypes::PIScreenBase * s);
|
||||
|
||||
//! \brief
|
||||
//! \~english Deletes all children
|
||||
//! \~russian Удаляет всех потомков
|
||||
void deleteChildren();
|
||||
|
||||
//! \brief
|
||||
//! \~english Internal draw event
|
||||
//! \~russian Внутреннее событие отрисовки
|
||||
void drawEventInternal(PIScreenDrawer * d);
|
||||
|
||||
//! \brief
|
||||
//! \~english Performs layout
|
||||
//! \~russian Выполняет компоновку
|
||||
void layout();
|
||||
|
||||
//! \brief
|
||||
//! \~english Checks if layout is needed
|
||||
//! \~russian Проверяет, нужна ли компоновка
|
||||
bool needLayout() { return size_policy != PIScreenTypes::Ignore; }
|
||||
|
||||
PIVector<PIScreenTile *> tiles;
|
||||
|
||||
Reference in New Issue
Block a user