TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::DocumentSet Struct Reference

The documents one main window shows, in tab order, and which one is active. More...

#include <gui_controls/gui_docking_types.h>

Classes

struct  Internal
 Kept by the documents; not part of the API. More...

Public Member Functions

Document * Active ()
 The shown document; null when there are none.
const Document * Active () const

Public Attributes

std::vector< std::unique_ptr< Document > > documents
 Boxed, so a document's layout keeps its address (torn-off panels refer to it).
int active = 0
 index of the shown document
std::function< void()> onNew
 The "+" after the last tab; none when unset.
std::function< bool(Document &)> onClose
 Asked before a document is closed from its tab: false keeps it open (to ask about unsaved changes first, then CloseDocument).
std::function< void(std::unique_ptr< Document >, tachyon::int2)> onTearOff
 A tab dropped outside every document bar: the document, taken out of the set, for a new main window (its own DocumentSet) at the screen position the tab was dropped at.
struct tachyon::DocumentSet::Internal internal
 not part of the API

Detailed Description

The documents one main window shows, in tab order, and which one is active.

Document& forest = CreateDocument(documents, "Forest", ".level", "level", levelIcon);
CreatePanel(forest.layout.panels, ...);   forest.layout.root = MakeLeaf({ ... });

// In OnGUI, under the title bar:
Documents(documentsID, documents); 

Member Function Documentation

◆ Active() [1/2]

Document * tachyon::DocumentSet::Active ( )
inline

The shown document; null when there are none.

◆ Active() [2/2]

const Document * tachyon::DocumentSet::Active ( ) const
inline

Member Data Documentation

◆ documents

std::vector<std::unique_ptr<Document> > tachyon::DocumentSet::documents

Boxed, so a document's layout keeps its address (torn-off panels refer to it).

◆ active

int tachyon::DocumentSet::active = 0

index of the shown document

◆ onNew

std::function<void()> tachyon::DocumentSet::onNew

The "+" after the last tab; none when unset.

◆ onClose

std::function<bool(Document&)> tachyon::DocumentSet::onClose

Asked before a document is closed from its tab: false keeps it open (to ask about unsaved changes first, then CloseDocument).

Unset: it closes.

◆ onTearOff

std::function<void(std::unique_ptr<Document>, tachyon::int2)> tachyon::DocumentSet::onTearOff

A tab dropped outside every document bar: the document, taken out of the set, for a new main window (its own DocumentSet) at the screen position the tab was dropped at.

Unset: the tab goes back.

◆ internal

struct tachyon::DocumentSet::Internal tachyon::DocumentSet::internal

not part of the API


The documentation for this struct was generated from the following file: