#include "requirementsPanel.h"

#include "requirementDetailPanel/requirementDetailPanel.h"
#include "requirementListPanel/requirementListPanel.h"

using namespace std;
using namespace gui;
//--------------------------------------------------------------
/* Constructor */
RequirementsPanel::RequirementsPanel(wxWindow *parentWindow, dBus::Bus &bus)
  : wxPanel(parentWindow, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER)
  , dBus::wxNode(this, bus)
{
  // Initialization

  // Creating controls
  createControls();

  // Post initialization
}
//--------------------------------------------------------------
/* Creating controls */
void RequirementsPanel::createControls()
{
  m_requirementListPanel   = new RequirementListPanel(this, m_bus);
  m_requirementDetailPanel = new RequirementDetailPanel(this, m_bus);

  // Controls positioning
  const auto mainSizer = new wxBoxSizer(wxHORIZONTAL);
  mainSizer->Add(m_requirementListPanel, wxSizerFlags(0).Expand().Border(wxALL, 5));
  mainSizer->Add(m_requirementDetailPanel, wxSizerFlags(1).Expand().Border(wxALL, 5));
  //mainSizer->AddStretchSpacer(1);

  SetSizer(mainSizer);
}
//--------------------------------------------------------------
/* dBus message reception handler */
void RequirementsPanel::on_receiveMessageFromBus(MessageID messageID, MessagePtr message)
{
}
//--------------------------------------------------------------
