=== modified file 'include/wxPcbStruct.h'
--- include/wxPcbStruct.h	2012-03-17 14:39:27 +0000
+++ include/wxPcbStruct.h	2012-04-25 23:44:38 +0000
@@ -200,10 +200,16 @@
      */
     int propagate();
 
+    void updatePadHighlighting( void );
+    
+    void updateSelHighlightValBox( void );
+
 public:
     LAYER_BOX_SELECTOR* m_SelLayerBox;  // a combo box to display and select active layer
     wxComboBox* m_SelTrackWidthBox;     // a combo box to display and select current track width
     wxComboBox* m_SelViaSizeBox;        // a combo box to display and select current via diameter
+    wxComboBox* m_SelPadHighlightModeBox;
+    wxComboBox* m_SelHighlightValBox;
 
     bool m_show_microwave_tools;
     bool m_show_layer_manager_tools;

=== modified file 'pcbnew/class_board.cpp'
--- pcbnew/class_board.cpp	2012-04-22 15:16:39 +0000
+++ pcbnew/class_board.cpp	2012-04-25 23:16:57 +0000
@@ -66,6 +66,10 @@
     m_NetClasses.GetDefault()->SetParams();
 
     SetCurrentNetClass( m_NetClasses.GetDefault()->GetName() );
+    
+    m_HighlightByValueMode = false;
+    m_HighlightByValueLayers = 0;
+    m_HighlightValue = wxEmptyString;   
 }
 
 
@@ -2193,3 +2197,29 @@
 }
 
 #endif
+
+void BOARD::EnableHighlightByValue( const wxString& aHighlightValue, int aLayerMask )
+{
+    m_HighlightByValueMode = true;
+    m_HighlightValue = aHighlightValue;
+    m_HighlightByValueLayers = aLayerMask;
+}
+
+void BOARD::DisableHighlightByValue( void )
+{
+    m_HighlightByValueMode = false;
+}
+
+bool BOARD::IsPadGrayedOut( D_PAD* aPad, int layer ) const
+{
+    wxASSERT( aPad );
+
+    if( !m_HighlightByValueMode )
+        return false;
+    
+    MODULE* module = static_cast<MODULE*>( aPad->GetParent() );
+    wxASSERT( module );
+    
+    return !( m_HighlightByValueLayers & layer ) || 
+           ( module->GetValue() != m_HighlightValue );
+}

=== modified file 'pcbnew/class_board.h'
--- pcbnew/class_board.h	2012-04-22 15:16:39 +0000
+++ pcbnew/class_board.h	2012-04-25 23:15:43 +0000
@@ -184,6 +184,10 @@
 
     /// Position of the origin axis, which is used in exports mostly
     wxPoint             m_originAxisPosition;
+        
+    bool                m_HighlightByValueMode;
+    int                 m_HighlightByValueLayers;
+    wxString            m_HighlightValue;
 
     /**
      * Function chainMarkedSegments
@@ -1325,6 +1329,12 @@
      *         aPosition and a pointer to the via are returned.
      */
     TRACK* CreateLockPoint( wxPoint& aPosition, TRACK* aSegment, PICKED_ITEMS_LIST* aList );
+
+    void EnableHighlightByValue( const wxString& aHighlightValue, int aLayerMask );
+    
+    void DisableHighlightByValue( void );
+    
+    bool IsPadGrayedOut( D_PAD* aPAD, int aLayer ) const;
 };
 
 #endif      // #ifndef CLASS_BOARD_H

=== modified file 'pcbnew/class_pad_draw_functions.cpp'
--- pcbnew/class_pad_draw_functions.cpp	2012-04-19 06:55:45 +0000
+++ pcbnew/class_pad_draw_functions.cpp	2012-04-26 00:17:34 +0000
@@ -141,14 +141,35 @@
     else
         drawInfo.m_ShowPadFilled = false;
 
-    if( m_layerMask & LAYER_FRONT )
-    {
-        color = brd->GetVisibleElementColor( PAD_FR_VISIBLE );
-    }
-
-    if( m_layerMask & LAYER_BACK )
-    {
-        color |= brd->GetVisibleElementColor( PAD_BK_VISIBLE );
+    const bool isOnFront = m_layerMask & LAYER_FRONT;
+    const bool isOnBack = m_layerMask & LAYER_BACK;
+    
+    if( isOnFront && isOnBack )
+    {
+        if( brd->IsPadGrayedOut( this, LAYER_FRONT ) && 
+            brd->IsPadGrayedOut( this, LAYER_BACK ) )
+        {
+            color = DARKDARKGRAY;
+        }
+        else
+        {
+            color = brd->GetVisibleElementColor( PAD_FR_VISIBLE ) | 
+                    brd->GetVisibleElementColor( PAD_BK_VISIBLE );
+        }
+    }
+    else if ( isOnFront )
+    {
+        if( brd->IsPadGrayedOut( this, LAYER_FRONT ) )
+            color = DARKDARKGRAY;
+        else
+            color = brd->GetVisibleElementColor( PAD_FR_VISIBLE );       
+    }
+    else if ( isOnBack )
+    {
+        if( brd->IsPadGrayedOut( this, LAYER_BACK ) )
+            color = DARKDARKGRAY;
+        else
+            color = brd->GetVisibleElementColor( PAD_BK_VISIBLE );
     }
 
     if( color == 0 ) /* Not on copper layer */

=== modified file 'pcbnew/edit.cpp'
--- pcbnew/edit.cpp	2012-03-26 23:47:08 +0000
+++ pcbnew/edit.cpp	2012-04-25 23:52:35 +0000
@@ -1104,6 +1104,35 @@
     case ID_MENU_ARCHIVE_ALL_MODULES:
         ArchiveModulesOnBoard( wxEmptyString, false );
         break;
+        
+    case ID_TOOLBARH_PCB_SELECT_HIGHLIGHT_MODE: 
+    case ID_TOOLBARH_PCB_SELECT_HIGHLIGHT_VAL:
+        updatePadHighlighting();
+        break;
+
+    case ID_TOOLBARH_PCB_PREV_HIGHLIGHT_VAL:
+        if ( m_SelPadHighlightModeBox->GetSelection() > 0 )
+        {
+            const int selected = m_SelHighlightValBox->GetSelection();
+            if ( selected > 0 )
+            {   
+                m_SelHighlightValBox->SetSelection( selected - 1 );
+                updatePadHighlighting();
+            }
+        }
+        break;
+
+    case ID_TOOLBARH_PCB_NEXT_HIGHLIGHT_VAL:
+         if ( m_SelPadHighlightModeBox->GetSelection() > 0 )
+         {
+            const int selected = m_SelHighlightValBox->GetSelection();
+            if ( selected >= 0 && selected < m_SelHighlightValBox->GetCount() - 1)
+            {   
+                m_SelHighlightValBox->SetSelection( selected + 1 );            
+                updatePadHighlighting();
+            }
+        }
+        break;
 
     default:
         wxString msg;
@@ -1381,3 +1410,32 @@
         break;
     }
 }
+
+void PCB_EDIT_FRAME::updatePadHighlighting()
+{
+    static const int layerMasks[] = 
+    {
+        0,
+        LAYER_FRONT,
+        LAYER_BACK,
+        LAYER_FRONT | LAYER_BACK
+    };
+
+    const int mode = m_SelPadHighlightModeBox->GetSelection();
+    const bool enabled = ( mode != 0 );
+
+    if ( m_Pcb )
+    {
+        if ( enabled )        
+            m_Pcb->EnableHighlightByValue( m_SelHighlightValBox->GetValue(), layerMasks[mode] );        
+        else
+            m_Pcb->DisableHighlightByValue();
+
+        m_canvas->Refresh();
+    }
+
+    m_SelHighlightValBox->Enable( enabled );
+    m_mainToolBar->EnableTool( ID_TOOLBARH_PCB_PREV_HIGHLIGHT_VAL, enabled );
+    m_mainToolBar->EnableTool( ID_TOOLBARH_PCB_NEXT_HIGHLIGHT_VAL, enabled );
+    m_mainToolBar->Refresh();
+}

=== modified file 'pcbnew/files.cpp'
--- pcbnew/files.cpp	2012-04-17 01:35:43 +0000
+++ pcbnew/files.cpp	2012-04-25 23:20:00 +0000
@@ -135,6 +135,10 @@
                                            GetChars( PcbFileExtension ) );
         UpdateTitle();
         ReCreateLayerBox( NULL );
+        
+        updateSelHighlightValBox();
+        m_SelPadHighlightModeBox->SetSelection( 0 );
+        updatePadHighlighting();
         break;
 
     case ID_SAVE_BOARD:
@@ -317,6 +321,9 @@
 
     updateTraceWidthSelectBox();
     updateViaSizeSelectBox();
+    
+    updateSelHighlightValBox();
+    updatePadHighlighting();
 
     // Display the loaded board:
     Zoom_Automatique( false );

=== modified file 'pcbnew/hotkeys.cpp'
--- pcbnew/hotkeys.cpp	2012-02-19 17:33:06 +0000
+++ pcbnew/hotkeys.cpp	2012-04-25 23:23:49 +0000
@@ -190,6 +190,10 @@
 
 static EDA_HOTKEY HkCallMacros9( wxT( "Call Macro 9" ), HK_CALL_MACROS_9, '9' );
 
+static EDA_HOTKEY HkPrevHighlightVal( wxT( "Select Previous Highlight Value"), HK_PREV_HIGHLIGHT_VAL, '[' );
+
+static EDA_HOTKEY HkNextHighlightVal( wxT( "Select Next Highlight Value"), HK_NEXT_HIGHLIGHT_VAL, ']' );
+
 
 // List of common hotkey descriptors
 EDA_HOTKEY* common_Hotkey_List[] =
@@ -225,7 +229,7 @@
     &HkRecordMacros4,          &HkCallMacros4,    &HkRecordMacros5,          &HkCallMacros5,
     &HkRecordMacros6,          &HkCallMacros6,    &HkRecordMacros7,          &HkCallMacros7,
     &HkRecordMacros8,          &HkCallMacros8,    &HkRecordMacros9,          &HkCallMacros9,
-    &HkSwitchHighContrastMode,
+    &HkSwitchHighContrastMode, &HkPrevHighlightVal,  &HkNextHighlightVal,
     NULL
 };
 

=== modified file 'pcbnew/hotkeys.h'
--- pcbnew/hotkeys.h	2012-02-19 17:33:06 +0000
+++ pcbnew/hotkeys.h	2012-04-25 23:21:15 +0000
@@ -78,6 +78,8 @@
     HK_RECORD_MACROS_9,
     HK_CALL_MACROS_9,
     HK_SWITCH_HIGHCONTRAST_MODE,
+    HK_PREV_HIGHLIGHT_VAL,
+    HK_NEXT_HIGHLIGHT_VAL
 };
 
 // Full list of hotkey descriptors for board editor and footprint editor

=== modified file 'pcbnew/hotkeys_board_editor.cpp'
--- pcbnew/hotkeys_board_editor.cpp	2012-02-20 18:46:56 +0000
+++ pcbnew/hotkeys_board_editor.cpp	2012-04-25 23:31:54 +0000
@@ -630,7 +630,15 @@
     case HK_SWITCH_HIGHCONTRAST_MODE: // switch to high contrast mode and refresh the canvas
         DisplayOpt.ContrastModeDisplay = !DisplayOpt.ContrastModeDisplay;
         m_canvas->Refresh();
-	break;
+        break;
+    
+    case HK_PREV_HIGHLIGHT_VAL:
+        evt_type = ID_TOOLBARH_PCB_PREV_HIGHLIGHT_VAL;
+        break;
+
+    case HK_NEXT_HIGHLIGHT_VAL:
+        evt_type = ID_TOOLBARH_PCB_NEXT_HIGHLIGHT_VAL;
+        break;
     }
 
     if( evt_type != 0 )

=== modified file 'pcbnew/pcbframe.cpp'
--- pcbnew/pcbframe.cpp	2012-04-16 23:31:29 +0000
+++ pcbnew/pcbframe.cpp	2012-04-26 00:19:44 +0000
@@ -172,7 +172,11 @@
     EVT_COMBOBOX( ID_AUX_TOOLBAR_PCB_VIA_SIZE, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event )
     EVT_TOOL( ID_TOOLBARH_PCB_MODE_MODULE, PCB_EDIT_FRAME::OnSelectAutoPlaceMode )
     EVT_TOOL( ID_TOOLBARH_PCB_MODE_TRACKS, PCB_EDIT_FRAME::OnSelectAutoPlaceMode )
-    EVT_TOOL( ID_TOOLBARH_PCB_FREEROUTE_ACCESS, PCB_EDIT_FRAME::Access_to_External_Tool )
+    EVT_TOOL( ID_TOOLBARH_PCB_FREEROUTE_ACCESS, PCB_EDIT_FRAME::Access_to_External_Tool )    
+    EVT_COMBOBOX( ID_TOOLBARH_PCB_SELECT_HIGHLIGHT_MODE, PCB_EDIT_FRAME::Process_Special_Functions )        
+    EVT_COMBOBOX( ID_TOOLBARH_PCB_SELECT_HIGHLIGHT_VAL, PCB_EDIT_FRAME::Process_Special_Functions )
+    EVT_TOOL( ID_TOOLBARH_PCB_PREV_HIGHLIGHT_VAL, PCB_EDIT_FRAME::Process_Special_Functions )
+    EVT_TOOL( ID_TOOLBARH_PCB_NEXT_HIGHLIGHT_VAL, PCB_EDIT_FRAME::Process_Special_Functions )
 
     // Option toolbar
     EVT_TOOL( ID_TB_OPTIONS_DRC_OFF,
@@ -275,6 +279,8 @@
     m_SelTrackWidthBox = NULL;
     m_SelViaSizeBox = NULL;
     m_SelLayerBox = NULL;
+    m_SelHighlightValBox = NULL;
+    m_SelPadHighlightModeBox = NULL;
     m_show_microwave_tools = false;
     m_show_layer_manager_tools = true;
     m_HotkeysZoomAndGridList = g_Board_Editor_Hokeys_Descr;
@@ -734,6 +740,8 @@
 
     if( m_Draw3DFrame )
         m_Draw3DFrame->ReloadRequest();
+    
+    updateSelHighlightValBox();
 }
 
 
@@ -779,4 +787,3 @@
         m_autoPlaceModeId = 0;
     }
 }
-

=== modified file 'pcbnew/pcbnew_id.h'
--- pcbnew/pcbnew_id.h	2012-02-12 19:39:37 +0000
+++ pcbnew/pcbnew_id.h	2012-04-25 23:45:37 +0000
@@ -232,6 +232,10 @@
     ID_TOOLBARH_PCB_MODE_MODULE,
     ID_TOOLBARH_PCB_MODE_TRACKS,
     ID_TOOLBARH_PCB_FREEROUTE_ACCESS,
+    ID_TOOLBARH_PCB_SELECT_HIGHLIGHT_MODE,
+    ID_TOOLBARH_PCB_SELECT_HIGHLIGHT_VAL,
+    ID_TOOLBARH_PCB_PREV_HIGHLIGHT_VAL,
+    ID_TOOLBARH_PCB_NEXT_HIGHLIGHT_VAL,
 
     ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR,
 

=== modified file 'pcbnew/tool_pcb.cpp'
--- pcbnew/tool_pcb.cpp	2012-03-20 14:17:58 +0000
+++ pcbnew/tool_pcb.cpp	2012-04-25 23:55:17 +0000
@@ -36,13 +36,14 @@
 #include <wxPcbStruct.h>
 
 #include <class_board.h>
+#include <class_module.h>
 
 #include <pcbnew.h>
 #include <pcbnew_id.h>
 #include <hotkeys.h>
 
 #include <wx/wupdlock.h>
-
+#include <boost/foreach.hpp>
 
 #ifdef __UNIX__
 #define LISTBOX_WIDTH 150
@@ -86,6 +87,16 @@
     { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
 };
 
+static const wxString PadHighlightChoices[] =
+{
+    _( "No pad highlighting " ),
+    _( "Highlight front pads" ),
+    _( "Highlight back pads" ),
+    _( "Highlight front and back pads" )
+};
+
+#define PAD_HIGHLIGHT_MODE_CNT ( sizeof( PadHighlightChoices ) / sizeof( wxString ) ) 
+
 
 /* Draw the icon for the "Select layer pair" bitmap tool
  */
@@ -297,6 +308,48 @@
                             _( "Fast access to the Web Based FreeROUTE advanced router" ) );
 
     m_mainToolBar->AddSeparator();
+    
+    //Pad highlighting items
+    if( m_SelPadHighlightModeBox == NULL )
+    {
+        m_SelPadHighlightModeBox = new wxComboBox( m_mainToolBar,
+                                                   ID_TOOLBARH_PCB_SELECT_HIGHLIGHT_MODE,
+                                                   wxEmptyString,
+                                                   wxDefaultPosition,
+                                                   wxDefaultSize,
+                                                   PAD_HIGHLIGHT_MODE_CNT,
+                                                   PadHighlightChoices,
+                                                   wxCB_READONLY );
+        m_SelPadHighlightModeBox->SetSelection( 0 );
+        m_SelPadHighlightModeBox->SetToolTip( _( "Select pad highlight mode" ) );
+    }
+    m_mainToolBar->AddControl( m_SelPadHighlightModeBox );
+
+    if( m_SelHighlightValBox == NULL )
+    {
+        m_SelHighlightValBox = new wxComboBox( m_mainToolBar,
+                                               ID_TOOLBARH_PCB_SELECT_HIGHLIGHT_VAL,
+                                               wxEmptyString,
+                                               wxDefaultPosition,
+                                               wxDefaultSize,
+                                               0,
+                                               NULL,
+                                               wxCB_READONLY );        
+        m_SelHighlightValBox->SetToolTip( _( "Select module value for highlighting pads" ) );
+        m_SelHighlightValBox->Disable();
+        updateSelHighlightValBox();
+    }
+    m_mainToolBar->AddControl( m_SelHighlightValBox );
+
+    m_mainToolBar->AddTool( ID_TOOLBARH_PCB_PREV_HIGHLIGHT_VAL, wxEmptyString, 
+                         KiBitmap( left_xpm ), _( "Select next highlight value" ));
+    m_mainToolBar->AddTool( ID_TOOLBARH_PCB_NEXT_HIGHLIGHT_VAL, wxEmptyString, 
+                         KiBitmap( right_xpm ), _( "Select previous highlight value" ));
+
+    m_mainToolBar->EnableTool( ID_TOOLBARH_PCB_PREV_HIGHLIGHT_VAL, false );
+    m_mainToolBar->EnableTool( ID_TOOLBARH_PCB_NEXT_HIGHLIGHT_VAL, false );
+    
+    m_mainToolBar->AddSeparator();
 
     // after adding the buttons to the toolbar, must call Realize() to reflect the changes
     m_mainToolBar->Realize();
@@ -655,3 +708,31 @@
 
     return m_SelLayerBox;
 }
+
+void PCB_EDIT_FRAME::updateSelHighlightValBox()
+{
+    if( m_SelHighlightValBox == NULL )
+        return;
+
+    const wxString prevItem = m_SelHighlightValBox->GetValue();
+    m_SelHighlightValBox->Clear();
+
+    std::set<wxString> values;
+    for( MODULE* module = m_Pcb->m_Modules; module; module = module->Next() )
+    {
+        const wxString& val = module->GetValue();
+        values.insert( val );
+    }
+    
+    BOOST_FOREACH( const wxString& item, values )
+    {
+        m_SelHighlightValBox->Append( item );
+    }
+
+    int selIdx = ( m_SelHighlightValBox->GetCount() == 0 ) ? wxNOT_FOUND : 0;         
+    if ( !prevItem.IsEmpty() )
+        selIdx = m_SelHighlightValBox->FindString( prevItem );
+    
+    if ( selIdx != wxNOT_FOUND )
+        m_SelHighlightValBox->SetSelection( selIdx );
+}

