/////////////////////////////////////////////////////////////////////////////
// Name:        cmdpresetchooserdlg.h
// Purpose:     wxPackageCommandPresetChooserDialog
// Author:      Francesco Montorsi
// Modified by:
// Created:     18/09/2006 23:11:59
// RCS-ID:      $Id: cmdpresetchooserdlg.h,v 1.3 2007/01/01 20:06:19 frm Exp $
// Copyright:   (c) 2006 Francesco Montorsi
// Licence:     wxWidgets license
/////////////////////////////////////////////////////////////////////////////

#ifndef _CMDPRESETCHOOSERDLG_H_
#define _CMDPRESETCHOOSERDLG_H_

/*!
 * Includes
 */

#include "wxp/wxp.h"


/*!
 * Forward declarations
 */

class wxCommandListBox;


/*!
 * Control identifiers
 */

////@begin control identifiers
#define SYMBOL_WXPACKAGECOMMANDPRESETCHOOSERDLG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_WXPACKAGECOMMANDPRESETCHOOSERDLG_TITLE _("Choose a command preset")
#define SYMBOL_WXPACKAGECOMMANDPRESETCHOOSERDLG_IDNAME wxID_ANY
#define SYMBOL_WXPACKAGECOMMANDPRESETCHOOSERDLG_SIZE wxSize(400, 300)
#define SYMBOL_WXPACKAGECOMMANDPRESETCHOOSERDLG_POSITION wxDefaultPosition
#define ID_CMDPRESETCHOOSER_PRESETS 10000
#define ID_CMDPRESETCHOOSER_DESC 10003
#define ID_CMDPRESETCHOOSER_VARIABLES 10002
#define ID_CMDPRESETCHOOSER_PREVIEW 10015
////@end control identifiers


// ----------------------------------------------------------------------------
// wxPackageCommandPresetChooserDialog
// ----------------------------------------------------------------------------

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

public:
    /// Constructors
    wxPackageCommandPresetChooserDlg( );
    wxPackageCommandPresetChooserDlg( wxWindow* parent, 
        wxWindowID id = SYMBOL_WXPACKAGECOMMANDPRESETCHOOSERDLG_IDNAME, 
        wxPackageBuildSystemType type = wxPBST_INVALID,
        const wxString& caption = SYMBOL_WXPACKAGECOMMANDPRESETCHOOSERDLG_TITLE, 
        const wxPoint& pos = SYMBOL_WXPACKAGECOMMANDPRESETCHOOSERDLG_POSITION, 
        const wxSize& size = SYMBOL_WXPACKAGECOMMANDPRESETCHOOSERDLG_SIZE, 
        long style = SYMBOL_WXPACKAGECOMMANDPRESETCHOOSERDLG_STYLE );

    /// Creation
    bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WXPACKAGECOMMANDPRESETCHOOSERDLG_IDNAME, 
                 wxPackageBuildSystemType type = wxPBST_INVALID,
                 const wxString& caption = SYMBOL_WXPACKAGECOMMANDPRESETCHOOSERDLG_TITLE, 
                 const wxPoint& pos = SYMBOL_WXPACKAGECOMMANDPRESETCHOOSERDLG_POSITION, 
                 const wxSize& size = SYMBOL_WXPACKAGECOMMANDPRESETCHOOSERDLG_SIZE, 
                 long style = SYMBOL_WXPACKAGECOMMANDPRESETCHOOSERDLG_STYLE );

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

    /// Should we show tooltips?
    static bool ShowToolTips();

public:     // public API

    const wxPackageCommandSet &GetSelectedPreset() const
        { return wxPresetXMLDescriptor::s_hashmapCommands[m_pPresets->GetStringSelection()]; }

    wxString GetSelectedPresetName() const
        { return m_pPresets->GetStringSelection(); }


public:     // event handlers

    void OnPreset(wxCommandEvent &ev);

protected:

////@begin wxPackageCommandPresetChooserDlg member variables
    wxChoice* m_pPresets;
    wxTextCtrl* m_pDescription;
    wxListBox* m_pVariables;
    wxCommandListBox* m_pPreview;
////@end wxPackageCommandPresetChooserDlg member variables
};

#endif
    // _CMDPRESETCHOOSERDLG_H_
