File ImGuiDockspace.h¶
Defines
-
IMGUI_DEFINE_MATH_OPERATORS
¶
-
namespace
Gsage
-
Enums
-
class
Dock
Public Types
Public Functions
-
Dock
(const char *label, const ImGuiDockspaceStyle &mStyle)¶
-
virtual
~Dock
()¶
-
void
reset
()¶ Called when dock is detached
-
void
activateOther
()¶ Activate any other tab if there is one Descending order is preferable
-
bool
isContainer
() const¶ Check if dock is container should have any children present
-
bool
hasBothChildren
() const¶ Check if container has both children open
-
bool
bothChildrenVisible
() const¶ Check if both children are visible
-
void
updateChildren
()¶ Update children in container
Update dimensions, positions and draw splits
-
void
setDimensions
(ImVec2 pos, ImVec2 size)¶ Update dock dimensions
- Parameters
pos
: Positionsize
: Size
-
float
getRatio
() const¶ Get first dock scale ratio
-
void
setRatio
(float ratio)¶ Set first dock scale ratio
- Parameters
ratio
: from 0 to 1
-
const ImVec2 &
getPosition
() const¶ Get position
-
const ImVec2 &
getSize
() const¶ Get size
-
bool
getOpened
() const¶ Check if dock is opened
-
bool
anyTabOpen
() const¶ Check if this tab or any next tab is open
-
void
setOpened
(bool value)¶ Change opened state for dock
- Parameters
value
:
-
bool
getActive
() const¶ Check if dock is active (tab wise)
-
void
setActive
(bool value)¶ Set dock as active
- Parameters
value
:
-
bool
visible
() const¶ Check if the dock should be drawn
-
bool
docked
() const¶ Is docked to anything
-
void
addChild
(DockPtr child)¶ Add child to location defined in child itself
- Parameters
child
: DockPtr
-
void
addChildAt
(DockPtr child, Location location)¶ Add child to container at location
- Parameters
child
: DockPtrlocation
: Location
-
const char *
getLabel
() const¶ Get dock label
-
const char *
getTitle
() const¶ Get dock title
-
const ImRect &
getBoundingRect
() const¶ Get bounding rect
Private Members
-
char *
mLabel
¶
-
char *
mTitle
¶
-
ImVec2
mPos
¶
-
ImVec2
mSize
¶
-
ImRect
mBounds
¶
-
bool
mActive
¶
-
bool
mOpened
¶
-
bool
mRendered
¶
-
bool
mResized
¶
-
bool
mDirty
¶
-
float
mRatio
¶
-
int
mFlags
¶
-
const ImGuiDockspaceStyle &
mStyle
¶
Friends
-
friend
Gsage::ImGuiDockspace
-
friend
Gsage::ImGuiDockspaceRenderer
-
-
class
ImGuiDockspace
- #include <ImGuiDockspace.h>
Imgui dockspace
Public Functions
-
ImGuiDockspace
()¶
-
ImGuiDockspace
(const ImGuiDockspaceStyle &style)¶
-
virtual
~ImGuiDockspace
()¶
-
ImGuiDockspaceState
getState
()¶ Get dockspace state
- Return
current ImGuiDockspaceState
-
void
setState
(ImGuiDockspaceState state)¶ Set dockspace state
- Parameters
state
: ImGuiDockspaceState
-
void
setDimensions
(ImVec2 pos, ImVec2 size)¶ Update dockspace position and dimensions
- Parameters
pos
: Positionsize
: Size
-
void
updateLayout
()¶ Update layout
-
bool
dockTo
(const char *label, DockPtr dock, Dock::Location location)¶ Dock window
- Parameters
label
: parent dock labellocation
: location to dock to
-
bool
undock
(DockPtr dock, bool destroy = false)¶ Undock dock from any kind of container
- Parameters
dock
: DockPtrdestroy
: removes dock object completely, clearing the dock state
-
bool
undock
(const char *label, bool destroy = false)¶ Undock dock from any kind of container
- Parameters
label
: dock labeldestroy
: removes dock object completely, clearing the dock state
-
DockPtr
getDock
(const char *label)¶ Get window state calculated by updateLayout call
- Parameters
label
: identifies window uniquely
-
DockPtr
createDock
(const char *label, bool opened = true, bool active = true)¶ Create new dock
- Parameters
label
: dock label
-
void
addChild
(DockPtr container, DockPtr child)¶ Add child dock to container
- Parameters
container
:child
:
-
void
reset
()¶ Reset dockspace, remove all docks
Private Types
Friends
-
friend
Gsage::ImGuiDockspaceRenderer
-
-
class
ImGuiDockspaceRenderer
- #include <ImGuiDockspace.h>
Dockspace for ImGUI.
Provides alternate methods for
Begin
andEnd
. Docked view should be surrounded byBeginDock
andEndDock
methods.local flags = 0 local active, open = imgui.BeginDockOpen("test", true, flags) if active and open then -- render some view here imgui.TextWrapped("Hello World!") end imgui.EndDock()
Saving and loading dockspace state:
-- save dock state (will get lua table) local savedState = imgui.GetDockState() ... -- restore dock state imgui.SetDockState(savedState)
Public Functions
-
ImGuiDockspaceRenderer
()¶
-
ImGuiDockspaceRenderer
(const ImGuiDockspaceStyle &style)¶
-
virtual
~ImGuiDockspaceRenderer
()¶
-
void
beginWorkspace
(ImVec2 pos, ImVec2 size)¶ Must be called before rendering all windows
-
bool
begin
(const char *label, bool *opened, ImGuiWindowFlags windowFlags)¶ Begin rendering
- Parameters
label
: Window labelopened
: Pointer to boolwindowFlags
: additional window flags
-
bool
begin
(const char *label, const char *title, bool *opened, ImGuiWindowFlags windowFlags, int dockFlags)¶ Begin rendering
- Parameters
label
: Window labelopened
: Pointer to boolwindowFlags
: additional window flagsdockFlags
: additional dock flags
-
bool
begin
(const char *label, const char *title, bool *opened, ImGuiWindowFlags windowFlags)¶ Begin rendering
- Parameters
label
: Window labeltitle
: Actual window nameopened
: Pointer to boolwindowFlags
: additional window flags
-
void
end
()¶ End rendering
-
void
endWorkspace
(bool cleanup = false)¶ Must be called after rendering all windows
- Parameters
cleanup
: do cleanup of docks that were not rendered this time
-
ImGuiDockspaceState
getState
()¶ Get workspace state
-
void
setState
(const ImGuiDockspaceState &state)¶ Set workspace state
- Parameters
state
:
Private Types
-
typedef std::map<std::string, bool>
Windows
¶
Private Members
-
ImGuiDockspace
mDockspace
¶
-
ImGuiDockspaceStyle
mStyle
¶
-
EndCommand
mEndCommand
¶
-
ImVec2
mPos
¶
-
ImVec2
mSize
¶
-
bool
mPopClipRect
¶
-
bool
mStateWasUpdated
¶
-
-
struct
ImGuiDockspaceStyle
¶ Public Members
-
float
splitterThickness
¶
-
float
tabbarHeight
¶
-
float
tabbarTextMargin
¶
-
float
tabbarPadding
¶
-
float
windowRounding
¶
-
ImU32
windowBGColor
¶
-
ImU32
tabInactiveColor
¶
-
ImU32
tabActiveColor
¶
-
ImU32
tabHoveredColor
¶
-
ImU32
textColor
¶
-
ImU32
splitterHoveredColor
¶
-
ImU32
splitterNormalColor
¶
-
ImU32
dockSlotHoveredColor
¶
-
ImU32
dockSlotNormalColor
¶
-
DockSlotPreviewStyle
dockSlotPreview
¶
-
float
-
class