~ubuntu-branches/ubuntu/trusty/plee-the-bear/trusty-proposed

« back to all changes in this revision

Viewing changes to bear-factory/model-editor/src/bf/code/snapshot_frame.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Julien Jorge, Julien Jorge
  • Date: 2010-11-17 20:13:34 UTC
  • mfrom: (6.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20101117201334-o4dp7uq437to7oxb
Tags: 0.5.1-1
[ Julien Jorge ]
* New upstream release (Closes: #565062, #546514).
* Add armhf architecture (Closes: #604689).
* Remove patches integrated upstream: rpath-editors.diff, rpath-game.diff,
  editors-menu-section.diff.
* Bump the Standard-Version, no changes.
* Update my email address.
* Set build dependency of libclaw to 1.6.0.
* Add the missing ${misc:Depends} in debian/control.
* List gettext translations in bear-factory.install and plee-the-bear.install.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
    Bear Engine - Model editor
3
3
 
4
 
    Copyright (C) 2005-2009 Julien Jorge, Sebastien Angibaud
 
4
    Copyright (C) 2005-2010 Julien Jorge, Sebastien Angibaud
5
5
 
6
6
    This program is free software; you can redistribute it and/or modify it
7
7
    under the terms of the GNU General Public License as published by the
112
112
 */
113
113
void bf::snapshot_frame::create_member_controls()
114
114
{
115
 
  m_date_button = new wxButton( this, IDC_DATE_CTRL, _("0"));
 
115
  m_date_button = new wxButton( this, IDC_DATE_CTRL, wxT("0"));
116
116
 
117
117
  m_function_button = new wxButton( this, IDC_FUNCTION, wxEmptyString );
118
118
 
119
 
  m_mark_choice = new wxChoice( this, IDC_MARK_CHOICE ); 
120
 
  
 
119
  m_mark_choice = new wxChoice( this, IDC_MARK_CHOICE );
 
120
 
121
121
  m_mark_left_spin = new spin_ctrl<double>
122
122
    ( this, IDC_MARK_PLACEMENT, wxDefaultPosition,
123
 
      wxDefaultSize, 0, - std::numeric_limits<double>::infinity(), 
 
123
      wxDefaultSize, 0, - std::numeric_limits<double>::infinity(),
124
124
      std::numeric_limits<double>::infinity(), 0, 1 );
125
125
  m_mark_bottom_spin = new spin_ctrl<double>
126
126
    ( this, IDC_MARK_PLACEMENT, wxDefaultPosition,
127
 
      wxDefaultSize, 0, - std::numeric_limits<double>::infinity(), 
 
127
      wxDefaultSize, 0, - std::numeric_limits<double>::infinity(),
128
128
      std::numeric_limits<double>::infinity(), 0, 1  );
129
129
  m_mark_depth_spin = new wxSpinCtrl( this, IDC_MARK_PLACEMENT );
130
130
  m_mark_angle_spin = new spin_ctrl<double>
131
131
    ( this, IDC_MARK_PLACEMENT, wxDefaultPosition,
132
 
      wxDefaultSize, 0, - std::numeric_limits<double>::infinity(), 
 
132
      wxDefaultSize, 0, - std::numeric_limits<double>::infinity(),
133
133
      std::numeric_limits<double>::infinity(), 0, 0.01 );
134
134
 
135
135
  m_mark_depth_spin->SetRange
136
136
    ( std::numeric_limits<int>::min(), std::numeric_limits<int>::max() );
137
137
  m_mark_visible_box = new wxCheckBox( this, IDC_VISIBILITY,_("Visible") );
138
138
 
139
 
  m_sound_button = new wxButton(this, IDC_SOUND_FILE, _("..."));
140
 
  m_sound_path = new wxTextCtrl(this, wxID_ANY);
141
 
  m_globally_sound_box = 
 
139
  m_sound_button = new wxButton(this, IDC_SOUND_FILE, wxT("..."));
 
140
  m_sound_path = new wxTextCtrl(this, IDC_SOUND_TEXT);
 
141
  m_globally_sound_box =
142
142
    new wxCheckBox( this, IDC_GLOBALLY_SOUND,_("Play globally") );
143
143
 
144
144
  m_width_spin = new spin_ctrl<double>
150
150
 
151
151
   m_x_alignment_value_spin = new spin_ctrl<double>
152
152
    ( this, IDC_ALIGNMENT, wxDefaultPosition,
153
 
      wxDefaultSize, 0, -std::numeric_limits<double>::infinity(), 
 
153
      wxDefaultSize, 0, -std::numeric_limits<double>::infinity(),
154
154
      std::numeric_limits<double>::infinity(), 0, 1 );
155
155
 
156
156
  m_y_alignment_value_spin = new spin_ctrl<double>
157
157
    ( this, IDC_ALIGNMENT, wxDefaultPosition,
158
 
      wxDefaultSize, 0, -std::numeric_limits<double>::infinity(), 
 
158
      wxDefaultSize, 0, -std::numeric_limits<double>::infinity(),
159
159
      std::numeric_limits<double>::infinity(), 0, 1 );
160
160
 
161
161
  wxArrayString array;
162
 
  array.Add(_("align_bottom"));
163
 
  array.Add(_("align_center"));
164
 
  array.Add(_("align_top"));
 
162
  array.Add(wxT("align_bottom"));
 
163
  array.Add(wxT("align_center"));
 
164
  array.Add(wxT("align_top"));
165
165
  m_y_alignment_choice = new wxChoice
166
166
    ( this, IDC_ALIGNMENT, wxDefaultPosition, wxDefaultSize, array );
167
167
 
168
168
  array.Clear();
169
 
  array.Add(_("align_left"));
170
 
  array.Add(_("align_center"));
171
 
  array.Add(_("align_right"));
 
169
  array.Add(wxT("align_left"));
 
170
  array.Add(wxT("align_center"));
 
171
  array.Add(wxT("align_right"));
172
172
  m_x_alignment_choice = new wxChoice
173
173
    ( this, IDC_ALIGNMENT, wxDefaultPosition, wxDefaultSize, array );
 
174
 
 
175
  enable_controls(false);
174
176
} // snapshot_frame::create_member_controls()
175
177
 
176
178
/*----------------------------------------------------------------------------*/
200
202
 
201
203
  wxStaticBoxSizer* static_sizer;
202
204
  static_sizer = new wxStaticBoxSizer( wxHORIZONTAL, this, _("Size") );
203
 
  static_sizer->Add( new wxStaticText(this, wxID_ANY, _("Width: ")), 0,
 
205
  static_sizer->Add( new wxStaticText(this, wxID_ANY, _("Width:")), 0,
204
206
                     wxALIGN_CENTER_VERTICAL );
205
207
  static_sizer->Add( m_width_spin, 1 );
206
208
  static_sizer->AddSpacer(5);
207
 
  static_sizer->Add( new wxStaticText(this, wxID_ANY, _("Height: ")), 0,
 
209
  static_sizer->Add( new wxStaticText(this, wxID_ANY, _("Height:")), 0,
208
210
                     wxALIGN_CENTER_VERTICAL );
209
211
  static_sizer->Add( m_height_spin, 1 );
210
212
  sizer->Add( static_sizer, 0, wxEXPAND );
212
214
  static_sizer =
213
215
    new wxStaticBoxSizer( wxVERTICAL, this, _("Alignments") );
214
216
  s_sizer = new wxBoxSizer( wxHORIZONTAL );
215
 
  s_sizer->Add( new wxStaticText(this, wxID_ANY, _("X: ")), 0,
 
217
  s_sizer->Add( new wxStaticText(this, wxID_ANY, _("X:")), 0,
216
218
                     wxALIGN_CENTER_VERTICAL );
217
219
  s_sizer->Add( m_x_alignment_choice, 1, wxALL );
218
220
  s_sizer->AddSpacer(5);
219
 
  s_sizer->Add( new wxStaticText(this, wxID_ANY, _("Gap: ")), 0,
 
221
  s_sizer->Add( new wxStaticText(this, wxID_ANY, _("Gap:")), 0,
220
222
                     wxALIGN_CENTER_VERTICAL );
221
223
  s_sizer->Add( m_x_alignment_value_spin, 1 );
222
224
  static_sizer->Add( s_sizer, 0, wxEXPAND );
223
225
  s_sizer = new wxBoxSizer( wxHORIZONTAL );
224
 
  s_sizer->Add( new wxStaticText(this, wxID_ANY, _("Y: ")), 0,
 
226
  s_sizer->Add( new wxStaticText(this, wxID_ANY, _("Y:")), 0,
225
227
                     wxALIGN_CENTER_VERTICAL );
226
228
  s_sizer->Add( m_y_alignment_choice, 1, wxALL );
227
229
  s_sizer->AddSpacer(5);
228
 
  s_sizer->Add( new wxStaticText(this, wxID_ANY, _("Gap: ")), 0,
 
230
  s_sizer->Add( new wxStaticText(this, wxID_ANY, _("Gap:")), 0,
229
231
                     wxALIGN_CENTER_VERTICAL );
230
232
  s_sizer->Add( m_y_alignment_value_spin, 1 );
231
233
 
243
245
{
244
246
  wxStaticBoxSizer* result =
245
247
    new wxStaticBoxSizer( wxVERTICAL, this, _("Marks") );
246
 
 
 
248
 
247
249
  wxBoxSizer* s_sizer = new wxBoxSizer( wxHORIZONTAL );
248
250
  s_sizer->Add
249
251
    ( new wxStaticText(this, wxID_ANY, _("Mark:")),
250
252
      0, wxALIGN_CENTRE_VERTICAL | wxALL, 5 );
251
 
  s_sizer->Add( m_mark_choice, 1, wxALL, 5 ); 
 
253
  s_sizer->Add( m_mark_choice, 1, wxALL, 5 );
252
254
  result->Add( s_sizer, 0, wxEXPAND, 0 );
253
255
 
254
256
  s_sizer = new wxBoxSizer( wxHORIZONTAL );
286
288
 */
287
289
wxSizer* bf::snapshot_frame::create_sound_sizer()
288
290
{
289
 
  wxStaticBoxSizer* result = 
 
291
  wxStaticBoxSizer* result =
290
292
    new wxStaticBoxSizer( wxVERTICAL, this, _("Sound") );
291
 
 
 
293
 
292
294
  wxBoxSizer* s_sizer = new wxBoxSizer( wxHORIZONTAL );
293
295
  s_sizer = new wxBoxSizer( wxHORIZONTAL );
294
296
  s_sizer->Add( m_sound_path, 1, wxEXPAND );
296
298
 
297
299
  result->Add( m_globally_sound_box, 0, wxEXPAND );
298
300
  result->Add( s_sizer, 0, wxEXPAND );
299
 
  
 
301
 
300
302
  return result;
301
303
} // snapshot_frame::create_sound_sizer()
302
304
 
313
315
    if ( m_model_frame->get_model().has_active_action() )
314
316
      {
315
317
        m_snapshot = m_model_frame->get_model().get_selected_snapshot();
316
 
      
317
 
        if ( m_snapshot != NULL ) 
 
318
 
 
319
        if ( m_snapshot != NULL )
318
320
          {
319
321
            enable = true;
320
 
            
 
322
 
321
323
            m_date_button->SetLabel
322
324
              ( wxString::Format(wxT("%.3f"), m_snapshot->get_date()) );
323
 
  
 
325
 
324
326
            m_function_button->SetLabel
325
327
              (std_to_wx_string(m_snapshot->get_function()));
326
328
 
332
334
            m_globally_sound_box->SetValue
333
335
              ( m_snapshot->get_sound().is_played_globally() );
334
336
 
335
 
            m_width_spin->SetValue(m_snapshot->get_width());
336
 
            m_height_spin->SetValue(m_snapshot->get_height());
337
 
            m_x_alignment_choice->SetStringSelection
338
 
              (std_to_wx_string(m_snapshot->get_x_alignment()));
339
 
            m_y_alignment_choice->SetStringSelection
340
 
              (std_to_wx_string(m_snapshot->get_y_alignment()));
341
 
            m_x_alignment_value_spin->SetValue
342
 
              (m_snapshot->get_x_alignment_value());
343
 
            m_y_alignment_value_spin->SetValue
344
 
              (m_snapshot->get_y_alignment_value());
345
 
          }
 
337
            m_width_spin->SetValue(m_snapshot->get_width());
 
338
            m_height_spin->SetValue(m_snapshot->get_height());
 
339
            m_x_alignment_choice->SetStringSelection
 
340
              (std_to_wx_string(m_snapshot->get_x_alignment()));
 
341
            m_y_alignment_choice->SetStringSelection
 
342
              (std_to_wx_string(m_snapshot->get_y_alignment()));
 
343
            m_x_alignment_value_spin->SetValue
 
344
              (m_snapshot->get_x_alignment_value());
 
345
            m_y_alignment_value_spin->SetValue
 
346
              (m_snapshot->get_y_alignment_value());
 
347
          }
346
348
      }
347
349
 
348
 
  m_date_button->Enable(enable);
349
 
  m_mark_choice->Enable(enable);
350
 
  m_function_button->Enable(enable);
351
 
  m_sound_button->Enable(enable);
352
 
  m_sound_path->Enable(enable);
353
 
  m_globally_sound_box->Enable(enable);
354
 
  m_width_spin->Enable(enable);
355
 
  m_height_spin->Enable(enable);
356
 
  m_x_alignment_choice->Enable(enable);
357
 
  m_y_alignment_choice->Enable(enable);
358
 
  m_x_alignment_value_spin->Enable(enable);
359
 
  m_y_alignment_value_spin->Enable(enable);
 
350
  enable_controls(enable);
360
351
 
361
352
  fill_mark();
362
353
} // snapshot_frame::fill()
363
354
 
364
355
/*----------------------------------------------------------------------------*/
365
356
/**
366
 
 * \brief Fill controls of current mark. 
 
357
 * \brief Fill controls of current mark.
367
358
 */
368
359
void bf::snapshot_frame::fill_mark()
369
360
{
373
364
 
374
365
  if ( m_model_frame != NULL )
375
366
    if ( m_model_frame->get_model().has_active_action() )
376
 
      if ( m_snapshot != NULL ) 
377
 
        {
378
 
          snapshot::const_mark_placement_iterator it;
379
 
          
380
 
          for ( it = m_snapshot->mark_placement_begin();
381
 
                it != m_snapshot->mark_placement_end(); ++it )
382
 
            m_mark_choice->Append
383
 
              ( std_to_wx_string(it->get_mark()->get_label()) );
384
 
          
385
 
          if ( m_model_frame->get_model().has_mark_selection() ) 
386
 
            {
387
 
              enable = true;
388
 
              const mark* m
 
367
      if ( m_snapshot != NULL )
 
368
        {
 
369
          snapshot::const_mark_placement_iterator it;
 
370
 
 
371
          for ( it = m_snapshot->mark_placement_begin();
 
372
                it != m_snapshot->mark_placement_end(); ++it )
 
373
            m_mark_choice->Append
 
374
              ( std_to_wx_string(it->get_mark()->get_label()) );
 
375
 
 
376
          if ( m_model_frame->get_model().has_mark_selection() )
 
377
            {
 
378
              enable = true;
 
379
              const mark* m
389
380
                ( m_model_frame->get_model().get_main_mark_selection() );
390
 
              
391
 
              m_mark_choice->SetStringSelection
 
381
 
 
382
              m_mark_choice->SetStringSelection
392
383
                ( std_to_wx_string(m->get_label()) );
393
 
              
394
 
              mark_placement p = m_snapshot->get_placement(m->get_label());
395
 
        
396
 
              m_mark_left_spin->SetValue(p.get_position_x());
397
 
              m_mark_bottom_spin->SetValue(p.get_position_y());
398
 
              m_mark_depth_spin->SetValue(p.get_depth_position());
399
 
              m_mark_angle_spin->SetValue(p.get_angle());
400
 
              m_mark_visible_box->SetValue(p.is_visible());
401
 
            }
402
 
        }
403
 
  
 
384
 
 
385
              mark_placement p = m_snapshot->get_placement(m->get_label());
 
386
 
 
387
              m_mark_left_spin->SetValue(p.get_position_x());
 
388
              m_mark_bottom_spin->SetValue(p.get_position_y());
 
389
              m_mark_depth_spin->SetValue(p.get_depth_position());
 
390
              m_mark_angle_spin->SetValue(p.get_angle());
 
391
              m_mark_visible_box->SetValue(p.is_visible());
 
392
            }
 
393
        }
 
394
 
404
395
  m_mark_left_spin->Enable(enable);
405
396
  m_mark_bottom_spin->Enable(enable);
406
397
  m_mark_depth_spin->Enable(enable);
410
401
 
411
402
/*----------------------------------------------------------------------------*/
412
403
/**
413
 
 * \brief The mark placement has changed. 
 
404
 * \brief The mark placement has changed.
414
405
 */
415
406
void bf::snapshot_frame::placement_change()
416
407
{
417
408
  mark* m( m_model_frame->get_model().get_main_mark_selection() );
418
 
  
 
409
 
419
410
  m_model_frame->do_action
420
411
    ( new action_modify_placement
421
412
      (m_snapshot, m, m_mark_left_spin->GetValue(),
425
416
 
426
417
/*----------------------------------------------------------------------------*/
427
418
/**
428
 
 * \brief The alignment has changed. 
 
419
 * \brief The alignment has changed.
429
420
 */
430
421
void bf::snapshot_frame::alignment_change()
431
422
{
432
423
  m_model_frame->do_action
433
424
    ( new action_modify_snapshot_alignment
434
425
      (m_snapshot,
435
 
       wx_to_std_string(m_x_alignment_choice->GetStringSelection()), 
 
426
       wx_to_std_string(m_x_alignment_choice->GetStringSelection()),
436
427
       m_x_alignment_value_spin->GetValue(),
437
 
       wx_to_std_string(m_y_alignment_choice->GetStringSelection()), 
 
428
       wx_to_std_string(m_y_alignment_choice->GetStringSelection()),
438
429
       m_y_alignment_value_spin->GetValue() ) );
439
430
} // snapshot_frame::alignment_change()
440
431
 
441
432
/*----------------------------------------------------------------------------*/
442
433
/**
443
 
 * \brief The size has changed. 
 
434
 * \brief The size has changed.
444
435
 */
445
436
void bf::snapshot_frame::size_change()
446
437
{
451
442
 
452
443
/*----------------------------------------------------------------------------*/
453
444
/**
454
 
 * \brief The sound has changed. 
 
445
 * \brief The sound has changed.
455
446
 */
456
447
void  bf::snapshot_frame::sound_change()
457
448
{
458
449
  sound_description sound;
459
 
  
460
 
  sound.set_file( wx_to_std_string( m_sound_path->GetValue() ) ); 
 
450
 
 
451
  sound.set_file( wx_to_std_string( m_sound_path->GetValue() ) );
461
452
  sound.set_played_globally(m_globally_sound_box->IsChecked());
462
453
  m_model_frame->do_action
463
 
    ( new action_modify_snapshot_sound(m_snapshot,sound) );
 
454
    ( new action_modify_snapshot_sound(m_snapshot, sound) );
464
455
} // snapshot_frame::sound_change()
465
456
 
466
457
/*----------------------------------------------------------------------------*/
467
458
/**
 
459
 * \brief Enable or disable the controls.
 
460
 * \param enable Tell if the controls have to be enabled.
 
461
 */
 
462
void  bf::snapshot_frame::enable_controls(bool enable)
 
463
{
 
464
  m_date_button->Enable(enable);
 
465
  m_mark_choice->Enable(enable);
 
466
  m_function_button->Enable(enable);
 
467
  m_mark_visible_box->Enable(enable);
 
468
  m_sound_button->Enable(enable);
 
469
  m_sound_path->Enable(enable);
 
470
  m_globally_sound_box->Enable(enable);
 
471
  m_width_spin->Enable(enable);
 
472
  m_height_spin->Enable(enable);
 
473
  m_x_alignment_choice->Enable(enable);
 
474
  m_y_alignment_choice->Enable(enable);
 
475
  m_x_alignment_value_spin->Enable(enable);
 
476
  m_y_alignment_value_spin->Enable(enable);
 
477
} // snapshot_frame::enable_controls()
 
478
 
 
479
/*----------------------------------------------------------------------------*/
 
480
/**
468
481
 * \brief Procedure called when closing the window.
469
482
 * \param event This event occured.
470
483
 */
482
495
 * \brief The date button is pressed.
483
496
 * \param event The event that occured.
484
497
 */
485
 
void bf::snapshot_frame::on_date_change( wxCommandEvent& event )
 
498
void bf::snapshot_frame::on_date_change( wxCommandEvent& WXUNUSED(event) )
486
499
{
487
500
  action& act = m_model_frame->get_model().get_active_action();
488
501
  snapshot_date_frame dlg(this, &act);
489
 
  
 
502
 
490
503
  dlg.fill_from( m_snapshot );
491
 
  
 
504
 
492
505
  if ( dlg.ShowModal() == wxID_OK )
493
506
    {
494
507
      double new_date = dlg.get_date();
495
508
      double initial_date = m_snapshot->get_date();
496
 
      
497
 
      if ( new_date != initial_date ) 
 
509
 
 
510
      if ( new_date != initial_date )
498
511
        {
499
512
          action_group* group = new action_group();
500
513
          group->set_description(_("Move snapshot"));
501
 
          
 
514
 
502
515
          if ( act.has_snapshot_date( new_date ) )
503
516
            group->add_action
504
517
              ( new action_remove_snapshot
505
 
                ( act.get_name(), act.get_snapshot(new_date)));
506
 
          
 
518
                ( act.get_name(),
 
519
                  act.get_snapshot_before_or_at_date(new_date)));
 
520
 
507
521
          group->add_action
508
522
            ( new action_move_snapshot(m_snapshot, new_date) );
509
 
          
 
523
 
510
524
          if ( initial_date == 0 )
511
525
            {
512
 
              snapshot* s = new snapshot(* act.get_snapshot(initial_date));
 
526
              snapshot* s =
 
527
                new snapshot
 
528
                ( *act.get_snapshot_before_or_at_date(initial_date));
513
529
              s->set_date(0);
514
530
              group->add_action
515
531
                ( new action_add_snapshot( act.get_name(), s));
516
532
            }
517
 
          
 
533
 
518
534
          m_model_frame->do_action(group);
519
535
          m_model_frame->set_date(new_date);
520
536
          fill();
527
543
 * \brief The selected mark has been modified.
528
544
 * \param event The event that occured.
529
545
 */
530
 
void bf::snapshot_frame::on_mark_change( wxCommandEvent& event )
 
546
void bf::snapshot_frame::on_mark_change( wxCommandEvent& WXUNUSED(event) )
531
547
{
532
548
  m_model_frame->set_mark_selection
533
549
    (wx_to_std_string(m_mark_choice->GetStringSelection()));
538
554
 * \brief The alignment has been modified.
539
555
 * \param event The event that occured.
540
556
 */
541
 
void bf::snapshot_frame::on_alignment_choice_change( wxCommandEvent& event )
 
557
void bf::snapshot_frame::on_alignment_choice_change
 
558
( wxCommandEvent& WXUNUSED(event) )
542
559
{
543
560
  alignment_change();
544
561
} // snapshot_frame::on_alignment_choice_change()
549
566
 * \brief The placement has been changed.
550
567
 * \param event The event that occured.
551
568
 */
552
 
void bf::snapshot_frame::on_placement_change( spin_event<double>& event )
 
569
void bf::snapshot_frame::on_placement_change
 
570
( spin_event<double>& WXUNUSED(event) )
553
571
{
554
572
  placement_change();
555
573
} // snapshot_frame::on_placement_change()
559
577
 * \brief The alignment has been changed.
560
578
 * \param event The event that occured.
561
579
 */
562
 
void bf::snapshot_frame::on_alignment_change( spin_event<double>& event )
 
580
void bf::snapshot_frame::on_alignment_change
 
581
( spin_event<double>& WXUNUSED(event) )
563
582
{
564
583
  alignment_change();
565
584
} // snapshot_frame::on_alignment_change()
569
588
 * \brief The size has been changed.
570
589
 * \param event The event that occured.
571
590
 */
572
 
void bf::snapshot_frame::on_size_change( spin_event<double>& event )
 
591
void bf::snapshot_frame::on_size_change( spin_event<double>& WXUNUSED(event) )
573
592
{
574
593
  size_change();
575
594
} // snapshot_frame::on_size_change()
579
598
 * \brief The depth control has been changed.
580
599
 * \param event The event that occured.
581
600
 */
582
 
void bf::snapshot_frame::on_depth_change( wxSpinEvent& event )
 
601
void bf::snapshot_frame::on_depth_change( wxSpinEvent& WXUNUSED(event) )
583
602
{
584
603
  placement_change();
585
604
} // snapshot_frame::on_depth_change()
589
608
 * \brief The visibility statut of the mark has been modified.
590
609
 * \param event The event that occured.
591
610
 */
592
 
void bf::snapshot_frame::on_visibility_change( wxCommandEvent& event )
 
611
void bf::snapshot_frame::on_visibility_change( wxCommandEvent& WXUNUSED(event) )
593
612
{
594
613
  placement_change();
595
614
} // snapshot_frame::on_visibility_change()
599
618
 * \brief The function button is pressed.
600
619
 * \param event The event that occured.
601
620
 */
602
 
void bf::snapshot_frame::on_function_change( wxCommandEvent& event )
 
621
void bf::snapshot_frame::on_function_change( wxCommandEvent& WXUNUSED(event) )
603
622
{
604
 
  wxTextEntryDialog dlg 
605
 
    (this, _("Function :"), _("Set function"), 
 
623
  wxTextEntryDialog dlg
 
624
    (this, _("Function:"), _("Set function"),
606
625
     std_to_wx_string(m_snapshot->get_function()) );
607
626
 
608
627
  if ( dlg.ShowModal() == wxID_OK )
609
628
    {
610
629
      m_model_frame->do_action
611
 
        ( new action_modify_function
 
630
              ( new action_modify_function
612
631
          (m_snapshot, wx_to_std_string(dlg.GetValue())) );
613
 
      
 
632
 
614
633
      fill();
615
634
    }
616
635
} // snapshot_frame::on_function_change()
620
639
 * \brief The globally_sound button is pressed.
621
640
 * \param event The event that occured.
622
641
 */
623
 
void bf::snapshot_frame::on_globally_sound_change( wxCommandEvent& event )
 
642
void bf::snapshot_frame::on_globally_sound_change
 
643
( wxCommandEvent& WXUNUSED(event) )
624
644
{
625
645
  sound_change();
626
646
} // snapshot_frame::on_globally_sound_change()
630
650
 * \brief The sound_file button is pressed.
631
651
 * \param event The event that occured.
632
652
 */
633
 
void bf::snapshot_frame::on_sound_file_edit( wxCommandEvent& event )
634
 
 
653
void bf::snapshot_frame::on_sound_file_edit( wxCommandEvent& WXUNUSED(event) )
 
654
{
635
655
  std::string p = wx_to_std_string(m_sound_path->GetValue());
636
656
  path_configuration::get_instance().get_full_path(p);
637
657
 
638
 
  wxFileDialog dlg(this,_("Choose a sound"), wxEmptyString, 
 
658
  wxFileDialog dlg(this,_("Choose a sound"), wxEmptyString,
639
659
                   std_to_wx_string(p),
640
 
                   _("sound files (*.ogg;*.wav)|*.wav;*.ogg"),
 
660
                   _("Sound files (*.ogg;*.wav)|*.wav;*.ogg"),
641
661
                   wxFD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST );
642
662
 
643
663
  if ( dlg.ShowModal() == wxID_OK )
644
664
    {
645
665
      std::string new_p = wx_to_std_string( dlg.GetPath() );
646
666
      path_configuration::get_instance().get_relative_path(new_p);
647
 
      
 
667
 
648
668
      m_sound_path->SetValue(std_to_wx_string(new_p) ) ;
649
669
 
650
670
      sound_change();
653
673
 
654
674
/*----------------------------------------------------------------------------*/
655
675
/**
656
 
 * \brief The sound_path has been modified.
 
676
 * \brief The text sound_file is edited.
657
677
 * \param event The event that occured.
658
678
 */
659
 
void bf::snapshot_frame::on_sound_file_change( wxCommandEvent& event )
660
 
 
679
void bf::snapshot_frame::on_sound_text_edit( wxCommandEvent& WXUNUSED(event) )
 
680
{
661
681
  sound_change();
662
 
} // snapshot_frame::on_sound_file_change()
 
682
} // snapshot_frame::on_sound_text_edit()
663
683
 
664
684
/*----------------------------------------------------------------------------*/
665
685
BEGIN_EVENT_TABLE(bf::snapshot_frame, wxPanel)
666
686
  EVT_CLOSE( bf::snapshot_frame::on_close )
667
687
  EVT_BUTTON( bf::snapshot_frame::IDC_DATE_CTRL,
668
688
              bf::snapshot_frame::on_date_change )
669
 
  EVT_CHOICE(bf::snapshot_frame::IDC_MARK_CHOICE, 
 
689
  EVT_CHOICE(bf::snapshot_frame::IDC_MARK_CHOICE,
670
690
             bf::snapshot_frame::on_mark_change)
671
 
  EVT_CHOICE(bf::snapshot_frame::IDC_ALIGNMENT, 
 
691
  EVT_CHOICE(bf::snapshot_frame::IDC_ALIGNMENT,
672
692
             bf::snapshot_frame::on_alignment_choice_change)
673
 
  EVT_SPIN_VALUE_CHANGE(bf::snapshot_frame::IDC_MARK_PLACEMENT, 
 
693
  EVT_SPIN_VALUE_CHANGE(bf::snapshot_frame::IDC_MARK_PLACEMENT,
674
694
                        bf::snapshot_frame::on_placement_change,
675
695
                        double)
676
 
  EVT_SPIN_VALUE_CHANGE(bf::snapshot_frame::IDC_ALIGNMENT, 
 
696
  EVT_SPIN_VALUE_CHANGE(bf::snapshot_frame::IDC_ALIGNMENT,
677
697
                        bf::snapshot_frame::on_alignment_change,
678
698
                        double)
679
 
  EVT_SPIN_VALUE_CHANGE(bf::snapshot_frame::IDC_SIZE, 
 
699
  EVT_SPIN_VALUE_CHANGE(bf::snapshot_frame::IDC_SIZE,
680
700
                        bf::snapshot_frame::on_size_change,
681
701
                        double)
682
702
  EVT_SPINCTRL( bf::snapshot_frame::IDC_MARK_PLACEMENT,
689
709
              bf::snapshot_frame::on_globally_sound_change )
690
710
  EVT_BUTTON( bf::snapshot_frame::IDC_SOUND_FILE,
691
711
              bf::snapshot_frame::on_sound_file_edit )
692
 
  EVT_TEXT_ENTER( bf::snapshot_frame::IDC_SOUND_FILE,
693
 
                  bf::snapshot_frame::on_sound_file_change )
 
712
  EVT_TEXT( bf::snapshot_frame::IDC_SOUND_TEXT,
 
713
            bf::snapshot_frame::on_sound_text_edit )
694
714
END_EVENT_TABLE()