Skip to content

Commit

Permalink
Update docs / 2024-01-09 / 17:53:10
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Jan 9, 2024
1 parent eb2c32b commit 963c4b0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
18 changes: 13 additions & 5 deletions docs/book/_sources/doc_params.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ struct RunnerCallbacks
// EdgesToolbars: A map that contains the definition of toolbars
// that can be placed on the edges of the App window
std::map<EdgeToolbarType, EdgeToolbar> edgesToolbars;
void AddEdgeToolbar(EdgeToolbarType edgeToolbarType,
VoidFunction callback,
const EdgeToolbarOptions& options = EdgeToolbarOptions());


// --------------- Startup sequence callbacks -------------------
Expand Down Expand Up @@ -387,12 +390,8 @@ enum class EdgeToolbarType
Right
};

// EdgeToolbar :a toolbar that can be placed on the edges of the App window
// It will be placed in a non-dockable window
struct EdgeToolbar
struct EdgeToolbarOptions
{
VoidFunction ShowToolbar = EmptyVoidFunction();

// height or width the top toolbar, in em units
// (i.e. multiples of the default font size, to be Dpi aware)
float sizeEm = 2.5f;
Expand All @@ -404,6 +403,15 @@ struct EdgeToolbar
ImVec4 WindowBg = ImVec4(0.f, 0.f, 0.f, 0.f);
};


// EdgeToolbar :a toolbar that can be placed on the edges of the App window
// It will be placed in a non-dockable window
struct EdgeToolbar
{
VoidFunction ShowToolbar = EmptyVoidFunction();
EdgeToolbarOptions options;
};

std::vector<EdgeToolbarType> AllEdgeToolbarTypes();
std::string EdgeToolbarTypeName(EdgeToolbarType e);
```
Expand Down
18 changes: 13 additions & 5 deletions docs/book/doc_params.html
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,9 @@ <h1>Runner callbacks<a class="headerlink" href="#runner-callbacks" title="Permal
<span class="w"> </span><span class="c1">// EdgesToolbars: A map that contains the definition of toolbars</span>
<span class="w"> </span><span class="c1">// that can be placed on the edges of the App window</span>
<span class="w"> </span><span class="n">std</span><span class="o">::</span><span class="n">map</span><span class="o">&lt;</span><span class="n">EdgeToolbarType</span><span class="p">,</span><span class="w"> </span><span class="n">EdgeToolbar</span><span class="o">&gt;</span><span class="w"> </span><span class="n">edgesToolbars</span><span class="p">;</span>
<span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="nf">AddEdgeToolbar</span><span class="p">(</span><span class="n">EdgeToolbarType</span><span class="w"> </span><span class="n">edgeToolbarType</span><span class="p">,</span>
<span class="w"> </span><span class="n">VoidFunction</span><span class="w"> </span><span class="n">callback</span><span class="p">,</span>
<span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="n">EdgeToolbarOptions</span><span class="o">&amp;</span><span class="w"> </span><span class="n">options</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">EdgeToolbarOptions</span><span class="p">());</span>


<span class="w"> </span><span class="c1">// --------------- Startup sequence callbacks -------------------</span>
Expand Down Expand Up @@ -810,12 +813,8 @@ <h2>Edge Toolbars Callbacks<a class="headerlink" href="#edge-toolbars-callbacks"
<span class="w"> </span><span class="n">Right</span>
<span class="p">};</span>

<span class="c1">// EdgeToolbar :a toolbar that can be placed on the edges of the App window</span>
<span class="c1">// It will be placed in a non-dockable window</span>
<span class="k">struct</span><span class="w"> </span><span class="nc">EdgeToolbar</span>
<span class="k">struct</span><span class="w"> </span><span class="nc">EdgeToolbarOptions</span>
<span class="p">{</span>
<span class="w"> </span><span class="n">VoidFunction</span><span class="w"> </span><span class="n">ShowToolbar</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">EmptyVoidFunction</span><span class="p">();</span>

<span class="w"> </span><span class="c1">// height or width the top toolbar, in em units</span>
<span class="w"> </span><span class="c1">// (i.e. multiples of the default font size, to be Dpi aware)</span>
<span class="w"> </span><span class="kt">float</span><span class="w"> </span><span class="n">sizeEm</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">2.5f</span><span class="p">;</span>
Expand All @@ -827,6 +826,15 @@ <h2>Edge Toolbars Callbacks<a class="headerlink" href="#edge-toolbars-callbacks"
<span class="w"> </span><span class="n">ImVec4</span><span class="w"> </span><span class="n">WindowBg</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ImVec4</span><span class="p">(</span><span class="mf">0.f</span><span class="p">,</span><span class="w"> </span><span class="mf">0.f</span><span class="p">,</span><span class="w"> </span><span class="mf">0.f</span><span class="p">,</span><span class="w"> </span><span class="mf">0.f</span><span class="p">);</span>
<span class="p">};</span>


<span class="c1">// EdgeToolbar :a toolbar that can be placed on the edges of the App window</span>
<span class="c1">// It will be placed in a non-dockable window</span>
<span class="k">struct</span><span class="w"> </span><span class="nc">EdgeToolbar</span>
<span class="p">{</span>
<span class="w"> </span><span class="n">VoidFunction</span><span class="w"> </span><span class="n">ShowToolbar</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">EmptyVoidFunction</span><span class="p">();</span>
<span class="w"> </span><span class="n">EdgeToolbarOptions</span><span class="w"> </span><span class="n">options</span><span class="p">;</span>
<span class="p">};</span>

<span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">EdgeToolbarType</span><span class="o">&gt;</span><span class="w"> </span><span class="n">AllEdgeToolbarTypes</span><span class="p">();</span>
<span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="w"> </span><span class="nf">EdgeToolbarTypeName</span><span class="p">(</span><span class="n">EdgeToolbarType</span><span class="w"> </span><span class="n">e</span><span class="p">);</span>
</pre></div>
Expand Down
Loading

0 comments on commit 963c4b0

Please sign in to comment.