#include #include #include // // Fl_Fixed_Group.H -- A group with attachable sides // // Copyright 2008 by Greg Ercolano. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Library General Public License for more details. // // You should have received a copy of the GNU Library General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA. // Fl_Fixed_Group::Fl_Fixed_Group(int X, int Y, int W, int H, const char *L):Fl_Group(X,Y,W,H,L) { attach(window(), FL_FIXED_GROUP_TOPLEFT); } void Fl_Fixed_Group::resize(int X,int Y,int W,int H) { if ( attach_ & FL_FIXED_GROUP_LEFT ) { X = x(); } if ( attach_ & FL_FIXED_GROUP_TOP ) { Y = y(); } if ( attach_ & FL_FIXED_GROUP_RIGHT ) { X = attach_to_->w() - init_w - rdiff; } if ( attach_ & FL_FIXED_GROUP_BOTTOM ) { Y = attach_to_->h() - init_h - bdiff; } // FIXED WIDTH/HEIGHT W = init_w; H = init_h; Fl_Group::resize(X,Y,W,H); } void Fl_Fixed_Group::init_sizes() { rdiff = attach_to_->w() - (x()+w()); // right diff bdiff = attach_to_->h() - (y()+h()); // bottom diff init_w = w(); init_h = h(); Fl_Group::init_sizes(); }