diff --git a/harbour/.cvsignore b/harbour/.cvsignore index f067600ce8..6351bebe86 100644 --- a/harbour/.cvsignore +++ b/harbour/.cvsignore @@ -1,3 +1,4 @@ +*.log bsd bsd/* dos @@ -14,7 +15,8 @@ b32 b32/* vc vc/* -obj +obj OBJ obj/* -lib +lib LIB lib/* + diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 9f309295fe..bbf7d97077 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,21 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2005-08-23 18:45 UTC-0400 Alejandro de Garate + + * source\rtl\scrollbr.prg + * Fixed length in Style string (more than 4 characters) + - Eliminated unused LOCAL vars in Hitest() + - Deleted unused method GetColor() + + Added METHOD SetStyle( cStyle ) to change SB characters at runtime + + Added METHOD SetColor( cColor ) to change SB colors at runtime + * fixed bugs, minor optimizations + +2005-08-23 18:45 UTC-0400 Alejandro de Garate + + + tests\sbartest.prg + Added sample of scrollbar class + 2005-06-14 21:11 UTC+0100 Viktor Szakats * source/rtl/disksphb.c diff --git a/harbour/source/rtl/scrollbr.prg b/harbour/source/rtl/scrollbr.prg index 14965e8c8e..e42900ff5e 100644 --- a/harbour/source/rtl/scrollbr.prg +++ b/harbour/source/rtl/scrollbr.prg @@ -1,418 +1,499 @@ -/* - * $Id$ - */ + /* + * $Id$ + */ -/* - * Harbour Project source code: - * ScrollBar class - * - * Copyright 2000 Luiz Rafael Culik - * www - http://www.harbour-project.org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). - * - * As a special exception, the Harbour Project gives permission for - * additional uses of the text contained in its release of Harbour. - * - * The exception is that, if you link the Harbour libraries with other - * files to produce an executable, this does not by itself cause the - * resulting executable to be covered by the GNU General Public License. - * Your use of that executable is in no way restricted on account of - * linking the Harbour library code into it. - * - * This exception does not however invalidate any other reasons why - * the executable file might be covered by the GNU General Public License. - * - * This exception applies only to the code released by the Harbour - * Project under the name Harbour. If you copy code from other - * Harbour Project or Free Software Foundation releases into a copy of - * Harbour, as the General Public License permits, the exception does - * not apply to the code that you add in this way. To avoid misleading - * anyone as to the status of such modified files, you must delete - * this exception notice from them. - * - * If you write modifications of your own for Harbour, it is your choice - * whether to permit this exception to apply to your modifications. - * If you do not wish that, delete this exception notice. - * - */ + /* + * Harbour Project source code: + * ScrollBar class + * + * Copyright 2000 Luiz Rafael Culik + * www - http://www.harbour-project.org + * + * Copyright 2005 Alejandro de Garate + * METHOD SetStyle( cStyle ) + * METHOD SetColor( cColor ) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ + #include "hbclass.ch" + #include "color.ch" + #include "common.ch" + #include "button.ch" -#include "hbclass.ch" -#include "common.ch" #ifdef HB_COMPAT_C53 -MEMVAR hb_p_lShow + // new definitions for better coding. Are screen Codepage dependent, but + // can be changed with the setStyle method. + #define SB_UPARROW CHR(24) + #define SB_TRACK CHR(178) + #define SB_THUMB CHR(254) + #define SB_DNARROW CHR(25) + #define SB_LEFTARROW CHR(27) + #define SB_RIGHTARROW CHR(26) -CLASS HBScrollBar -Data BarLength -Data Cargo -Data Sblock -Data Style -DATA CLASSNAME init "SCROLLBAR" -Data Colorspec -METHOD Display() -METHOD HitTest() -METHOD Update() -METHOD New(nStart,nEnd,nOffSet,bSblock,nOrient) -ACCESS Current inline ::GetCurrent() -ASSIGN Current(nCurrent) inline ::GetCurrent(nCurrent) -ACCESS End inline ::GetEnd() -ASSIGN End(nEnd) inline ::GetEnd(nEnd) -ACCESS OffSet inline ::GetOffset() -ASSIGN OffSet(nOffSet) inline ::GetOffset(nOffset) -ACCESS Orient inline ::GetOrient() -ASSIGN Orient(nOrient) inline ::GetOrient(nOrient) -ACCESS Start inline ::GetStart() -ASSIGN Start(nStart) inline ::GetStart(nStart) -ACCESS ThumbPos inline ::GetThumbPos() -ASSIGN ThumbPos(nPos) inline ::GetThumbPos(nPos) -ACCESS Total inline ::GetTotal() -ASSIGN Total(nTotal) inline ::GetTotal(nTotal) + #define SB_VERT_SCROLL 1 + #define SB_HORZ_SCROLL 2 -Data Color init '' -Data nCurrent init 0 -Data nEnd init 0 -Data nOffSet init 0 -Data nOrient init 0 -Data nStart init 0 -Data nThumbPos init 1 -Data nTotal init 100 + // converted to macro to speed up things... + #define __GuiColor( cPair, nPos) (hb_colorindex( cPair, nPos - 1)) -METHOD GetCurrent(nCurrent) -METHOD GetEnd(nEnd) -METHOD GetStart(nStart) -METHOD GetThumbPos(nPos) -METHOD GetTotal(nTotal) -METHOD GetOffSet(nOffset) -METHOD GetOrient(nOrient) -ENDCLASS -Method New(nStart,nEnd,nOffSet,bSblock,nOrient) CLASS HBScrollBar - Local cStyle,cColor - - if ( nOrient == 1 ) - cStyle := "°²" - elseif ( nOrient == 2 ) - cStyle := "°²" + Chr(26) - endif - ::Barlength := nEnd - nStart - 1 - ::Current := 1 - ::Cargo := Nil - cColor := SetColor() - ::ColorSpec := __guicolor(cColor, 5) + "," + __guicolor(cColor, 2) - ::end := nEnd - ::Offset := nOffSet - ::Orient := nOrient - ::sBlock := bSblock - ::Start := nStart - ::Style := cStyle - ::Thumbpos := 1 - ::total:=1 - return Self + CLASS HBScrollBar + + DATA BarLength INIT 1 // 1er error (no tenia INIT 1) + DATA Cargo + DATA sBlock + DATA Style + DATA ClassName INIT "HBSCROLLBAR" + DATA ColorSpec + DATA aStyle // Note: new instance var for old Harbour versions to + // speed up displaying,