~ubuntu-branches/ubuntu/hardy/codeblocks/hardy-backports

« back to all changes in this revision

Viewing changes to src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsgenericdirctrl.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michael Casadevall
  • Date: 2008-07-17 04:39:23 UTC
  • Revision ID: james.westby@ubuntu.com-20080717043923-gmsy5cwkdjswghkm
Tags: upstream-8.02
ImportĀ upstreamĀ versionĀ 8.02

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
* This file is part of wxSmith plugin for Code::Blocks Studio
 
3
* Copyright (C) 2006-2007  Bartlomiej Swiecki
 
4
*
 
5
* wxSmith is free software; you can redistribute it and/or modify
 
6
* it under the terms of the GNU General Public License as published by
 
7
* the Free Software Foundation; either version 3 of the License, or
 
8
* (at your option) any later version.
 
9
*
 
10
* wxSmith is distributed in the hope that it will be useful,
 
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
13
* GNU General Public License for more details.
 
14
*
 
15
* You should have received a copy of the GNU General Public License
 
16
* along with wxSmith. If not, see <http://www.gnu.org/licenses/>.
 
17
*
 
18
* $Revision: 4850 $
 
19
* $Id: wxsgenericdirctrl.cpp 4850 2008-01-29 21:45:49Z byo $
 
20
* $HeadURL: svn://svn.berlios.de/codeblocks/tags/8.02/src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsgenericdirctrl.cpp $
 
21
*/
 
22
 
 
23
#include "wxsgenericdirctrl.h"
 
24
 
 
25
#include <wx/dirctrl.h>
 
26
 
 
27
namespace
 
28
{
 
29
    wxsRegisterItem<wxsGenericDirCtrl> Reg(_T("GenericDirCtrl"),wxsTWidget,_T("Standard"),30);
 
30
 
 
31
    WXS_ST_BEGIN(wxsGenericDirCtrlStyles,_T(""))
 
32
        WXS_ST_CATEGORY("wxGenericDirCtrl")
 
33
        WXS_ST(wxDIRCTRL_DIR_ONLY)
 
34
        WXS_ST(wxDIRCTRL_3D_INTERNAL)
 
35
        WXS_ST(wxDIRCTRL_SELECT_FIRST)
 
36
        WXS_ST(wxDIRCTRL_SHOW_FILTERS)
 
37
        WXS_ST(wxDIRCTRL_EDIT_LABELS)
 
38
        WXS_ST_DEFAULTS()
 
39
    WXS_ST_END()
 
40
 
 
41
    WXS_EV_BEGIN(wxsGenericDirCtrlEvents)
 
42
    WXS_EV_END()
 
43
}
 
44
 
 
45
wxsGenericDirCtrl::wxsGenericDirCtrl(wxsItemResData* Data):
 
46
    wxsWidget(
 
47
        Data,
 
48
        &Reg.Info,
 
49
        wxsGenericDirCtrlEvents,
 
50
        wxsGenericDirCtrlStyles),
 
51
    DefaultFilter(0)
 
52
{}
 
53
 
 
54
 
 
55
void wxsGenericDirCtrl::OnBuildCreatingCode()
 
56
{
 
57
    switch ( GetLanguage() )
 
58
    {
 
59
        case wxsCPP:
 
60
        {
 
61
            AddHeader(_T("<wx/dirctrl.h>"),GetInfo().ClassName,0);
 
62
            Codef(_T("%C(%W, %I, %n, %P, %S, %T, %n, %d, %N);\n"),DefaultFolder.c_str(),Filter.c_str(),DefaultFilter);
 
63
            BuildSetupWindowCode();
 
64
            return;
 
65
        }
 
66
 
 
67
        default:
 
68
        {
 
69
            wxsCodeMarks::Unknown(_T("wxsGenericDirCtrl::OnBuildCreatingCode"),GetLanguage());
 
70
        }
 
71
    }
 
72
}
 
73
 
 
74
wxObject* wxsGenericDirCtrl::OnBuildPreview(wxWindow* Parent,long Flags)
 
75
{
 
76
    wxGenericDirCtrl* Preview = new wxGenericDirCtrl(Parent,GetId(),DefaultFolder,Pos(Parent),Size(Parent),Style(),Filter,DefaultFilter);
 
77
    return SetupWindow(Preview,Flags);
 
78
}
 
79
 
 
80
void wxsGenericDirCtrl::OnEnumWidgetProperties(long Flags)
 
81
{
 
82
    WXS_SHORT_STRING(wxsGenericDirCtrl,DefaultFolder,_("Default Folder"),_T("defaultfolder"),_T(""),true)
 
83
    WXS_SHORT_STRING(wxsGenericDirCtrl,Filter,_("Filter"),_T("filter"),_T(""),true)
 
84
    WXS_LONG(wxsGenericDirCtrl,DefaultFilter,_("Default Filter"),_T("defaultfilter"),0)
 
85
}