summaryrefslogtreecommitdiffstats
path: root/tools/designer/examples/filechooser/plugin/plugin.cpp
blob: be8105ff524db17b60dd62f6b1d3015c9a564210 (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
#include "plugin.h"
#include "../widget/filechooser.h"

static const char *filechooser_pixmap[] = {
    "22 22 8 1",
    "  c Gray100",
    ". c Gray97",
    "X c #4f504f",
    "o c #00007f",
    "O c Gray0",
    "+ c none",
    "@ c Gray0",
    "# c Gray0",
    "++++++++++++++++++++++",
    "++++++++++++++++++++++",
    "++++++++++++++++++++++",
    "++++++++++++++++++++++",
    "+OOOOOOOOOOOOOOOOOOOO+",
    "OOXXXXXXXXXXXXXXXXXXOO",
    "OXX.          OO OO  O",
    "OX.      oo     O    O",
    "OX.      oo     O   .O",
    "OX  ooo  oooo   O    O",
    "OX    oo oo oo  O    O",
    "OX  oooo oo oo  O    O",
    "OX oo oo oo oo  O    O",
    "OX oo oo oo oo  O    O",
    "OX  oooo oooo   O    O",
    "OX            OO OO  O",
    "OO..................OO",
    "+OOOOOOOOOOOOOOOOOOOO+",
    "++++++++++++++++++++++",
    "++++++++++++++++++++++",
    "++++++++++++++++++++++",
    "++++++++++++++++++++++"
};

CustomWidgetPlugin::CustomWidgetPlugin()
{
}

TQStringList CustomWidgetPlugin::keys() const
{
    TQStringList list;
    list << "FileChooser";
    return list;
}

TQWidget* CustomWidgetPlugin::create( const TQString &key, TQWidget* parent, const char* name )
{
    if ( key == "FileChooser" )
	return new FileChooser( parent, name );
    return 0;
}

TQString CustomWidgetPlugin::group( const TQString& feature ) const
{
    if ( feature == "FileChooser" )
	return "Input";
    return TQString::null;
}

TQIconSet CustomWidgetPlugin::iconSet( const TQString& ) const
{
    return TQIconSet( TQPixmap( filechooser_pixmap ) );
}

TQString CustomWidgetPlugin::includeFile( const TQString& feature ) const
{
    if ( feature == "FileChooser" )
	return "filechooser.h";
    return TQString::null;
}

TQString CustomWidgetPlugin::toolTip( const TQString& feature ) const
{
    if ( feature == "FileChooser" )
	return "File Chooser Widget";
    return TQString::null;
}

TQString CustomWidgetPlugin::whatsThis( const TQString& feature ) const
{
    if ( feature == "FileChooser" )
	return "A widget to choose a file or directory";
    return TQString::null;
}

bool CustomWidgetPlugin::isContainer( const TQString& ) const
{
    return FALSE;
}


TQ_EXPORT_PLUGIN( CustomWidgetPlugin )