2012-11-13 05:38 UTC+0100 Viktor Szakats (harbour syenar.net)
* contrib/hbgd/gdbar.prg
* contrib/hbgd/gdbarcod.prg
* contrib/hbgd/hbgd.hbx
* contrib/hbgd/tests/barms.prg
* contrib/hbgd/tests/bartest.prg
* Renamed classes that have confusing and misleading
names out of the gd namespace: (f.e. TBarCode class
was in gdbar.prg, and TCode in gdbarcod.prg)
These were very buggy until recently, so I doubt
anybody uses them, anyways it's an INCOMPATIBLE
change:
class TBarCode -> GDBar
class TCode -> GDBarCode
This commit is contained in:
@@ -16,6 +16,21 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2012-11-13 05:38 UTC+0100 Viktor Szakats (harbour syenar.net)
|
||||
* contrib/hbgd/gdbar.prg
|
||||
* contrib/hbgd/gdbarcod.prg
|
||||
* contrib/hbgd/hbgd.hbx
|
||||
* contrib/hbgd/tests/barms.prg
|
||||
* contrib/hbgd/tests/bartest.prg
|
||||
* Renamed classes that have confusing and misleading
|
||||
names out of the gd namespace: (f.e. TBarCode class
|
||||
was in gdbar.prg, and TCode in gdbarcod.prg)
|
||||
These were very buggy until recently, so I doubt
|
||||
anybody uses them, anyways it's an INCOMPATIBLE
|
||||
change:
|
||||
class TBarCode -> GDBar
|
||||
class TCode -> GDBarCode
|
||||
|
||||
2012-11-13 05:15 UTC+0100 Viktor Szakats (harbour syenar.net)
|
||||
* contrib/hbgd/gdwrp.c
|
||||
* formatting cleanups
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
#define THICKNESS_I250 0
|
||||
#define THICKNESS_I251 0
|
||||
|
||||
CREATE CLASS TBarCode FROM GDImage
|
||||
CREATE CLASS GDBar FROM GDImage
|
||||
|
||||
// class attributes
|
||||
VAR positionX AS NUMERIC INIT 4
|
||||
@@ -116,7 +116,7 @@ CREATE CLASS TBarCode FROM GDImage
|
||||
|
||||
ENDCLASS
|
||||
|
||||
METHOD CreateBar( sx, sy, filename, cColor ) CLASS TBarCode
|
||||
METHOD CreateBar( sx, sy, filename, cColor ) CLASS GDBar
|
||||
|
||||
::Create( sx, sy )
|
||||
|
||||
@@ -152,7 +152,7 @@ METHOD CreateBar( sx, sy, filename, cColor ) CLASS TBarCode
|
||||
|
||||
RETURN Self
|
||||
|
||||
METHOD Configure( nMaxHeight, aFillColor, aBackColor, nRes, nTextFont, lBook, lDrawValue ) CLASS TBarCode
|
||||
METHOD Configure( nMaxHeight, aFillColor, aBackColor, nRes, nTextFont, lBook, lDrawValue ) CLASS GDBar
|
||||
|
||||
hb_default( @lBook , .F. )
|
||||
hb_default( @lDrawValue , .T. )
|
||||
@@ -173,20 +173,20 @@ METHOD Configure( nMaxHeight, aFillColor, aBackColor, nRes, nTextFont, lBook, lD
|
||||
|
||||
RETURN NIL
|
||||
|
||||
METHOD SetText( ptext ) CLASS TBarCode
|
||||
METHOD SetText( ptext ) CLASS GDBar
|
||||
|
||||
::text := ptext
|
||||
|
||||
RETURN NIL
|
||||
|
||||
METHOD ResetColor() CLASS TBarCode
|
||||
METHOD ResetColor() CLASS GDBar
|
||||
|
||||
::FillColor := ::SetColor( ::color_f[ 1 ], ::color_f[ 2 ], ::color_f[ 3 ] )
|
||||
::BackColor := ::SetColor( ::color_b[ 1 ], ::color_b[ 2 ], ::color_b[ 3 ] )
|
||||
|
||||
RETURN NIL
|
||||
|
||||
METHOD Allocate() CLASS TBarCode
|
||||
METHOD Allocate() CLASS GDBar
|
||||
|
||||
LOCAL R := ::color_b[ 1 ]
|
||||
LOCAL G := ::color_b[ 2 ]
|
||||
@@ -194,7 +194,7 @@ METHOD Allocate() CLASS TBarCode
|
||||
|
||||
RETURN ::SetColor( R, G, B )
|
||||
|
||||
METHOD DrawSingleBar( pcode ) CLASS TBarCode
|
||||
METHOD DrawSingleBar( pcode ) CLASS GDBar
|
||||
|
||||
LOCAL i
|
||||
LOCAL j
|
||||
@@ -211,7 +211,7 @@ METHOD DrawSingleBar( pcode ) CLASS TBarCode
|
||||
|
||||
RETURN NIL
|
||||
|
||||
METHOD DrawSingleI25( pcode ) CLASS TBarCode
|
||||
METHOD DrawSingleI25( pcode ) CLASS GDBar
|
||||
|
||||
LOCAL j
|
||||
|
||||
@@ -240,7 +240,7 @@ METHOD DrawSingleI25( pcode ) CLASS TBarCode
|
||||
|
||||
RETURN NIL
|
||||
|
||||
METHOD DrawError( ptext ) CLASS TBarCode
|
||||
METHOD DrawError( ptext ) CLASS GDBar
|
||||
|
||||
::Say( 5, ::error * 15, ptext, ::FillColor )
|
||||
|
||||
@@ -251,7 +251,7 @@ METHOD DrawError( ptext ) CLASS TBarCode
|
||||
|
||||
RETURN NIL
|
||||
|
||||
METHOD nextX( lI25 ) CLASS TBarCode
|
||||
METHOD nextX( lI25 ) CLASS GDBar
|
||||
|
||||
hb_default( @li25, .F. )
|
||||
|
||||
@@ -263,7 +263,7 @@ METHOD nextX( lI25 ) CLASS TBarCode
|
||||
|
||||
RETURN NIL
|
||||
|
||||
METHOD DrawText( lIsI25 ) CLASS TBarCode
|
||||
METHOD DrawText( lIsI25 ) CLASS GDBar
|
||||
|
||||
LOCAL xPosition
|
||||
|
||||
@@ -285,7 +285,7 @@ METHOD DrawText( lIsI25 ) CLASS TBarCode
|
||||
|
||||
RETURN .T.
|
||||
|
||||
METHOD CheckCode() CLASS TBarCode
|
||||
METHOD CheckCode() CLASS GDBar
|
||||
|
||||
LOCAL lRet := .T.
|
||||
LOCAL i
|
||||
@@ -299,13 +299,13 @@ METHOD CheckCode() CLASS TBarCode
|
||||
|
||||
RETURN lRet
|
||||
|
||||
METHOD CheckValInArray( cChar ) CLASS TBarCode
|
||||
METHOD CheckValInArray( cChar ) CLASS GDBar
|
||||
|
||||
LOCAL nPos := AScan( ::keys, {| x | SubStr( x, 1, 1 ) == cChar } )
|
||||
|
||||
RETURN iif( nPos > 0, nPos, NIL )
|
||||
|
||||
METHOD Finish( image_style, quality, nFG ) CLASS TBarCode
|
||||
METHOD Finish( image_style, quality, nFG ) CLASS GDBar
|
||||
|
||||
hb_default( @image_style, IMG_FORMAT_PNG )
|
||||
hb_default( @quality , 95 )
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
#define STARTB 105
|
||||
#define STARTC 106
|
||||
|
||||
CREATE CLASS TCode FROM TBarCode
|
||||
CREATE CLASS GDBarCode FROM GDBar
|
||||
|
||||
VAR nType
|
||||
|
||||
@@ -93,7 +93,7 @@ CREATE CLASS TCode FROM TBarCode
|
||||
|
||||
ENDCLASS
|
||||
|
||||
METHOD New( nTypeCode ) CLASS TCode
|
||||
METHOD New( nTypeCode ) CLASS GDBarCode
|
||||
|
||||
LOCAL ii
|
||||
|
||||
@@ -157,7 +157,7 @@ METHOD New( nTypeCode ) CLASS TCode
|
||||
|
||||
RETURN Self
|
||||
|
||||
METHOD Draw( cText ) CLASS TCode
|
||||
METHOD Draw( cText ) CLASS GDBarCode
|
||||
|
||||
IF ::nType == 13
|
||||
::Draw13( cText )
|
||||
@@ -171,7 +171,7 @@ METHOD Draw( cText ) CLASS TCode
|
||||
|
||||
RETURN NIL
|
||||
|
||||
METHOD Draw13( cText ) CLASS TCode
|
||||
METHOD Draw13( cText ) CLASS GDBarCode
|
||||
|
||||
LOCAL lError := .F.
|
||||
LOCAL nChkSum := 0
|
||||
@@ -289,7 +289,7 @@ METHOD Draw13( cText ) CLASS TCode
|
||||
|
||||
RETURN NIL
|
||||
|
||||
METHOD DrawText13() CLASS TCode
|
||||
METHOD DrawText13() CLASS GDBarCode
|
||||
|
||||
IF ::textfont != 0
|
||||
|
||||
@@ -303,7 +303,7 @@ METHOD DrawText13() CLASS TCode
|
||||
|
||||
RETURN NIL
|
||||
|
||||
METHOD Draw8( cText ) CLASS TCode
|
||||
METHOD Draw8( cText ) CLASS GDBarCode
|
||||
|
||||
LOCAL lError := .F.
|
||||
LOCAL ii, jj
|
||||
@@ -394,7 +394,7 @@ METHOD Draw8( cText ) CLASS TCode
|
||||
|
||||
RETURN NIL
|
||||
|
||||
METHOD DrawText8() CLASS TCode
|
||||
METHOD DrawText8() CLASS GDBarCode
|
||||
|
||||
::say( 10 + ( ( 3 * ::res + 34 * ::res ) / 2 - ::GetFontWidth() * ( 4 / 2 ) ), ::maxHeight + 1, SubStr( ::text, 1, 4 ), ::fillcolor )
|
||||
::say( 10 + ( 32 * ::res + ( 3 * ::res + 32 * ::res ) / 2 - ::GetFontWidth() * ( 4 / 2 ) ), ::maxHeight + 1, SubStr( ::text, 5, 4 ), ::fillcolor )
|
||||
@@ -403,7 +403,7 @@ METHOD DrawText8() CLASS TCode
|
||||
|
||||
RETURN NIL
|
||||
|
||||
METHOD FindCharCode( cString, cChar ) CLASS TCode
|
||||
METHOD FindCharCode( cString, cChar ) CLASS GDBarCode
|
||||
|
||||
LOCAL i
|
||||
LOCAL nC := 0
|
||||
@@ -423,7 +423,7 @@ METHOD FindCharCode( cString, cChar ) CLASS TCode
|
||||
|
||||
RETURN nret
|
||||
|
||||
METHOD Draw128( cText, cModeCode ) CLASS TCode
|
||||
METHOD Draw128( cText, cModeCode ) CLASS GDBarCode
|
||||
|
||||
LOCAL cChar, nValChar, n, i
|
||||
|
||||
@@ -584,7 +584,7 @@ METHOD Draw128( cText, cModeCode ) CLASS TCode
|
||||
|
||||
RETURN NIL
|
||||
|
||||
METHOD DrawI25( cText ) CLASS TCode
|
||||
METHOD DrawI25( cText ) CLASS GDBarCode
|
||||
|
||||
::settext( cText )
|
||||
|
||||
@@ -592,7 +592,7 @@ METHOD DrawI25( cText ) CLASS TCode
|
||||
|
||||
RETURN NIL
|
||||
|
||||
METHOD GenCodei25() CLASS TCode
|
||||
METHOD GenCodei25() CLASS GDBarCode
|
||||
|
||||
LOCAL lError := .F.
|
||||
LOCAL bc_string
|
||||
@@ -628,7 +628,7 @@ METHOD GenCodei25() CLASS TCode
|
||||
It makes mixe of the value to be codified by the Bar code I25
|
||||
*/
|
||||
|
||||
METHOD MixCode( value ) CLASS TCode
|
||||
METHOD MixCode( value ) CLASS GDBarCode
|
||||
|
||||
LOCAL l, i, k
|
||||
LOCAL s
|
||||
@@ -667,6 +667,6 @@ METHOD MixCode( value ) CLASS TCode
|
||||
|
||||
RETURN bar_string
|
||||
|
||||
METHOD Findcode( uVal ) CLASS TCode
|
||||
METHOD Findcode( uVal ) CLASS GDBarCode
|
||||
|
||||
RETURN ::acode[ AScan( ::keys, {| x | Left( x, 1 ) == uVal } ) ]
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
#command DYNAMIC <fncs,...> => EXTERNAL <fncs>
|
||||
#endif
|
||||
|
||||
DYNAMIC GDBar
|
||||
DYNAMIC GDBarCode
|
||||
DYNAMIC GDChart
|
||||
DYNAMIC gdFontCacheSetup
|
||||
DYNAMIC gdFontCacheShutdown
|
||||
@@ -132,8 +134,6 @@ DYNAMIC gdTrueColorAlpha
|
||||
DYNAMIC gdVersion
|
||||
DYNAMIC gdVersionNumber
|
||||
DYNAMIC hb_gd_Version
|
||||
DYNAMIC TBarCode
|
||||
DYNAMIC TCode
|
||||
|
||||
#if defined( __HBEXTREQ__ ) .OR. defined( __HBEXTERN__HBGD__REQUEST )
|
||||
#uncommand DYNAMIC <fncs,...> => EXTERNAL <fncs>
|
||||
|
||||
@@ -31,7 +31,7 @@ PROCEDURE Main()
|
||||
1- Barcode Type 13,8 and 128
|
||||
*/
|
||||
|
||||
bar := TCode():New( 13 )
|
||||
bar := GDBarCode():New( 13 )
|
||||
|
||||
/* Here is the list of the arguments
|
||||
1 - Thickness
|
||||
@@ -56,7 +56,7 @@ PROCEDURE Main()
|
||||
bar:Finish( 2 )
|
||||
|
||||
// EAN8
|
||||
bar := TCode():New( 8 )
|
||||
bar := GDBarCode():New( 8 )
|
||||
|
||||
bar:Configure( 70, black, white, 2, 1 )
|
||||
|
||||
@@ -69,7 +69,7 @@ PROCEDURE Main()
|
||||
bar:ResizeImage()
|
||||
|
||||
// EAN128
|
||||
bar := TCode():New( 128 )
|
||||
bar := GDBarCode():New( 128 )
|
||||
|
||||
bar:Configure( 50, black, white, 2, 1 )
|
||||
|
||||
@@ -88,7 +88,7 @@ PROCEDURE Main()
|
||||
bar:Finish( 8 )
|
||||
|
||||
// BRAZIL-FEBRABAN
|
||||
bar := TCode():New( 25 )
|
||||
bar := GDBarCode():New( 25 )
|
||||
|
||||
bar:Configure( 25, black, white, 1, 1,, .T. )
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ PROCEDURE Main()
|
||||
1- Barcode Type 13,8 and 128
|
||||
*/
|
||||
|
||||
bar := TCode():New( 13 )
|
||||
bar := GDBarCode():New( 13 )
|
||||
|
||||
/* Here is the list of the arguments
|
||||
1 - Thickness
|
||||
@@ -57,7 +57,7 @@ PROCEDURE Main()
|
||||
bar:Finish( 2 )
|
||||
|
||||
// EAN8
|
||||
bar := TCode():New( 8 )
|
||||
bar := GDBarCode():New( 8 )
|
||||
|
||||
bar:Configure( 70, black, white, 2, 1 )
|
||||
|
||||
@@ -70,7 +70,7 @@ PROCEDURE Main()
|
||||
bar:ResizeImage()
|
||||
|
||||
// EAN128
|
||||
bar := TCode():New( 128 )
|
||||
bar := GDBarCode():New( 128 )
|
||||
|
||||
bar:Configure( 50, black, white, 2, 1 )
|
||||
|
||||
@@ -86,7 +86,7 @@ PROCEDURE Main()
|
||||
bar:Finish( 2 )
|
||||
|
||||
// BRAZIL-FEBRABAN
|
||||
bar := TCode():New( 25 )
|
||||
bar := GDBarCode():New( 25 )
|
||||
|
||||
bar:Configure( 25, black, white, 1, 1,, .T. )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user