/////////////////////////////////////////////////////////////////////////////
// Name:        MenuObjectPropDlg.h
// Purpose:     DVD menu button properties dialog
// Author:      Alex Thuering
// Created:	20.11.2003
// RCS-ID:      $Id: MenuObjectPropDlg.h,v 1.5 2008/03/02 19:00:12 ntalex Exp $
// Copyright:   (c) Alex Thuering
// Licence:     GPL
/////////////////////////////////////////////////////////////////////////////
 
#ifndef BUTTON_PROP_DLG_H
#define BUTTON_PROP_DLG_H

#include <wx/wx.h>
#include <wxVillaLib/PropDlg.h>
#include "DVD.h"

enum ButtonDirCommand
{
  bdNONE, bdLEFT, bdRIGHT, bdUP, bdDOWN
};

class MenuObjectPropDlg: public wxPropDlg
{
  public:
    MenuObjectPropDlg(wxWindow *parent, wxString id,
      Menu *menu, DVD* dvd, int tsi, int pgci);
    virtual ~MenuObjectPropDlg() {}

  private:
    wxString m_id;
    MenuObject* m_object;
    Menu* m_menu;
    DVD* m_dvd;
    int m_tsi;
    int m_pgci;
    int m_btInd;
    void CreatePropPanel(wxSizer* sizer);
    
    wxChoice* m_titlesetChoice;
    wxChoice* m_targetChoice;
    wxChoice* m_chapterChoice;
    int GetTsi(); // returns selected titleset id
    int GetPgci(); // returns selected pgc (target) id
    int GetChapter(); // returns selected chapter nummer
    void UpdateTitlesets();
    void UpdateTargets();
    void UpdateChapters();
    void OnChangeTitleset(wxCommandEvent& WXUNUSED(evt)) { UpdateTargets(); UpdateChapters(); }
    void OnChangeTarget(wxCommandEvent& WXUNUSED(evt)) { UpdateChapters(); }
    
    wxRadioButton* m_videoFrameRadio;
    wxString GetVideoFilename(bool withTimestamp = false, long position = -1);
    void OnSelectVideoFrame(wxCommandEvent& evt);
    
    wxTextCtrl* m_customActionEdit;
    void OnJumpActionSelected(wxCommandEvent& evt);
    void OnCustomActionSelected(wxCommandEvent& evt);
    
    wxTextCtrl* m_widthEdit;
    wxTextCtrl* m_heightEdit;
    void OnDefaultSizeSelected(wxCommandEvent& evt);
    void OnCustomSizeSelected(wxCommandEvent& evt);
    
    void AddStaticLine(wxSizer* sizer, wxString caption);
    void AddDirectionProp(wxSizer* sizer, ButtonDirCommand dir);
    bool SetValues();
    
    DECLARE_EVENT_TABLE()
};

#endif // BUTTON_PROP_DLG_H
