CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
UISplitView.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
11
14
15namespace CeresEngine {
16
26 class UISplitView : public UIView {
27 public:
29 enum class DividerStyle {
31 Thick,
32
34 Thin,
35
39 };
40
41 private:
52 bool mVertical = true;
53
58
61
62 private:
65
68
69 public:
70 struct {
77
83
101
118
141
164
183
184 public:
185 using UIView::UIView;
186
189
193
199
201 ~UISplitView() override;
202
203 public:
213 void setPosition(double position, UInt32 index);
214
229
234
242 virtual UIRect getDividerRectAtIndex(UInt32 index) const;
243
249
252
255
258
261
264
267
270
271 protected:
282
283 protected: // UIView
286
289
292
295
296 public: // UIResponder
299
302
305 };
306
318
320
321} // namespace CeresEngine
An object that represents a graphics context.
Definition GraphicsContext.hpp:45
A templated UIViewController sub-class that specializes it for a specific view type.
Definition UIViewController.hpp:292
TUIViewController(Args &&... args)
Creates a new TUIViewController and instantiates a new view of type ViewType by passing args to the v...
Definition UIViewController.hpp:306
Definition UIUtility.hpp:114
A UIViewController sub-class that uses a typed represented object.
Definition UIViewController.hpp:332
Definition UISplitView.hpp:307
void didAddChildViewController(UIViewController *const childViewController) override
Instantiates a view.
void didRemoveChildViewController(UIViewController *const childViewController) override
Instantiates a view.
A view that arranges two or more views in a linear stack running horizontally or vertically.
Definition UISplitView.hpp:26
static const UInt32 kUndefinedDragIndex
A constant that represents an undefined drag index.
Definition UISplitView.hpp:64
void setVertical(bool vertical)
void mouseDown(const UIMouseEvent &event) override
Informs the receiver that the user has pressed the left mouse button.
DividerStyle
Constants that specify the style of the split view's dividers.
Definition UISplitView.hpp:29
@ Thick
A thick style divider displays between subviews.
@ Thin
A thin style divider displays between subviews.
@ PaneSplitter
A thick style divider with a 3D appearance displays between subviews.
const UIColor & getDividerColor() const noexcept
The color of the dividers that the split view draws between subviews.
Definition UISplitView.hpp:263
DividerStyle getDividerStyle() const noexcept
The style of divider between views.
Definition UISplitView.hpp:257
void adjustSubViews()
Adjusts the sizes of the split view's subviews so they (plus the dividers) fill the split view.
void setDividerStyle(DividerStyle dividerStyle)
The style of divider between views.
UISplitView()
Creates a new UISplitView with default settings.
UInt32 getDividerIndexAtPoint(const UIPoint &point) const
Computes the divider index for the view at the given point.
void didRemoveSubview(UIView &view) override
Overridden by subclasses to perform additional actions when subviews are removed to the view.
UIDelegate< UISplitView, void()> didResizeSubviews
Notifies the delegate when the split view resizes its subviews.
Definition UISplitView.hpp:82
virtual void drawDivider(UIGraphicsContext &context, const UIRect &aRect)
Draws a divider between two of the split view's subviews.
void didAddSubview(UIView &view) override
Overridden by subclasses to perform additional actions when subviews are added to the view.
struct CeresEngine::UISplitView::@62 delegate
UIDelegate< UISplitView, void()> willResizeSubviews
Notifies the delegate when the split view is about to resize its subviews.
Definition UISplitView.hpp:76
void setPosition(double position, UInt32 index)
Sets the position of the divider at the specified index.
void mouseUp(const UIMouseEvent &event) override
Informs the receiver that the user has released the left mouse button.
UIDelegate< UISplitView, double(double proposedMinimum, UInt32 dividerIndex)> constrainMinimumCoordinate
Allows the delegate to constrain the minimum coordinate limit of a divider when the user drags it.
Definition UISplitView.hpp:140
UISplitView(DividerStyle dividerStyle, const UIColor &dividerColor)
Create a new UISplitView with a custom divider style.
DividerStyle mDividerStyle
The style of divider between views.
Definition UISplitView.hpp:57
bool isSubviewCollapsed(const UIView *subView) const
Returns whether the specified view is in a collapsed state.
bool mVertical
A Boolean value that determines the geometric orientation of the split view's dividers.
Definition UISplitView.hpp:52
void mouseDragged(const UIMouseEvent &event) override
Informs the receiver that the user has moved the mouse with the left button pressed.
UISplitView(DividerStyle dividerStyle)
Create a new UISplitView with a custom divider style.
UIDelegate< UISplitView, double(double proposedPosition, UInt32 dividerIndex)> constrainSplitPosition
Allows the delegate to constrain the divider to certain positions.
Definition UISplitView.hpp:181
void draw(UIGraphicsContext &context, const UIRect &dirtyRect) override
Overridden by subclasses to draw the view's texture within the specified rectangle.
UIDelegate< UISplitView, void()> layoutSubviews
Allows the delegate to specify custom sizing behavior for the subviews of the split view.
Definition UISplitView.hpp:117
virtual UIRect getDividerRectAtIndex(UInt32 index) const
Gets the divider rect for the divider with the given index.
bool isVertical() const noexcept
A Boolean value that determines the geometric orientation of the split view's dividers.
Definition UISplitView.hpp:251
UIDelegate< UISplitView, bool(UIView *subView)> canCollapseSubview
Allows the delegate to determine whether the user can collapse and expand the specified subview.
Definition UISplitView.hpp:100
virtual double getDividerThickness() const noexcept
The thickness of the dividers for the split view.
UIDelegate< UISplitView, double(double proposedMaximum, UInt32 dividerIndex)> constrainMaximumCoordinate
Allows the delegate to constrain the maximum coordinate limit of a divider when the user drags it.
Definition UISplitView.hpp:163
UInt32 mDragIndex
The divider index currently being dragged.
Definition UISplitView.hpp:67
UIColor mDividerColor
The color of the dividers that the split view draws between subviews.
Definition UISplitView.hpp:60
void setDividerColor(const UIColor &dividerColor)
The color of the dividers that the split view draws between subviews.
~UISplitView() override
Destroys the UISplitView and releases it's subviews.
A controller that manages a view.
Definition UIViewController.hpp:24
The infrastructure for drawing and handling events in a UI.
Definition UIView.hpp:153
UIView()
Initializes new UIView object with an empty frame rectangle.
Definition Application.hpp:19
Color UIColor
Definition UIUtility.hpp:187
Rect2 UIRect
A structure that contains the location and dimensions of a rectangle.
Definition UIUtility.hpp:33
Point2 UIPoint
A type that contains a point in a two-dimensional coordinate system.
Definition UIUtility.hpp:27
std::uint32_t UInt32
Definition DataTypes.hpp:23
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Definition UIEvent.hpp:173