/////////////////////////////////////////////////////////////////////////////
// Name:        extcmddlg.h
// Purpose:     wxExtCmdWizard definition
// Author:      Julian Smart, Francesco Montorsi
// Modified by: 
// Created:     15/06/2006 21:23:11
// RCS-ID:      $Id: extcmddlg.h,v 1.2 2007/01/01 20:06:20 frm Exp $
// Copyright:   (c) 2006 Francesco Montorsi
// Licence:     wxWidgets license
/////////////////////////////////////////////////////////////////////////////

#ifndef _PMEXTCMDDLG2_H_
#define _PMEXTCMDDLG2_H_

/*!
 * Includes
 */

#include "wx/wizard.h"
#include "wxp/package.h"
#include "guipm/extcmdoptionspanel.h"
#include "guipm/extcmdprogresspanel.h"


/*!
 * Forward declarations
 */

class wxExtCmdWizardPage1;
class wxExtCmdWizardPage2;


/*!
 * Control identifiers
 */

#define ID_EXTCMD_WIZARD 10020
#define SYMBOL_WXEXTCMDWIZARD_IDNAME ID_EXTCMD_WIZARD
#define ID_EXTCMD_PAGE1 10026
#define ID_EXTCMD_PAGE2 10031

#define ID_EXTCMD_STARTLABEL          wxT("Start")
#define ID_EXTCMD_STOPLABEL           wxT("Stop")



// ----------------------------------------------------------------------------
// wxExtCmdWizard
// ----------------------------------------------------------------------------

class wxExtCmdWizard: public wxWizard
{    
    DECLARE_DYNAMIC_CLASS( wxExtCmdWizard )
    DECLARE_EVENT_TABLE()

public:
    /// Constructors
    wxExtCmdWizard( );
    wxExtCmdWizard( wxWindow* parent, wxWindowID id = SYMBOL_WXEXTCMDWIZARD_IDNAME, 
                    const wxString &title = wxEmptyString,
                    const wxPoint& pos = wxDefaultPosition );

    /// Creation
    bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WXEXTCMDWIZARD_IDNAME, 
                 const wxString &title = wxEmptyString,
                 const wxPoint& pos = wxDefaultPosition );

    /// Creates the controls and sizers
    void CreateControls();

    /// Runs the wizard.
    bool Run();


public:     // event handlers

    void OnNext(wxCommandEvent &);
    void OnPageChanged(wxWizardEvent &);
    void OnProgressPanelEnd(wxCommandEvent &);

public:

    void Set(const wxPackage &p, wxPackageBuildSystemStage stage);

    void Start();
    void Stop();

protected:
    wxExtCmdWizardPage1* m_pPage1;
    wxExtCmdWizardPage2* m_pPage2;
};


// ----------------------------------------------------------------------------
// wxExtCmdWizardPage1
// ----------------------------------------------------------------------------

class wxExtCmdWizardPage1: public wxWizardPageSimple
{    
    DECLARE_DYNAMIC_CLASS( wxExtCmdWizardPage1 )
    DECLARE_EVENT_TABLE()

public:
    /// Constructors
    wxExtCmdWizardPage1( );

    wxExtCmdWizardPage1( wxWizard* parent, const wxString &name );

    /// Creation
    bool Create( wxWizard* parent, const wxString &name );

    /// Creates the controls and sizers
    void CreateControls();

    wxExtCmdOptionsPanel *GetPanel()
        { return m_pPanel; }

protected:

    wxExtCmdOptionsPanel *m_pPanel;
};



// ----------------------------------------------------------------------------
// wxExtCmdWizardPage2
// ----------------------------------------------------------------------------

class wxExtCmdWizardPage2: public wxWizardPageSimple
{    
    DECLARE_DYNAMIC_CLASS( wxExtCmdWizardPage2 )
    DECLARE_EVENT_TABLE()

public:
    /// Constructors
    wxExtCmdWizardPage2( );

    wxExtCmdWizardPage2( wxWizard* parent, const wxString &name );

    /// Creation
    bool Create( wxWizard* parent, const wxString &name );

    /// Creates the controls and sizers
    void CreateControls();

    wxExtCmdProgressPanel *GetPanel()
        { return m_pPanel; }

protected:

    wxExtCmdProgressPanel *m_pPanel;
};

#endif
    // _PMEXTCMDDLG2_H_
