#############################################################################
## Name:        ext/ribbon/XS/RibbonBar.xsp
## Purpose:     XS++ for Wx::RibbonBar
## Author:      Mark Dootson
## Modified by:
## Created:     04/03/2012
## RCS-ID:      $Id: $
## Copyright:   (c) 2012 Mattia Barbon
## Licence:     This program is free software; you can redistribute it and/or
##              modify it under the same terms as Perl itself
#############################################################################

%module{Wx};

#if WXPERL_W_VERSION_GE( 2, 9, 3 ) && wxUSE_RIBBON

#include <wx/ribbon/bar.h>

%loadplugin{build::Wx::XSP::Overload};
%loadplugin{build::Wx::XSP::Event};

%name{Wx::RibbonBarEvent} class wxRibbonBarEvent : public %name{Wx::NotifyEvent} wxNotifyEvent
{
public:
    
    wxRibbonBarEvent(wxEventType command_type = wxEVT_NULL,
                     int win_id = 0,
                     wxRibbonPage* page = NULL);

    wxRibbonPage* GetPage();
    
    void SetPage(wxRibbonPage* page);
    wxEvent *Clone();
};

%Event{%EVT_RIBBONBAR_PAGE_CHANGED(id, func)%}
      {wxEVT_COMMAND_RIBBONBAR_PAGE_CHANGED};
%Event{%EVT_RIBBONBAR_PAGE_CHANGING(id, func)%}
      {wxEVT_COMMAND_RIBBONBAR_PAGE_CHANGING};
%Event{%EVT_RIBBONBAR_TAB_MIDDLE_DOWN(id, func)%}
      {wxEVT_COMMAND_RIBBONBAR_TAB_MIDDLE_DOWN};
%Event{%EVT_RIBBONBAR_TAB_MIDDLE_UP(id, func)%}
      {wxEVT_COMMAND_RIBBONBAR_TAB_MIDDLE_UP};
%Event{%EVT_RIBBONBAR_TAB_RIGHT_DOWN(id, func)%}
      {wxEVT_COMMAND_RIBBONBAR_TAB_RIGHT_DOWN};
%Event{%EVT_RIBBONBAR_TAB_RIGHT_UP(id, func)%}
      {wxEVT_COMMAND_RIBBONBAR_TAB_RIGHT_UP};
%Event{%EVT_RIBBONBAR_TAB_LEFT_DCLICK(id, func)%}
      {wxEVT_COMMAND_RIBBONBAR_TAB_LEFT_DCLICK};      


%name{Wx::RibbonBar} class wxRibbonBar : public %name{Wx::RibbonControl} wxRibbonControl
{
public:
   
    %name{newDefault} wxRibbonBar() %Overload
        %postcall{% wxPli_create_evthandler( aTHX_ RETVAL, CLASS ); %};

    %name{newFull} wxRibbonBar(wxWindow* parent,
                wxWindowID id = wxID_ANY,
                const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize,
                long style = wxRIBBON_BAR_DEFAULT_STYLE) %Overload
        %postcall{% wxPli_create_evthandler( aTHX_ RETVAL, CLASS ); %};
    
    bool Create(wxWindow* parent,
                wxWindowID id = wxID_ANY,
                const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize,
                long style = wxRIBBON_BAR_DEFAULT_STYLE);

    void SetTabCtrlMargins(int left, int right);

    void SetArtProvider(wxRibbonArtProvider* art);

    %name{SetActivePageByIndex} bool SetActivePage(size_t page) %Overload;
    
    %name{SetActivePageByPage} bool SetActivePage(wxRibbonPage* page) %Overload;
    
    int GetActivePage() const;
    
    wxRibbonPage* GetPage(int n);
    
    bool DismissExpandedPanel();

    void ShowPanels(bool show = true);

    void HidePanels();

    bool ArePanelsShown() const;
    
    virtual bool Realize();
    
    void SetWindowStyleFlag(long style);
    long GetWindowStyleFlag() const;
    virtual bool HasMultiplePages() const;

#if WXPERL_W_VERSION_GE( 2, 9, 4 )
    size_t GetPageCount() const;
    void DeletePage(size_t n);
    void ClearPages();
#endif    

};

#endif
