~efargaspro/+junk/codeblocks-16.01-release

« back to all changes in this revision

Viewing changes to src/plugins/contrib/wxSmith/wxwidgets/defitems/wxstimer.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: 7109 $
 
19
* $Id: wxstimer.cpp 7109 2011-04-15 11:53:16Z mortenmacfly $
 
20
* $HeadURL: http://svn.code.sf.net/p/codeblocks/code/branches/release-16.xx/src/plugins/contrib/wxSmith/wxwidgets/defitems/wxstimer.cpp $
 
21
*/
 
22
 
 
23
#include "wxstimer.h"
 
24
#include "../wxsitemresdata.h"
 
25
#include <wx/timer.h>
 
26
 
 
27
namespace
 
28
{
 
29
    wxsRegisterItem<wxsTimer> Reg(_T("Timer"),wxsTTool,_T("Tools"),20,false);
 
30
 
 
31
    WXS_EV_BEGIN(wxsTimerEvents)
 
32
        WXS_EVI(EVT_TIMER,wxEVT_TIMER,wxTimerEvent,Trigger)
 
33
    WXS_EV_END()
 
34
 
 
35
}
 
36
 
 
37
wxsTimer::wxsTimer(wxsItemResData* Data):
 
38
    wxsTool(
 
39
        Data,
 
40
        &Reg.Info,
 
41
        wxsTimerEvents,
 
42
        0,
 
43
        flVariable|flId|flSubclass|flExtraCode)
 
44
{
 
45
    m_Interval = 0;
 
46
    m_OneShot = false;
 
47
}
 
48
 
 
49
void wxsTimer::OnBuildCreatingCode()
 
50
{
 
51
    switch ( GetLanguage() )
 
52
    {
 
53
        case wxsCPP:
 
54
        {
 
55
            AddHeader(_T("<wx/timer.h>"),GetInfo().ClassName,hfInPCH);
 
56
            Codef(_T("%ASetOwner(this, %I);\n"));
 
57
            if ( m_Interval > 0 ) Codef(_T("%AStart(%d, %b);\n"),m_Interval,m_OneShot);
 
58
            BuildSetupWindowCode();
 
59
            return;
 
60
        }
 
61
 
 
62
        default:
 
63
        {
 
64
            wxsCodeMarks::Unknown(_T("wxsTimer::OnBuildCreatingCode"),GetLanguage());
 
65
        }
 
66
    }
 
67
}
 
68
 
 
69
void wxsTimer::OnEnumToolProperties(long Flags)
 
70
{
 
71
    WXS_LONG(wxsTimer,m_Interval,_("Interval"),_T("interval"),0);
 
72
    WXS_BOOL(wxsTimer,m_OneShot,_("One Shot"),_T("oneshot"),false);
 
73
}