/////////////////////////////////////////////////////////////////////////////
// Name:        annotate_dialog.cpp
// Purpose:     
// Author:      jean-pierre Charras
// Modified by: 
// Created:     05/02/2006 12:31:28
// RCS-ID:      
// Copyright:   License GNU
// Licence:     
/////////////////////////////////////////////////////////////////////////////

// Generated by DialogBlocks (unregistered), 05/02/2006 12:31:28

#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "annotate_dialog.h"
#endif

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

////@begin includes
////@end includes

#include "annotate_dialog.h"

////@begin XPM images
////@end XPM images

/*!
 * WinEDA_AnnotateFrame type definition
 */

IMPLEMENT_DYNAMIC_CLASS( WinEDA_AnnotateFrame, wxDialog )

/*!
 * WinEDA_AnnotateFrame event table definition
 */

BEGIN_EVENT_TABLE( WinEDA_AnnotateFrame, wxDialog )

////@begin WinEDA_AnnotateFrame event table entries
    EVT_BUTTON( ID_ANNOTATE_CMP, WinEDA_AnnotateFrame::OnAnnotateCmpClick )

    EVT_BUTTON( ID_DEANNOTATE_CMP, WinEDA_AnnotateFrame::OnDeannotateCmpClick )

    EVT_BUTTON( wxID_CLOSE, WinEDA_AnnotateFrame::OnCloseClick )

////@end WinEDA_AnnotateFrame event table entries

END_EVENT_TABLE()

/*!
 * WinEDA_AnnotateFrame constructors
 */

WinEDA_AnnotateFrame::WinEDA_AnnotateFrame( )
{
}

WinEDA_AnnotateFrame::WinEDA_AnnotateFrame( WinEDA_SchematicFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
	m_Parent = parent;
	m_Abort = FALSE;
    Create(parent, id, caption, pos, size, style);
	m_AnnotNewCmpCtrl->SetSelection(1);
}

/*!
 * WinEDA_AnnotateFrame creator
 */

bool WinEDA_AnnotateFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin WinEDA_AnnotateFrame member initialisation
    m_AnnotProjetCtrl = NULL;
    m_AnnotNewCmpCtrl = NULL;
////@end WinEDA_AnnotateFrame member initialisation

////@begin WinEDA_AnnotateFrame 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_AnnotateFrame creation
    return true;
}

/*!
 * Control creation for WinEDA_AnnotateFrame
 */

void WinEDA_AnnotateFrame::CreateControls()
{    
	SetFont(*g_DialogFont);

////@begin WinEDA_AnnotateFrame content construction
    // Generated by DialogBlocks, 05/02/2006 12:40:51 (unregistered)

    WinEDA_AnnotateFrame* itemDialog1 = this;

    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
    itemDialog1->SetSizer(itemBoxSizer2);

    wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5);

    wxString m_AnnotProjetCtrlStrings[] = {
        _("Hierarchy"),
        _("Current sheet")
    };
    m_AnnotProjetCtrl = new wxRadioBox( itemDialog1, ID_RADIOBOX, _("annotate:"), wxDefaultPosition, wxDefaultSize, 2, m_AnnotProjetCtrlStrings, 1, wxRA_SPECIFY_COLS );
    itemBoxSizer3->Add(m_AnnotProjetCtrl, 0, wxALIGN_LEFT|wxALL, 5);

    wxString m_AnnotNewCmpCtrlStrings[] = {
        _("all components"),
        _("new components only")
    };
    m_AnnotNewCmpCtrl = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _("select items:"), wxDefaultPosition, wxDefaultSize, 2, m_AnnotNewCmpCtrlStrings, 1, wxRA_SPECIFY_COLS );
    itemBoxSizer3->Add(m_AnnotNewCmpCtrl, 0, wxALIGN_LEFT|wxALL, 5);

    wxString m_AnnotSortCmpCtrlStrings[] = {
        _("by position"),
        _("by value")
    };
    m_AnnotSortCmpCtrl = new wxRadioBox( itemDialog1, ID_RADIOBOX2, _("sorting:"), wxDefaultPosition, wxDefaultSize, 2, m_AnnotSortCmpCtrlStrings, 1, wxRA_SPECIFY_COLS );
    itemBoxSizer3->Add(m_AnnotSortCmpCtrl, 0, wxALIGN_LEFT|wxALL, 5);

    wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer2->Add(itemBoxSizer6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxButton* itemButton7 = new wxButton( itemDialog1, ID_ANNOTATE_CMP, _("&Annotate"), wxDefaultPosition, wxDefaultSize, 0 );
    itemButton7->SetDefault();
    itemButton7->SetForegroundColour(wxColour(198, 0, 0));
    itemBoxSizer6->Add(itemButton7, 0, wxGROW|wxALL, 5);

    wxButton* itemButton8 = new wxButton( itemDialog1, ID_DEANNOTATE_CMP, _("&Del Annotate"), wxDefaultPosition, wxDefaultSize, 0 );
    itemButton8->SetForegroundColour(wxColour(0, 0, 230));
    itemBoxSizer6->Add(itemButton8, 0, wxGROW|wxALL, 5);

    wxButton* itemButton9 = new wxButton( itemDialog1, wxID_CLOSE, _("&Close"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer6->Add(itemButton9, 0, wxGROW|wxALL, 5);

////@end WinEDA_AnnotateFrame content construction
}

/*!
 * Should we show tooltips?
 */

bool WinEDA_AnnotateFrame::ShowToolTips()
{
    return true;
}

/*!
 * Get bitmap resources
 */

wxBitmap WinEDA_AnnotateFrame::GetBitmapResource( const wxString& name )
{
    // Bitmap retrieval
////@begin WinEDA_AnnotateFrame bitmap retrieval
    wxUnusedVar(name);
    return wxNullBitmap;
////@end WinEDA_AnnotateFrame bitmap retrieval
}

/*!
 * Get icon resources
 */

wxIcon WinEDA_AnnotateFrame::GetIconResource( const wxString& name )
{
    // Icon retrieval
////@begin WinEDA_AnnotateFrame icon retrieval
    wxUnusedVar(name);
    return wxNullIcon;
////@end WinEDA_AnnotateFrame icon retrieval
}
/*!
 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ANNOTATE_CMP
 */

void WinEDA_AnnotateFrame::OnAnnotateCmpClick( wxCommandEvent& event )
{
	AnnotateComponents(event);
}

/*!
 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DEANNOTATE_CMP
 */

void WinEDA_AnnotateFrame::OnDeannotateCmpClick( wxCommandEvent& event )
{
	DeleteAnnotation(event);
}

/*!
 * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CLOSE
 */

void WinEDA_AnnotateFrame::OnCloseClick( wxCommandEvent& event )
{
	Close(TRUE);
}


