NCBI C++ ToolKit
pt_project_folder.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_CORE___PT_PROJECT_FOLDER__HPP
2 #define GUI_CORE___PT_PROJECT_FOLDER__HPP
3 
4 /* $Id: pt_project_folder.hpp 46504 2021-06-15 17:33:09Z shkeda $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Roman Katargin
30  *
31  * File Description:
32  */
33 
34 #include <corelib/ncbiobj.hpp>
35 
36 #include <gui/core/pt_item.hpp>
37 #include <gui/core/document.hpp>
38 
40 
41 class IStatusBarService;
42 class ICanceled;
43 
44 namespace PT
45 {
46  class CProjectFolder : public TPTItem<CRef<objects::CProjectFolder>, eProjectFolder>
47  {
49  public:
51 
52  size_t CountDisabledItems(wxTreeCtrl& treeCtrl);
53 
54  void UpdateDisabledItems(wxTreeCtrl& treeCtrl);
55  void UpdateProjectItems(wxTreeCtrl& treeCtrl, CGBDocument& doc);
56 
57  void Initialize(wxTreeCtrl& treeCtrl, CGBDocument& doc);
58 
59  virtual void OnItemExpandedCollapsed(wxTreeCtrl& treeCtrl);
60 
61  virtual bool CanDoNewFolder() const { return true; }
62  virtual void DoNewFolder(wxTreeCtrl& treeCtrl);
63 
64  virtual bool CanDoProperties() { return true; }
65  virtual bool DoProperties(wxTreeCtrl& treeCtrl);
66 
67  virtual void BeginLabelEdit(wxTreeCtrl& treeCtrl, wxTreeEvent& event);
68  virtual bool EndLabelEdit(wxTreeCtrl& treeCtrl, wxTreeEvent& event);
69 
70  virtual bool CanDoRemove(wxTreeCtrl& treeCtrl) const;
71  virtual bool DoRemove(wxTreeCtrl& treeCtrl);
72 
73  virtual bool CanCopyToClipboard(wxTreeCtrl& treeCtrl) const;
74  virtual bool CanCutToClipboard(wxTreeCtrl& treeCtrl) const;
75 
76  virtual bool CanPaste(wxTreeCtrl& treeCtrl) const;
77  virtual bool Paste(wxTreeCtrl& treeCtrl, PT::TItems& items, bool move);
78 
79  void ExpandCompacted(wxTreeCtrl& treeCtrl, wxTreeItemId& compacted_node, CGBDocument& doc, IStatusBarService* sb_srv, ICanceled* cancel);
80  bool IsCompacted() const {
81  return m_Compacted;
82  }
83  void SetCompacted(bool compacted= true) {
84  m_Compacted = compacted;
85  }
86  private:
87  bool m_Compacted{ false };
88  };
89 }
90 
92 
93 #endif /// GUI_CORE___PT_PROJECT_FOLDER__HPP
CGBDocument.
Definition: document.hpp:113
Interface for testing cancellation request in a long lasting operation.
Definition: icanceled.hpp:51
virtual void DoNewFolder(wxTreeCtrl &treeCtrl)
virtual void BeginLabelEdit(wxTreeCtrl &treeCtrl, wxTreeEvent &event)
virtual bool CanDoRemove(wxTreeCtrl &treeCtrl) const
virtual bool DoProperties(wxTreeCtrl &treeCtrl)
void Initialize(wxTreeCtrl &treeCtrl, CGBDocument &doc)
void UpdateProjectItems(wxTreeCtrl &treeCtrl, CGBDocument &doc)
TPTItem< CRef< objects::CProjectFolder >, eProjectFolder > TParent
virtual bool CanPaste(wxTreeCtrl &treeCtrl) const
virtual bool CanDoProperties()
void ExpandCompacted(wxTreeCtrl &treeCtrl, wxTreeItemId &compacted_node, CGBDocument &doc, IStatusBarService *sb_srv, ICanceled *cancel)
void UpdateDisabledItems(wxTreeCtrl &treeCtrl)
CProjectFolder(const TParent::TDataType &data)
size_t CountDisabledItems(wxTreeCtrl &treeCtrl)
virtual void OnItemExpandedCollapsed(wxTreeCtrl &treeCtrl)
virtual bool CanCopyToClipboard(wxTreeCtrl &treeCtrl) const
virtual bool CanCutToClipboard(wxTreeCtrl &treeCtrl) const
void SetCompacted(bool compacted=true)
virtual bool DoRemove(wxTreeCtrl &treeCtrl)
virtual bool EndLabelEdit(wxTreeCtrl &treeCtrl, wxTreeEvent &event)
virtual bool Paste(wxTreeCtrl &treeCtrl, PT::TItems &items, bool move)
virtual bool CanDoNewFolder() const
char data[12]
Definition: iconv.c:80
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
@ eProjectFolder
Definition: pt_item.hpp:119
vector< CItem * > TItems
Definition: pt_item.hpp:113
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Modified on Fri Jun 14 16:48:53 2024 by modify_doxy.py rev. 669887