scrollbar.cpp

00001 /***************************************************************************
00002                           scrollbar.cpp  -  description
00003                              -------------------
00004     begin                : Mon Mar 1 2004
00005     copyright            : (C) 2004 by Dynacube Team
00006     email                : 
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017  #include "gui/components/scrollbar.h"
00018  
00019  void scrollbar::scrollbar_init(DW _id,DW _parent_id,DW _cnt_type,void *_cnt_ptr,DW _alias_id,DW _x,DW _y,DW _width,DW _height)
00020  {
00021     scroll_offset = 0;
00022     scaling = 1;
00023     comp_init(SCROLLBAR_TYPE,_id,_parent_id,_cnt_type,_cnt_ptr,_alias_id,_x,_y,_width,_height);   
00024  }
00025  
00026  void scrollbar::paint()
00027  {
00028     window *win_ptr;
00029     frame *frm_ptr;
00030     DW _x,_y,_width,_height;
00031 
00032     switch(cnt_type)
00033     {
00034       case WIND_TYPE :
00035                       win_ptr = (window *) cnt_ptr;
00036                       if(win_ptr->style & W_MAXIMIZE)
00037                        {
00038                          _x = BORDER_WIDTH;
00039                          _y = TITLE_HEIGHT + BORDER_HEIGHT ;
00040                          _width  = SCREEN_WIDTH;
00041                          _height = SCREEN_HEIGHT;
00042                        }
00043                       else
00044                        {
00045                          _x = win_ptr->x + BORDER_WIDTH;
00046                          _y = win_ptr->y + TITLE_HEIGHT + BORDER_HEIGHT ;
00047                          _width = win_ptr->width;
00048                          _height = win_ptr->height;
00049                        }
00050 
00051                       if((x + width < _width) && (y + height < _height))
00052                       {
00053                           drawstring(x,y,"SCROLLBAR");
00054                       }
00055                       break;
00056     }
00057   }

Generated on Thu Jul 27 23:52:27 2006 for Dynacube by  doxygen 1.4.7