/////////////////////////////////////////////////////////////////////////////
// Name:        builddlg.h
// Purpose:     wxPackageBuildDlg definition
// Author:      Francesco Montorsi
// Modified by:
// Created:     Fri 23 Jun 2006 14:45:45 CEST
// RCS-ID:      $Id: builddlg.h,v 1.2 2007/01/01 20:06:20 frm Exp $
// Copyright:   (c) 2006 Francesco Montorsi
// Licence:     wxWidgets license
/////////////////////////////////////////////////////////////////////////////

#ifndef _PMBUILDDLG_H_
#define _PMBUILDDLG_H_

/*!
 * Includes
 */

#include "wx/notebook.h"
#include "wxp/package.h"
#include "guipm/extcmdoptionspanel.h"
#include "guipm/compilerpanel.h"

/*!
 * Forward declarations
 */

class wxNotebook;


/*!
 * Control identifiers
 */

////@begin control identifiers
#define SYMBOL_WXPACKAGEBUILDDLG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_WXPACKAGEBUILDDLG_TITLE _("Build")
#define SYMBOL_WXPACKAGEBUILDDLG_IDNAME wxID_ANY
#define SYMBOL_WXPACKAGEBUILDDLG_SIZE wxSize(400, 300)
#define SYMBOL_WXPACKAGEBUILDDLG_POSITION wxDefaultPosition
////@end control identifiers



// ----------------------------------------------------------------------------
// wxPackageBuildDlg
// ----------------------------------------------------------------------------

class wxPackageBuildDlg: public wxDialog
{
    DECLARE_DYNAMIC_CLASS( wxPackageBuildDlg )
    DECLARE_EVENT_TABLE()

public:
    /// Constructors
    wxPackageBuildDlg( );
    wxPackageBuildDlg( wxWindow* parent, wxWindowID id = SYMBOL_WXPACKAGEBUILDDLG_IDNAME, const wxString& caption = SYMBOL_WXPACKAGEBUILDDLG_TITLE, const wxPoint& pos = SYMBOL_WXPACKAGEBUILDDLG_POSITION, const wxSize& size = SYMBOL_WXPACKAGEBUILDDLG_SIZE, long style = SYMBOL_WXPACKAGEBUILDDLG_STYLE );

    /// Creation
    bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WXPACKAGEBUILDDLG_IDNAME, const wxString& caption = SYMBOL_WXPACKAGEBUILDDLG_TITLE, const wxPoint& pos = SYMBOL_WXPACKAGEBUILDDLG_POSITION, const wxSize& size = SYMBOL_WXPACKAGEBUILDDLG_SIZE, long style = SYMBOL_WXPACKAGEBUILDDLG_STYLE );

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

public:     // event handlers

    void OnPageChanged(wxNotebookEvent &);
    void OnOK(wxCommandEvent &);

public:     // API

    void SetPackage(const wxPackage &p);

    wxPackage GetPackage() const
        { return m_pBuildOptPanel->GetPackage(); }

    bool IsSelectedBuildOptPage() const
        { return m_pNotebook->GetSelection() == 0; }
    bool IsSelectedCompilerPage() const
        { return m_pNotebook->GetSelection() == 1; }

protected:      // controls

    //! our internal options panel
    wxExtCmdOptionsPanel *m_pBuildOptPanel;

    //! the build system panel dialog
    wxCompilerSettingsPanel *m_pCompilerPanel;

    //! the notebook used by this panel
    wxNotebook *m_pNotebook;

    //! The informative static text above the compiler panel.
    wxStaticText *m_pDescLabel;

protected:      // misc

    wxPackageCompilerFormat m_last;
};


#endif
    // _PMBUILDDLG_H_
