Update of /cvsroot/audacity/audacity-src/src
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv30753/src

Modified Files:
        AColor.cpp AColor.h AllThemeResources.h LabelTrack.cpp 
        LabelTrack.h 
Log Message:
Reduce number of GDI handles required on Windows.

Index: AColor.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/AColor.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- AColor.h    13 Apr 2006 11:57:09 -0000      1.8
+++ AColor.h    6 Nov 2006 05:36:45 -0000       1.9
@@ -62,6 +62,14 @@
    static wxPen WideEnvelopePen;
    static wxBrush envelopeBrush;
 
+   static wxBrush labelTextNormalBrush;
+   static wxBrush labelTextEditBrush;
+   static wxBrush labelUnselectedBrush;
+   static wxBrush labelSelectedBrush;
+   static wxPen labelUnselectedPen;
+   static wxPen labelSelectedPen;
+   static wxPen labelSurroundPen;
+
    static wxBrush tooltipBrush;
 
 

Index: LabelTrack.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/LabelTrack.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- LabelTrack.cpp      22 Oct 2006 20:35:21 -0000      1.72
+++ LabelTrack.cpp      6 Nov 2006 05:36:45 -0000       1.73
@@ -82,7 +82,6 @@
    mMouseOverLabelRight(-1),
    mIsAdjustingLabel(false)
 {
-   InitColours();
    SetDefaultName(_("Label Track"));
    SetName(GetDefaultName());
 
@@ -105,8 +104,6 @@
    mMouseOverLabelRight(-1),
    mIsAdjustingLabel(false)
 {
-   InitColours();
-
    int len = orig.mLabels.Count();
 
    for (int i = 0; i < len; i++) {
@@ -559,15 +556,15 @@
 
    wxRect before = r;
    before.width = int ((dsel0 - h) * pps);
-   dc.SetBrush(mUnselectedBrush);
-   dc.SetPen(mUnselectedPen);
+   dc.SetBrush(AColor::labelUnselectedBrush);
+   dc.SetPen(AColor::labelUnselectedPen);
    dc.DrawRectangle(before);
 
    wxRect selr = r;
    selr.x += before.width;
    selr.width = int ((dsel1 - dsel0) * pps);
-   dc.SetBrush(mSelectedBrush);
-   dc.SetPen(mSelectedPen);
+   dc.SetBrush(AColor::labelSelectedBrush);
+   dc.SetPen(AColor::labelSelectedPen);
    dc.DrawRectangle(selr);
 
    wxRect after = r;
@@ -579,8 +576,8 @@
       after.x = r.x;
    }
 
-   dc.SetBrush(mUnselectedBrush);
-   dc.SetPen(mUnselectedPen);
+   dc.SetBrush(AColor::labelUnselectedBrush);
+   dc.SetPen(AColor::labelUnselectedPen);
    dc.DrawRectangle(after);
 
    int i;
@@ -611,8 +608,8 @@
    ComputeLayout( r, h , pps );
    dc.SetTextForeground(theTheme.Colour( clrLabelTrackText));
    dc.SetBackgroundMode(wxTRANSPARENT);
-   dc.SetBrush(mTextNormalBrush);
-   dc.SetPen(mLabelSurroundPen);
+   dc.SetBrush(AColor::labelTextNormalBrush);
+   dc.SetPen(AColor::labelSurroundPen);
    const int nLabels = (int)mLabels.Count();
    int GlyphLeft;
    int GlyphRight;
@@ -640,9 +637,9 @@
    // Draw the label boxes.
    for (i = 0; i < nLabels; i++)
    {
-      if( mSelIndex==i) dc.SetBrush(mTextEditBrush);
+      if( mSelIndex==i) dc.SetBrush(AColor::labelTextEditBrush);
       mLabels[i]->DrawTextBox( dc, r );
-      if( mSelIndex==i) dc.SetBrush(mTextNormalBrush);
+      if( mSelIndex==i) dc.SetBrush(AColor::labelTextNormalBrush);
    }
 
    // Draw highlights
@@ -664,9 +661,9 @@
    // Draw the text and the label boxes.
    for (i = 0; i < nLabels; i++)
    {
-      if( mSelIndex==i) dc.SetBrush(mTextEditBrush);
+      if( mSelIndex==i) dc.SetBrush(AColor::labelTextEditBrush);
       mLabels[i]->DrawText( dc, r );
-      if( mSelIndex==i) dc.SetBrush(mTextNormalBrush);
+      if( mSelIndex==i) dc.SetBrush(AColor::labelTextNormalBrush);
    }
 
    // Draw the cursor, if there is one.
@@ -1976,25 +1973,6 @@
    mLabels.RemoveAt(index);
 }
 
-// Private method called from the constructor
-void LabelTrack::InitColours()
-{
-// JKC: Standard Audacity colours are grays and shades of blue.
-// To keep interface 'unified' only use special colors
-// where there is a good/established reason, e.g.
-//   Red   - Record.
-//   Green - Playback.
-   mLabelSurroundPen.SetColour( 0, 0, 0);
-   mTextEditBrush.SetColour( 255,255,255);
-   mTextNormalBrush.SetColour( 190,190,240 );// #BEBEF0
-
-   mUnselectedBrush.SetColour(192, 192, 192);
-   mSelectedBrush.SetColour(148, 148, 170);
-
-   mUnselectedPen.SetColour(192, 192, 192);
-   mSelectedPen.SetColour(148, 148, 170);
-}
-
 wxBitmap & LabelTrack::GetGlyph( int i)
 {
    return theTheme.Bitmap( i + bmpLabelGlyph0);

Index: LabelTrack.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/LabelTrack.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- LabelTrack.h        23 Sep 2006 02:28:04 -0000      1.35
+++ LabelTrack.h        6 Nov 2006 05:36:45 -0000       1.36
@@ -182,15 +182,6 @@
    int mxMouseDisplacement;    /// Displacement of mouse cursor from the 
centre being dragged.
    LabelArray mLabels;
 
-   wxBrush mUnselectedBrush;
-   wxBrush mSelectedBrush;
-   wxBrush mTextNormalBrush;
-   wxBrush mTextEditBrush;
-
-   wxPen mLabelSurroundPen;
-   wxPen mUnselectedPen;
-   wxPen mSelectedPen;
-
    static int mIconHeight;
    static int mIconWidth;
    static int mTextHeight;
@@ -214,7 +205,6 @@
    // Used only for a LabelTrack on the clipboard
    double mClipLen;
 
-   void InitColours();
    void ComputeLayout(wxRect & r, double h, double pps);
    void ComputeTextPosition(wxRect & r, int index);
    void SetCurrentCursorPosition(wxDC & dc, int xPos);

Index: AllThemeResources.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/AllThemeResources.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- AllThemeResources.h 11 Jul 2006 08:14:12 -0000      1.6
+++ AllThemeResources.h 6 Nov 2006 05:36:45 -0000       1.7
@@ -264,3 +264,22 @@
    DEFINE_COLOUR( clrTimeBack,             wxColour(   160,160,160),  
wxT("TimeBack") ); 
    DEFINE_COLOUR( clrTimeFontFocus,        wxColour(     0,  0,  0),  
wxT("TimeFontFocus") );
    DEFINE_COLOUR( clrTimeBackFocus,        wxColour(   242,242,255),  
wxT("TimeBackFocus") );
+
+   DEFINE_COLOUR( clrLabelTextNormalBrush, wxColour(   190,190,240),  
wxT("LabelTextNormalBrush") );
+   DEFINE_COLOUR( clrLabelTextEditBrush,   wxColour(   255,255,255),  
wxT("LabelTextEditBrush") );
+   DEFINE_COLOUR( clrLabelUnselectedBrush, wxColour(   192,192,192),  
wxT("LabelUnselectedBrush") );
+   DEFINE_COLOUR( clrLabelSelectedBrush,   wxColour(   148,148,170),  
wxT("LabelSelectedBrush") );
+   DEFINE_COLOUR( clrLabelUnselectedPen,   wxColour(   192,192,192),  
wxT("LabelUnselectedPen") );
+   DEFINE_COLOUR( clrLabelSelectedPen,     wxColour(   148,148,170),  
wxT("LabelSelectedPen") );
+   DEFINE_COLOUR( clrLabelSurroundPen,     wxColour(     0,  0,  0),  
wxT("LabelSurroundPen") );
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: b8a9d878-fa18-4cba-a5ce-3c61b5d77f0e

Index: AColor.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/AColor.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- AColor.cpp  25 Aug 2006 05:03:34 -0000      1.19
+++ AColor.cpp  6 Nov 2006 05:36:45 -0000       1.20
@@ -45,6 +45,15 @@
 wxBrush AColor::envelopeBrush;
 wxPen AColor::envelopePen;
 wxPen AColor::WideEnvelopePen;
+
+wxBrush AColor::labelTextNormalBrush;
+wxBrush AColor::labelTextEditBrush;
+wxBrush AColor::labelUnselectedBrush;
+wxBrush AColor::labelSelectedBrush;
+wxPen AColor::labelUnselectedPen;
+wxPen AColor::labelSelectedPen;
+wxPen AColor::labelSurroundPen;
+
 wxBrush AColor::tooltipBrush;
 
 //
@@ -202,7 +211,15 @@
    theTheme.SetBrushColour( envelopeBrush,   clrEnvelope );
 
    WideEnvelopePen.SetWidth( 3 );
-   
+
+   theTheme.SetBrushColour( labelTextNormalBrush, clrLabelTextNormalBrush );
+   theTheme.SetBrushColour( labelTextEditBrush,   clrLabelTextEditBrush );
+   theTheme.SetBrushColour( labelUnselectedBrush, clrLabelUnselectedBrush );
+   theTheme.SetBrushColour( labelSelectedBrush,   clrLabelSelectedBrush );
+   theTheme.SetPenColour( labelUnselectedPen,   clrLabelUnselectedPen );
+   theTheme.SetPenColour( labelSelectedPen,     clrLabelSelectedPen );
+   theTheme.SetPenColour( labelSurroundPen,     clrLabelSurroundPen );
+
    // These colors were modified to avoid using reserved colors red and green
    // for the buttons.
    theTheme.SetBrushColour( muteBrush[0],      clrMuteButtonActive);      


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to