2
* This file is part of wxSmith plugin for Code::Blocks Studio
3
* Copyright (C) 2008 Ron Collins
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.
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.
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/>.
20
#include "wxssashwindow.h"
21
#include <wx/sashwin.h>
23
//------------------------------------------------------------------------------
27
wxsRegisterItem<wxsSashWindow> Reg(
30
_T("Layout"), // Category in palette
31
11, // Priority in palette
32
false); // We do not allow this item inside XRC files
35
WXS_ST_BEGIN(wxsSashWindowStyles,_T("wxSW_3D|wxCLIP_CHILDREN"))
36
WXS_ST_CATEGORY("wxSashWindow")
44
WXS_EV_BEGIN(wxsSashWindowEvents)
45
WXS_EVI(EVT_SASH_DRAGGED,wxEVT_SASH_DRAGGED,wxSashEvent,SashDragged)
50
//------------------------------------------------------------------------------
52
wxsSashWindow::wxsSashWindow(wxsItemResData* Data):
53
wxsContainer(Data,&Reg.Info,wxsSashWindowEvents,wxsSashWindowStyles)
61
//------------------------------------------------------------------------------
63
wxObject* wxsSashWindow::OnBuildPreview(wxWindow* Parent,long Flags)
65
// make a thing to display
67
wxSashWindow *swin = new wxSashWindow(Parent,GetId(),Pos(Parent),Size(Parent),Style());
68
SetupWindow(swin, Flags);
70
// for now, a sash on all edges
72
swin->SetSashVisible(wxSASH_TOP, mTop);
73
swin->SetSashVisible(wxSASH_BOTTOM, mBottom);
74
swin->SetSashVisible(wxSASH_LEFT, mLeft);
75
swin->SetSashVisible(wxSASH_RIGHT, mRight);
77
// don't forget the kids
79
AddChildrenPreview(swin, Flags);
86
//------------------------------------------------------------------------------
88
void wxsSashWindow::OnBuildCreatingCode()
90
switch ( GetLanguage() )
93
AddHeader(_T("<wx/sashwin.h>"),GetInfo().ClassName, 0);
95
Codef(_T("%C(%W, %I, %P, %S, %T, %N);\n"));
96
BuildSetupWindowCode();
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);
107
wxsCodeMarks::Unknown(_T("wxsSashWindow::OnBuildCreatingCode"),GetLanguage());
111
//------------------------------------------------------------------------------
113
void wxsSashWindow::OnEnumContainerProperties(long Flags)
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);
121
//------------------------------------------------------------------------------
123
bool wxsSashWindow::OnCanAddChild(wxsItem* Item,bool ShowMessage)