summaryrefslogtreecommitdiff
path: root/tvision/include/tv/dirlibo.h
blob: 4c7bef20604b23e9e01573de081cca400b083c12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
 *      Turbo Vision - Version 2.0
 *
 *      Copyright (c) 1994 by Borland International
 *      All Rights Reserved.
 *

Modified by Robert H”hne to be used for RHIDE.

 *
 *
 */

#if defined( Uses_TDirListBox ) && !defined( __TDirListBox )
#define __TDirListBox

class TRect;
class TScrollBar;
struct TEvent;
class TDirCollection;

#include <limits.h>

class TDirListBox : public TListBox
{

public:

    TDirListBox( const TRect& bounds, TScrollBar *aVScrollBar,
                 TScrollBar *aHScrollBar = NULL );
    ~TDirListBox();

    virtual void getText( char *, ccIndex, short );
    virtual void handleEvent( TEvent& );
    virtual Boolean isSelected( ccIndex );
    void newDirectory( const char * );
    virtual void setState( ushort aState, Boolean enable );
    virtual void draw();
    // SET: Now we use the cursor to help in incremental searches
    void updateCursorPos();

    TDirCollection *list();

    static char pathDir[];
    static char firstDir[];
    static char middleDir[];
    static char lastDir[];
    static char graphics[];
    static char opathDir[];
    static char ofirstDir[];
    static char omiddleDir[];
    static char olastDir[];
    static char ographics[];

private:

    void showDrives( TDirCollection * );
    void showDirs( TDirCollection * );

    char dir[PATH_MAX];
    ushort cur;

    // SET: Incremental search
    char incremental[PATH_MAX];
    int  incPos;

#if !defined( NO_STREAM )
    virtual const char *streamableName() const
        { return name; }

protected:

    TDirListBox( StreamableInit ): TListBox( streamableInit ) {}

public:

    static const char * const name;
    static TStreamable *build();
#endif // NO_STREAM
};

#if !defined( NO_STREAM )
inline ipstream& operator >> ( ipstream& is, TDirListBox& cl )
    { return is >> (TStreamable&)cl; }
inline ipstream& operator >> ( ipstream& is, TDirListBox*& cl )
    { return is >> (void *&)cl; }

inline opstream& operator << ( opstream& os, TDirListBox& cl )
    { return os << (TStreamable&)cl; }
inline opstream& operator << ( opstream& os, TDirListBox* cl )
    { return os << (TStreamable *)cl; }
#endif // NO_STREAM

inline TDirCollection *TDirListBox::list()
{
    return (TDirCollection *)TListBox::list();
}

#endif  // Uses_TDirListBox