1 // 2 // This file is part of libyacurs. 3 // Copyright (C) 2013 Rafael Ostertag 4 // 5 // This program is free software: you can redistribute it and/or 6 // modify it under the terms of the GNU General Public License as 7 // published by the Free Software Foundation, either version 3 of the 8 // License, or (at your option) any later version. 9 // 10 // This program is distributed in the hope that it will be useful, but 11 // WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 // General Public License for more details. 14 // 15 // You should have received a copy of the GNU General Public License 16 // along with this program. If not, see 17 // <http://www.gnu.org/licenses/>. 18 // 19 // 20 // $Id$ 21 22 #include <cassert> 23 #include <cstdlib> 24 25 #include "vrule.h" 26 #include "yacursex.h" 27 28 using namespace YACURS; 29 30 // 31 // Private 32 // 33 34 // 35 // Protected 36 // 37 38 // 39 // Public 40 // VRule()41VRule::VRule() : Rule() {} 42 ~VRule()43VRule::~VRule() {} 44 size_available(const Size & s)45void VRule::size_available(const Size& s) { 46 assert(s.cols() > 0); 47 WidgetBase::size_available(s); 48 _size = Size(s.rows(), 1); 49 } 50 size_hint() const51Size VRule::size_hint() const { return Size(0, 1); } 52 refresh(bool immediate)53void VRule::refresh(bool immediate) { 54 if (realization() != REALIZED && realization() != REALIZING) return; 55 56 assert(widget_subwin() != 0); 57 58 widget_subwin()->set_color(_color); 59 widget_subwin()->set_bg(_color); 60 widget_subwin()->vrule(); 61 62 Widget::refresh(immediate); 63 } 64