File: TrackPanel2.cpp

package info (click to toggle)
audacity 2.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 86,844 kB
  • sloc: ansic: 225,005; cpp: 221,240; sh: 27,327; python: 16,896; makefile: 8,186; lisp: 8,002; perl: 317; xml: 307; sed: 16
file content (133 lines) | stat: -rw-r--r-- 3,644 bytes parent folder | download | duplicates (2)
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
/**********************************************************************

  Audacity: A Digital Audio Editor

  Registrar.cpp

  James Crook

  Audacity is free software.
  This file is licensed under the wxWidgets license, see License.txt

********************************************************************//**

\class TrackPanel2
\brief TrackPanel2 is the start of the new TrackPanel.

*//********************************************************************/

#include <wx/wx.h>
#include "ShuttleGui.h"
#include "widgets/LinkingHtmlWindow.h"
#include "SkewedRuler.h"
#include "Registrar.h"
#include "TrackPanel2.h"

TrackPanel * TrackPanel2Factory(wxWindow * parent,
   wxWindowID id,
   const wxPoint & pos,
   const wxSize & size,
   TrackList * tracks,
   ViewInfo * viewInfo,
   TrackPanelListener * listener,
   AdornedRulerPanel * ruler)
{
   return new TrackPanel2(
      parent,
      id,
      pos,
      size,
      tracks,
      viewInfo,
      listener,
      ruler);
}

void ShowExtraDialog()
{
   int k=42;

   wxDialog Dlg(NULL, wxID_ANY, wxString(wxT("Experimental Extra Dialog")));
   ShuttleGui S(&Dlg, eIsCreating);
   S.StartNotebook();
   {
      S.StartNotebookPage( _("Panel 1") );
      S.StartVerticalLay(1);
      {
         HtmlWindow *html = new LinkingHtmlWindow(S.GetParent(), -1,
                                               wxDefaultPosition,
                                               wxSize(600, 359), 
                                               wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER);
         html->SetFocus();
         html->SetPage(wxT("<h1><font color=\"blue\">An Html Window</font></h1>Replace with whatever you like."));
         S.Prop(1).AddWindow( html, wxEXPAND );
      }
      S.EndVerticalLay();
      S.EndNotebookPage();

      S.StartNotebookPage( _("Diagnostics") );
      S.StartVerticalLay(1);
      {
         HtmlWindow *html = new LinkingHtmlWindow(S.GetParent(), -1,
                                               wxDefaultPosition,
                                               wxSize(600, 359), 
                                               wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER);
         html->SetFocus();
         html->SetPage(wxT("<h1>Diagnostics</h1>This is an html diagnostics page"));
         S.Prop(1).AddWindow( html, wxEXPAND );
      }
      S.EndVerticalLay();
      S.EndNotebookPage();
   }
   S.EndNotebook();
   
   wxButton *ok = new wxButton(S.GetParent(), wxID_OK, _("OK... Audacious!"));
   ok->SetDefault();
   S.Prop(0).AddWindow( ok );

   Dlg.Fit();

   Dlg.ShowModal();
}


int TrackPanel2Dispatch( Registrar & R, t_RegistrarDispatchType Type )
{
   switch( Type )
   {
   case RegResource:
      R.pShowFn = ShowExtraDialog;
      break;
   case RegArtist:
      break;
   case RegDataType:
      break;
   case RegCommand:
      break;
   case RegMenuItem:
      break;
   default:
      break;
   }
   return 1;
}

TrackPanel2::TrackPanel2(
   wxWindow * parent, wxWindowID id, const wxPoint & pos, const wxSize & size,
   TrackList * tracks, ViewInfo * viewInfo, TrackPanelListener * listener,
   AdornedRulerPanel * ruler) : 
      TrackPanel(
         parent, id, pos, size,
         tracks, viewInfo, listener, ruler)
{
}


// Here is a sample function that shows that TrackPanel2 is being invoked.
void TrackPanel2::OnPaint(wxPaintEvent & event)
{
// Hmm... Log debug will only show if you open the log window.
// wxLogDebug( wxT("Paint TrackPanel2 requested") );
   TrackPanel::OnPaint( event );
}