ArcdpsExtension
 
Loading...
Searching...
No Matches
ArcdpsExtension::DemoWindow Class Referencefinal

#include <DemoWindow.h>

Inheritance diagram for ArcdpsExtension::DemoWindow:
Collaboration diagram for ArcdpsExtension::DemoWindow:

Public Member Functions

 DemoWindow ()
 
bool & GetOpenVar () override
 
void SetMaxHeightCursorPos (float pNewCursorPos=ImGui::GetCursorPosY()) override
 
bool & GetShowScrollbar () override
 
- Public Member Functions inherited from ArcdpsExtension::MainWindow
 MainWindow ()=default
 
virtual ~MainWindow ()
 
 MainWindow (const MainWindow &other)=delete
 
 MainWindow (MainWindow &&other) noexcept=delete
 
MainWindowoperator= (const MainWindow &other)=delete
 
MainWindowoperator= (MainWindow &&other) noexcept=delete
 
virtual void Draw (ImGuiWindowFlags imGuiWindowFlags=0, MainWindowFlags mainWindowFlags=0)
 
virtual void Init ()
 
void DrawOptionCheckbox ()
 
ImGuiWindow * GetInnerWindow ()
 
template<typename T >
requires std::is_base_of_v<ComponentBase, T>
void CreateComponent ()
 
void RegisterPreDrawHook (PreDrawHookFunction pFun)
 
void RegisterContextMenuHook (ContextMenuHookFunction pFun)
 
void RegisterContentHook (DrawContentHookFunction pFun)
 
void RegisterInitHook (InitHookFunction pFun)
 
void RegisterDrawStyleSubMenuHook (DrawStyleSubMenuHookFunction pFun)
 
float GetMaxCursorPos ()
 
- Public Member Functions inherited from ArcdpsExtension::Singleton< DemoWindow >
 ~Singleton () override
 
- Public Member Functions inherited from ArcdpsExtension::BaseSingleton
virtual ~BaseSingleton ()=default
 

Protected Member Functions

void DrawContextMenu () override
 
void DrawContent () override
 
const std::string & getTitleDefault () override
 
std::optional< std::string > & getTitle () override
 
const std::string & getWindowID () override
 
bool & getShowTitleBar () override
 
bool & getShowBackground () override
 
std::optional< ImVec2 > & getPadding () override
 
SizingPolicygetSizingPolicy () override
 
bool getMaxHeightActive () override
 
std::optional< std::string > & getAppearAsInOption () override
 
const std::string & getAppearAsInOptionDefault () override
 
void DrawStyleSettingsSubMenu () override
 
- Protected Member Functions inherited from ArcdpsExtension::MainWindow
virtual void DrawSizingPolicySubSettings (SizingPolicy sizingPolicy)
 
virtual gwlanguage getCurrentLanguage ()
 
virtual bool KeyBindPressed ()
 

Additional Inherited Members

- Public Types inherited from ArcdpsExtension::MainWindow
typedef std::function< void(ImGuiWindowFlags &)> PreDrawHookFunction
 
typedef std::function< void()> ContextMenuHookFunction
 
typedef std::function< void()> DrawContentHookFunction
 
typedef std::function< void()> InitHookFunction
 
typedef std::function< void()> DrawStyleSubMenuHookFunction
 
- Static Public Member Functions inherited from ArcdpsExtension::Singleton< DemoWindow >
static T2 & instance ()
 
static T2 & init (Args &&... args)
 
static void f (std::function< void(T2 &)> action)
 
static void f (std::function< void(DemoWindow &)> action)
 
static void reset ()
 
- Static Protected Member Functions inherited from ArcdpsExtension::BaseSingleton
static BaseSingletonStore (std::unique_ptr< BaseSingleton > &&ptr)
 
static void Clear (BaseSingleton *ptr)
 
- Protected Attributes inherited from ArcdpsExtension::MainWindow
ImGuiWindow * mThisWindow = nullptr
 

Constructor & Destructor Documentation

◆ DemoWindow()

ArcdpsExtension::DemoWindow::DemoWindow ( )

Member Function Documentation

◆ DrawContent()

void ArcdpsExtension::DemoWindow::DrawContent ( )
overrideprotectedvirtual

Called when the content of the Window should be drawn. This is the main function to draw into the window.

Implements ArcdpsExtension::MainWindow.

◆ DrawContextMenu()

void ArcdpsExtension::DemoWindow::DrawContextMenu ( )
overrideprotectedvirtual

Subcall inside context menu to add more things to it. Will be called at the beginning of the ContextMenu.

Implements ArcdpsExtension::MainWindow.

◆ DrawStyleSettingsSubMenu()

void ArcdpsExtension::DemoWindow::DrawStyleSettingsSubMenu ( )
overrideprotectedvirtual

This can be called to draw the SubMenu of the "Style". It will only draw the submenu and not the Menu option itself.

It is called by default at the bottom of the context menu. You can disable that by setting the flag MainWindowFlags_NoPositionMenu

Reimplemented from ArcdpsExtension::MainWindow.

◆ getAppearAsInOption()

std::optional< std::string > & ArcdpsExtension::DemoWindow::getAppearAsInOption ( )
overrideprotectedvirtual

Get the name of this window in the arcdps options. This has to return a string, else ImGui will cause an assert failure. This is set in the options

Implements ArcdpsExtension::MainWindow.

◆ getAppearAsInOptionDefault()

const std::string & ArcdpsExtension::DemoWindow::getAppearAsInOptionDefault ( )
overrideprotectedvirtual

Default for appear as in option, if the optional there is nullopt.

Implements ArcdpsExtension::MainWindow.

◆ getMaxHeightActive()

bool ArcdpsExtension::DemoWindow::getMaxHeightActive ( )
overrideprotectedvirtual

Check if the window should have a maximal height. If this is true, the variable set with SetMaxHeightCursorPos will be used to determine the max-height. This has to be tracked by the implementation, cause this window has no idea what it's content looks like.

Reimplemented from ArcdpsExtension::MainWindow.

◆ GetOpenVar()

bool & ArcdpsExtension::DemoWindow::GetOpenVar ( )
overridevirtual

◆ getPadding()

std::optional< ImVec2 > & ArcdpsExtension::DemoWindow::getPadding ( )
overrideprotectedvirtual

This padding is optional, if the optional is not set, no change to the window padding is applied. Default should be nullopt.

Implements ArcdpsExtension::MainWindow.

◆ getShowBackground()

bool & ArcdpsExtension::DemoWindow::getShowBackground ( )
overrideprotectedvirtual

This has to be true to show the background. Therefore setting it to true by default is recommended.

Implements ArcdpsExtension::MainWindow.

◆ GetShowScrollbar()

bool & ArcdpsExtension::DemoWindow::GetShowScrollbar ( )
overridevirtual

This has to be true to show the scrollbar. Therefore setting it to true by default is recommended. A scrollbar is only shown when the window is bigger than it's content.

Implements ArcdpsExtension::MainWindow.

◆ getShowTitleBar()

bool & ArcdpsExtension::DemoWindow::getShowTitleBar ( )
overrideprotectedvirtual

This has to be true to show the titlebar. Therefore setting it to true by default is recommended.

Implements ArcdpsExtension::MainWindow.

◆ getSizingPolicy()

SizingPolicy & ArcdpsExtension::DemoWindow::getSizingPolicy ( )
overrideprotectedvirtual

◆ getTitle()

std::optional< std::string > & ArcdpsExtension::DemoWindow::getTitle ( )
overrideprotectedvirtual

The name of the window (shown in the title bar) and changeable by the user.

Implements ArcdpsExtension::MainWindow.

◆ getTitleDefault()

const std::string & ArcdpsExtension::DemoWindow::getTitleDefault ( )
overrideprotectedvirtual

The default Text for the title bar, when the above optional is nullopt

Implements ArcdpsExtension::MainWindow.

◆ getWindowID()

const std::string & ArcdpsExtension::DemoWindow::getWindowID ( )
overrideprotectedvirtual

The ID appended onto the title to be used by the ImGuiWindow, so it doesn't crash. This should never change!

Implements ArcdpsExtension::MainWindow.

◆ SetMaxHeightCursorPos()

void ArcdpsExtension::DemoWindow::SetMaxHeightCursorPos ( float  pNewCursorPos = ImGui::GetCursorPosY())
overridevirtual

Function to call to make the max-height work. Call this within your window at a position where the max-height should be. Multiple calls to this will override the value and only the last call will be used for calculation.

Depending on where you call this function it is off by a few pixel. Override it to correct it. Example: The DemoWindow wants to have - GImGui->Style.ItemSpacing.y added and a ImGui::Table wants to have the inline border added.

Reimplemented from ArcdpsExtension::MainWindow.


The documentation for this class was generated from the following files: