~ubuntu-branches/ubuntu/raring/codeblocks/raring-proposed

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Cosme Domínguez Díaz
  • Date: 2010-08-09 04:38:38 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100809043838-a59ygguym4eg0jgw
Tags: 10.05-0ubuntu1
* New upstream release. Closes (LP: #322350)
 - Switch to dpkg-source 3.0 (quilt) format
 - Remove unneeded README.source
 - Add debian/get-source-orig script that removes all
   Windows prebuilt binaries
* Bump Standards-Version to 3.9.1
 - Stop shipping *.la files
* debian/control
 - Add cdbs package as Build-Depend
 - Add libbz2-dev and zlib1g-dev packages as
   Build-Depends (needed by libhelp_plugin.so)
 - Remove dpatch package of Build-Depends
 - Add codeblocks-contrib-debug package
 - Split architecture-independent files of codeblocks
   package in codeblocks-common package
* debian/rules
 - Switch to CDBS rules system
 - Add parallel build support
 - Add a call to debian/get-source-orig script
 - Use lzma compression (saves 23,5 MB of free space)
* debian/patches
 - Refresh 01_codeblocks_plugin_path
 - Add 02_no_Makefiles_in_debian_dir to remove any link
   in codeblocks build system to deleted Makefiles of debian directory
 - Drop 02_ftbfs_gcc44 and 03_ftbfs_glib221 (merged in upstream)
* debian/watch
 - Update to use the new host (berlios.de)

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) 2008 Ron Collins
 
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
*/
 
19
 
 
20
#include "wxssashwindow.h"
 
21
#include <wx/sashwin.h>
 
22
 
 
23
//------------------------------------------------------------------------------
 
24
 
 
25
namespace
 
26
{
 
27
    wxsRegisterItem<wxsSashWindow> Reg(
 
28
        _T("SashWindow"),
 
29
        wxsTContainer,
 
30
        _T("Layout"),                   // Category in palette
 
31
        11,                             // Priority in palette
 
32
        false);                         // We do not allow this item inside XRC files
 
33
 
 
34
 
 
35
    WXS_ST_BEGIN(wxsSashWindowStyles,_T("wxSW_3D|wxCLIP_CHILDREN"))
 
36
        WXS_ST_CATEGORY("wxSashWindow")
 
37
        WXS_ST(wxSW_3D)
 
38
        WXS_ST(wxSW_3DSASH)
 
39
        WXS_ST(wxSW_3DBORDER)
 
40
        WXS_ST(wxSW_BORDER)
 
41
        WXS_ST_DEFAULTS()
 
42
    WXS_ST_END()
 
43
 
 
44
    WXS_EV_BEGIN(wxsSashWindowEvents)
 
45
        WXS_EVI(EVT_SASH_DRAGGED,wxEVT_SASH_DRAGGED,wxSashEvent,SashDragged)
 
46
        WXS_EV_DEFAULTS()
 
47
    WXS_EV_END()
 
48
}
 
49
 
 
50
//------------------------------------------------------------------------------
 
51
 
 
52
wxsSashWindow::wxsSashWindow(wxsItemResData* Data):
 
53
    wxsContainer(Data,&Reg.Info,wxsSashWindowEvents,wxsSashWindowStyles)
 
54
{
 
55
    mTop    = true;
 
56
    mBottom = true;
 
57
    mLeft   = true;
 
58
    mRight  = true;
 
59
}
 
60
 
 
61
//------------------------------------------------------------------------------
 
62
 
 
63
wxObject* wxsSashWindow::OnBuildPreview(wxWindow* Parent,long Flags)
 
64
{
 
65
// make a thing to display
 
66
 
 
67
    wxSashWindow *swin = new wxSashWindow(Parent,GetId(),Pos(Parent),Size(Parent),Style());
 
68
    SetupWindow(swin, Flags);
 
69
 
 
70
// for now, a sash on all edges
 
71
 
 
72
    swin->SetSashVisible(wxSASH_TOP,    mTop);
 
73
    swin->SetSashVisible(wxSASH_BOTTOM, mBottom);
 
74
    swin->SetSashVisible(wxSASH_LEFT,   mLeft);
 
75
    swin->SetSashVisible(wxSASH_RIGHT,  mRight);
 
76
 
 
77
// don't forget the kids
 
78
 
 
79
    AddChildrenPreview(swin, Flags);
 
80
 
 
81
// done
 
82
 
 
83
    return swin;
 
84
}
 
85
 
 
86
//------------------------------------------------------------------------------
 
87
 
 
88
void wxsSashWindow::OnBuildCreatingCode()
 
89
{
 
90
    switch ( GetLanguage() )
 
91
    {
 
92
        case wxsCPP:
 
93
            AddHeader(_T("<wx/sashwin.h>"),GetInfo().ClassName, 0);
 
94
 
 
95
            Codef(_T("%C(%W, %I, %P, %S, %T, %N);\n"));
 
96
            BuildSetupWindowCode();
 
97
            AddChildrenCode();
 
98
 
 
99
            Codef( _T("%ASetSashVisible(wxSASH_TOP,    %b);\n"), mTop);
 
100
            Codef( _T("%ASetSashVisible(wxSASH_BOTTOM, %b);\n"), mBottom);
 
101
            Codef( _T("%ASetSashVisible(wxSASH_LEFT,   %b);\n"), mLeft);
 
102
            Codef( _T("%ASetSashVisible(wxSASH_RIGHT,  %b);\n"), mRight);
 
103
 
 
104
            break;
 
105
 
 
106
        default:
 
107
            wxsCodeMarks::Unknown(_T("wxsSashWindow::OnBuildCreatingCode"),GetLanguage());
 
108
    }
 
109
}
 
110
 
 
111
//------------------------------------------------------------------------------
 
112
 
 
113
void wxsSashWindow::OnEnumContainerProperties(long Flags)
 
114
{
 
115
    WXS_BOOL(wxsSashWindow, mTop,    _("Drag Top"),    _("dragtop"),    true);
 
116
    WXS_BOOL(wxsSashWindow, mBottom, _("Drag Bottom"), _("dragbottom"), true);
 
117
    WXS_BOOL(wxsSashWindow, mLeft,   _("Drag Left"),   _("dragleft"),   true);
 
118
    WXS_BOOL(wxsSashWindow, mRight,  _("Drag Right"),  _("dragright"),  true);
 
119
}
 
120
 
 
121
//------------------------------------------------------------------------------
 
122
 
 
123
bool wxsSashWindow::OnCanAddChild(wxsItem* Item,bool ShowMessage)
 
124
{
 
125
    return true;
 
126
}