************************************************** *-- Class: colorlabel ( clslabel.vcx ) *-- ParentClass: container *-- BaseClass: container * DEFINE CLASS colorlabel AS container Width = 55 Height = 24 BackStyle = 0 Name = "colorlabel" **--- Additional properties caption = "Color Label" fontname = "" && Blank/Empty = use FontName from FORM fontsize = .F. && FALSE = use FontSize from FORM fontbold = .F. *** *** Add more FontStyle *** PROCEDURE Init Local ln_X, lc_Object, ln_Left With This .BorderWidth = 0 If empty( .FontName ) .FontName = ThisForm.FontName endif If empty( .FontSize ) .FontSize = ThisForm.FontSize endif ln_left = 1 For ln_X = 1 to len( .Caption ) lc_Object = 'lblColor' + alltrim(str( ln_X )) .NewObject( lc_Object, 'lblChar', 'ClsLabel', , ; substr(.Caption, ln_X, 1), .FontName, .FontSize, .FontBold ) With .&lc_Object .Top = 1 .Left = ln_Left .Visible = .T. ln_Left = ln_Left + .Width - 2 EndWith Next .Width = ln_Left + 2 .Height = .&lc_Object..Height + 1 EndWith ENDPROC ENDDEFINE ************************************************** *-- Class: lblchar ( clslabel.vcx ) *-- ParentClass: label *-- BaseClass: label * DEFINE CLASS lblchar AS label AutoSize = .T. BackStyle = 0 Caption = "" Height = 17 Width = 2 Name = "lblchar" PROCEDURE Init LParameters tc_Char, tc_FontName, tn_FontSize, tl_FontBold With This .Caption = tc_Char .FontName = tc_FontName .FontSize = tn_FontSize .FontBold = tl_FontBold .ForeColor = int( round(rand(), 4) * 0xFFFFFF ) EndWith ENDPROC ENDDEFINEHTH