AlphaFramework API  1.0.3
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | Events | List of all members
AlphaFramework.Editor.Tab Class Reference

A base class for all editor windows that can be displayed as tabs More...

Inheritance diagram for AlphaFramework.Editor.Tab:
AlphaFramework.Editor.UndoTab< T > AlphaFramework.Editor.UndoCloneTab< T >

Public Member Functions

void Open (IToastProvider toastProvider)
 Opens the tab. More...
 
new void Hide ()
 Hides this tab (so that another can be brought to the foreground) More...
 
bool RequestClose ()
 Requests the tab to close, displaying warnings about unsaved data, etc. allowing the user to cancel. More...
 
bool SaveFile ()
 Saves the content of this tab to a file - error-handling included! More...
 
void Delete ()
 Delete the currently selected object in this tab More...
 
virtual void Undo ()
 Hook to undo the last change More...
 
virtual void Redo ()
 Hook to redo the last undone change More...
 

Protected Member Functions

 Tab ()
 
void FocusDefaultControl ()
 Set the focus back to the default control on the tab More...
 
virtual void OnInitialize ()
 Called on startup to load the content for this tab. More...
 
virtual void OnSaveFile ()
 Called when the content of this tab is to be saved to a file. More...
 
virtual void OnDelete ()
 Hook to delete the currently selected object in this tab More...
 
virtual void OnUpdate ()
 Called on startup, content updates and tab switch to refresh any on-screen displays More...
 
virtual void OnChange ()
 Mark the content of this tab as changed (needs to be saved) More...
 
virtual void OnClose ()
 Called when the tab needs to shutdown and close More...
 
void ForceClose ()
 Forces the tab to close, displaying warnings about unsaved data, etc. but not allowing the user to cancel. More...
 

Protected Attributes

bool _overwrite
 true if an existing file supposed to be overwritten when SaveFile is called. More...
 
string _fullPath
 The complete (rooted) path to load and/or save the file from/to More...
 
bool Changed
 True when unsaved changes to the content exist More...
 
IToastProvider ToastProvider
 Provides a surface for displaying toast messages to the user. More...
 

Properties

string NameUI [get, set]
 The user-friendly name of this editor More...
 
string FilePath [get, protected set]
 The path to the file in this editor More...
 

Events

EventHandler TabClosed
 Occurs after the tab was closed More...
 

Detailed Description

A base class for all editor windows that can be displayed as tabs

Call OnChange after each change to make sure the save and undo buttons are enabled

Member Function Documentation

◆ Delete()

void AlphaFramework.Editor.Tab.Delete ( )
inline

Delete the currently selected object in this tab

◆ FocusDefaultControl()

void AlphaFramework.Editor.Tab.FocusDefaultControl ( )
inlineprotected

Set the focus back to the default control on the tab

◆ ForceClose()

void AlphaFramework.Editor.Tab.ForceClose ( )
inlineprotected

Forces the tab to close, displaying warnings about unsaved data, etc. but not allowing the user to cancel.

◆ Hide()

new void AlphaFramework.Editor.Tab.Hide ( )
inline

Hides this tab (so that another can be brought to the foreground)

◆ OnChange()

virtual void AlphaFramework.Editor.Tab.OnChange ( )
inlineprotectedvirtual

Mark the content of this tab as changed (needs to be saved)

Reimplemented in AlphaFramework.Editor.UndoTab< T >, and AlphaFramework.Editor.UndoCloneTab< T >.

◆ OnClose()

virtual void AlphaFramework.Editor.Tab.OnClose ( )
inlineprotectedvirtual

Called when the tab needs to shutdown and close

◆ OnDelete()

virtual void AlphaFramework.Editor.Tab.OnDelete ( )
inlineprotectedvirtual

Hook to delete the currently selected object in this tab

◆ OnInitialize()

virtual void AlphaFramework.Editor.Tab.OnInitialize ( )
inlineprotectedvirtual

Called on startup to load the content for this tab.

Exceptions
NotSupportedExceptionAn unsupported graphics card feature is used.
FileNotFoundExceptionA file could not be located.
IOExceptionThere was a problem reading a file.
UnauthorizedAccessExceptionRead access to a file was denied.
InvalidOperationExceptionThere was a problem inside the engine.
InvalidDataExceptionA file contained invalid data.

Reimplemented in AlphaFramework.Editor.UndoCloneTab< T >.

◆ OnSaveFile()

virtual void AlphaFramework.Editor.Tab.OnSaveFile ( )
inlineprotectedvirtual

Called when the content of this tab is to be saved to a file.

Exceptions
ArgumentExceptionThe file path is invalid.
NotSupportedExceptionThe file path is invalid.
IOExceptionThere was a problem writing a file.
UnauthorizedAccessExceptionWrite access to a file was denied.

Reimplemented in AlphaFramework.Editor.UndoTab< T >.

◆ OnUpdate()

virtual void AlphaFramework.Editor.Tab.OnUpdate ( )
inlineprotectedvirtual

Called on startup, content updates and tab switch to refresh any on-screen displays

◆ Open()

void AlphaFramework.Editor.Tab.Open ( IToastProvider  toastProvider)
inline

Opens the tab.

Parameters
toastProviderProvides a surface for displaying toast messages to the user.
Exceptions
OperationCanceledExceptionThe user has been informed of an error and has confirmed the resulting cancellation.

◆ Redo()

virtual void AlphaFramework.Editor.Tab.Redo ( )
inlinevirtual

Hook to redo the last undone change

Reimplemented in AlphaFramework.Editor.UndoTab< T >.

◆ RequestClose()

bool AlphaFramework.Editor.Tab.RequestClose ( )
inline

Requests the tab to close, displaying warnings about unsaved data, etc. allowing the user to cancel.

Returns
true if the tab was closed, false if the user canceled the process

◆ SaveFile()

bool AlphaFramework.Editor.Tab.SaveFile ( )
inline

Saves the content of this tab to a file - error-handling included!

Returns
true if file was saved, false if an error occurred

◆ Undo()

virtual void AlphaFramework.Editor.Tab.Undo ( )
inlinevirtual

Hook to undo the last change

Reimplemented in AlphaFramework.Editor.UndoTab< T >.

Member Data Documentation

◆ _fullPath

string AlphaFramework.Editor.Tab._fullPath
protected

The complete (rooted) path to load and/or save the file from/to

◆ _overwrite

bool AlphaFramework.Editor.Tab._overwrite
protected

true if an existing file supposed to be overwritten when SaveFile is called.

◆ Changed

bool AlphaFramework.Editor.Tab.Changed
protected

True when unsaved changes to the content exist

◆ ToastProvider

IToastProvider AlphaFramework.Editor.Tab.ToastProvider
protected

Provides a surface for displaying toast messages to the user.

Property Documentation

◆ FilePath

string AlphaFramework.Editor.Tab.FilePath
getprotected set

The path to the file in this editor

◆ NameUI

string AlphaFramework.Editor.Tab.NameUI
getset

The user-friendly name of this editor

Event Documentation

◆ TabClosed

EventHandler AlphaFramework.Editor.Tab.TabClosed

Occurs after the tab was closed


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