KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PROJECT_TREE_ITEM Class Reference

Handle one item (a file or a directory name) for the tree file. More...

#include <project_tree_item.h>

Inheritance diagram for PROJECT_TREE_ITEM:

Public Member Functions

 PROJECT_TREE_ITEM (TREE_FILE_TYPE type, const wxString &data, wxTreeCtrl *parent)
 Class PROJECT_TREE_ITEM is a derived class from wxTreeItemData and store info about a file or directory shown in the KiCad tree project files.
 
 PROJECT_TREE_ITEM ()
 
 PROJECT_TREE_ITEM (const PROJECT_TREE_ITEM &src)
 
TREE_FILE_TYPE GetType () const
 
void SetType (TREE_FILE_TYPE aType)
 
const wxString & GetFileName () const
 
void SetFileName (const wxString &name)
 
bool IsRootFile () const
 
void SetRootFile (bool aValue)
 
bool IsPopulated () const
 
void SetPopulated (bool aValue)
 
const wxString GetDir () const
 
bool Rename (const wxString &name, bool check=true)
 
void Delete ()
 
void Print ()
 
void Activate (PROJECT_TREE_PANE *aTreePrjFrame)
 
void SetState (int state)
 
bool CanDelete () const
 Determine if a file can be deleted via the project tree pane.
 
bool CanRename () const
 

Private Attributes

TREE_FILE_TYPE m_type
 
wxString m_file_name
 
bool m_isRootFile
 
bool m_isPopulated
 
wxTreeCtrl * m_parent
 
int m_state
 

Detailed Description

Handle one item (a file or a directory name) for the tree file.

Definition at line 39 of file project_tree_item.h.

Constructor & Destructor Documentation

◆ PROJECT_TREE_ITEM() [1/3]

PROJECT_TREE_ITEM::PROJECT_TREE_ITEM ( TREE_FILE_TYPE  type,
const wxString &  data,
wxTreeCtrl *  parent 
)

Class PROJECT_TREE_ITEM is a derived class from wxTreeItemData and store info about a file or directory shown in the KiCad tree project files.

Definition at line 49 of file project_tree_item.cpp.

References m_parent, m_state, SetFileName(), SetPopulated(), SetRootFile(), and SetType().

◆ PROJECT_TREE_ITEM() [2/3]

PROJECT_TREE_ITEM::PROJECT_TREE_ITEM ( )
inline

Definition at line 45 of file project_tree_item.h.

◆ PROJECT_TREE_ITEM() [3/3]

PROJECT_TREE_ITEM::PROJECT_TREE_ITEM ( const PROJECT_TREE_ITEM src)
inline

Definition at line 49 of file project_tree_item.h.

References m_isPopulated, m_state, and SetState().

Member Function Documentation

◆ Activate()

◆ CanDelete()

bool PROJECT_TREE_ITEM::CanDelete ( ) const

Determine if a file can be deleted via the project tree pane.

Note
Any of the files that could potentially break a project are flagged as cannot delete or rename.
Returns
false if the file managed by this item cannot be deleted or true if it can.

Definition at line 76 of file project_tree_item.cpp.

References m_type.

Referenced by CanRename(), and Delete().

◆ CanRename()

bool PROJECT_TREE_ITEM::CanRename ( ) const
inline

Definition at line 92 of file project_tree_item.h.

References CanDelete().

Referenced by Rename().

◆ Delete()

void PROJECT_TREE_ITEM::Delete ( )

◆ GetDir()

const wxString PROJECT_TREE_ITEM::GetDir ( ) const
Returns
the path of an item. if this item is a directory, returns the stored filename if this is a file, returns its path

Definition at line 96 of file project_tree_item.cpp.

References GetFileName(), and m_type.

Referenced by PROJECT_TREE_PANE::addItemToProjectTree(), PROJECT_TREE_PANE::onGitInitializeProject(), and Rename().

◆ GetFileName()

◆ GetType()

◆ IsPopulated()

bool PROJECT_TREE_ITEM::IsPopulated ( ) const
inline

◆ IsRootFile()

bool PROJECT_TREE_ITEM::IsRootFile ( ) const
inline

Definition at line 64 of file project_tree_item.h.

References m_isRootFile.

Referenced by PROJECT_TREE::OnCompareItems().

◆ Print()

void PROJECT_TREE_ITEM::Print ( )

◆ Rename()

bool PROJECT_TREE_ITEM::Rename ( const wxString &  name,
bool  check = true 
)

◆ SetFileName()

void PROJECT_TREE_ITEM::SetFileName ( const wxString &  name)
inline

Definition at line 62 of file project_tree_item.h.

References m_file_name, and name.

Referenced by PROJECT_TREE_ITEM().

◆ SetPopulated()

void PROJECT_TREE_ITEM::SetPopulated ( bool  aValue)
inline

◆ SetRootFile()

void PROJECT_TREE_ITEM::SetRootFile ( bool  aValue)
inline

Definition at line 65 of file project_tree_item.h.

References m_isRootFile.

Referenced by PROJECT_TREE_PANE::addItemToProjectTree(), and PROJECT_TREE_ITEM().

◆ SetState()

void PROJECT_TREE_ITEM::SetState ( int  state)

Definition at line 62 of file project_tree_item.cpp.

References m_parent, m_state, and m_type.

Referenced by PROJECT_TREE_PANE::addItemToProjectTree(), and PROJECT_TREE_ITEM().

◆ SetType()

void PROJECT_TREE_ITEM::SetType ( TREE_FILE_TYPE  aType)
inline

Definition at line 59 of file project_tree_item.h.

References m_type.

Referenced by PROJECT_TREE_ITEM().

Member Data Documentation

◆ m_file_name

wxString PROJECT_TREE_ITEM::m_file_name
private

Definition at line 96 of file project_tree_item.h.

Referenced by GetFileName(), and SetFileName().

◆ m_isPopulated

bool PROJECT_TREE_ITEM::m_isPopulated
private

Definition at line 98 of file project_tree_item.h.

Referenced by IsPopulated(), PROJECT_TREE_ITEM(), and SetPopulated().

◆ m_isRootFile

bool PROJECT_TREE_ITEM::m_isRootFile
private

Definition at line 97 of file project_tree_item.h.

Referenced by IsRootFile(), and SetRootFile().

◆ m_parent

wxTreeCtrl* PROJECT_TREE_ITEM::m_parent
private

Definition at line 99 of file project_tree_item.h.

Referenced by Activate(), Delete(), PROJECT_TREE_ITEM(), Rename(), and SetState().

◆ m_state

int PROJECT_TREE_ITEM::m_state
private

Definition at line 100 of file project_tree_item.h.

Referenced by PROJECT_TREE_ITEM(), and SetState().

◆ m_type

TREE_FILE_TYPE PROJECT_TREE_ITEM::m_type
private

Definition at line 95 of file project_tree_item.h.

Referenced by CanDelete(), GetDir(), GetType(), SetState(), and SetType().


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