~efargaspro/+junk/codeblocks-16.01-release

« back to all changes in this revision

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

  • Committer: damienlmoore at gmail
  • Date: 2016-02-02 02:43:22 UTC
  • Revision ID: damienlmoore@gmail.com-20160202024322-yql5qmtbwdyamdwd
Code::BlocksĀ 16.01

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: 8335 $
 
19
* $Id: wxsgridsizer.cpp 8335 2012-09-03 07:43:04Z ollydbg $
 
20
* $HeadURL: http://svn.code.sf.net/p/codeblocks/code/branches/release-16.xx/src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsgridsizer.cpp $
 
21
*/
 
22
 
 
23
#include "wxsgridsizer.h"
 
24
 
 
25
namespace
 
26
{
 
27
    wxsRegisterItem<wxsGridSizer> Reg(_T("GridSizer"),wxsTSizer,_T("Layout"),60);
 
28
}
 
29
 
 
30
wxsGridSizer::wxsGridSizer(wxsItemResData* Data):
 
31
    wxsSizer(Data,&Reg.Info),
 
32
    Cols(3),
 
33
    Rows(0)
 
34
{
 
35
}
 
36
 
 
37
wxSizer* wxsGridSizer::OnBuildSizerPreview(wxWindow* Parent)
 
38
{
 
39
    return new wxGridSizer(Rows,Cols,
 
40
        VGap.GetPixels(Parent),HGap.GetPixels(Parent));
 
41
}
 
42
 
 
43
void wxsGridSizer::OnBuildSizerCreatingCode()
 
44
{
 
45
    switch ( GetLanguage() )
 
46
    {
 
47
        case wxsCPP:
 
48
        {
 
49
            AddHeader(_T("<wx/sizer.h>"),GetInfo().ClassName,hfInPCH);
 
50
            Codef(_T("%C(%d, %d, %s, %s);\n"),Rows,Cols,
 
51
                  VGap.GetPixelsCode(GetCoderContext()).wx_str(),
 
52
                  HGap.GetPixelsCode(GetCoderContext()).wx_str());
 
53
            return;
 
54
        }
 
55
 
 
56
        default:
 
57
        {
 
58
            wxsCodeMarks::Unknown(_T("wxsGridSizer::OnBuildSizerCreatingCode"),GetLanguage());
 
59
        }
 
60
    }
 
61
}
 
62
 
 
63
void wxsGridSizer::OnEnumSizerProperties(long Flags)
 
64
{
 
65
    WXS_LONG(wxsGridSizer,Cols,_("Cols"),_T("cols"),0);
 
66
    WXS_LONG(wxsGridSizer,Rows,_("Rows"),_T("rows"),0);
 
67
    WXS_DIMENSION(wxsGridSizer,VGap,_("V-Gap"),_("V-Gap in dialog units"),_T("vgap"),0,false);
 
68
    WXS_DIMENSION(wxsGridSizer,HGap,_("H-Gap"),_("H,y-Gap in dialog units"),_T("hgap"),0,false);
 
69
}