Guidance
指路人
g.yi.org
software / rapidq / Examples / QObject / QCoolBarXP / QCoolBarXP88.inc

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
' Créé par D-évolution / Created by D-evolution -=@=- 2003 - 2005

' Dans la série de objet perso voici QCoolBarXP -- Immitation d'une Barre d'outil

' CoolBarXP est une version complètement revue de ma CoolBar, d'ailleur il y a
' encore des traces de cette dernière dans le code
' Tout ça est possible via une modification de l'Add-On fournis avec QTButton
' Voyez-les posibilités !!!
' Il ne reste plus qu'a gérer l'effet Survolle, placer une image de fond et
' on obtient une Barre d'outil casi identique à celles de WinXP (sous XP)

' Pour plus de détail sur l'utilisation de ce composant reportez vous à la
' documentation fournise... (QCoolBarXP.html)
' For more details on using this component please refer to the doc
' (QCoolBarXP.html)

' Si la doc n'est pas disponible actuellement elle le sera sous peu...
'
     $OPTION EXPLICIT

'Const RGN_AND = 1
'Const RGN_COPY = 5
'Const RGN_OR = 2
     CONST RGN_XOR_QCBar = 3
'Const RGN_DIFF = 4

     DECLARE FUNCTION GetDC_QCBar LIB "user32" ALIAS "GetDC" _
      (BYVAL hwnd AS LONG) AS LONG
     DECLARE FUNCTION ReleaseDC_QCBar LIB "user32" ALIAS "ReleaseDC" _
      (BYVAL hwnd AS LONG, BYVAL hdc AS LONG) AS LONG
'Declare Function GetClipRgn_QCBar Lib "gdi32" Alias "GetClipRgn" _
'	 (ByVal hdc As Long, ByVal hRgn As Long) As Long
     DECLARE FUNCTION DeleteObject_QCBar LIB "gdi32" ALIAS "DeleteObject" _
      (BYVAL hObject AS LONG) AS LONG
     DECLARE FUNCTION CreateRectRgn_QCBar LIB "gdi32" ALIAS "CreateRectRgn" _
      (BYVAL X1 AS LONG, BYVAL Y1 AS LONG, BYVAL X2 AS LONG, BYVAL Y2 AS LONG) AS LONG
'Declare Function OffsetRgn_QCBar Lib "gdi32" Alias "OffsetRgn" _
'	(ByVal hRgn As Long, ByVal x As Long, ByVal y As Long) As Long

     DECLARE FUNCTION CombineRgn_QCBar LIB "gdi32"  ALIAS "CombineRgn" _
      (BYVAL hDestRgn AS LONG, BYVAL hSrcRgn1 AS LONG, BYVAL hSrcRgn2 AS LONG, BYVAL nCombineMode AS LONG) AS LONG
     DECLARE FUNCTION SetWindowRgn_QCBar LIB "user32" ALIAS "SetWindowRgn" _
      (BYVAL hWnd AS LONG, BYVAL hRgn AS LONG, BYVAL bRedraw AS INTEGER) AS LONG

' ===
' Extrait de QTButton
     $IFNDEF __RQINC' ==(corrigé! doh!)
      CONST False = 0
      CONST True	= 1

      CONST clBtnFace = -2147483633
      CONST clHilight	= -2147483635
      CONST clGrayText = -2147483631
      CONST clBtnText	= -2147483630
      CONST clPurple	= &HFF00FF

      CONST pf15bit	= 4
     $ENDIF ' __RQINC

     CONST rqNullChr_CBar = CHR$(0)
'Const rqSL		= CHR$(10)

     CONST DefPixelFormat_CBar = 4

     DIM QCBarOptimize AS INTEGER
     QCBarOptimize = False

     DIM QCBarBMP AS QBITMAP
'	QCBarBMP.BMPHandle = btn_BMP' REsource bitmap

     $IFNDEF __RQOBJDRAWING
      $DEFINE __RQOBJDRAWING
      TYPE RECT_QTBtn
       Left	AS LONG
       Top		AS LONG
       Right	AS LONG
       Bottom	AS LONG
      END TYPE

      CONST DT_SINGLELINE_QTBtn AS LONG = &H20
      CONST DT_CENTER_QTBtn = &H1
      CONST DT_VCENTER_QTBtn AS LONG = &H4

      DECLARE FUNCTION DrawText_QTBtn LIB "user32" ALIAS "DrawTextA" ( _
       BYVAL hdc AS LONG, _
       BYVAL lpStr AS STRING, _
       BYVAL nCount AS LONG, _
       lpRect AS RECT_QTBtn, _
       BYVAL wFormat AS LONG) AS LONG

      DECLARE FUNCTION SetBkMode_QTBtn LIB "gdi32" ALIAS "SetBkMode" _
       (BYVAL hdc AS LONG, BYVAL nBkMode AS LONG) AS LONG
'Declare Function SetTextColor Lib "gdi32" Alias "SetTextColor" _
'		(ByVal hdc As Long, ByVal crColor As Long) As Long

' -- (Ajouté 11janv) Les Nouveaux API pour le suport des Thèmes de Bureau XP
      DECLARE FUNCTION OpenThemeData_QTBtn LIB "uxtheme.dll" ALIAS "OpenThemeData" ( _
       BYVAL hwnd AS LONG, _
       BYVAL pszClassList AS LONG) AS LONG

      DECLARE FUNCTION CloseThemeData_QTBtn LIB "uxtheme.dll" ALIAS "CloseThemeData" ( _
       BYVAL hTheme AS LONG) AS LONG

      DECLARE FUNCTION DrawThemeBackground_QTBtn LIB "uxtheme.dll" ALIAS "DrawThemeBackground" ( _
       BYVAL hTheme AS LONG, _
       BYVAL hdc AS LONG, _
       BYVAL iPartID AS LONG, _
       BYVAL iStateID AS LONG, _
       pRect AS RECT_QTBtn, _
       pClipRect AS RECT_QTBtn) AS LONG
'Declare Function DrawThemeText_QTBtn Lib "uxtheme.dll" Alias "DrawThemeText" ( _
'		ByVal hTheme As Long, _
'		ByVal hdc As Long, _
'		ByVal iPartID As Long, _
'		ByVal iStateID As Long, _
'		ByVal pszText As Long, _
'		ByVal iCharCount As Long, _
'		ByVal dwTextFlags As Long, _
'		ByVal dwTextFlags2 As Long, _
'		pRect As RECT_QTBtn) As Long

      CONST xpt_PushBtn		= "Button"
      CONST xpt_ToolBarBtn	= "Toolbar"
      CONST xpt_TabBtn		= "Tab"
' //--
     $ENDIF ' __RQOBJDRAWING

     CONST xpt_ReBar		= "ReBar" ' Seulement pour coolbarxp


     $IFNDEF __RQGETVERSION
      $DEFINE __RQGETVERSION
      DIM isXP_QTBtn AS INTEGER
      isXP_QTBtn = False

      TYPE OSVERSIONINFO_QTBtn
       dwOSVersionInfoSize AS LONG
       dwMajorVersion AS LONG
       dwMinorVersion AS LONG
       dwBuildNumber AS LONG
       dwPlatformId AS LONG
       szCSDVersion AS STRING *128
      END TYPE
'Const PLATFORM_WIN32_WINDOWS = 1
'Const PLATFORM_WIN32_NT = 2
      DECLARE FUNCTION GetVersionEx_QTBtn LIB "kernel32.dll" ALIAS "GetVersionExA" _
       (BYVAL lpVersionInformation AS LONG) AS LONG

      DIM rtn_QTBtn AS LONG
      DIM OSV_QTBtn AS OSVERSIONINFO_QTBtn, Mem_QTBtn AS QMEMORYSTREAM

      DIM PixelFormatFix_QTBtn AS INTEGER
      PixelFormatFix_QTBtn = pf15bit

      SUB GetVersion_QTBtn
       OSV_QTBtn.dwOSVersionInfoSize = SIZEOF(OSV_QTBtn)
       Mem_QTBtn.WriteUDT(OSV_QTBtn)
       rtn_QTBtn = GetVersionEx_QTBtn(Mem_QTBtn.Pointer)
       IF rtn_QTBtn <> False THEN
        Mem_QTBtn.Position = False
        Mem_QTBtn.ReadUDT(OSV_QTBtn)
        IF OSV_QTBtn.dwPlatformId = True THEN
         isXP_QTBtn = False
        ELSEIF OSV_QTBtn.dwPlatformId = 2 THEN
         IF OSV_QTBtn.dwMajorVersion = 5 THEN _
          IF OSV_QTBtn.dwMinorVersion = True THEN _
          isXP_QTBtn = True
        END IF
       END IF
       Mem_QTBtn.CLOSE
      END SUB
      CALL GetVersion_QTBtn
     $ENDIF ' __RQGETVERSION

     DIM maxnumbmp_QCBar AS INTEGER
     maxnumbmp_QCBar = 5

' //--

'Extrait de QTButton_AddOns
     SUB Fast_QCBarToQTBtn( _
       BtnType AS STRING, _
       PartID AS INTEGER, _
       Sender AS QBITMAP, _
       CAPTION AS STRING, _
       wMenu AS INTEGER, _
       Grouped AS INTEGER, _
       Hwnd AS LONG)
					 '( _
					 '  BtnType As String, _
					 '  PartID As Integer, _
					 '  Sender As QBitmap, _
					 '  Caption As String, _
					 '  pWidth As Integer, _
					 '  pLeft As Integer, _
					 '  wMenu As Integer, _
					 '  Hwnd As Long)
      DIM Dest AS QRECT, Source AS QRECT
      DIM tmpBitmap1 AS QBITMAP, _
       NBitmap1 AS QBITMAP, _
       XPBitmap1 AS QBITMAP
      DIM XPBtnType AS STRING ' Ajouté 19jan corrige un problème où les types sont différents
      DIM XPPartID AS INTEGER
	'Dim oldCaption As String
	'	oldCaption = Sender.Caption
      DIM Width1 AS INTEGER, Height1 AS INTEGER
      DIM Width2 AS INTEGER, Height2 AS INTEGER
      DIM btnCount AS INTEGER

	'Sender.Flat = False
	'Sender.NumBMPs = maxnumbmp_QCBar
    'Sender.Spacing = False
      btnCount = maxnumbmp_QCBar 'Sender.NumBMPs

	'if btnCount > maxnumbmp_QCBar Then
	'	btnCount = maxnumbmp_QCBar
	'	sender.numbmps = btncount
	'end if

      DIM fixTab AS INTEGER
      fixTab = False

      IF isXP_QTBtn AND BtnType = xpt_TabBtn THEN _
       fixTab = True
      IF isXP_QTBtn AND (BtnType = xpt_pushbtn OR BtnType = xpt_toolbarbtn OR BtnType = xpt_TabBtn) THEN _
       PartID = True

      Width1 = ((Sender.Width +3) *btnCount) +True
      Height1 = Sender.Height +3
      DOEVENTS
	' Si l'image à déjà la même dimension elle ne sera pas redimensionnée
	'If QCBarOptimize <> True or (Width2 <> Width1 and Height2 <> Height1) Then
      IF QCBarOptimize <> True OR _
       (isXP_QTBtn = True AND (XPBtnType <> BtnType OR PartID <> XPPartID)) OR _
       (tmpBitmap1.Width <> Width1 AND tmpBitmap1.Height <> Height1 AND _
       Width2 <> tmpBitmap1.Width AND Height2 <> tmpBitmap1.Width) THEN
       WITH NBitmap1
        .Width = Width1		'== (mod)
        .Height = Height1	'== (mod)
        .FillRect(False, False, .Width, .Height, clBtnFace)'==(mod) (13janv remplacé clPurple par clBtnFace)
			'.PixelFormat = DefPixelFormat_CBar
       END WITH
       WITH XPBitmap1
        .Width = Width1		'== (mod)
        .Height = Height1	'== (mod)
        .FillRect(False, False, .Width, .Height, clBtnFace)'==(mod) (13janv remplacé clPurple par clBtnFace)
			'.PixelFormat = DefPixelFormat_CBar
       END WITH
       Width1 = Sender.Width *btnCount
       Height1 = Sender.Height

       tmpBitmap1.Font.Name = Sender.Font.Name' == (add)
       tmpBitmap1.Font.Size = Sender.Font.Size' == (add)
       tmpBitmap1.Font.COLOR = Sender.Font.COLOR' == (add)
       tmpBitmap1.Font.Bold = Sender.Font.Bold
       tmpBitmap1.Font.Italic = Sender.Font.Italic
       tmpBitmap1.Font.Underline = Sender.Font.Underline

       IF isXP_QTBtn = False THEN
			' Thème non activé ou ce n'est pas Windows XP

        DIM J AS INTEGER, I AS INTEGER
        FOR J = False TO btnCount -True
				' Le centre ----------------------------------------------------------
         WITH Dest
          .Left = ((Width1 \btnCount) *J) +3 +(True *(J +True)) +(J *2) -IIF(J = 2, True, False)
          .Top = 4 -IIF(J=2, True, False)
          .Right = .Left +(Width1 \btnCount) -6
          .Bottom = Height1 -2 -IIF(J = 2, True, False)
         END WITH
         WITH Source: .Left = ((QCBarBMP.Width \btnCount) *J) +3: .Top = 3: _
           .Right = .Left +(QCBarBMP.Width \btnCount) -6
          .Bottom = QCBarBMP.Height -3
         END WITH

         NBitmap1.CopyRect(Dest, QCBarBMP, Source)

				' Les coins ----------------------------------------------------------
         FOR I = False TO 3
          WITH Dest
           .Left = ((Width1 \btnCount) *J) _
            +IIF(I = False OR I = 2, False, (Width1 \btnCount) -3) +(True *(J +True)) +(J *2) _
            -IIF(J = 2, True, False)
           .Top = IIF(I<2, True, Height1 -2) -IIF(J = 2, True, False)
           .Right = .Left +3
           .Bottom = .Top +3
          END WITH
          WITH Source
           .Left = ((QCBarBMP.Width \btnCount) *J) _
            +IIF(I = False OR I = 2, False, (QCBarBMP.Width \btnCount) -3)
           .Top = IIF(I < 2, False, QCBarBMP.Height -3)
           .Right = .Left +3
           .Bottom = .Top +3
          END WITH
          NBitmap1.CopyRect(Dest, QCBarBMP, Source)
         NEXT I
				' Les horizontaux ----------------------------------------------------
         FOR I = False TO True
          WITH Dest
           .Left = ((Width1 \btnCount) *J) +3 +(True *(J +True)) +(J *2) -IIF(J = 2, True, False)
           .Top = IIF(I = False, True, Height1 -2) -IIF(J = 2, True, False)
           .Right = .Left +(Width1 \btnCount) -6
           .Bottom = .Top +3
          END WITH
          WITH Source
           .Left = (QCBarBMP.Width \btnCount) *J +3
           .Top = IIF(I = False, False, QCBarBMP.Height -3)
           .Right = .Left +(QCBarBMP.Width \btnCount) -6
           .Bottom = .Top +3
          END WITH
          NBitmap1.CopyRect(Dest, QCBarBMP, Source)
         NEXT I
				' Les verticaux ------------------------------------------------------
         FOR I = False TO True
          WITH Dest
           .Left = ((Width1 \btnCount) *J) _
            +IIF(I = False, False, (Width1 \btnCount) -3) +(True *(J +True)) +(J *2) _
            -IIF(J = 2, True, False)
           .Top = 4 -IIF(J = 2, True, False)
           .Right = .Left +3
           .Bottom = Height1 -2 -IIF(J = 2, True, False)
          END WITH
          WITH Source
           .Left = ((QCBarBMP.Width \btnCount) *J) +IIF(I = False, False, (QCBarBMP.Width \btnCount) -3)
           .Top = 3
           .Right = .Left +3
           .Bottom = QCBarBMP.Height -3
          END WITH
          NBitmap1.CopyRect(Dest, QCBarBMP, Source)
         NEXT I
        NEXT J
        NBitmap1.PixelFormat = DefPixelFormat_CBar
       ELSE
			' Thème activé (Windows XP)
			' --
        DIM hTheme AS LONG
			'On Error Resume Next

			' Ouverture du thème
        DIM rtButton AS STRING ', _
			'	bgButton As String
        rtButton = ""
			'bgButton =	"R" +rqNullChr_CBar +_
			'			"e" +rqNullChr_CBar +_
			'			"B" +rqNullChr_CBar +_
			'			"a" +rqNullChr_CBar +_
			'			"r" +rqNullChr_CBar +_
			'			rqNullChr_CBar

        DIM lR AS LONG
        DIM m_hDC AS LONG
        DIM m_lPartId AS LONG, m_lStateId AS LONG
        DIM tR AS RECT_QTBtn

			' Finalement inutile
			'rtButton =
			'hTheme = OpenThemeData_QTBtn(Hwnd, VarPtr(bgButton))
			'If hTheme <> False Then
			'	m_hDC = XPBitmap1.Handle

			'	tR.Left = -pLeft 'False
			'	tR.Top = False '-True 'False
			'	tR.Right = pWidth -pLeft 'Sender.Width
			'	tR.Bottom = Sender.Height +True

			'	lR = DrawThemeBackground_QTBtn(hTheme, _
			'							 m_hDC, _
			'							 6, _
			'							 True, _
			'							 tR, tR)
			'End If
			'CloseThemeData_QTBtn hTheme
			'CloseThemeData_QTBtn hTheme

			' Format unicode ?!?
        FOR I = True TO LEN(BtnType)
         rtButton = rtButton +MID$(BtnType, I, True) +rqNullChr_CBar
        NEXT I
        rtButton = rtButton +rqNullChr_CBar ' Un dernier pour finaliser

        hTheme = OpenThemeData_QTBtn(Hwnd, VARPTR(rtButton))
        IF hTheme <> False THEN
				' Styles XP disponible

				' m_hDC est le DC pour dessiner
				' m_lPartId et m_lStateId sont la class + l'état à dessiner
				' tR est un RECT spécifiant la zone dans laquelle dessiner
         m_hDC = XPBitmap1.Handle
         DIM mLeft AS INTEGER
         mLeft = False
         IF wMenu > False THEN
          m_lPartId = 3
          mLeft = 12
         ELSEIF PartID > True THEN
          m_lPartId = PartID
         ELSE
          m_lPartId = True 'BP_PUSHBUTTON
         END IF

         FOR I = False TO 2 STEP 2
          m_lStateId = I +True 'PBS_NORMAL
          tR.Left = ((I *(Sender.Width +3)) +IIF(I <> 2, True, False))
          tR.Top = True -IIF(I <> 2, False, True) +fixTab 'False -iif(I <> 2, False, True)
          tR.Right = (tR.Left +Sender.Width) -mLeft '+True
          tR.Bottom = (Sender.Height +True -IIF(I <> 2, False, True) +fixTab) -True '-2 '+iif(I <> 2, True, False)

          lR = DrawThemeBackground_QTBtn(hTheme, _
           m_hDC, _
           m_lPartId, _
           m_lStateId, _
           tR, tR)
         NEXT I
				' Inverse Sélectionné et Désactivé (Survolle est remplacé par Sélectionné)
         FOR I = True TO 3 STEP 2
          m_lStateId = (I +True) +IIF(I = True, True +Grouped, False) '+iif(I = True, True, False)'PBS_NORMAL
					'tR.Left = (((I +iif(I = True, 2, -2)) *(Sender.Width +3)) +True)
					'tR.Top = True
          tR.Left = (((I +IIF(I = True, 2, -2)) *(Sender.Width +3)) +IIF(I = True, False, True))
          tR.Top = IIF(I = True, False, True +fixTab)
          tR.Right = (tR.Left +Sender.Width) -mLeft '+True
          tR.Bottom = Sender.Height +True +fixTab -True '-2 '+2

          lR = DrawThemeBackground_QTBtn( hTheme, _
           m_hDC, _
           m_lPartId, _
           m_lStateId, _
           tR, tR)
         NEXT I
				'Survole
         m_lStateId = 2
         tR.Left = (4 *(Sender.Width +3)) +True
         tR.Top = True
         tR.Right = (tR.Left +Sender.Width) -mLeft '+True
         tR.Bottom = Sender.Height +fixTab +True '+2

         lR = DrawThemeBackground_QTBtn( hTheme, _
          m_hDC, _
          m_lPartId, _
          m_lStateId, _
          tR, tR)
         IF wMenu > False THEN
          mLeft = Sender.Width -11
          m_lPartId = 4

          FOR I = False TO 2 STEP 2
           m_lStateId = I +True 'PBS_NORMAL
           tR.Left = ((I *(Sender.Width +3)) +IIF(I <> 2, True, False)) +mLeft
           tR.Top = True -IIF(I <> 2, False, True) +fixTab 'False -iif(I <> 2, False, True)
           tR.Right = (tR.Left +Sender.Width) -mLeft '+True
           tR.Bottom = (Sender.Height +True -IIF(I <> 2, False, True) +fixTab) -True '-2 '+iif(I <> 2, True, False)

           lR = DrawThemeBackground_QTBtn(hTheme, _
            m_hDC, _
            m_lPartId, _
            m_lStateId, _
            tR, tR)
          NEXT I
					' Inverse Sélectionné et Désactivé (Survolle est remplacé par Sélectionné)
          FOR I = True TO 3 STEP 2
           m_lStateId = (I +True) +IIF(I = True, True, False)'PBS_NORMAL
						'tR.Left = (((I +iif(I = True, 2, -2)) *(Sender.Width +3)) +True)
						'tR.Top = True
           tR.Left = (((I +IIF(I = True, 2, -2)) *(Sender.Width +3)) +IIF(I = True, False, True)) +mLeft
           tR.Top = IIF(I = True, False, True +fixTab)
           tR.Right = (tR.Left +Sender.Width) -mLeft '+True
           tR.Bottom = Sender.Height +True +fixTab -True '-2 '+2

           lR = DrawThemeBackground_QTBtn(hTheme, _
            m_hDC, _
            m_lPartId, _
            m_lStateId, _
            tR, tR)
          NEXT I
					'Survole
          m_lStateId = 2
          tR.Left = (4 *(Sender.Width +3)) +True +mLeft
          tR.Top = True
          tR.Right = (tR.Left +Sender.Width) -mLeft '+True
          tR.Bottom = Sender.Height +True +fixTab '-2 '+2

          lR = DrawThemeBackground_QTBtn(hTheme, _
           m_hDC, _
           m_lPartId, _
           m_lStateId, _
           tR, tR)
         END IF
        END IF

			' Session de dessin terminée
        CloseThemeData_QTBtn hTheme
        CloseThemeData_QTBtn hTheme
			'//--
        XPBitmap1.PixelFormat = DefPixelFormat_CBar
       END IF

      END IF
      Width2 = ((Sender.Width +3) *btnCount) +True
      Height2 = Sender.Height +3


      IF isXP_QTBtn THEN
       tmpBitmap1.BMP = XPBitmap1.BMP
      ELSE
       tmpBitmap1.BMP = NBitmap1.BMP
      END IF

	'If Caption = "" Then
	'	'Sender.Layout = False
	'Else
	'	SetBkMode_QTBtn tmpBitmap1.Handle, True
	'	For I = False To 2 Step 2
	'		tR.Left = ((I *(Sender.Width +3)) +iif(I <> 2, True, False))
	'		tR.Top = True -iif(I <> 2, False, True) +fixTab 'False -iif(I <> 2, False, True)
	'		tR.Right = (tR.Left +Sender.Width) '+True
	'		tR.Bottom = (Sender.Height +True -iif(I <> 2, False, True) +fixTab) '+iif(I <> 2, True, False)

	'		DrawText_QTBtn (tmpBitmap1.Handle, Caption, Len(Caption), _
	'						tR, DT_CENTER_QTBtn OR DT_SINGLELINE_QTBtn OR DT_VCENTER_QTBtn)
	'	Next I
	'	' Inverse Survolle et Désactivé
	'	For I = True To 3 Step 2
	'		'tR.Left = (((I +iif(I = True, 2, -2)) *(Sender.Width +3)) +True)
	'		'tR.Top = True
	'		tR.Left = (((I +iif(I = True, 2, -2)) *(Sender.Width +3)) +iif(I = True, False, True))
	'		tR.Top = iif(I = True, False, True +fixTab)
	'		tR.Right = (tR.Left +Sender.Width) '+True
	'		tR.Bottom = Sender.Height +True +fixTab '+2

	'		DrawText_QTBtn (tmpBitmap1.Handle, Caption, Len(Caption), _
	'						tR, DT_CENTER_QTBtn OR DT_SINGLELINE_QTBtn OR DT_VCENTER_QTBtn)
	'	Next I

	'	tmpBitmap1.Height = (Height1 +True) +tmpBitmap1.TextHeight(Caption)
	'	'Sender.Layout = 3
	'End If
      tmpBitmap1.PixelFormat = DefPixelFormat_CBar

      XPBtnType = BtnType
      IF PartID <> True THEN PartID = True
      XPPartID = True
	'tmpBitmap1.Transparent = True
	' Prévient l'apparission du rectangle de survole de CoolBtn
	'tmpBitmap1.Pixel(True, True) = clPurple
	'tmpBitmap1.TransparentColor = clPurple
	'tmpBitmap1.TransparentColor = tmpBitmap1.Pixel(True, True)
      Sender.BMP = tmpBitmap1.BMP
     END SUB


     SUB XPPart ( _
       BtnType AS STRING, _
       PartID AS INTEGER, _
       Orientation AS INTEGER, _
       DisableXPThemeBG AS INTEGER, _
       COLOR, _
       Sender AS QIMAGE, _
       hWnd AS LONG)
      IF isXP_QTBtn THEN
		' Thème activé (Windows XP)
		' --
       DIM XPBitmap1 AS QBITMAP
       XPBitmap1.Width = Sender.Width
       XPBitmap1.Height = Sender.Height
		'If DisableXPThemeBG Then _
       IF DisableXPThemeBG OR PartID <> 6 THEN _
        XPBitmap1.FillRect(False, False, Sender.Width, Sender.Height, COLOR)

       DIM hTheme AS LONG
		'On Error Resume Next

		' Ouverture du thème
       DIM rtButton AS STRING
       rtButton = ""
		' Format unicode ?!?
       DIM I AS INTEGER
       FOR I = True TO LEN(BtnType)
        rtButton = rtButton +MID$(BtnType, I, True) +rqNullChr_CBar
       NEXT I
       rtButton = rtButton +rqNullChr_CBar ' Un dernier pour finaliser

       hTheme = OpenThemeData_QTBtn(hWnd, VARPTR(rtButton))
       IF hTheme <> False THEN
			' Styles XP disponible

        DIM lR AS LONG
        DIM m_hDC AS LONG
        DIM m_lPartId AS LONG, m_lStateId AS LONG
        DIM tR AS RECT_QTBtn

			' m_hDC est le DC pour dessiner
			' m_lPartId et m_lStateId sont la class + l'état à dessiner
			' tR est un RECT spécifiant la zone dans laquelle dessiner
        m_hDC = XPBitmap1.Handle
        IF PartID > True THEN _
         m_lPartId = PartID _
        ELSE _
         m_lPartId = True 'BP_PUSHBUTTON

        m_lStateId = True 'PBS_NORMAL
        IF Orientation THEN
         tR.Left = False -IIF(PartID =< 2, True, False)
         tR.Top = False
         tR.Right = Sender.Width -IIF(PartID =< 2, True, False)
         tR.Bottom = IIF(PartID =< 2, 8, Sender.Height)
        ELSE
         tR.Left = False
         tR.Top = False -IIF(PartID =< 2, True, False)
         tR.Right = IIF(PartID =< 2, 5, Sender.Width)
         tR.Bottom = Sender.Height -IIF(PartID =< 2, True, False)
        END IF

        lR = DrawThemeBackground_QTBtn(hTheme, _
         m_hDC, _
         m_lPartId, _
         m_lStateId, _
         tR, tR)
        Sender.BMP = XPBitmap1.BMP
       END IF

		' Session de dessin terminée
       CloseThemeData_QTBtn hTheme
       CloseThemeData_QTBtn hTheme
		'//--
		'XPBitmap1.PixelFormat = DefPixelFormat_CBar
      END IF
     END SUB
' //==

'Declare Function LoadIcon Lib "user32" Alias "LoadIconA" _
'	(ByVal hInstance As Long, ByVal lpIconName As Long) As Long
'Declare Function DestroyIcon Lib "user32" Alias "DestroyIcon" _
'	(ByVal hIcon As Long) As Long

'Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" _
'	(ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
'Declare Function DestroyCursor Lib "user32" Alias "DestroyCursor" _
'	(ByVal hCursor As Long) As Long
'Declare Function DrawIcon Lib "user32" Alias "DrawIcon" _
'	(ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
'Declare Function GetCursor Lib "user32" Alias "GetCursor" () As Long

'Declare Function CBar_EnumChild LIB "User32" ALIAS "EnumChildWindows" _
'	(hWndParent AS LONG,lpEnumFunc AS LONG,lParam AS LONG) _
'	AS LONG
'Declare Function CBar_GetClassName LIB "User32" ALIAS "GetClassNameA" _
'	(hwnd AS LONG,ByRef lpClassName AS STRING,nMaxCount AS LONG) _
'	AS LONG

'Declare Function CBar_GetParent Lib "user32" Alias "GetParent" _
'	(ByVal hwnd As Long) _
'	As Long
'Declare Function CBar_SetParent Lib "user32" Alias "SetParent" _
'	(ByVal hWndChild As Long, ByVal hWndNewParent As Long) _
'	As Long

'Declare Function EnumChild(hWnd as long,lParam as long) as long

'DIM LH AS LONG
'DIM BFR AS STRING: BFR = SPACE$(100)

'DECLARE FUNCTION CBar_GetWindowText LIB "user32" ALIAS "GetWindowTextA" _
'	(ByVal hwnd AS LONG, ByVal lpString AS STRING, ByVal cch AS LONG) _
'	AS LONG
'DECLARE FUNCTION CBar_GetClassName LIB "user32" ALIAS "GetClassNameA" _
'	(ByVal hwnd AS LONG, ByVal lpClassName AS STRING, ByVal nMaxCount AS LONG) _
'	AS LONG
'DECLARE FUNCTION CBar_GetWindowRect LIB "user32" ALIAS "GetWindowRect" _
'	(ByVal hwnd AS LONG, lpRect AS RECT_QTBtn) _
'	AS LONG


     DECLARE FUNCTION SetCapture_QCBar LIB "user32" ALIAS "SetCapture" _
      (BYVAL hwnd AS LONG) AS LONG
     DECLARE FUNCTION ReleaseCapture_QCBar LIB "user32" ALIAS "ReleaseCapture" () AS LONG
     DECLARE FUNCTION GetCapture_QCBar LIB "user32" ALIAS "GetCapture" () AS LONG

'DrawEdge Constants
'Const BDR_RAISEDOUTER = &H1
     CONST BDR_SUNKENOUTER_QCBar = &H2
'Const BDR_RAISEDINNER = &H4
'Const BDR_SUNKENINNER = &H8

'Const BDR_OUTER	= &H3
'Const BDR_INNER	= &HC
'Const BDR_RAISED	= &H5
'Const BDR_SUNKEN	= &HA

     CONST BF_LEFT_QCBar		= &H1
     CONST BF_TOP_QCBar		= &H2
     CONST BF_RIGHT_QCBar	= &H4
     CONST BF_BOTTOM_QCBar	= &H8

     CONST BF_RECT_QCBar = (BF_LEFT_QCBar OR BF_TOP_QCBar OR BF_RIGHT_QCBar OR BF_BOTTOM_QCBar)

'Const BF_MIDDLE	= &H800		' Fill in the middle.
'Const BF_SOFT		= &H1000	' Use for softer buttons.
'Const BF_ADJUST	= &H2000	' Calculate the space left over.
     CONST BF_FLAT_QCBar	= &H4000	' For flat rather than 3-D borders.
'Const BF_MONO		= &H8000	' For monochrome borders.

'Const DC_ACTIVE	= &H1
'Const DC_NOTACTIVE	= &H2
'Const DC_ICON		= &H4
'Const DC_TEXT		= &H8
'Const DFC_BUTTON	= 4
'Const DFC_POPUPMENU = 5			'Only Win98/2000 !!
'Const DFCS_BUTTON3STATE = &H10
'Const DT_CENTER	= &H1
'Const DC_GRADIENT	= &H20			'Only Win98/2000 !!

     DECLARE FUNCTION DrawEdge_QCBar LIB "user32" ALIAS "DrawEdge" _
      (BYVAL hdc AS LONG, qrc AS RECT_QTBtn, BYVAL edge AS LONG, BYVAL grfFlags AS LONG) _
      AS LONG
'Declare Function DrawFrameControl Lib "user32" Alias "DrawFrameControl" _
'	(ByVal hdc As Long, lpRect As RECT_QTBtn, ByVal un1 As Long, ByVal un2 As Long) _
'	As Long
     DECLARE FUNCTION SetRect_QCBar LIB "user32" ALIAS "SetRect" _
      (lpRect AS RECT_QTBtn, BYVAL X1 AS LONG, BYVAL Y1 AS LONG, BYVAL X2 AS LONG, BYVAL Y2 AS LONG) _
      AS LONG
'Declare Function OffsetRect Lib "user32" Alias "OffsetRect" _
'	(lpRect As RECT_QTBtn, ByVal x As Long, ByVal y As Long) _
'	As Long

'DECLARE FUNCTION CBar_GetDC LIB "USER32" ALIAS "GetDC" _
'	(hWnd AS INTEGER) AS INTEGER

     DECLARE FUNCTION GetMenuItemCount_QCBar LIB "user32" ALIAS "GetMenuItemCount" ( _
      BYVAL hMenu AS LONG) AS LONG
'Declare Function GetMenuItemRect Lib "user32" Alias "GetMenuItemRect" ( _
'		ByVal hwnd As Long, _
'		ByVal hMenu As Long, _
'		ByVal uItem As Long, _
'		lprcItem As RECT_QTBtn) As Long

'Const HTCLIENT_QCBar	= 1
     CONST HTCAPTION_QCBar	= 2
     CONST WM_NCLBUTTONDOWN_QCBar = &HA1
'Const WM_NCLBUTTONUP_QCBar	= &HA2
'Const WM_LBUTTONDOWN_QCBar = &H201
'Const WM_LBUTTONUP_QCBar = &H202
     DECLARE FUNCTION SendMessage_QCBar LIB "user32" ALIAS "SendMessageA" _
      (BYVAL hwnd AS LONG, BYVAL wMsg AS LONG, BYVAL wParam AS LONG,lParam AS LONG) _
      AS LONG


'Declare Sub BMPStretch2_Property (Width As Integer, Height As Integer, Sender As QBitmap)

     DIM Style AS INTEGER
     Style = False 'True

' Event Template pour les nouveaux événements MouseLeave et MouseEnter
     DECLARE SUB OnMouseEnter_EventTemplate (X AS INTEGER, Y AS INTEGER, Shift AS INTEGER, ItemIndex AS INTEGER, Sender AS QPANEL)
     DECLARE SUB OnMouseLeave_EventTemplate (X AS INTEGER, Y AS INTEGER, Shift AS INTEGER, Sender AS QPANEL)
     DECLARE SUB OnChange_EventTemplate (ItemIndex AS INTEGER, Sender AS QPANEL)
'Dim MainCoolBarHandles(4) As Long

'Type QMainCoolBar Extends QPanel
'  With QMainCoolBar
'	Panel(1 To 5)	As QPanel
'	PanelCount		As Integer
'	CoolBarCount	As Long
'	CoolBarHnd(40)	As Long
'
'	Function EnumChild(hWnd as long,lParam as long) as long
'		dim Buffer as string
'
'		Buffer = Space$(255)
'		Call CBar_GetClassName(hWnd, Buffer, 255)
'		if INSTR(UCASE$(Buffer), "TPANELS") then
'			if .CoolBarCount > False then
'				if hwnd <> .CoolBarHnd(.CoolBarCount -1) then
'					.CoolBarHnd(.CoolBarCount) = hWnd
'					.CoolBarCount ++
'				end if
'			else
'				.CoolBarHnd(.CoolBarCount) = hWnd
'				.CoolBarCount ++
'			end if
'		end if
'		Result=true
'	End Function
'
'	Function AddMainCoolBarHandle () As Long ' (hwnd As Long) As Long
'		Dim I As Integer
'		For I = False TO 4
'			If MainCoolBarHandles(I) = False and MainCoolBarHandles(I) <> .Handle Then
'				MainCoolBarHandles(I) = .Handle
'				Result = 1
'			End If
'		Next I
'	End Function
'
'	Sub RePaint
'		CBar_EnumChild(QMainCoolBar.Handle, CODEPTR(QMainCoolBar.EnumChild), False)
'		Dim I As Integer
'		Dim newParent As Long
'		newParent = .Panel(1).Handle
'		For I = True To .CoolBarCount -True
'			If .CoolBarHnd(I) <> newParent Then
'				If GetParent(.CoolBarHnd(I)) = .Handle Then
'					SetParent .CoolBarHnd(I), newParent
'					LH = GETWINDOWTEXT(.CoolBarHnd(I),@BFR, 100)
'					ShowMessage STR$(.CoolBarHnd(I)) +chr$(10) +_
'								STR$(.Handle) +chr$(10) +_
'								LEFT$(BFR, LH)
'				End If
'			End If
'			If GetParent(.CoolBarHnd(I)) = .Handle Then
'					SetParent .CoolBarHnd(I), newParent
'				LH = GETWINDOWTEXT(.CoolBarHnd(I),@BFR, 100)
'				ShowMessage "Erreur:  Parent " +STR$(GetParent(.CoolBarHnd(I))) +chr$(10) +_
'							STR$(newParent) +chr$(10) +_
'							STR$(.Handle) +chr$(10) +_
'							LEFT$(BFR, LH)
'			End If
'		Next I
'	End Sub
'
'	Constructor
'		Align		= alTop
'		BevelWidth	= False
'		PanelCount	= True
'		Panel(2).Parent = QMainCoolBar
'		Panel(2).Caption = "Panel2"
'		Panel(1).Align = alTop
'		Panel(1).Parent = QMainCoolBar
'		'Panel(1).Visible = False
'		Panel(1).Align = alTop
'		'AddMainCoolBarHandle'(QMainCoolBar.Handle)
'	End Constructor
'  End With
'End Type

     SUB DrawMyText( _
       Left AS INTEGER, _
       Top AS INTEGER, _
       Right AS INTEGER, _
       Bottom AS INTEGER, _
       CAPTION AS STRING, _
       nFontName AS STRING, _
       nColor AS INTEGER, _
       Sender AS QBITMAP)
      DIM tR AS RECT_QTBtn
      SetRect_QCBar(tR, Left, Top, Right, Bottom)

      DIM sFontName AS STRING
      IF nFontName <> "" AND nFontName <> Sender.Font.Name THEN
       sFontName = Sender.Font.Name
       Sender.Font.Name = nFontName
      END IF
      DIM sColor AS INTEGER
      IF nColor <> -True AND nColor <> Sender.Font.COLOR THEN
       sColor = Sender.Font.COLOR
       Sender.Font.COLOR = nColor
      END IF

      SetBkMode_QTBtn Sender.Handle, True
      DrawText_QTBtn (Sender.Handle, CAPTION, LEN(CAPTION), _
       tR, DT_SINGLELINE_QTBtn OR DT_VCENTER_QTBtn) ' DT_CENTER_QTBtn OR

      IF nFontName <> "" AND nFontName = Sender.Font.Name THEN _
       Sender.Font.Name = sFontName
      IF nColor <> False AND nColor = Sender.Font.COLOR THEN _
       Sender.Font.COLOR = sColor
      nFontName = ""
      sFontName = ""
      nColor = -True
      sColor = -True
      SetRect_QCBar(tR, False, False, False, False)
     END SUB

     TYPE QCoolBarXP EXTENDS QPANEL
  ' À Faire/TODO :
  ' *Permettre de modifier l'orientation de la barre						(Orientation)
  '																			(0. Horizontal, 1. Vertical)
  ' Permettre de définir l'espace entre les btns							(BtnsSpacing)
  ' Permettre de définir l'emplacement vertical (à partir du haut) des btns	(BtnsDistVert)
  ' Permettre de définir l'emplacement horizontal (à partir de la gauche) des btns	(BtnsDistHorz)
  ' *Permettre de regrouper/dégrouper certains btns							(DefineBtnsGroup(Group, ...))
  '																			(-1) nettoie tous les groupes
  ' *Permettre d'initialliser l'état enfoncé de certains btns				(InitBtnsDownUp(False ou True, ...))
  '   DefineBtnsGroup doit avoir été définie au préalable					(False ou True) enfonce ou non tous les btns
  ' Permettre de désélectionner un btn groupé
  ' *Permettre de désactiver/activer certains btns							(EnableBtns(False ou True,...))
  '																			(False ou True) désactive ou active tous les btns
  ' *Permettre d'afficher/masquer le titre des btns							(ShowBtnsCaption(False ou True, ...))
  '   non disponnible si l'Orientation de la Barre est autre que Faux
  ' *Lorsque la largeur de la Barre est inférieur à celle de sont Parent
  '   afficher soit un popupmenu, soit une barre flottante					(ExceedShowPopup(Menu ou FloatBar))
  ' *Permettre de désactiver l'image de fond sous XP						(DisableXPThemeBG)
  ' Permettre de désactiver le thème XP										(DisableXPTheme)
  ' Permettre de personnaliser l'image de fond								(CustBG = IMGBMP/RES)
  ' *Permettre le partage d'une image de fond commune						(BGFromContainer)
  ' Permettre de personnaliser l'image de la "Grippe"						(CustGrip = IMGBMP/RES)
  ' Permettre de personnaliser l'image des btns	(non-XP)					(CustBtns = IMGBMP/RES)
  ' *Permettre d'ajouter des images pour les états Désactivés/Survolle/Sélectionné	(IMGL? (IMGBMP/RES))
  ' Permettre d'utiliser une collection d'image à la place des ImageLists	(CollectionBMP.Empty = Faux)
  ' Permettre de placer une image ou un titre devant un contrôle (Edit, ComboBox)
  ' Réintroduire les 4 styles de btns offerts par la version original
  ' Si ShowGrip = 2 la grippe sera affiche comme décoration seulement
  ' Ajouter DelItems
  ' Permettre de vérouiller la barre (si align = 0 donc à corriger)
  ' Corriger l'arrière plan lorsque Orientation = Vrai
  ' Plus besoin de lancer .RePaint, mais il est toujours conseillé
  '   puisque l'on voit les btns se positionner lors du chargement
  '
      WITH This
PRIVATE:
       IsPainted	AS INTEGER
       dummypanel		AS QPANEL		' Utiliser pour forcer BtnsHotTrack à garder le premier plan
       FlickeringFree	AS QPANEL
       Dest			AS QRECT
       Src				AS QRECT
       PnlExceed		AS QPANEL		' ...
       CBtnExceed		AS QCOOLBTN		' ...
       CBtnExceedHot	AS QIMAGE		' ...
       CBtnExceedHotTrack	AS QIMAGE	' Capture l'événement OnMouseMove avant que CoolBtn l'intercepte
       mnuExceed		AS QPOPUPMENU	' ...
       mnuItemExceed(30) AS QMENUITEM	' ...
       mnuItemCount	AS INTEGER		' ...
       CoolBtnBMP		AS QBITMAP		' Img sur laquelle l'enjolivure est dessinée avant d'être transférée
       CoolBtn(30)		AS QCOOLBTN		' Btns de la Barre d'outil
       ImgBtnHot(30)	AS QIMAGE		' Image(s) survolle de chaque btns
       BMPtmp			AS QBITMAP		' Image temporaire
       BtnsHotTrack	AS QIMAGE		' Capture l'événement OnMouseMove avant que CoolBtn l'intercepte
	'IMGMask			As QBitmap		' ...
       IMGBackGround	AS QIMAGE		' Image de fond
       IMGStretchedBackGround AS QIMAGE
       IMGStretchedBackGround2 AS QIMAGE
       IMGBackGroundFix AS QBITMAP		' Corrige les dimensions de IMGBackGround
	'Bitmap2			AS QBitmap
	'Bitmap3			AS QBitmap
PUBLIC:
       mnuPopup(29)	AS QPOPUPMENU	' Menu popup pour chaque btn, il seront affiché sur demande
	'CustBG			As QBitmap		' Image de fond
	'CustGrip		As QBitmap		' Image de la "Grippe"
	'CustSkin		As QBitmap		' Image de l'enjolivure
       imgLA			AS QIMAGELIST	' ImgLst des btns Actifs
       imgLD			AS QIMAGELIST	' ImgLst des btns Inactifs
       imgLS			AS QIMAGELIST	' ImgLst des btns Sélectionnés
       imgLH			AS QIMAGELIST	' ImgLst des btns Survollés
	'CollectionBMP	AS QBitmap		' Une collection d'image de tous les btns
PRIVATE:
       imgLBK			AS QBITMAP		' Corrige le problème de transparence des ImgLists
	'CanvasLeft		AS QCanvas		' ...
       CanvasRight		AS QCANVAS		' ...
       CaptionWidth	AS INTEGER		' Largeur du titre de la barre
       CaptionHeight	AS INTEGER		' Hauteur du titre de la barre (En réalité il sagit de la position suppérieur)
       Btn(30)			AS STRING		' Titre de chaque btn
       ShowBtnCapt(30)	AS INTEGER		' Largeur du titre de chaque btn en pixel
       BtnLeft(30)		AS INTEGER		' Position horizontal de chaque btns
       BtnWidth(30)	AS INTEGER		' Largeur de chaque btns
	'BtnCaptionWidth(30) As Integer	' Largeur du titre de chaque btn
       BtnCount		AS INTEGER		' Nombre de btn
PUBLIC:
       ShowGrip		AS INTEGER		' Affiche ou Masque la "Grippe"
	'BtnsSpacing		As Integer		' Espace entre les btns
	'BtnsDistVert	As Integer		' Ditance à partir du Haut
	'BtnsDistHorz	As Integer		' Distance à partir du bas

	'DisableXPTheme		As Integer	' Désactive le Thème XP
       DisableXPThemeBG	AS INTEGER	' Désactive le fond XP
       SharedBG		AS QBITMAP		' ...
PRIVATE:
       GripWidth		AS INTEGER		' Largeur de la "Grippe"
       BtnMenu(30)		AS INTEGER		' Est-ce qu'il y a un Menu pour ce btn
	'OrgFontName		As String
	'OrgFontSize		As Integer
       WidthChanged	AS INTEGER		' Largeur modifiée

       EditCount		AS INTEGER		' Nombre de contrôle Edit
       EditCtrl(4)		AS LONG
       EditLeft(4)		AS INTEGER
       EditWidth(4)	AS INTEGER
       EditHeight(4)	AS INTEGER
	'EditBG(4)		As QImage
       ComboBoxCount	AS INTEGER		' Nombre de contrôle ComboBox
       ComboBoxCtrl(4)	AS LONG
       ComboBoxLeft(4)	AS INTEGER
       ComboBoxWidth(4) AS INTEGER
       ComboBoxHeight(4) AS INTEGER
	'ComboBoxBG(4)	As QImage
	'HintSquare		As QImage		' Devrait aider à corriger l'affichage de l'info bulle
PUBLIC:
	'Height			As Integer PROPERTY SET SetHeight
	'Width			As Integer PROPERTY SET SetWidth

       HideCaption		AS INTEGER PROPERTY SET SetHideCaption	' Masque le titre de la CoolBar
       ItemsWidth		AS INTEGER PROPERTY SET SetItemsWidth	' Dimension des btns de la barre
       Orientation		AS INTEGER PROPERTY SET SetOrientation	' Orientation de la barre (0. Horz, True. Vert)

       OnMouseLeave	AS EVENT(OnMouseLeave_EventTemplate)	' La souris quitte la barre
       OnMouseEnter	AS EVENT(OnMouseEnter_EventTemplate)	' La souris entre et se déplace sur la barre
       OnChange		AS EVENT(OnChange_EventTemplate)		' Un btn est cliqué
	'Nouvelles propriétés
	'qqchose as qqchose Property Set SetQqChose

PRIVATE:
       FUNCTION TextWidth(text AS STRING) AS INTEGER:	Result = .IMGBackGround.TextWidth(text)
       END FUNCTION
       FUNCTION TextHeight(text AS STRING) AS INTEGER:	Result = .IMGBackGround.TextHeight(text)
       END FUNCTION

       SUB mnuItem_Click(Sender AS QMENUITEM)
        IF Sender.CAPTION <> "-" THEN
         IF .CoolBtn(Sender.Tag).GroupIndex > True THEN _
          .CoolBtn(Sender.Tag).Down = True
         CALLFUNC(.OnChange, Sender.Tag, This)
        END IF
       END SUB

PUBLIC:
       SUBI AddItems (...)
        DIM I AS INTEGER
        .BtnCount = PARAMSTRCOUNT	' Devrait être .BtnCount +ParamStrCount
		'ReDim Btn(ParamStrCount -True) As String
        IF .ItemsWidth = False THEN
         IF .Orientation THEN
          .ItemsWidth = .ClientWidth -2 '24
         ELSE
          .ItemsWidth = .ClientHeight -2 '24
         END IF
        END IF

        .BtnLeft(False) = False		' Devrait être .BtnLeft(.BtnCount -ParamStrCount)
        .BtnWidth(False) = False	' Devrait être .BtnWidth(.BtnCount -ParamStrCount)
        FOR I = True TO PARAMSTRCOUNT
         .Btn(I -True) = PARAMSTR$(I)
         .mnuItemExceed(I -True).CAPTION = PARAMSTR$(I)
         .mnuItemExceed(I -True).Tag = I -True
         .mnuItemExceed(I -True).OnClick = This.mnuItem_Click
         IF PARAMSTR$(I) = "-" THEN
          .BtnWidth(I -True) = 5
			'ElseIf Tally(ParamStr$(I), "EditCtrl") or Tally(ParamStr$(I), "ComboBoxCtrl") Then
			'	.BtnWidth(I -True) = False
         ELSE
          .BtnWidth(I -True) = .ItemsWidth +_
           IIF(.ShowBtnCapt(I -True) = True AND .Orientation = False, _
           .TextWidth(PARAMSTR$(I)) +3, _
           False)
          .CoolBtn(I -True).GroupIndex = True
          .CoolBtn(I -True).AllowAllUp = True
         END IF
        NEXT I
        FOR I = False TO .BtnCount -True
         .BtnLeft(I +True) = .BtnLeft(I) +.BtnWidth(I)
        NEXT I
		'ShowMessage STR$(.BtnLeft(0)) +" /" +STR$(.BtnWidth(0)) +chr$(10) +_
		'			STR$(.BtnLeft(1)) +" /" +STR$(.BtnWidth(1)) +chr$(10) +_
		'			STR$(.BtnLeft(2)) +" /" +STR$(.BtnWidth(2)) +chr$(10) +_
		'			STR$(.BtnLeft(3)) +" /" +STR$(.BtnWidth(3)) +chr$(10) +_
		'			STR$(.BtnLeft(4)) +" /" +STR$(.BtnWidth(4))
        IF .Orientation THEN _
         .ClientHeight = .BtnLeft(.BtnCount -True) +.BtnWidth(.BtnCount -True) +2 _
        ELSE _
         .ClientWidth = .BtnLeft(.BtnCount -True) +.BtnWidth(.BtnCount -True) +2
		'.FlickeringFree.Height = .ClientHeight
		'.FlickeringFree.Width = .ClientWidth
       END SUBI
       SUB AddEditCtrl (Sender AS QEDIT)
        Sender.Left = .btnLeft(.BtnCount) +6
        Sender.Top = (This.FlickeringFree.Height -Sender.Height) \2 -True
        Sender.PARENT = This.FlickeringFree 'This
        .EditCtrl(.EditCount) = Sender.Handle
        .EditLeft(.EditCount) = Sender.Left
        .EditWidth(.EditCount) = Sender.Width
        .EditHeight(.EditCount) = Sender.Height
		'.EditBG(.EditCount).Enabled = False
		'.EditBG(.EditCount).AutoSize = True
		'.EditBG(.EditCount).Left = Sender.Left
		'.EditBG(.EditCount).Top = Sender.Top
		'.BMPtmp.Width = Sender.Width
		'.BMPtmp.Height = Sender.Height
		'.BMPtmp.FillRect(False, False, .BMPtmp.Width, .BMPtmp.Height, -2147483627)
		'.EditBG(.EditCount).BMP = .BMPtmp.BMP
		'.EditBG(.EditCount).Parent = This.FlickeringFree 'This
        .EditCount ++
       END SUB
       SUB AddComboBoxCtrl (Sender AS QCOMBOBOX)
        Sender.Left = .btnLeft(.BtnCount) +5
        Sender.Top = (This.FlickeringFree.Height -Sender.Height +6) \2 -True
        Sender.PARENT = This.FlickeringFree 'This
        .ComboBoxCtrl(.ComboBoxCount) = Sender.Handle
        .ComboBoxLeft(.ComboBoxCount) = Sender.Left
        .ComboBoxWidth(.ComboBoxCount) = Sender.Width
        .ComboBoxHeight(.ComboBoxCount) = Sender.Height
		'.ComboBoxBG(.ComboBoxCount).Enabled = False
		'.ComboBoxBG(.ComboBoxCount).AutoSize = True
		'.ComboBoxBG(.ComboBoxCount).Left = Sender.Left
		'.ComboBoxBG(.ComboBoxCount).Top = Sender.Top
		'.BMPtmp.Width = Sender.Width
		'.BMPtmp.Height = Sender.Height
		'.BMPtmp.FillRect(False, False, .BMPtmp.Width, .BMPtmp.Height, -2147483627)
		'.ComboBoxBG(.ComboBoxCount).BMP = .BMPtmp.BMP
		'.ComboBoxBG(.ComboBoxCount).Parent = This.FlickeringFree 'This
        .ComboBoxCount ++
       END SUB

       SUBI DefineBtnsGroup (...)
		'... = ParamValCount
        DIM I AS INTEGER
        DIM modSepState AS INTEGER
        modSepState = False
        DIM Index AS INTEGER
        Index = IIF(PARAMVAL(True) = False, True, False)

        IF PARAMVALCOUNT = True AND (PARAMVAL(True) <= False) THEN
         FOR I = False TO .BtnCount -True
          IF .Btn(I) <> "-" THEN
           .CoolBtn(I).GroupIndex = True
           .CoolBtn(I).AllowAllUp = True
          END IF
         NEXT I
        ELSEIF PARAMVALCOUNT > True THEN
         FOR I = 2 TO PARAMVALCOUNT
          IF .Btn(PARAMVAL(I)) <> "-" THEN
           .CoolBtn(PARAMVAL(I)).GroupIndex = PARAMVAL(True) +Index +True
           .CoolBtn(PARAMVAL(I)).AllowAllUp = False 'True
          ELSE
           modSepState ++
          END IF
         NEXT I
        ELSE
         SHOWMESSAGE "Erreur: paramètre(s) manquant(s) ou incorrect(s)"
        END IF
        IF modSepState THEN _
         SHOWMESSAGE "Avertissement: vous tentez de redéfinir le " +CHR$(10) +_
         "               groupe d'un séparateur..."
       END SUBI
       SUBI InitBtnsDownUp (...)
		'... = ParamValCount
        DIM I AS INTEGER
        DIM modSepState AS INTEGER
        modSepState = False
        DIM Index AS INTEGER
        Index = IIF(PARAMVAL(True) = False, True, False)

        IF PARAMVALCOUNT = True AND (PARAMVAL(True) = False OR PARAMVAL(True) = True) THEN
         FOR I = False TO .BtnCount -True
          IF .Btn(I) <> "-" THEN _
           .CoolBtn(I).Down = PARAMVAL(True)
         NEXT I
        ELSEIF PARAMVALCOUNT > True AND (PARAMVAL(True) = False OR PARAMVAL(True) = True) THEN
         FOR I = 2 TO PARAMVALCOUNT
          IF .Btn(PARAMVAL(I)) <> "-" THEN
           .CoolBtn(PARAMVAL(I)).Down = PARAMVAL(True)
          ELSE
           modSepState ++
          END IF
         NEXT I
        ELSE
         SHOWMESSAGE "Erreur: paramètre(s) manquant(s) ou incorrect(s)"
        END IF
        IF modSepState THEN _
         SHOWMESSAGE "Avertissement: vous tentez de modifier l'état " +CHR$(10) +_
         "               enfoncé d'un séparateur..."
       END SUBI

       SUBI EnableBtns (...)
		'... = ParamValCount
        DIM I AS INTEGER
        DIM modSepState AS INTEGER
        modSepState = False
        IF PARAMVALCOUNT = True AND (PARAMVAL(True) = False OR PARAMVAL(True) = True) THEN
         FOR I = False TO .BtnCount -True
          IF .Btn(I) <> "-" THEN _
           .CoolBtn(I).Enabled = PARAMVAL(True)
         NEXT I
        ELSEIF PARAMVALCOUNT > True THEN
         FOR I = 2 TO PARAMVALCOUNT
          IF .Btn(PARAMVAL(I)) <> "-" THEN
           .CoolBtn(PARAMVAL(I)).Enabled = PARAMVAL(True)
          ELSE
           modSepState ++
          END IF
         NEXT I
        ELSE
         SHOWMESSAGE "Erreur: paramètre(s) manquant(s) ou incorrect(s)"
        END IF
        IF modSepState THEN _
         SHOWMESSAGE "Avertissement: vous tentez de modifier l'état " +CHR$(10) +_
         "               active/inactive d'un séparateur..."
       END SUBI
       SUBI ShowBtnsCaption (...)
		'... = ParamValCount
        DIM I AS INTEGER
        DIM modSepState AS INTEGER
        modSepState = False
        IF PARAMVALCOUNT = True AND (PARAMVAL(True) = False OR PARAMVAL(True) = True) THEN
         FOR I = False TO .BtnCount -True
          IF .Btn(I) <> "-" THEN _
           .ShowBtnCapt(I) = PARAMVAL(True)
         NEXT I
        ELSEIF PARAMVALCOUNT > True THEN
         FOR I = 2 TO PARAMVALCOUNT
          IF .Btn(PARAMVAL(I)) <> "-" THEN
           .ShowBtnCapt(PARAMVAL(I)) = PARAMVAL(True)
          ELSE
           modSepState ++
          END IF
         NEXT I
        ELSE
         SHOWMESSAGE "Erreur: paramètre(s) manquant(s) ou incorrect(s)"
        END IF
        IF modSepState THEN _
         SHOWMESSAGE "Avertissement: vous tentez de modifier " +CHR$(10) +_
         "               un séparateur..."
       END SUBI
PRIVATE:
	'Sub FixBtnSize
	'	If .Align <> False Then Exit Sub'!-- 22/08
	'	dim height as integer, width as integer
	'	height = super.height: width = super.width

	'	.height = height: .width = width
	'	.FlickeringFree.Height = height
	'	.FlickeringFree.Width = Width
	'End Sub
       SUB ShapeBar(Sender AS QPANEL)
        DIM hRgn AS LONG, _
         hRgn2 AS LONG
        DIM hDC AS LONG
        DIM I AS INTEGER
		' Clean previouse rgn
        SetWindowRgn_QCBar Sender.Handle, False, True
        hDC = GetDC_QCBar(Sender.Handle)
		'destroy the previous region
        DeleteObject_QCBar hRgn
        DeleteObject_QCBar hRgn2
		'create an elliptic region
        IF .Orientation THEN
         hRgn = CreateRectRgn_QCBar(False, False, False, False)
         IF .ShowGrip = True THEN
          hRgn2 = CreateRectRgn_QCBar(True, True, Sender.Width, .GripWidth)
          CombineRgn_QCBar hRgn, hRgn, hRgn2, RGN_XOR_QCBar
          DeleteObject_QCBar hRgn2
         END IF
			'If .ShowGrip = True Then _
         FOR I = False TO .BtnCount -True
          hRgn2 = CreateRectRgn_QCBar(True, .BtnLeft(I), Sender.Width -True, .BtnLeft(I) +.BtnWidth(I))
				'Combine our two regions
          CombineRgn_QCBar hRgn, hRgn, hRgn2, RGN_XOR_QCBar
          DeleteObject_QCBar hRgn2
         NEXT I
        ELSE
         hRgn = CreateRectRgn_QCBar(False, False, False, False)
         IF .ShowGrip = True THEN
          hRgn2 = CreateRectRgn_QCBar ( True, _
           True, _
           .GripWidth, _
           Sender.Height -True)
          CombineRgn_QCBar hRgn, hRgn, hRgn2, RGN_XOR_QCBar
          DeleteObject_QCBar hRgn2
         END IF
         IF .HideCaption = False THEN
          hRgn2 = CreateRectRgn_QCBar ( .GripWidth, _
           .CaptionHeight, _
           .GripWidth +.CaptionWidth, _
           This.ClientHeight -.CaptionHeight)
          CombineRgn_QCBar hRgn, hRgn, hRgn2, RGN_XOR_QCBar
          DeleteObject_QCBar hRgn2
         END IF
         FOR I = False TO .BtnCount -True
          hRgn2 = CreateRectRgn_QCBar(.BtnLeft(I), False, .BtnLeft(I) +.BtnWidth(I), Sender.Height)
				'Combine our two regions
          CombineRgn_QCBar hRgn, hRgn, hRgn2, RGN_XOR_QCBar
          DeleteObject_QCBar hRgn2
         NEXT I
         IF .EditCount THEN
          FOR I = False TO .EditCount -True
					'If .EditTop(I) > Sender.ClientHeight -.EditHeight(I) Then _
						'hRgn2 = CreateRectRgn ( .EditLeft(I) +IIf(isXP_QTBtn, False, True), _
						'						(Sender.ClientHeight \2) -(.EditHeight(I) \2) -True +IIf(isXP_QTBtn, False, True), _
						'						.EditLeft(I) +.EditWidth(I) -IIf(isXP_QTBtn, False, True), _
						'						(Sender.ClientHeight \2) +(.EditHeight(I) \2) -IIf(isXP_QTBtn, False, True))
           hRgn2 = CreateRectRgn_QCBar ( .EditLeft(I), _
            (Sender.Height \2) -(.EditHeight(I) \2) -True, _
            .EditLeft(I) +.EditWidth(I), _
            (Sender.Height \2) +(.EditHeight(I) \2) +True)
						'Combine our two regions
           CombineRgn_QCBar hRgn, hRgn, hRgn2, RGN_XOR_QCBar
           DeleteObject_QCBar hRgn2
					'End If
          NEXT I
         END IF
         IF .ComboBoxCount THEN
          FOR I = False TO .ComboBoxCount -True
					'If .EditTop(I) > Sender.ClientHeight -.ComboBoxHeight(I) Then _
						'hRgn2 = CreateRectRgn ( .ComboBoxLeft(I) +IIf(isXP_QTBtn, False, True), _
						'						(Sender.ClientHeight \2) -(.ComboBoxHeight(I) \2) -True +IIf(isXP_QTBtn, False, True), _
						'						.ComboBoxLeft(I) +.ComboBoxWidth(I) -IIf(isXP_QTBtn, False, True), _
						'						(Sender.ClientHeight \2) +(.ComboBoxHeight(I) \2) -IIf(isXP_QTBtn, False, True))
           hRgn2 = CreateRectRgn_QCBar ( .ComboBoxLeft(I), _
            (Sender.Height \2) -(.ComboBoxHeight(I) \2) -True, _
            .ComboBoxLeft(I) +.ComboBoxWidth(I), _
            (Sender.Height \2) +(.ComboBoxHeight(I) \2) +True)
						'Combine our two regions
           CombineRgn_QCBar hRgn, hRgn, hRgn2, RGN_XOR_QCBar
           DeleteObject_QCBar hRgn2
					'End If
          NEXT I
         END IF
        END IF
		'OffsetRgn hRgn, 10, 10
		'SelectClipRgn hDC, hRgn
		'move the clipping region
		'OffsetClipRgn hDC, 10, 10
		'set the new window region
		'SetWindowRgn Me.Handle, Ret, True
        SetWindowRgn_QCBar Sender.Handle, hRgn, True
		'clean up
        DeleteObject_QCBar hRgn
        DeleteObject_QCBar hRgn2
        ReleaseDC_QCBar (Sender.Handle, hDC)
		'Reset rgn address to 0
		'hRgn = 0
       END SUB

PUBLIC:
       SUB RePaint
        DIM btnStandSet AS INTEGER, _
         btnMenuSet AS INTEGER
        DIM I AS INTEGER, _
         J AS INTEGER
        DIM R AS RECT_QTBtn
		'Dim btnWidth As Integer
        DIM curLeft AS INTEGER
		'btnWidth = (This.ClientWidth -2) /.BtnCount

        STATIC wasgripped AS INTEGER
        IF .ShowGrip = True THEN
         IF wasgripped = False THEN 'or .WidthChanged = True Then
          FOR I = False TO .BtnCount' -True
           INC(.BtnLeft(I), IIF(.Orientation, 8, 5))
          NEXT I
         END IF
         wasgripped = True
        ELSE
         IF wasgripped = True THEN 'or .WidthChanged = True Then
          FOR I = False TO .BtnCount' -True
           DEC(.BtnLeft(I), IIF(.Orientation, 8, 5))
          NEXT I
         END IF
         .GripWidth = False
         wasgripped = False
        END IF
        STATIC wascaptioned AS INTEGER
        IF .HideCaption = False THEN
         .CaptionHeight = (.ClientHeight -.TextHeight(.CAPTION)) \2
         .CaptionWidth = .TextWidth(.CAPTION) +5
			'.IMGBackGround.FillRect ( False, False, 5, .ClientHeight -2, clBtnFace )
			'FOR I = 2 TO (.ClientHeight -5) STEP 3
			'	.IMGBackGround.Line	 ( 1, I, 3, I, clBtnShadow )
			'NEXT I
         IF wascaptioned = False THEN 'or .WidthChanged = True Then
          FOR I = False TO .BtnCount
           INC(.BtnLeft(I), .CaptionWidth)
          NEXT I
         END IF
         wascaptioned = True
        ELSE
         .CaptionHeight = False
         .CaptionWidth = False
         IF wascaptioned = True THEN 'or .WidthChanged = True Then
          FOR I = False TO .BtnCount -True
           DEC(.BtnLeft(I), .CaptionWidth)
          NEXT I
         END IF
         .CaptionWidth = False
         wascaptioned = False
        END IF
        STATIC MenuCount AS INTEGER
		'MenuCount = False
        IF MenuCount = False THEN
         FOR I = False TO .BtnCount ' -True
          IF MenuCount > False THEN _
           .BtnLeft(I) = .BtnLeft(I) +(MenuCount *8)
          IF GetMenuItemCount_QCBar (This.mnuPopup(I).Handle) > False THEN
           MenuCount ++
           .BtnMenu(I) = True
           .BtnWidth(I) = .BtnWidth(I) +8
           .mnuPopup(I).Alignment = True
					'.BtnLeft(I +True) = .BtnLeft(I +True) +(MenuCount *8)
					'ShowMessage "Button X got a menu!"' +STR$()
          ELSE
           .BtnMenu(I) = False
          END IF
         NEXT I
        END IF
        IF .Orientation THEN
         .ClientHeight = .BtnLeft(.BtnCount -True) +.BtnWidth(.BtnCount -True) +3
         .FlickeringFree.Width	= .ClientWidth
        ELSE
         .ClientWidth = .BtnLeft(.BtnCount -True) +.BtnWidth(.BtnCount -True) +3 _
          +IIF(.EditCount > False, .EditLeft(.EditCount -True) +.EditWidth(.EditCount -True), False) + _
          +IIF(.ComboBoxCount > False, .ComboBoxLeft(.ComboBoxCount -True) +.ComboBoxWidth(.ComboBoxCount -True), False)
         .FlickeringFree.Width	= .BtnLeft(.BtnCount -True) +.BtnWidth(.BtnCount -True) +3 _
          +IIF(.EditCount > False, .EditLeft(.EditCount -True) +.EditWidth(.EditCount -True), False) + _
          +IIF(.ComboBoxCount > False, .ComboBoxLeft(.ComboBoxCount -True) +.ComboBoxWidth(.ComboBoxCount -True), False)
        END IF
        .FlickeringFree.Height	= .Height -(.BevelWidth *2) '.ClientHeight

		'.FlickeringFree.Height = .ClientHeight
		'.FlickeringFree.Width = .ClientWidth
        .IMGBackGround.Font.COLOR		= .Font.COLOR
        .IMGBackGround.Font.Name		= .Font.Name
        .IMGBackGround.Font.Size		= .Font.Size
        .IMGBackGround.Font.Bold		= .Font.Bold
        .IMGBackGround.Font.Italic		= .Font.Italic
        .IMGBackGround.Font.Underline	= .Font.Underline
        .IMGStretchedBackGround.Stretch	= False

        .IMGBackGroundFix.Width			= .FlickeringFree.Width 'IMGBackGround.Width
        .IMGBackGroundFix.Height		= .FlickeringFree.Height '.IMGBackGround.Height
        .IMGBackGroundFix.FillRect		(False, False, .IMGBackGroundFix.Width, .IMGBackGroundFix.Height, _
         This.COLOR) 'clBtnFace)
        .IMGBackGround.Transparent = False
        .IMGBackGround.BMP				= .IMGBackGroundFix.BMP
        .IMGStretchedBackGround2.BMP	= .IMGBackGroundFix.BMP

        IF isXP_QTBtn THEN
         .IMGStretchedBackGround.Visible = True
         .IMGBackGroundFix.Width = Screen.Width
         .IMGBackGroundFix.FillRect(False, False, .IMGBackGroundFix.Width, .IMGBackGroundFix.Height, This.COLOR) 'clBtnFace)
         .IMGStretchedBackGround.BMP = .IMGBackGroundFix.BMP
			'.IMGStretchedBackGround.Width = Screen.Width
        ELSE
         .IMGStretchedBackGround.Visible = False
        END IF

        IF isXP_QTBtn AND .DisableXPThemeBG = False THEN
         IF .SharedBG.Empty = False THEN
				'.IMGStretchedBackGround.Width = This.SharedBG.Width -(This.SharedBG.Width \5) '.SharedBG.Width
          WITH Dest: .Left = False: .Right  = This.IMGStretchedBackGround.Width 'This.ClientWidth
           .Top  = False: .Bottom = This.ClientHeight
          END WITH
          WITH Src: .Left = This.SharedBG.Width -(This.SharedBG.Width \4) '.Left
           .Right  = This.Left +This.SharedBG.Width
           .Top	= This.Top:  .Bottom = This.Top +This.Height +2 '+True
          END WITH
          .IMGStretchedBackGround.CopyRect(This.Dest, This.SharedBG, This.Src)
          .Dest.Right = This.ClientWidth
          .Src.Left = .Left
          .IMGStretchedBackGround2.CopyRect(This.Dest, This.SharedBG, This.Src)
         ELSE
          XPPart ( _
           xpt_ReBar, _
           6, _
           False, _
           True, _
           False, _
           This.IMGStretchedBackGround, _
           This.Handle)
          XPPart ( _
           xpt_ReBar, _
           6, _
           False, _
           True, _
           False, _
           This.IMGStretchedBackGround2, _
           This.Handle)
         END IF
        END IF
        .IMGStretchedBackGround.Stretch = True
		'.BtnsHotTrack.Width = This.ClientWidth -2
		'.BtnsHotTrack.Height = This.ClientHeight -2

		'static wasgripped as integer
        IF .ShowGrip = True THEN
         .GripWidth = IIF(.Orientation, 8, 5)
			'.IMGBackGround.FillRect ( False, False, IIf(.Orientation, 8, 5), .ClientHeight -2, clBtnFace )
         IF isXP_QTBtn THEN
          XPPart ( xpt_ReBar, _
           True, _
           This.Orientation, _
           This.DisableXPThemeBG, _
           This.COLOR, _
           This.IMGBackGround, _
           This.Handle)
         ELSE
          IF .Orientation THEN
           FOR I = 2 TO (.ClientWidth -5) STEP 3
            .IMGBackGround.Line	 ( I, True, I, 3, -2147483632 ) 'clBtnShadow
           NEXT I
          ELSE
           FOR I = 2 TO (.ClientHeight -IIF(.Orientation, 8, 5)) STEP 3
            .IMGBackGround.Line	 ( True, I, 3, I, -2147483632 ) 'clBtnShadow
           NEXT I
          END IF
         END IF
		'	If wasgripped = False Then 'or .WidthChanged = True Then
		'		FOR I = False To .BtnCount' -True
		'			INC(.BtnLeft(I), IIf(.Orientation, 8, 5))
		'		NEXT I
		'	End If
		'	wasgripped = True
		'Else
		'	If wasgripped = True Then 'or .WidthChanged = True Then
		'		FOR I = False To .BtnCount' -True
		'			DEC(.BtnLeft(I), IIf(.Orientation, 8, 5))
		'		NEXT I
		'	End If
		'	.GripWidth = False
		'	wasgripped = False
        END IF

        curLeft = False
        DIM sepBefore AS INTEGER
        sepBefore = False
        FOR I = False TO .BtnCount -True

			'If I > False Then _
			'	curLeft = curLeft +.BtnWidth(I)
         IF .btn(I) <> "-" THEN
          .CoolBtn(I).Visible = False
          .CoolBtn(I).PARENT = This.FlickeringFree 'this
          .CoolBtn(I).Width = .btnwidth(I)
          .CoolBtn(I).Height = .ItemsWidth -2 'This.ClientHeight -2
          .ImgBtnHot(I).Visible = False
          .ImgBtnHot(I).Enabled = False
          .ImgBtnHot(I).PARENT = This.FlickeringFree 'this
          .ImgBtnHot(I).Width = .btnwidth(I) 'This.ClientWidth -2
          .ImgBtnHot(I).Height = .ItemsWidth -2 '.btnwidth(I)
          IF .Orientation THEN
           .CoolBtn(I).Left = True
           .CoolBtn(I).Top = .btnleft(I)
					'.CoolBtn(I).Width = .btnwidth(I) 'This.ClientWidth -2
					'.CoolBtn(I).Height = .ItemsWidth -2 '.btnwidth(I)
           .ImgBtnHot(I).Left = True
           .ImgBtnHot(I).Top = .btnleft(I)
					'.ImgBtnHot(I).Width = .btnwidth(I) 'This.ClientWidth -2
					'.ImgBtnHot(I).Height = .ItemsWidth -2 '.btnwidth(I)
          ELSE
           .CoolBtn(I).Left = .btnleft(I)
           .CoolBtn(I).Top = IIF(.BevelWidth, False, True)
					'.CoolBtn(I).Width = .btnwidth(I)
					'.CoolBtn(I).Height = .ItemsWidth -2 'This.ClientHeight -2
           .ImgBtnHot(I).Left = .btnleft(I)
           .ImgBtnHot(I).Top = IIF(.BevelWidth, False, True)
					'.ImgBtnHot(I).Width = .btnwidth(I)
					'.ImgBtnHot(I).Height = .ItemsWidth -2 'This.ClientHeight -2
          END IF
          .CoolBtn(I).Flat = True
				'.CoolBtn(I).GroupIndex = True
				'.CoolBtn(I).AllowAllUp = True
          .CoolBtn(I).NumBMPs = maxnumbmp_QCBar
          .CoolBtn(I).Spacing = False
          IF .CoolBtn(I).CAPTION = "" THEN _
           .CoolBtn(I).Layout = False _
          ELSE _
           .CoolBtn(I).Layout = 3

          IF isXP_QTBtn = False THEN
           .CoolBtnBMP.Width = ((.btnwidth(I) +3) *maxnumbmp_QCBar) +2
           .CoolBtnBMP.Height = .btnwidth(I) +True
           .CoolBtnBMP.FillRect(False, False, .CoolBtnBMP.Width, .CoolBtnBMP.Height, clBtnFace)
          ELSE
           .CoolBtnBMP.Width = .btnwidth(I)
           .CoolBtnBMP.Height = .ItemsWidth -2 '((.btnwidth(I) -IIf(.BtnMenu(I), 8, False)) -2) 'This.ClientHeight -2

           Fast_QCBarToQTBtn( xpt_ToolBarBtn, _
            True, _
            This.CoolBtnBMP, _
            "", _
            This.BtnMenu(I), _
            IIF(This.CoolBtn(I).GroupIndex > True, 2, False), _
            This.Handle)
          END IF

'				If Style = 2 Then
'					'Style2
'					.IMGBackGround.Rectangle(.btnLeft(I), _
'									 False, _
'									 .btnLeft(I +True), _
'									 This.ClientHeight -2, _
'									 clBtnShadow)
'					.IMGBackGround.FillRect(.btnLeft(I) +True, _
'									True, _
'									.btnLeft(I +True) -True, _
'									This.ClientHeight -3, _
'									clActiveBorder)
'				End If
				'If Style < 2 Then
				'	'SetRect_QCBar R, .btnLeft(I), False, .btnLeft(I +True), This.Height -2
				'	'If Style = True Then
				'	'	'Style1
				'	'	DrawEdge_QCBar .IMGBackGround.Handle, R, BDR_RAISEDINNER, BF_RECT_QCBar OR BF_FLAT_QCBar 'BDR_SUNKENOUTER_QCBar, BF_RECT_QCBar '
				'	'Else
				'	'	DrawEdge_QCBar .IMGBackGround.Handle, R, BDR_RAISEDINNER, BF_RECT_QCBar 'BDR_SUNKENOUTER_QCBar, BF_RECT_QCBar '
				'	'End If
				'ElseIf Style = 2 Then
'				If Style = 2 Then
'					'Style2
'					.IMGBackGround.FillRect(.btnLeft(I), _
'									False, _
'									.btnLeft(I +True), _
'									This.ClientHeight -2, _
'									clBtnFace)
'				End If
'				If Style = 3 Then
'					If btnStandSet = False Then 'and .IMGSkin.Empty = False Then
'						.Bitmap2.BMP = .IMGSkin.BMP
'						BMPStretch2_Property (.btnWidth(I), .ClientHeight -2, This.Bitmap2)
'						'.Bitmap2.SaveToFile("C:\RapidQ\Temp\testbtnbmp.bmp")
'
'						btnStandSet = True
'						.IMGBackGround.Draw(.btnLeft(I), _
'									False, _
'									This.Bitmap2.BMP)
'					End If
'				End If
          .imgLBK.Width	= .imgLA.Width
          .imgLBK.Height	= .imgLA.Height
'				.IMGBackGround.Draw(((.BtnWidth(I) -IIf(.BtnMenu(I) = True, 8, False) -.imgLBK.Width) \2) +.btnLeft(I), _
'							(This.ClientHeight -2 -.imgLBK.Height) \2, _
'							.imgLBK.BMP) '.imgLA.GetBMP(I -sepBefore)) 'Bitmap2.BMP)

				'.CoolBtnBMP.BMP = .CoolBtn(I).BMP
				'.CoolBtnBMP.Draw(((.BtnWidth(I) -IIf(.BtnMenu(I) = True, 8, False) -.imgLBK.Width) \2) +True, _
				'			((This.ClientHeight -2 -.imgLBK.Height) \2) +True , _
				'			.imgLBK.BMP) '.imgLA.GetBMP(I -sepBefore)) 'Bitmap2.BMP)

          DIM Left AS INTEGER
          Left = False
          FOR J = False TO 3
           IF (I -True =< .imgLA.Count) THEN
            IF J = False OR _
             (J = True AND (I +True > .imgLD.Count)) OR _
             (J = 2 AND (I +True > .imgLS.Count)) OR _
             (J = 3 AND (I +True > .imgLS.Count)) THEN
             .imgLBK.BMP	= .imgLA.GetBMP(I -sepBefore)
            ELSEIF J = True THEN
             .imgLBK.BMP	= .imgLD.GetBMP(I -sepBefore)
            ELSEIF J = 2 THEN
             .imgLBK.BMP	= .imgLS.GetBMP(I -sepBefore)
            ELSEIF J = 3 THEN
             .imgLBK.BMP	= .imgLS.GetBMP(I -sepBefore)
            END IF

            .imgLBK.TransparentColor = .imgLBK.Pixel(False, False) 'clWhite
            .imgLBK.Transparent = True

            IF .ShowBtnCapt(I) = True AND .Btn(I) <> "" THEN
             Left = J *(.CoolBtnBMP.Width \5) +3
            ELSE
             Left = J *(.CoolBtnBMP.Width \5) -IIF(.BtnMenu(I), 6, False) _
              +(((.CoolBtnBMP.Width \5) -.imgLBK.Width) \2)
            END IF

            .CoolBtnBMP.Draw( _
             Left, _
             ((This.CoolBtnBMP.Height -.imgLBK.Height) \2), _
             .imgLBK.BMP) '.imgLA.GetBMP(I -sepBefore)) 'Bitmap2.BMP)
           END IF
           IF isXP_QTBtn = False AND .BtnMenu(I) THEN
            DrawMyText( _
             ((J +True) *(This.CoolBtnBMP.Width \5)) -14, _
             False, _
             ((J +True) *(This.CoolBtnBMP.Width \5)), _
             This.CoolBtnBMP.Height -True -IIF(.ShowBtnCapt(I) = True, True, False), _
             "6", _
             "Marlett", _
             IIF(.CoolBtn(I).Enabled, -2147483630, -2147483631), _
             This.CoolBtnBMP)
           END IF
          NEXT J
          IF .ShowBtnCapt(I) = True AND .Btn(I) <> "" THEN
           FOR J = False TO 4 'step 2
						'SetTextColor This.CoolBtnBMP.Handle, clGrayText
            IF .CoolBtn(I).Enabled = False THEN
             DrawMyText( _
              ((This.CoolBtnBMP.Width \5) *J) +2, _
              2, _
              (This.CoolBtnBMP.Width \5) *(J +True) -IIF(.BtnMenu(I), 12, False) +True, _
              This.CoolBtnBMP.Height, _
              This.Btn(I), _
              "", _
              -2147483628, _
              This.CoolBtnBMP)
            END IF

            DrawMyText( _
             ((This.CoolBtnBMP.Width \5) *J) +.imgLBK.Width +4, _
             True, _
             (This.CoolBtnBMP.Width \5) *(J +True) -IIF(.BtnMenu(I), 12, False), _
             This.CoolBtnBMP.Height -True, _
             This.Btn(I), _
             "", _
             IIF(J <> True AND .CoolBtn(I).Enabled, -2147483630, -2147483631), _
             This.CoolBtnBMP)
           NEXT J
          END IF

				'.BMPtmp.BMP = .CoolBtnBMP.BMP
          WITH Dest: .Left = False: .Right = This.CoolBtn(I).Width
           .Top = False: .Bottom = This.CoolBtnBMP.Height
          END WITH
          WITH Src: .Left = ((This.CoolBtn(I).Width +3) *4) +True
           .Right = .Left +This.CoolBtn(I).Width
           .Top = True: .Bottom = This.CoolBtnBMP.Height +True
          END WITH
          .BMPtmp.Width = .Dest.Right: .BMPtmp.Height = .Dest.Bottom
          IF isXP_QTBtn THEN
           .BMPtmp.CopyRect(This.Dest, This.CoolBtnBMP, This.Src)
          ELSE
					' Style2
           .BMPtmp.Rectangle( False, _
            False, _
            .btnWidth(I), _
            .ItemsWidth -2, _
            -2147483632) 'clBtnShadow
           .BMPtmp.FillRect( True, _
            True, _
            .btnWidth(I) -True, _
            .ItemsWidth -3, _
            -2147483638) 'clActiveBorder
           IF .ShowBtnCapt(I) = True AND .Btn(I) <> "" THEN
						'SetTextColor This.CoolBtnBMP.Handle, clGrayText
            IF .CoolBtn(I).Enabled = False THEN
             DrawMyText( _
              2, _
              2, _
              This.BMPtmp.Width -IIF(.BtnMenu(I), 12, False) +True, _
              This.ItemsWidth, _
              This.Btn(I), _
              "", _
              -2147483628, _
              This.BMPtmp)
            END IF

            DrawMyText( _
             .imgLBK.Width +3, _
             True, _
             This.BMPtmp.Width -IIF(.BtnMenu(I), 12, False), _
             This.ItemsWidth -True, _
             This.Btn(I), _
             "", _
             IIF(J <> True AND .CoolBtn(I).Enabled, -2147483630, -2147483631), _
             This.BMPtmp)
           END IF
           IF .BtnMenu(I) THEN
            DrawMyText( _
             .btnWidth(I) -12, _
             False, _
             .btnWidth(I), _
             (.ItemsWidth /2) +9, _
             "6", _
             "Marlett", _
             IIF(.CoolBtn(I).Enabled, -2147483630, -2147483631), _
             This.BMPtmp)
           END IF
          END IF
          IF (I -True =< .imgLA.Count) THEN
           IF (I +True > .imgLH.Count) THEN
            .imgLBK.BMP	= .imgLA.GetBMP(I -sepBefore)
           ELSE
            .imgLBK.BMP	= .imgLH.GetBMP(I -sepBefore)
           END IF

           .imgLBK.TransparentColor = .imgLBK.Pixel(False, False) 'clWhite
           .imgLBK.Transparent = True

           IF .ShowBtnCapt(I) = True AND .Btn(I) <> "" THEN
            Left = 2
           ELSE
            Left = (.BtnWidth(I) -IIF(.BtnMenu(I) = True, 12, False) -.imgLBK.Width) \2
           END IF
           .BMPtmp.Draw(Left, _
            ((.ItemsWidth -2 -.imgLBK.Height) \2) , _
            .imgLBK.BMP)
          END IF

          .BMPtmp.PixelFormat = pf15bit
				'.BMPtmp.Pixel(False, False) = .BMPtmp.Pixel(False, .BMPtmp.Height -1)
          .BMPtmp.Transparent = True
          .BMPtmp.TransparentColor = .BMPtmp.Pixel(False, False) 'clWhite
          .ImgBtnHot(I).BMP = .BMPtmp.BMP
				'.ImgBtnHot(I).Draw(False, _
				'			 False, _
				'			.BMPtmp.BMP)
          IF isXP_QTBtn THEN _
           .ImgBtnHot(I).Transparent = True _
          ELSE _
           .ImgBtnHot(I).Transparent = False

          .CoolBtnBMP.Width = ((.CoolBtn(I).Width +3) *4) +True
          .CoolBtn(I).BMP = .CoolBtnBMP.BMP

				'Dim hCursor As Long
				'load the 'Size-All' cursos
				'$TypeCheck Off
				'hCursor = LoadCursor(ByVal 0&, 32753)
				'DrawIcon(IMGBackGround1.Hanlde, 0, 0, GetCursor)
				'$TypeCheck On
				'DestroyCursor (hCursor)
'				If .BtnMenu(I) Then
'					If Style = False Then
'						.IMGBackGround.FillRect(.btnLeft(I +True) -12, _
'										True, _
'										.btnLeft(I) +.btnWidth(I) -True, _
'										This.ClientHeight -3, _
'										clWhite)
'					End If
'					If Style = 3 Then
'						If btnMenuSet = False and .IMGSkin.Empty = False Then
'							.Bitmap3.BMP = .IMGSkin.BMP
'							BMPStretch2_Property (.btnWidth(I), .ClientHeight -2, This.Bitmap3)
'							btnMenuSet = True
'							'.Bitmap3.SaveToFile("C:\RapidQ\Temp\testbtnbmp.bmp")
'
'							.IMGBackGround.Draw(.btnLeft(I), _
'									False, _
'									This.Bitmap3.BMP)
'						End If
'					End If
'					.IMGBackGround.Font.Name = "Marlett"
'					.IMGBackGround.TextOut( .BtnLeft(I +True) -12, _
'									5, _
'									"6", .Font.Color, -True )
'					.IMGBackGround.Font.Name = .Font.Name
'				End If

'				If Style = False Then
'					'Style1
'					SetRect_QCBar R, .btnLeft(I), False, .btnLeft(I +True), This.ClientHeight -2
'					DrawEdge_QCBar .IMGBackGround.Handle, R, BDR_RAISEDINNER, BF_RECT_QCBar 'OR BF_FLAT_QCBar ''BDR_SUNKENOUTER_QCBar, BF_RECT_QCBar '
'				End If
          .CoolBtn(I).Visible = True
         ELSE
          IF .Orientation THEN
           SetRect_QCBar ( R, _
            False +IIF(.BevelWidth = False, 2, False), _
            .btnLeft(I) +True, _
            This.ClientWidth -3, _
            .btnLeft(I) +IIF(Style < 2 OR isXP_QTBtn = False, 3, 2))
          ELSE
           SetRect_QCBar ( R, _
            .btnLeft(I) +True, _
            2, _
            .btnLeft(I) +IIF(Style < 2 OR isXP_QTBtn = False, 3, 2), _
            This.Height -3)
          END IF
          DrawEdge_QCBar .IMGBackGround.Handle, R, BDR_SUNKENOUTER_QCBar, BF_RECT_QCBar 'BDR_SUNKENOUTER_QCBar, BF_RECT_QCBar '
          sepBefore ++

         END IF
        NEXT I
        IF wascaptioned = True THEN 'or .WidthChanged = True Then _
         .IMGBackGround.TextOut(.GripWidth +2, .CaptionHeight, .CAPTION, .Font.COLOR, -True)
        END IF
        .WidthChanged = False
		'If .Orientation Then
		'	.ClientHeight = .BtnLeft(.BtnCount -True) +.BtnWidth(.BtnCount -True) +3
		'	.FlickeringFree.Width	= .ClientWidth
		'Else
		'	.ClientWidth = .BtnLeft(.BtnCount -True) +.BtnWidth(.BtnCount -True) +3 _
		'					+IIf(.EditCount > False, .EditLeft(.EditCount -True) +.EditWidth(.EditCount -True), False) + _
		'					+IIf(.ComboBoxCount > False, .ComboBoxLeft(.ComboBoxCount -True) +.ComboBoxWidth(.ComboBoxCount -True), False)
		'	.FlickeringFree.Width	= .BtnLeft(.BtnCount -True) +.BtnWidth(.BtnCount -True) +3 _
		'								+IIf(.EditCount > False, .EditLeft(.EditCount -True) +.EditWidth(.EditCount -True), False) + _
		'								+IIf(.ComboBoxCount > False, .ComboBoxLeft(.ComboBoxCount -True) +.ComboBoxWidth(.ComboBoxCount -True), False)
		'End If
		'.FlickeringFree.Height	= .ClientHeight
		''.FlickeringFree.Width	= .ClientWidth
        .BtnsHotTrack.PARENT = .DummyPanel
        .BtnsHotTrack.PARENT = This.FlickeringFree 'This
        .IMGBackGround.Transparent = True
		'SetWindowPos ( _
		'			   This.BtnsHotTrack.Handle, _
		'			   HWND_TOP, _
		'			   False, _
		'			   False, _
		'			   False, _
		'			   False, _
		'			   SWP_NOMOVE Or SWP_NOSIZE)

        IF .Orientation THEN
         .PnlExceed.Align = 2
         .PnlExceed.Top = This.Height -12
         .PnlExceed.Width = This.ClientWidth
         .PnlExceed.Height = 12
			'.CBtnExceed.Align = 1
         .CBtnExceed.Height = 12
         .CBtnExceed.Width = This.PnlExceed.ClientWidth
         .CoolBtnBMP.Width = .CBtnExceed.Width
         .CoolBtnBMP.Height = .CBtnExceed.Height
        ELSE
         .PnlExceed.Align = 4
         .PnlExceed.Left = This.Width -12
         .PnlExceed.Width = 12
         .PnlExceed.Height = This.ClientHeight
			'.CBtnExceed.Align = 3
         .CBtnExceed.Height = This.PnlExceed.ClientHeight
         .CBtnExceed.Width = 12
         .CoolBtnBMP.Width = .CBtnExceed.Width
         .CoolBtnBMP.Height = This.PnlExceed.ClientHeight '.CBtnExceed.Height
        END IF
        .CBtnExceedHot.Width = .CBtnExceed.Width
        .CBtnExceedHot.Height = .CBtnExceed.Height
        .PnlExceed.PARENT = .DummyPanel
        .PnlExceed.PARENT = This

        IF isXP_QTBtn = False THEN
         .CoolBtnBMP.Width = ((.btnwidth(I) +3) *4) +2
         .CoolBtnBMP.Height = .btnwidth(I) +True
         .CoolBtnBMP.FillRect(False, False, .CoolBtnBMP.Width, .CoolBtnBMP.Height, clBtnFace)
         .CoolBtnBMP.Font.Name = "MS Sans Serif"
         .CoolBtnBMP.Font.Bold = True
         .CoolBtnBMP.Font.Size = 12
         FOR I = False TO 3
          .BMPtmp.TextOut((I *.PnlExceed.Width) +((.PnlExceed.Width -.TextWidth("»") -True) \2), _
           -6, _
           "»", _
           .Font.COLOR, _
           -True)
         NEXT I
         .CoolBtnBMP.Font.Name = This.Font.Name
         .CoolBtnBMP.Font.Bold = This.Font.Bold
         .CoolBtnBMP.Font.Size = This.Font.Size

			' Style2
         .BMPtmp.Width = .PnlExceed.Width: .BMPtmp.Height = .PnlExceed.Height
         .BMPtmp.Rectangle( False, _
          False, _
          .BMPtmp.Width, _
          .BMPtmp.Height, _
          -2147483632) 'clBtnShadow
         .BMPtmp.FillRect( True, _
          True, _
          .BMPtmp.Width -True, _
          .BMPtmp.Height -True, _
          -2147483638) 'clActiveBorder
         .BMPtmp.Font.Name = "MS Sans Serif"
         .BMPtmp.Font.Bold = True
         .BMPtmp.Font.Size = 12
         .BMPtmp.TextOut((.BMPtmp.Width -.TextWidth("»") -True) \2, -6, "»", .Font.COLOR, -True)
			'.BMPtmp.TextOut((.BMPtmp.Width -.BMPtmp.TextWidth(">>")) \2, -2, ">>", .Font.Color, -True)
         .BMPtmp.Font.Name = This.Font.Name
         .BMPtmp.Font.Bold = This.Font.Bold
         .BMPtmp.Font.Size = This.Font.Size
         .CBtnExceedHot.BMP = .BMPtmp.BMP
        ELSE
         Fast_QCBarToQTBtn( xpt_ReBar, _
          IIF(.Orientation, 5, 4), _
          This.CoolBtnBMP, _
          "", _
          False, _
          False, _
          This.Handle)

         WITH Dest: .Left = False: .Right = This.CBtnExceed.Width
          .Top = False: .Bottom = This.CoolBtnBMP.Height
         END WITH
         WITH Src: .Left = ((This.CBtnExceed.Width +3) *4) +True
          .Right = .Left +This.CBtnExceed.Width +True
          .Top = True: .Bottom = This.CoolBtnBMP.Height +True
         END WITH
         .BMPtmp.Width = .Dest.Right: .CBtnExceedHot.Height = .Dest.Bottom
			'.BMPtmp.FillRect(,,,,, clBtnFace)

         .BMPtmp.CopyRect(This.Dest, This.CoolBtnBMP, This.Src)
         .CBtnExceedHot.BMP = .BMPtmp.BMP

         .CoolBtnBMP.Width = ((.CBtnExceed.Width +3) *3) +True
         .CBtnExceed.NumBMPs = 3
         .CBtnExceed.BMP = .CoolBtnBMP.BMP
        END IF

        .ShapeBar(This.FlickeringFree)
       END SUB


	'PROPERTY SET SetHeight(Height As Integer)
	'	.Height = Height
	'	Super.Height = Height
	'END PROPERTY
	'PROPERTY SET SetWidth(Width As Integer)
	'	.Width = Width
	'	Super.Width = Width
	'	'.FlickeringFree.Width = .ClientWidth
	'	.FlickeringFree.Visible = IIf(.FlickeringFree.Visible, 0, 1)
	'END PROPERTY
       PROPERTY SET SetHideCaption(hide AS INTEGER)
        .HideCaption = hide
        .RePaint
		'If .HideCaption = True Then
		'	.CaptionHeight = False
		'	.CaptionWidth = False
		'Else
		'	.CaptionHeight = (.Height -.TextHeight(.Caption)) /2
		'	.CaptionWidth = .TextWidth(.Caption) +5
		'	.IMGBackGround.TextOut(2, .CaptionHeight, .Caption, .Font.Color, -1)
		'End If
       END PROPERTY
       PROPERTY SET SetItemsWidth(width AS INTEGER)
        .ItemsWidth = width

        DIM I AS INTEGER
		'.BtnLeft(False) = False
        .BtnWidth(False) = False
        FOR I = False TO .BtnCount
         IF .Btn(I) = "-" THEN _
          .BtnWidth(I) = 5 _
         ELSE _
          .BtnWidth(I) = .ItemsWidth
        NEXT I
        FOR I = False TO .BtnCount -True
         .BtnLeft(I +True) = .BtnLeft(I) +.BtnWidth(I)
        NEXT I
        .WidthChanged = True

       END PROPERTY
       PROPERTY SET SetOrientation(orientation AS INTEGER)
        .Orientation = orientation
		'.FlickeringFree.Align = IIf(orientation, 1, 3)
       END PROPERTY

PRIVATE:
       EVENT IMGBackGround.OnMouseMove (X AS INTEGER, Y AS INTEGER, Shift AS INTEGER)
        SetCapture_QCBar This.Handle
       END EVENT
       EVENT BtnsHotTrack.OnMouseMove (X AS INTEGER, Y AS INTEGER, Shift AS INTEGER)
        SetCapture_QCBar This.Handle
       END EVENT
       EVENT CBtnExceedHotTrack.OnMouseMove (X AS INTEGER, Y AS INTEGER, Shift AS INTEGER)
        SetCapture_QCBar This.Handle
       END EVENT
	'Event CanvasLeft.OnMouseMove (X As Integer, Y As Integer, Shift As Integer)
	'	SetCapture_QCBar This.Handle '.IMGBackGround.Handle
	'End Event
	'Event CanvasLeft.OnPaint
	'	If .Top > 40 Then .Height = .Height \2
	'End Event
       EVENT CanvasRight.OnPaint
        IF .IsPainted = False THEN
         .IsPainted = True
			'.FlickeringFree.Visible = False
         .RePaint
         .FlickeringFree.Visible = True
			'.mnuItemCount = GetMenuItemCount_QCBar(.mnuExceed.Handle)
        END IF
        DIM btnNum AS INTEGER
        DIM I AS INTEGER

        FOR I = -(.BtnCount -True) TO False
         IF .Btn(I *-True) <> "-" THEN
          btnNum = I *-True
          EXIT FOR
         END IF
        NEXT I
        IF .Orientation = False THEN
         IF .Width < (.BtnLeft(btnNum) +(.BtnWidth(btnNum) \.66)) AND _
          .Btn(btnNum) <> "-" AND _
          .PnlExceed.Visible = False THEN
          .PnlExceed.Visible = True
         ELSEIF .Width > (.BtnLeft(btnNum) +(.BtnWidth(btnNum) \.66)) AND .PnlExceed.Visible = True THEN
          .PnlExceed.Visible = False
         END IF
        ELSEIF .Orientation THEN
         IF .Height < (.BtnLeft(btnNum) +(.BtnWidth(btnNum) \.66)) AND _
          .Btn(btnNum) <> "-" AND _
          .PnlExceed.Visible = False THEN
          .PnlExceed.Visible = True
         ELSEIF .Height > (.BtnLeft(btnNum) +(.BtnWidth(btnNum) \.66)) AND .PnlExceed.Visible = True THEN
          .PnlExceed.Visible = False
         END IF
        END IF
		'If .mnuItemCount Then
		'	For I = False To .mnuItemCount -True
		'		.mnuExceed.DelIndex (False)
		'		'CALLFUNC(.OnMouseEnter, False, False, False, 1000, This)
		'	Next I
		'	.mnuItemCount = False
		'End If
		'.RePaint
       END EVENT
       EVENT OnMouseMove (X AS INTEGER, Y AS INTEGER, Shift AS INTEGER)
        DIM curPosX AS INTEGER
        DIM curBtn AS INTEGER
        DIM btnWidth AS INTEGER
        DIM I AS INTEGER
        DIM R AS RECT_QTBtn
		'Dim mDC As Integer
		'If mDC = False Then _
		'	mDC = GetDC_QCBar(This.Handle)
        STATIC firstAction AS INTEGER
        STATIC wasBtn AS INTEGER
		'wasBtn = -1
        STATIC PosX AS INTEGER, PosY AS INTEGER
        DIM sepBefore AS INTEGER

        IF .Orientation THEN _
         btnWidth = (This.ClientHeight -2) /5 _
        ELSE _
         btnWidth = (This.ClientWidth -2) /5

        IF (X < False) OR (Y < False) OR (X > This.Width) _
         OR (Y > This.Height) THEN
			' le pseudo-evénement MOUSELEAVE
         ReleaseCapture_QCBar
			' on retourne le caption à la normal
			'This.Font.Bold = False
			'This.Font.Color = -2147483630
			'This.caption = "Dehors..."
			'StatusBar1.Panel(0).Caption = "Dehors"
         wasBtn = -True
         IF curBtn > -True THEN
          sepBefore = False
          FOR I = False TO curBtn
           IF .btn(I) = "-" THEN _
            sepBefore ++
          NEXT I
          IF .btn(curBtn) <> "-" THEN
'					.imgLBK.Width = .imgLA.Width
'					.imgLBK.Height = .imgLA.Height
'					If Style > False Then
'						.IMGBackGround.FillRect(.btnLeft(curBtn), _
'										False, _
'										.btnLeft(curBtn +True), _
'										This.ClientHeight -2, _
'										clBtnFace)
'					End If
'					.imgLBK.BMP = .imgLA.GetBMP(curBtn -sepBefore)
'					.imgLBK.TransparentColor = .imgLBK.Pixel(0,0) 'clWhite
'					.imgLBK.Transparent = True
'					.IMGBackGround.Draw(((.btnWidth(curBtn) -IIf(.BtnMenu(curBtn) = True, 8, False) -.imgLBK.Width) \2) +.btnLeft(curBtn), _
'								(This.ClientHeight -2 -.imgLBK.Height) \2, _
'								.imgLBK.BMP) '.imgLA.GetBMP(curBtn -sepBefore)) 'Bitmap2.BMP)
					'$TypeCheck Off
					'hCursor = LoadCursor(ByVal 0&, 32753)
					'DrawIcon(IMGBackGround1.Hanlde, 0, 0, GetCursor)
					'$TypeCheck On
					'DestroyCursor (hCursor)
'					If .BtnMenu(curBtn) Then
'						.IMGBackGround.Font.Name = "Marlett"
'						.IMGBackGround.TextOut( .BtnLeft(curBtn +True) -12, _
'										5, _
'										"6", .Font.Color, -True )
'						.IMGBackGround.Font.Name = .Font.Name
'					End If
           .ImgBtnHot(curBtn).Visible = False
           .CoolBtn(curBtn).Down = False
           .Hint = ""
	' !!Repetitive	''If .CBtnExceedHot.Visible Then _
					''	.CBtnExceedHot.Visible = False
          END IF
         END IF
         IF .CBtnExceedHot.Visible THEN _
          .CBtnExceedHot.Visible = False
         CALLFUNC(.OnMouseLeave, X, Y, Shift, This)
        ELSEIF (GetCapture_QCBar() <> This.Handle) AND _
          (PosX <> X AND PosY <> Y) THEN
			' Verifie si la requete de relâcher la capture d'un QCBar est 0
			' Check if the release capture request for QCBar is 0
			'
			' Ce qui va aussi empêcher le btn de reprendre son état initial
			' lors d'une action...
          PosX = X
          PosY = Y

			' le pseudo-evénement MOUSEENTER
          SetCapture_QCBar This.Handle
			' on met le caption en gras
			'.Font.Bold = True
			'This.Font.Color = -2147483635
			'.caption = "Dessus..."

			'ReleaseCapture_QCBar
         ELSE
          IF .EditCount > False THEN
           FOR I = False TO .EditCount -True
            IF X >= .EditLeft(I) AND X <= .EditLeft(I) +.EditWidth(I) THEN
             IF .CBtnExceedHot.Visible THEN _
              .CBtnExceedHot.Visible = False
             ReleaseCapture_QCBar
             EXIT FOR
            END IF
           NEXT I
          END IF
          IF .ComboBoxCount > False THEN
           FOR I = False TO .ComboBoxCount -True
            IF X >= .ComboBoxLeft(I) AND X <= .ComboBoxLeft(I) +.ComboBoxWidth(I) THEN
             IF .CBtnExceedHot.Visible THEN _
              .CBtnExceedHot.Visible = False
             ReleaseCapture_QCBar
             EXIT FOR
            END IF
           NEXT I
          END IF
			'StatusBar1.Panel(0).Caption = "Dedans"
			'btnWidth = (This.ClientWidth -2) /5
			'curPosX = ROUND(X \btnWidth) +1
			'curBtn = -1 'curPosX -1
          FOR I = False TO .BtnCount -True
           IF .Orientation THEN
            IF Y >= .BtnLeft(I) AND Y <= .BtnLeft(I +True) THEN
             curBtn = I
             EXIT FOR
            ELSE
             curBtn = -True
            END IF
           ELSE
            IF X >= .BtnLeft(I) AND X <= .BtnLeft(I +True) THEN
             curBtn = I
             EXIT FOR
            ELSE
             curBtn = -True
            END IF
           END IF
          NEXT I
          IF (curBtn > -True AND curBtn < .btnCount) THEN
           IF firstAction = False OR (wasBtn <> curBtn OR wasBtn = -True) THEN 'curPosX Then
            firstAction = True
            IF .btn(curBtn) = "-" THEN .Hint = "" ELSE .Hint = .Btn(curBtn)
'					If Style = 2 and .btn(curBtn) <> "-" Then
'						'Style2
'						.IMGBackGround.Rectangle(.btnLeft(curBtn), _
'										 False, _
'										 .btnLeft(curBtn) +.btnWidth(curBtn), _
'										 This.ClientHeight -2, _
'										 clBtnShadow)
'						.IMGBackGround.FillRect(.btnLeft(curBtn) +True, _
'										True, _
'										.btnLeft(curBtn) +.btnWidth(curBtn) -True, _
'										This.ClientHeight -3, _
'										clActiveBorder)
'					End If

            sepBefore = False
            .imgLBK.Width = .imgLA.Width
            .imgLBK.Height = .imgLA.Height
            FOR I = False TO .BtnCount -True
             IF .btn(I) <> "-" THEN
'							If I <> curBtn Then
'								If Style < 2 Then
'									SetRect_QCBar R, .btnLeft(I), False, .btnLeft(I +True), This.Height -2
'									If Style = True Then
'										'Style1
'										DrawEdge_QCBar .IMGBackGround.Handle, R, BDR_RAISEDINNER, BF_RECT_QCBar OR BF_FLAT_QCBar 'BDR_SUNKENOUTER_QCBar, BF_RECT_QCBar '
'									Else
'										DrawEdge_QCBar .IMGBackGround.Handle, R, BDR_RAISEDINNER, BF_RECT_QCBar ' BDR_SUNKENOUTER_QCBar, BF_RECT_QCBar '
'									End If
'								ElseIf Style = 2 Then
'									'Style2
'									.IMGBackGround.FillRect(.btnLeft(I), _
'													False, _
'													.btnLeft(I +True), _
'													This.ClientHeight -2, _
'													clBtnFace)
'								End If
'							End If
'							.imgLBK.BMP = .imgLA.GetBMP(I -sepBefore)
'							.imgLBK.TransparentColor = .imgLBK.Pixel(0,0) 'clWhite
'							.imgLBK.Transparent = True
'							.IMGBackGround.Draw(((.btnWidth(I) -IIf(.BtnMenu(I) = True, 8, False) -.imgLBK.Width) \2) +.btnLeft(I), _
'										(This.ClientHeight -2 -.imgLBK.Height) \2, _
'										.imgLBK.BMP) '.imgLA.GetBMP(I -sepBefore)) 'Bitmap2.BMP)
							'$TypeCheck Off
							'hCursor = LoadCursor(ByVal 0&, 32753)
							'DrawIcon(IMGBackGround1.Hanlde, 0, 0, GetCursor)
							'$TypeCheck On
							'DestroyCursor (hCursor)
'							If .BtnMenu(I) Then
'								If Style = True Then
'									.IMGBackGround.FillRect(.btnLeft(I +True) -12, _
'													True, _
'													.btnLeft(I) +.btnWidth(I) -True, _
'													This.ClientHeight -3, _
'													clBtnFace)
'								End If
'								.IMGBackGround.Font.Name = "Marlett"
'								.IMGBackGround.TextOut( .BtnLeft(I +True) -12, _
'												5, _
'												"6", .Font.Color, -True )
'								.IMGBackGround.Font.Name = .Font.Name
'							End If
             ELSE
              sepBefore ++
             END IF
            NEXT I
'					If Style = True and .btn(curBtn) <> "-" Then
'						'Style1
'						If .BtnMenu(curBtn) Then
'							'avec menu
'							SetRect_QCBar R, .btnLeft(curBtn), False, .btnLeft(curBtn +True) -11, This.ClientHeight -2
'							DrawEdge_QCBar .IMGBackGround.Handle, R, BDR_RAISEDINNER, BF_RECT_QCBar 'OR BF_FLAT_QCBar ''BDR_SUNKENOUTER_QCBar, BF_RECT_QCBar '
'							SetRect_QCBar R, .btnLeft(curBtn +True) -10, False, .btnLeft(curBtn +True), This.ClientHeight -2
'							DrawEdge_QCBar .IMGBackGround.Handle, R, BDR_RAISEDINNER, BF_RECT_QCBar 'OR BF_FLAT_QCBar ''BDR_SUNKENOUTER_QCBar, BF_RECT_QCBar '
'						Else
'							'sans menu
'							SetRect_QCBar R, .btnLeft(curBtn), False, .btnLeft(curBtn +True), This.ClientHeight -2
'							DrawEdge_QCBar .IMGBackGround.Handle, R, BDR_RAISEDINNER, BF_RECT_QCBar 'OR BF_FLAT_QCBar ''BDR_SUNKENOUTER_QCBar, BF_RECT_QCBar '
'						End If
'					End If
            .ImgBtnHot(wasBtn).Visible = False
            .CoolBtn(wasBtn).Down = False
            IF .CBtnExceedHot.Visible THEN _
             .CBtnExceedHot.Visible = False
           END IF
           wasBtn = curBtn 'curPosX
           IF .CoolBtn(curBtn).Down = False THEN
            IF (.Orientation AND Y < This.Height -IIF(.PnlExceed.Visible, 12, False)) OR _
             (.Orientation = False AND X < This.Width -IIF(.PnlExceed.Visible, 12, False)) THEN
             .ImgBtnHot(curBtn).Visible = True
            ELSE
             .ImgBtnHot(curBtn).Visible = False
            END IF
           END IF
           CALLFUNC(.OnMouseEnter, X, Y, Shift, curBtn, This)

           IF .PnlExceed.Visible THEN
            IF .Orientation THEN
             IF (X > False AND X < This.Width) AND _
              (Y >= This.Height -12 AND Y <= This.Height) THEN
              .CBtnExceedHot.Visible = True
              CALLFUNC(.OnMouseEnter, X, Y, Shift, 99, This)
             ELSE
              .CBtnExceedHot.Visible = False
             END IF
            ELSE
             IF (X >= This.Width -12 AND X <= This.Width) AND _
              (Y > False AND Y < This.Height) THEN
              .CBtnExceedHot.Visible = True
              CALLFUNC(.OnMouseEnter, X, Y, Shift, 99, This)
             ELSE
              .CBtnExceedHot.Visible = False
             END IF
            END IF
           END IF
          ELSE
				'curBtn = -1
           IF .Orientation THEN
            IF (Y > .btnLeft(.btnCount -True) +.btnWidth(.btnCount -True) OR _
             Y < .btnLeft(0)) AND wasBtn <> -True THEN
             .ImgBtnHot(wasBtn).Visible = False
             .ImgBtnHot(curBtn).Visible = False
             .CoolBtn(wasBtn).Down = False
             .Hint = ""
             CALLFUNC(.OnMouseEnter, X, Y, Shift, curBtn, This)
						'.RePaint
             wasBtn = -True
            END IF
           ELSE
            IF (X > .btnLeft(.btnCount -True) +.btnWidth(.btnCount -True) OR _
             X < .btnLeft(0)) AND wasBtn <> -True THEN
             .ImgBtnHot(wasBtn).Visible = False
             .ImgBtnHot(curBtn).Visible = False
             .CoolBtn(wasBtn).Down = False
             .Hint = ""
             CALLFUNC(.OnMouseEnter, X, Y, Shift, curBtn, This)
						'.RePaint
             wasBtn = -True
            END IF
           END IF
          END IF
         END IF
		'CALLFUNC(.OnMouseEnter, X, Y, Shift, This)
		'wasBtn = curPosX
        END EVENT
        EVENT OnMouseDown (btn AS INTEGER, X AS INTEGER, Y AS INTEGER, Shift AS INTEGER)
         DIM I AS INTEGER
         DIM curBtn AS INTEGER
         DIM R AS RECT_QTBtn
		'curBtn = -1
         FOR I = False TO .BtnCount -True
          IF .Orientation = False AND (X >= .BtnLeft(I) AND X <= .BtnLeft(I +True)) THEN
           curBtn = I
           EXIT FOR
          ELSEIF .Orientation AND (Y >= .BtnLeft(I) AND Y <= .BtnLeft(I +True)) THEN
           curBtn = I
           EXIT FOR
          ELSE
           curBtn = -True
          END IF
         NEXT I
         IF .Orientation = False AND (curBtn = -True AND X >= False AND X <= 7) AND _
          .Width > 29 THEN
			'ShowMessage "Star drag..."
          ReleaseCapture_QCBar
          SendMessage_QCBar(This.Handle, WM_NCLBUTTONDOWN_QCBar, HTCAPTION_QCBar, False)
			'SetCapture_QCBar (This.Handle)
         ELSEIF .Orientation AND (curBtn = -True AND Y >= False AND Y <= 7) AND _
           .Height > 29 THEN
           ReleaseCapture_QCBar
           SendMessage_QCBar(This.Handle, WM_NCLBUTTONDOWN_QCBar, HTCAPTION_QCBar, False)
          ELSEIF .Orientation = False AND .PnlExceed.Visible AND (X >= .Width -12 AND X <= .Width) THEN
			'.mnuItemCount = GetMenuItemCount_QCBar(.mnuExceed.Handle)
           IF .mnuItemCount THEN
            FOR I = False TO .mnuItemCount -True
             .mnuExceed.DelIndex (False)
            NEXT I
            .mnuItemCount = False
           END IF
           FOR I = -(.BtnCount -True) TO False
            IF .Width < (.BtnLeft(I *-True) +(.BtnWidth(I *-True) \.66)) THEN
             .mnuExceed.AddItems (This.mnuItemExceed(I *-True))
					'CALLFUNC(.OnMouseEnter, False, False, False, 1001, This)
             .mnuItemCount ++
            ELSE
             EXIT FOR
            END IF
           NEXT I
           IF .mnuItemCount THEN
            .CBtnExceed.Down = True
            .CBtnExceedHot.Visible = False
            .mnuExceed.Alignment = True
            .mnuExceed.Popup(Screen.MOUSEX +(.PnlExceed.Left -X +.pnlExceed.Width), _
             Screen.MOUSEY +(.ClientHeight -Y) -2)
           END IF
			'.CBtnExceedHot.Visible = False
           .CBtnExceed.Down = False
          ELSEIF .Orientation AND .PnlExceed.Visible AND (Y >= .Height -12 AND X <= .Height) THEN
			'.mnuItemCount = GetMenuItemCount_QCBar(.mnuExceed.Handle)
           DIM MenuHeight AS INTEGER
           MenuHeight = False
           IF .mnuItemCount THEN
            FOR I = False TO .mnuItemCount -True
             .mnuExceed.DelIndex (False)
            NEXT I
            .mnuItemCount = False
            MenuHeight = False
           END IF
           FOR I = -(.BtnCount -True) TO False
            IF .Height < (.BtnLeft(I *-True) +(.BtnWidth(I *-True) \.66)) THEN
             .mnuExceed.Insert (False, This.mnuItemExceed(I *-True))
             MenuHeight = MenuHeight +IIF(.mnuItemExceed(I *-True).CAPTION <> "-", 17, 9)
					'CALLFUNC(.OnMouseEnter, False, False, False, 1001, This)
             .mnuItemCount ++
            ELSE
             EXIT FOR
            END IF
           NEXT I
           IF .mnuItemCount THEN
				'If .mnuItemExceed(.BtnCount -.mnuItemCount -True).Caption = "-" Then _
				'		.mnuExceed.DelIndex (.mnuItemCount -True)
				'If .mnuItemExceed(.BtnCount -True).Caption = "-" Then _
				'		.mnuExceed.DelIndex (False)
            MenuHeight = MenuHeight +6
            .CBtnExceed.Down = True
            .CBtnExceedHot.Visible = False
            .mnuExceed.Alignment = False
            .mnuExceed.Popup(Screen.MOUSEX +(.PnlExceed.Left -X +.pnlExceed.Width) +True, _
             Screen.MOUSEY +(.ClientHeight -Y) -MenuHeight)
           END IF
			'.CBtnExceedHot.Visible = False
           .CBtnExceed.Down = False

		'ElseIf .BtnMenu(curBtn) = True and X >= .BtnLeft(curBtn +True) -12 Then
		'	.mnuPopup(curBtn).Popup(Screen.MouseX +(.BtnLeft(curBtn +True) -X) +True, _
		'							Screen.MouseY +(.ClientHeight -Y) -2)
		'	curBtn = -True
          ELSE
           IF Btn = False THEN
				'Dim R As RECT_QTBtn
            DIM sepBefore AS INTEGER
            sepBefore = False
            IF curBtn > -True THEN
             sepBefore = False
             FOR I = False TO curBtn
              IF .btn(I) = "-" THEN _
               sepBefore ++
             NEXT I
             IF .btn(curBtn) <> "-" THEN
              .ImgBtnHot(curBtn).Visible = False
              .CoolBtn(curBtn).Down = True
              IF .Orientation = False AND .BtnMenu(curBtn) AND X >= .BtnLeft(curBtn +True) -12 THEN
'							If Style < 2 Then
'								SetRect_QCBar R, .btnLeft(curBtn +True) -12, False, .btnLeft(curBtn +True), This.ClientHeight -2
'								DrawEdge_QCBar .IMGBackGround.Handle, R, BDR_SUNKENOUTER_QCBar, BF_RECT_QCBar
'							Else
'								'Style2
'								.IMGBackGround.Rectangle(.btnLeft(curBtn), _
'												 False, _
'												 .btnLeft(curBtn) +.btnWidth(curBtn), _
'												 This.ClientHeight -2, _
'												 clBtnShadow)
'								.IMGBackGround.FillRect(.btnLeft(curBtn +True) -12, _
'												True, _
'												.btnLeft(curBtn) +.btnWidth(curBtn) -True, _
'												This.ClientHeight -3, _
'												clWhite)
'							End If
							'If .BtnMenu(curBtn) Then
'								.IMGBackGround.Font.Name = "Marlett"
'								.IMGBackGround.TextOut( .BtnLeft(curBtn +True) -12, _
'												5, _
'												"6", .Font.Color, -True )
'								.IMGBackGround.Font.Name = .Font.Name
							'End If
               IF .CoolBtn(curBtn).Enabled THEN _
                .mnuPopup(curBtn).Popup(Screen.MOUSEX +(.BtnLeft(curBtn +True) -X) +True, _
                Screen.MOUSEY +(.ClientHeight -Y) -2)
               .CoolBtn(curBtn).Down = False
              ELSEIF .Orientation AND .BtnMenu(curBtn) AND X >= .BtnWidth(curBtn) -12 THEN
               IF .CoolBtn(curBtn).Enabled THEN _
                .mnuPopup(curBtn).Popup(Screen.MOUSEX +(.BtnWidth(curBtn) -X) +True, _
                Screen.MOUSEY +(.ClientHeight -Y) -2)
               .CoolBtn(curBtn).Down = False
'						Else
'							If Style = 2 Then
'								'Style2
'								.IMGBackGround.Rectangle(.btnLeft(curBtn), _
'												 False, _
'												 .btnLeft(curBtn) +.btnWidth(curBtn), _
'												 This.ClientHeight -2, _
'												 clBtnShadow)
'								.IMGBackGround.FillRect(.btnLeft(curBtn) +True, _
'												True, _
'												.btnLeft(curBtn) +.btnWidth(curBtn) -True, _
'												This.ClientHeight -3, _
'												clWhite)
'							End If

'							.imgLBK.Width = .imgLA.Width
'							.imgLBK.Height = .imgLA.Height
'							If Style <> 2 Then
'								.IMGBackGround.FillRect(.btnLeft(curBtn), _
'												False, _
'												.btnLeft(curBtn +True), _
'												This.ClientHeight -2, _
'												clBtnFace)
'							End If
'							.imgLBK.BMP = .imgLA.GetBMP(curBtn -sepBefore)
'							.imgLBK.TransparentColor = .imgLBK.Pixel(0,0) 'clWhite
'							.imgLBK.Transparent = True
'							.IMGBackGround.Draw(((.btnWidth(curBtn) -IIf(.BtnMenu(curBtn) = True, 8, False) -.imgLBK.Width) \2) +.btnLeft(curBtn), _
'										(This.ClientHeight -2 -.imgLBK.Height) \2, _
'										.imgLBK.BMP) '.imgLA.GetBMP(curBtn -sepBefore)) 'Bitmap2.BMP)
'							If .BtnMenu(curBtn) Then
'								.IMGBackGround.Font.Name = "Marlett"
'								.IMGBackGround.TextOut( .BtnLeft(curBtn +True) -12, _
'												5, _
'												"6", .Font.Color, -True )
'								.IMGBackGround.Font.Name = .Font.Name
'							End If
'							If Style <> 2 and .btn(curBtn) <> "-" Then
'								'Style1
'								SetRect_QCBar R, .btnLeft(curBtn), False, .btnLeft(curBtn +True), This.ClientHeight -2
'								DrawEdge_QCBar .IMGBackGround.Handle, R, BDR_SUNKENOUTER_QCBar, BF_RECT_QCBar 'OR BF_FLAT_QCBar ''BDR_SUNKENOUTER_QCBar, BF_RECT_QCBar '
'							End If
							'CALLFUNC(.OnChange, curBtn, This)
              END IF
             END IF
            END IF
           ELSEIF .BtnMenu(curBtn) THEN
            .mnuPopup(curBtn).Popup(Screen.MOUSEX, _
             Screen.MOUSEY)
            .CoolBtn(curBtn).Down = False
           END IF
			'ShowMessage STR$(curBtn)
          END IF
         END EVENT
         EVENT OnMouseUp (btn AS INTEGER, X AS INTEGER, Y AS INTEGER, Shift AS INTEGER)
          .Align = .Align
          DIM curBtn AS INTEGER
          DIM I AS INTEGER
          FOR I = False TO .BtnCount -True
           IF (.Orientation = False AND (X >= .BtnLeft(I) AND X <= .BtnLeft(I +True))) OR _
            (.Orientation AND (Y >= .BtnLeft(I) AND Y <= .BtnLeft(I +True))) THEN
            curBtn = I
            EXIT FOR
           ELSE
            curBtn = -True
           END IF
          NEXT I

          DIM sepBefore AS INTEGER
          sepBefore = False

          IF (.Orientation = False AND .PnlExceed.Visible AND (X >= .Width -12 AND X <= .Width)) OR _
           (.Orientation AND .PnlExceed.Visible AND (Y >= .Height -12 AND Y <= .Height)) THEN _
           .CBtnExceedHot.Visible = True
          IF .Orientation = False AND (.PnlExceed.Visible = False OR (.PnlExceed.Visible AND X < .Width -12)) OR _
           .Orientation AND (.PnlExceed.Visible = False OR (.PnlExceed.Visible AND Y < .Height -12)) THEN
           IF curBtn > -True THEN
            sepBefore = False
            FOR I = False TO curBtn
             IF .btn(I) = "-" THEN _
              sepBefore ++
            NEXT I
            IF .btn(curBtn) <> "-" THEN
             .ImgBtnHot(curBtn).Visible = False
             IF .CoolBtn(curBtn).GroupIndex > True AND .CoolBtn(curBtn).Down = False THEN _
              .CoolBtn(curBtn).Down = True _
             ELSE _
              .CoolBtn(curBtn).Down = False 'True

             IF .Orientation = False AND .BtnMenu(curBtn) AND X >= .BtnLeft(curBtn +True) -12 THEN
             ELSEIF .Orientation AND .BtnMenu(curBtn) AND X >= .BtnWidth(curBtn) -12 THEN
             ELSE
						'If .BtnMenu(curBtn) Then
						'End If
              IF .CoolBtn(curBtn).Enabled THEN _
               CALLFUNC(.OnChange, curBtn, This)
             END IF
            END IF
           END IF
          END IF
         END EVENT
PUBLIC:

         CONSTRUCTOR
          Align = False
          Alignment = False 'taLeftJustify
          CAPTION = "CoolBar"
          Width = 120
          Height = 24
          IMGStretchedBackGround.Align = 4'5 'alClient
          IMGStretchedBackGround.Enabled = False
          IMGStretchedBackGround.Stretch = True
          IMGStretchedBackGround.AutoSize = True
          IMGStretchedBackGround.PARENT = This
          IMGStretchedBackGround2.Align = 5 'alClient
          IMGStretchedBackGround2.Enabled = False
          IMGStretchedBackGround2.Stretch = True
          IMGStretchedBackGround2.AutoSize = True
          IMGStretchedBackGround2.PARENT = This.FlickeringFree
          FlickeringFree.Align = 3
          FlickeringFree.BevelWidth = False
          FlickeringFree.Visible = False
          FlickeringFree.PARENT = This
          IMGBackGround.Align = 5 'alClient
          IMGBackGround.Enabled = False
          IMGBackGround.AutoSize = True
          IMGBackGround.Transparent = True
          IMGBackGround.PARENT = This.FlickeringFree 'This
          BtnsHotTrack.PARENT = This.FlickeringFree 'This
          BtnsHotTrack.Align = 5 'alClient
		'BtnsHotTrack.Top = True
		'BtnsHotTrack.Left = True
          BtnsHotTrack.Transparent = True
		'IMGBackGround.Hint = "CoolBar"
		'IMGBackGround.ShowHint = True
          PnlExceed.Left = This.Width -12
          PnlExceed.Width = 12
          PnlExceed.Align = 4
          PnlExceed.BevelWidth = False
          PnlExceed.Visible = False
          PnlExceed.PARENT = This
		'PnlExceed.PopupMenu = .mnuExceed
		'mnuExceed.Alignment = True
		'CBtnExceed.Align = 3' 4
          CBtnExceed.Flat = True
          CBtnExceed.Width = 12
		'CBtnExceed.Height = This.ClientHeight
          CBtnExceed.GroupIndex = True
          CBtnExceed.AllowAllUp = True
          CBtnExceed.Spacing = False
          CBtnExceed.Layout = False
          CBtnExceed.NumBMPs = 4
		'CBtnExceed.Visible = False
          CBtnExceed.PARENT = This.PnlExceed
          CBtnExceedHot.Enabled = False
          CBtnExceedHot.Width = 12
          CBtnExceedHot.Visible = False
          CBtnExceedHot.PARENT = This.PnlExceed
          CBtnExceedHotTrack.PARENT = This.PnlExceed 'This
          CBtnExceedHotTrack.Align = 5 'alClient
          CBtnExceedHotTrack.Transparent = True
		'CanvasLeft.Parent = This
		'CanvasLeft.Align = alClient
		'CanvasRight.Left = This.Width -13
		'CanvasRight.Align = 4 'alClient
          CanvasRight.Width = True
          CanvasRight.Height = True
          CanvasRight.PARENT = This '.PnlExceed
          HideCaption = True
          Hint = "CoolBar"
          ShowHint = True
          ItemsWidth = 24
          imgLA.BkColor = This.COLOR
          Orientation = False
		'RePaint
         END CONSTRUCTOR
        END WITH
       END TYPE

掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Tue 2024-12-10  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2013-06-19 07:50:25