249 lines
7.0 KiB
C++
249 lines
7.0 KiB
C++
/////////////////////////////////////////////////////////////////////////////
|
|
// Name: dialog_find.cpp
|
|
// Purpose:
|
|
// Author: jean-pierre Charras
|
|
// Modified by:
|
|
// Created: 16/02/2006 20:18:11
|
|
// RCS-ID:
|
|
// Copyright: License GNU
|
|
// Licence:
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Generated by DialogBlocks (unregistered), 16/02/2006 20:18:11
|
|
|
|
|
|
////@begin includes
|
|
////@end includes
|
|
|
|
#include "dialog_find.h"
|
|
|
|
////@begin XPM images
|
|
////@end XPM images
|
|
|
|
/*!
|
|
* WinEDA_FindFrame type definition
|
|
*/
|
|
|
|
IMPLEMENT_DYNAMIC_CLASS( WinEDA_FindFrame, wxDialog )
|
|
|
|
/*!
|
|
* WinEDA_FindFrame event table definition
|
|
*/
|
|
|
|
BEGIN_EVENT_TABLE( WinEDA_FindFrame, wxDialog )
|
|
|
|
////@begin WinEDA_FindFrame event table entries
|
|
EVT_BUTTON( FIND_SHEET, WinEDA_FindFrame::OnFindSheetClick )
|
|
|
|
EVT_BUTTON( FIND_HIERARCHY, WinEDA_FindFrame::OnFindHierarchyClick )
|
|
|
|
EVT_BUTTON( FIND_NEXT, WinEDA_FindFrame::OnFindNextClick )
|
|
|
|
EVT_BUTTON( FIND_MARKERS, WinEDA_FindFrame::OnFindMarkersClick )
|
|
|
|
EVT_BUTTON( FIND_NEXT_MARKER, WinEDA_FindFrame::OnFindNextMarkerClick )
|
|
|
|
EVT_BUTTON( LOCATE_IN_LIBRARIES, WinEDA_FindFrame::OnLocateInLibrariesClick )
|
|
|
|
////@end WinEDA_FindFrame event table entries
|
|
|
|
END_EVENT_TABLE()
|
|
|
|
/*!
|
|
* WinEDA_FindFrame constructors
|
|
*/
|
|
|
|
WinEDA_FindFrame::WinEDA_FindFrame( )
|
|
{
|
|
}
|
|
|
|
WinEDA_FindFrame::WinEDA_FindFrame( WinEDA_SchematicFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
|
|
{
|
|
m_Parent = parent;
|
|
Create(parent, id, caption, pos, size, style);
|
|
}
|
|
|
|
/*!
|
|
* WinEDA_FindFrame creator
|
|
*/
|
|
|
|
bool WinEDA_FindFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
|
|
{
|
|
////@begin WinEDA_FindFrame member initialisation
|
|
m_NewTextCtrl = NULL;
|
|
////@end WinEDA_FindFrame member initialisation
|
|
|
|
////@begin WinEDA_FindFrame creation
|
|
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
|
|
wxDialog::Create( parent, id, caption, pos, size, style );
|
|
|
|
CreateControls();
|
|
GetSizer()->Fit(this);
|
|
GetSizer()->SetSizeHints(this);
|
|
Centre();
|
|
////@end WinEDA_FindFrame creation
|
|
|
|
m_NewTextCtrl->SetFocus();
|
|
|
|
/* does not work here, might work if moved elsewhere,
|
|
see void DrcDialog::OnInitDialog( wxInitDialogEvent& event )
|
|
// deselect the existing text, seems SetFocus() wants to emulate
|
|
// Microsoft and select all text, which is not desireable here.
|
|
m_NewTextCtrl->SetSelection(0,0);
|
|
*/
|
|
|
|
return true;
|
|
}
|
|
|
|
/*!
|
|
* Control creation for WinEDA_FindFrame
|
|
*/
|
|
|
|
void WinEDA_FindFrame::CreateControls()
|
|
{
|
|
SetFont(*g_DialogFont);
|
|
|
|
////@begin WinEDA_FindFrame content construction
|
|
// Generated by DialogBlocks, 03/03/2006 08:14:51 (unregistered)
|
|
|
|
WinEDA_FindFrame* itemDialog1 = this;
|
|
|
|
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
|
|
itemDialog1->SetSizer(itemBoxSizer2);
|
|
|
|
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
|
|
itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW|wxLEFT|wxRIGHT, 5);
|
|
|
|
wxStaticText* itemStaticText4 = new wxStaticText( itemDialog1, wxID_STATIC, _("Item to find:"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
|
|
|
|
m_NewTextCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
|
|
itemBoxSizer3->Add(m_NewTextCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
|
|
|
|
wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
|
|
itemBoxSizer2->Add(itemBoxSizer6, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxBOTTOM, 5);
|
|
|
|
wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxVERTICAL);
|
|
itemBoxSizer6->Add(itemBoxSizer7, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5);
|
|
|
|
wxButton* itemButton8 = new wxButton( itemDialog1, FIND_SHEET, _("Item in &Sheet"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
itemBoxSizer7->Add(itemButton8, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 1);
|
|
|
|
wxButton* itemButton9 = new wxButton( itemDialog1, FIND_HIERARCHY, _("Item in &Hierarchy"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
itemBoxSizer7->Add(itemButton9, 0, wxGROW|wxLEFT|wxRIGHT, 1);
|
|
|
|
wxButton* itemButton10 = new wxButton( itemDialog1, FIND_NEXT, _("Find &Next Item (F5)"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
itemBoxSizer7->Add(itemButton10, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 1);
|
|
|
|
wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
|
|
itemBoxSizer6->Add(itemBoxSizer11, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP|wxFIXED_MINSIZE, 5);
|
|
|
|
wxButton* itemButton12 = new wxButton( itemDialog1, FIND_MARKERS, _("Find Markers"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
itemButton12->SetForegroundColour(wxColour(41, 84, 84));
|
|
itemBoxSizer11->Add(itemButton12, 0, wxGROW|wxLEFT|wxRIGHT, 1);
|
|
|
|
wxButton* itemButton13 = new wxButton( itemDialog1, FIND_NEXT_MARKER, _("Next Marker (F5)"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
itemButton13->SetForegroundColour(wxColour(0, 0, 213));
|
|
itemBoxSizer11->Add(itemButton13, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 1);
|
|
|
|
wxButton* itemButton14 = new wxButton( itemDialog1, LOCATE_IN_LIBRARIES, _("Find Cmp in &Lib"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
itemButton14->SetForegroundColour(wxColour(170, 0, 0));
|
|
itemBoxSizer11->Add(itemButton14, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 1);
|
|
|
|
// Set validators
|
|
m_NewTextCtrl->SetValidator( wxTextValidator(wxFILTER_NONE, & s_OldStringFound) );
|
|
////@end WinEDA_FindFrame content construction
|
|
}
|
|
|
|
/*!
|
|
* Should we show tooltips?
|
|
*/
|
|
|
|
bool WinEDA_FindFrame::ShowToolTips()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/*!
|
|
* Get bitmap resources
|
|
*/
|
|
|
|
wxBitmap WinEDA_FindFrame::GetBitmapResource( const wxString& name )
|
|
{
|
|
// Bitmap retrieval
|
|
////@begin WinEDA_FindFrame bitmap retrieval
|
|
wxUnusedVar(name);
|
|
return wxNullBitmap;
|
|
////@end WinEDA_FindFrame bitmap retrieval
|
|
}
|
|
|
|
/*!
|
|
* Get icon resources
|
|
*/
|
|
|
|
wxIcon WinEDA_FindFrame::GetIconResource( const wxString& name )
|
|
{
|
|
// Icon retrieval
|
|
////@begin WinEDA_FindFrame icon retrieval
|
|
wxUnusedVar(name);
|
|
return wxNullIcon;
|
|
////@end WinEDA_FindFrame icon retrieval
|
|
}
|
|
/*!
|
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON
|
|
*/
|
|
|
|
void WinEDA_FindFrame::OnFindSheetClick( wxCommandEvent& event )
|
|
{
|
|
FindSchematicItem(event);
|
|
}
|
|
|
|
/*!
|
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON1
|
|
*/
|
|
|
|
void WinEDA_FindFrame::OnFindHierarchyClick( wxCommandEvent& event )
|
|
{
|
|
FindSchematicItem(event);
|
|
}
|
|
|
|
/*!
|
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON3
|
|
*/
|
|
|
|
void WinEDA_FindFrame::OnLocateInLibrariesClick( wxCommandEvent& event )
|
|
{
|
|
LocatePartInLibs(event);
|
|
}
|
|
|
|
/*!
|
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON5
|
|
*/
|
|
|
|
void WinEDA_FindFrame::OnFindNextMarkerClick( wxCommandEvent& event )
|
|
{
|
|
FindMarker(event);
|
|
}
|
|
|
|
|
|
/*!
|
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for FIND_MARKERS
|
|
*/
|
|
|
|
void WinEDA_FindFrame::OnFindMarkersClick( wxCommandEvent& event )
|
|
{
|
|
FindMarker(event);
|
|
}
|
|
|
|
|
|
/*!
|
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for FIND_NEXT
|
|
*/
|
|
|
|
void WinEDA_FindFrame::OnFindNextClick( wxCommandEvent& event )
|
|
{
|
|
FindSchematicItem(event);
|
|
}
|
|
|
|
|