~ubuntu-branches/ubuntu/vivid/notecase/vivid

« back to all changes in this revision

Viewing changes to src/TreeView.h

  • Committer: Bazaar Package Importer
  • Author(s): Vijay(Vijay)
  • Date: 2007-06-14 00:13:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070614001348-z9e2vbgtenb9nhoo
Tags: 1.5.6-0ubuntu1
* New Upstream release 
*  The libgnomevfs2-dev is also added to Build-Depends 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
////////////////////////////////////////////////////////////////////////////
2
 
// NoteCase notes manager project <http://notecase.sf.net>
3
 
//
4
 
// This code is licensed under BSD license.See "license.txt" for more details.
5
 
//
6
 
// File: GTK+ TreeView wrapper class
7
 
////////////////////////////////////////////////////////////////////////////
8
 
 
9
 
#ifndef TREEVIEW_H__
10
 
#define TREEVIEW_H__
11
 
 
12
 
#if _MSC_VER > 1000
13
 
#pragma once
14
 
#endif // _MSC_VER > 1000
15
 
 
16
 
#ifdef _WIN32
17
 
 #pragma warning(disable: 4786)
18
 
#endif
19
 
 
20
 
#include <gtk/gtk.h>
21
 
#include <vector>
22
 
 
23
 
#define STORE_IDX_TEXT  0
24
 
#define STORE_IDX_ICON  1
25
 
 
26
 
#define SCREEN_IDX_TEXT 1
27
 
#define SCREEN_IDX_ICON 0
28
 
 
29
 
class TreeView
30
 
{
31
 
public:
32
 
        TreeView();
33
 
        virtual ~TreeView();
34
 
 
35
 
        void Create();
36
 
        void Clear();           // remove tree contents 
37
 
        void EditLabel();       // enters edit mode for focused node
38
 
 
39
 
        GtkTreePath *GetFirstVisibleNode();
40
 
        bool GetNextVisibleNode(GtkTreePath **path1);
41
 
        bool GetPreviousVisibleNode(GtkTreePath **path1);
42
 
        bool IsTreePathValid(GtkTreePath *path);
43
 
        void DumpPath(GtkTreePath *path, const char *szFile);
44
 
        void EnableDragAndDrop(bool bEnable = true);
45
 
 
46
 
        //selection handlers
47
 
        void SelectionPageDown();
48
 
        void SelectionPageUp();
49
 
        void SelectionEnd();
50
 
        void SelectionHome();
51
 
        void SelectionLevelDown();
52
 
        void SelectionLevelUp();
53
 
        void SelectionUp();
54
 
        void SelectionDown();
55
 
 
56
 
        void SetFocus();
57
 
                
58
 
public:
59
 
        GtkWidget *m_pWidget;
60
 
 
61
 
        // Drag and drop 
62
 
        bool m_bDND;               //is DND in progress
63
 
        int  m_nFirstDroppedIdx;
64
 
        int  m_nFirstDraggedIdx;   //used for UNDO      
65
 
};
66
 
 
67
 
#endif // TREEVIEW_H__
 
1
////////////////////////////////////////////////////////////////////////////
 
2
// NoteCase notes manager project <http://notecase.sf.net>
 
3
//
 
4
// This code is licensed under BSD license.See "license.txt" for more details.
 
5
//
 
6
// File: GTK+ TreeView wrapper class
 
7
////////////////////////////////////////////////////////////////////////////
 
8
 
 
9
#ifndef TREEVIEW_H__
 
10
#define TREEVIEW_H__
 
11
 
 
12
#if _MSC_VER > 1000
 
13
#pragma once
 
14
#endif // _MSC_VER > 1000
 
15
 
 
16
#if _MSC_VER > 1000
 
17
  #pragma warning(disable: 4786)
 
18
#endif
 
19
 
 
20
#include <gtk/gtk.h>
 
21
#include <vector>
 
22
 
 
23
#define STORE_IDX_TEXT          0
 
24
#define STORE_IDX_ICON          1
 
25
#define STORE_IDX_STRIKE        2
 
26
#define STORE_IDX_UNDERLINE 3
 
27
#define STORE_IDX_COLOR         4
 
28
 
 
29
#define SCREEN_IDX_TEXT 1
 
30
#define SCREEN_IDX_ICON 0
 
31
 
 
32
class TreeView
 
33
{
 
34
public:
 
35
        TreeView();
 
36
        virtual ~TreeView();
 
37
 
 
38
        void Create();
 
39
        void Clear();           // remove tree contents 
 
40
        void EditLabel();       // enters edit mode for focused node
 
41
 
 
42
        GtkTreePath *GetFirstVisibleNode();
 
43
        bool GetNextVisibleNode(GtkTreePath **path1);
 
44
        bool GetPreviousVisibleNode(GtkTreePath **path1);
 
45
        bool IsTreePathValid(GtkTreePath *path);
 
46
        void DumpPath(GtkTreePath *path, const char *szFile);
 
47
        void EnableDragAndDrop(bool bEnable = true);
 
48
 
 
49
        //selection handlers
 
50
        void SelectionPageDown();
 
51
        void SelectionPageUp();
 
52
        void SelectionEnd();
 
53
        void SelectionHome();
 
54
        void SelectionLevelDown();
 
55
        void SelectionLevelUp();
 
56
        void SelectionUp();
 
57
        void SelectionDown();
 
58
 
 
59
        void SetFocus();
 
60
                
 
61
public:
 
62
        GtkWidget *m_pWidget;
 
63
 
 
64
        // Drag and drop 
 
65
        bool m_bDND;               //is DND in progress
 
66
        int  m_nFirstDroppedIdx;
 
67
        int  m_nFirstDraggedIdx;   //used for UNDO      
 
68
        bool m_bCellEdited;                //is in progress
 
69
};
 
70
 
 
71
#endif // TREEVIEW_H__