-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTransitionSettingsPanel.cpp
166 lines (143 loc) · 5.51 KB
/
TransitionSettingsPanel.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
// Copyright 2008 Daniel Anselmi
//
// This file is part of TimingEditor.
//
// TimingEditor is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// TimingEditor is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with TimingEditor. If not, see <http://www.gnu.org/licenses/>.
//
// Contact e-mail: daniel anselmi <[email protected]>
// Program URL : http://sourceforge.net/projects/timingeditor/
//
//
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 14 2006)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif //WX_PRECOMP
#include "TimingApp.h"//GetApp
#include "enumers.h"
#include "TimingView.h"
#include "TimingWindow.h"
#include "TransitionSettingsPanel.h"
#include "enumers.h"
///////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE(TransitionSettingsPanel, wxPanel)
EVT_UPDATE_UI(TIMING_ID_PANEL_TRANS_APPLY, TransitionSettingsPanel::OnUpdatePanelApply)
EVT_UPDATE_UI_RANGE(TIMING_ID_PANEL_TRANS_CHECK50, TIMING_ID_PANEL_TRANS_WIDTH,
TransitionSettingsPanel::OnUpdateControls)
EVT_BUTTON(TIMING_ID_PANEL_TRANS_APPLY , TransitionSettingsPanel::OnApply )
END_EVENT_TABLE()
void TransitionSettingsPanel::OnApply(wxCommandEvent &event)
{
SetUnmodified();
if ( wnd ) wnd->SetTransition(
(wxInt8)m_spinCtrl1->GetValue(),
m_check50->GetValue(),
m_check90->GetValue()
);
}
void TransitionSettingsPanel::Set50(bool val)
{
m_check50->SetValue(val);
en50 = val;
}
void TransitionSettingsPanel::Set90(bool val)
{
m_check90->SetValue(val);
en90 = val;
}
void TransitionSettingsPanel::SetTransitionWidth(wxInt8 tw)
{
m_spinCtrl1->SetValue(tw);
transwidth = tw;
}
void TransitionSettingsPanel::OnUpdatePanelApply(wxUpdateUIEvent& event)
{
if ( wnd )
{
if ( transwidth != m_spinCtrl1->GetValue() )
{
event.Enable(true);
return;
}
if ( en50 != m_check50->GetValue() )
{
event.Enable(true);
return;
}
if ( en90 != m_check90->GetValue() )
{
event.Enable(true);
return;
}
}
event.Enable(false);
}
void TransitionSettingsPanel::SetUnmodified()
{
transwidth = m_spinCtrl1->GetValue();
en50 = m_check50->GetValue();
en90 = m_check90->GetValue();
}
void TransitionSettingsPanel::OnUpdateControls(wxUpdateUIEvent& event)
{
if ( wnd )
{
event.Enable(true);
return;
}
event.Enable(false);
}
TransitionSettingsPanel::TransitionSettingsPanel( wxWindow* parent, int id, wxPoint pos, wxSize size, int style ) :
wxPanel( parent, id, pos, size, style ),
wnd(NULL)
{
wxBoxSizer* bSizer1;
bSizer1 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizer3;
bSizer3 = new wxBoxSizer( wxHORIZONTAL );
m_staticText1 = new wxStaticText( this, ID_DEFAULT, wxT("Transition width (% of a Tick)"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer3->Add( m_staticText1, 0, wxALL, 5 );
m_spinCtrl1 = new wxSpinCtrl( this, TIMING_ID_PANEL_TRANS_WIDTH, wxT(""), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100, 0);
bSizer3->Add( m_spinCtrl1, 1, wxALL, 5 );
bSizer1->Add( bSizer3, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 );
wxFlexGridSizer* fgSizer1;
fgSizer1 = new wxFlexGridSizer( 1, 2, 0, 0 );
bSizer1->Add( fgSizer1, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer2;
bSizer2 = new wxBoxSizer( wxVERTICAL );
//m_checkBox1 = new wxCheckBox( this, TIMING_ID_PANEL_TRANS_CHECK, wxT("Allow vertical lines after 50% and 90% of a transition"), wxDefaultPosition, wxDefaultSize, 0 );
m_check10 = new wxCheckBox( this, TIMING_ID_PANEL_TRANS_CHECK10, wxT("Snap vertical lines at 10% of transition"), wxDefaultPosition, wxDefaultSize, 0 );
m_check10->SetValue(true);
m_check10->Enable(false);
m_check50 = new wxCheckBox( this, TIMING_ID_PANEL_TRANS_CHECK50, wxT("Snap vertical lines at 50% of transition"), wxDefaultPosition, wxDefaultSize, 0 );
m_check90 = new wxCheckBox( this, TIMING_ID_PANEL_TRANS_CHECK90, wxT("Snap vertical lines at 90% of transition"), wxDefaultPosition, wxDefaultSize, 0 );
//bSizer2->Add( m_checkBox1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
bSizer2->Add(m_check10, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
bSizer2->Add(m_check50, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
bSizer2->Add(m_check90, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
bSizer1->Add( bSizer2, 0, wxEXPAND, 5 );
m_button4 = new wxButton( this, TIMING_ID_PANEL_TRANS_APPLY, wxT("Apply"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer1->Add( m_button4, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
this->SetSizer( bSizer1 );
this->Layout();
bSizer1->Fit( this );
}