#pragma once

#include "holly/ta_parameter.hpp"
#include "widget/button_tl.hpp"

namespace widget {
  struct button_label_tl : button_tl {
    const char * const label;
    const int label_length;

    inline button_label_tl(float _width, float _height, const char * label, void (* const _on_click)())
      : button_tl(0, 0, _width, _height, _on_click), label(label), label_length(str_length(label))
    { }

    inline button_label_tl(float _x, float _y, float _width, float _height, const char * label, void (* const _on_click)())
      : button_tl(_x, _y, _width, _height, _on_click), label(label), label_length(str_length(label))
    { }

    void draw_label(ta_parameter_writer& writer) const;
    void draw(ta_multiwriter& multi) override;
  };
}
