Commit ad86e50a authored by Marco Mattila's avatar Marco Mattila
Browse files

Derive pcbnew find dialog from DIALOG_SHIM.

parent f2bd20ab
Loading
Loading
Loading
Loading
+3 −13
Original line number Diff line number Diff line
/*
 * This program source code file is part of KICAD, a free EDA CAD application.
 *
 * Copyright (C) 1992-2012 Marco Mattila <marcom99@gmail.com>
 * Copyright (C) 2012 Marco Mattila <marcom99@gmail.com>
 * Copyright (C) 2006 Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
 * Copyright (C) 1992-2012 Kicad Developers, see AUTHORS.txt for contributors.
 *
 * This program is free software; you can redistribute it and/or
@@ -51,9 +52,6 @@ private:
    static wxString prevSearchString;
    static bool warpMouse;

    static wxPoint prevPosition;
    static wxSize prevSize;

    void onButtonFindItemClick( wxCommandEvent& event );
    void onButtonFindMarkerClick( wxCommandEvent& event );
    void onButtonCloseClick( wxCommandEvent& event );
@@ -62,8 +60,6 @@ private:


// Initialize static member variables
wxPoint DIALOG_FIND::prevPosition( -1, -1 );
wxSize DIALOG_FIND::prevSize;
wxString DIALOG_FIND::prevSearchString;
bool DIALOG_FIND::warpMouse = true;

@@ -79,10 +75,6 @@ DIALOG_FIND::DIALOG_FIND( PCB_BASE_FRAME* aParent ) : DIALOG_FIND_BASE( aParent

    itemCount = markerCount = 0;

    if( prevPosition.x != -1 )
        SetSize( prevPosition.x, prevPosition.y,
                 prevSize.x, prevSize.y );
    else
    Center();
}

@@ -196,8 +188,6 @@ void DIALOG_FIND::onButtonFindMarkerClick( wxCommandEvent& aEvent )

void DIALOG_FIND::onClose( wxCloseEvent& aEvent )
{
    prevPosition = GetPosition();
    prevSize = GetSize();
    warpMouse = !m_NoMouseWarpCheckBox->IsChecked();

    EndModal( 1 );
+3 −2
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@

///////////////////////////////////////////////////////////////////////////

DIALOG_FIND_BASE::DIALOG_FIND_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
DIALOG_FIND_BASE::DIALOG_FIND_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
@@ -41,13 +41,14 @@ DIALOG_FIND_BASE::DIALOG_FIND_BASE( wxWindow* parent, wxWindowID id, const wxStr
	m_button2 = new wxButton( this, wxID_ANY, _("Find Marker"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer4->Add( m_button2, 0, wxALL, 5 );
	
	m_button3 = new wxButton( this, wxID_ANY, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
	m_button3 = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer4->Add( m_button3, 0, wxALL, 5 );
	
	bSizerMain->Add( bSizer4, 0, 0, 5 );
	
	this->SetSizer( bSizerMain );
	this->Layout();
	bSizerMain->Fit( this );
	
	this->Centre( wxBOTH );
	
+3 −3
Original line number Diff line number Diff line
@@ -69,9 +69,9 @@
            <property name="resize">Resizable</property>
            <property name="row"></property>
            <property name="show">1</property>
            <property name="size">350,150</property>
            <property name="size">-1,-1</property>
            <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
            <property name="subclass"></property>
            <property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
            <property name="title">Find</property>
            <property name="toolbar_pane">0</property>
            <property name="tooltip"></property>
@@ -614,7 +614,7 @@
                                <property name="font"></property>
                                <property name="gripper">0</property>
                                <property name="hidden">0</property>
                                <property name="id">wxID_ANY</property>
                                <property name="id">wxID_CANCEL</property>
                                <property name="label">Close</property>
                                <property name="layer"></property>
                                <property name="max_size"></property>
+5 −2
Original line number Diff line number Diff line
@@ -11,6 +11,9 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;

#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
@@ -29,7 +32,7 @@
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_FIND_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_FIND_BASE : public wxDialog 
class DIALOG_FIND_BASE : public DIALOG_SHIM
{
	private:
	
@@ -50,7 +53,7 @@ class DIALOG_FIND_BASE : public wxDialog
	
	public:
		
		DIALOG_FIND_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Find"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 350,150 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); 
		DIALOG_FIND_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Find"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); 
		~DIALOG_FIND_BASE();
	
};