Commit ad86e50a authored by Marco Mattila's avatar Marco Mattila

Derive pcbnew find dialog from DIALOG_SHIM.

parent f2bd20ab
/* /*
* This program source code file is part of KICAD, a free EDA CAD application. * 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. * Copyright (C) 1992-2012 Kicad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -51,9 +52,6 @@ private: ...@@ -51,9 +52,6 @@ private:
static wxString prevSearchString; static wxString prevSearchString;
static bool warpMouse; static bool warpMouse;
static wxPoint prevPosition;
static wxSize prevSize;
void onButtonFindItemClick( wxCommandEvent& event ); void onButtonFindItemClick( wxCommandEvent& event );
void onButtonFindMarkerClick( wxCommandEvent& event ); void onButtonFindMarkerClick( wxCommandEvent& event );
void onButtonCloseClick( wxCommandEvent& event ); void onButtonCloseClick( wxCommandEvent& event );
...@@ -62,8 +60,6 @@ private: ...@@ -62,8 +60,6 @@ private:
// Initialize static member variables // Initialize static member variables
wxPoint DIALOG_FIND::prevPosition( -1, -1 );
wxSize DIALOG_FIND::prevSize;
wxString DIALOG_FIND::prevSearchString; wxString DIALOG_FIND::prevSearchString;
bool DIALOG_FIND::warpMouse = true; bool DIALOG_FIND::warpMouse = true;
...@@ -79,11 +75,7 @@ DIALOG_FIND::DIALOG_FIND( PCB_BASE_FRAME* aParent ) : DIALOG_FIND_BASE( aParent ...@@ -79,11 +75,7 @@ DIALOG_FIND::DIALOG_FIND( PCB_BASE_FRAME* aParent ) : DIALOG_FIND_BASE( aParent
itemCount = markerCount = 0; itemCount = markerCount = 0;
if( prevPosition.x != -1 ) Center();
SetSize( prevPosition.x, prevPosition.y,
prevSize.x, prevSize.y );
else
Center();
} }
...@@ -196,8 +188,6 @@ void DIALOG_FIND::onButtonFindMarkerClick( wxCommandEvent& aEvent ) ...@@ -196,8 +188,6 @@ void DIALOG_FIND::onButtonFindMarkerClick( wxCommandEvent& aEvent )
void DIALOG_FIND::onClose( wxCloseEvent& aEvent ) void DIALOG_FIND::onClose( wxCloseEvent& aEvent )
{ {
prevPosition = GetPosition();
prevSize = GetSize();
warpMouse = !m_NoMouseWarpCheckBox->IsChecked(); warpMouse = !m_NoMouseWarpCheckBox->IsChecked();
EndModal( 1 ); EndModal( 1 );
......
...@@ -9,7 +9,7 @@ ...@@ -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 ); this->SetSizeHints( wxDefaultSize, wxDefaultSize );
...@@ -41,13 +41,14 @@ DIALOG_FIND_BASE::DIALOG_FIND_BASE( wxWindow* parent, wxWindowID id, const wxStr ...@@ -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 ); m_button2 = new wxButton( this, wxID_ANY, _("Find Marker"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer4->Add( m_button2, 0, wxALL, 5 ); 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 ); bSizer4->Add( m_button3, 0, wxALL, 5 );
bSizerMain->Add( bSizer4, 0, 0, 5 ); bSizerMain->Add( bSizer4, 0, 0, 5 );
this->SetSizer( bSizerMain ); this->SetSizer( bSizerMain );
this->Layout(); this->Layout();
bSizerMain->Fit( this );
this->Centre( wxBOTH ); this->Centre( wxBOTH );
......
...@@ -69,9 +69,9 @@ ...@@ -69,9 +69,9 @@
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="row"></property> <property name="row"></property>
<property name="show">1</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="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="title">Find</property>
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip"></property> <property name="tooltip"></property>
...@@ -614,7 +614,7 @@ ...@@ -614,7 +614,7 @@
<property name="font"></property> <property name="font"></property>
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">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="label">Close</property>
<property name="layer"></property> <property name="layer"></property>
<property name="max_size"></property> <property name="max_size"></property>
......
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
#include <wx/artprov.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
#include <wx/intl.h> #include <wx/intl.h>
class DIALOG_SHIM;
#include "dialog_shim.h"
#include <wx/string.h> #include <wx/string.h>
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
...@@ -29,7 +32,7 @@ ...@@ -29,7 +32,7 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_FIND_BASE /// Class DIALOG_FIND_BASE
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class DIALOG_FIND_BASE : public wxDialog class DIALOG_FIND_BASE : public DIALOG_SHIM
{ {
private: private:
...@@ -50,7 +53,7 @@ class DIALOG_FIND_BASE : public wxDialog ...@@ -50,7 +53,7 @@ class DIALOG_FIND_BASE : public wxDialog
public: 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(); ~DIALOG_FIND_BASE();
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment