$OPTION EXPLICIT
$IFNDEF __RQINC
CONST False = 0
CONST True = 1
CONST clPurple = &HFF00FF
$ENDIF
CONST DefPixelFormat = 4
CONST CharAnd = "&"
CONST ChardAnd = "&&"
DIM AllQTBtnsHandle AS QSTRINGLIST, AllQTBtnsGrouped AS QSTRINGLIST
DIM AllQTBtnsRequester AS LONG, AllQTBtnsRequesterParent AS LONG
AllQTBtnsRequester = False
AllQTBtnsRequesterParent = False
DIM QTBtnOptimize AS INTEGER
QTBtnOptimize = False
DIM QTBtnBMP AS QBITMAP
QTBtnBMP.BMPHandle = btn_BMP
CONST BM_SETSTATE_QTBtn = &HF3
CONST WM_LBUTTONDOWN_QTBtn = &H201
CONST WM_LBUTTONUP_QTBtn = &H202
CONST WM_MOUSELAST_QTBtn = &H209
DECLARE FUNCTION SendMessage_QTBtn LIB "user32" ALIAS "SendMessageA" _
(BYVAL hwnd AS LONG, _
BYVAL wMsg AS LONG, _
BYVAL wParam AS LONG, _
lParam AS LONG) AS LONG
DECLARE FUNCTION IsWindowEnabled_QTBtn LIB "user32" ALIAS "IsWindowEnabled" _
(BYVAL hwnd AS LONG) AS LONG
DECLARE FUNCTION SetCapture_QTBtn LIB "user32" ALIAS "SetCapture" _
(BYVAL hwnd AS LONG) AS LONG
DECLARE FUNCTION ReleaseCapture_QTBtn LIB "user32" ALIAS "ReleaseCapture" () AS LONG
DECLARE FUNCTION GetCapture_QTBtn LIB "user32" ALIAS "GetCapture" () AS LONG
DECLARE FUNCTION GetNextDlgTabItem_QTBtn LIB "user32" ALIAS "GetNextDlgTabItem" _
(BYVAL hDlg AS LONG, _
BYVAL hCtl AS LONG, BYVAL bPrevious AS LONG) AS LONG
DECLARE FUNCTION SetFocus_QTBtn LIB "user32" ALIAS "SetFocus" _
(BYVAL hwnd AS LONG) AS LONG
DECLARE FUNCTION GetParent_QTBtn LIB "user32" ALIAS "GetParent" _
(BYVAL hwnd AS LONG) AS LONG
DECLARE FUNCTION GetFocus_QTBtn LIB "user32" ALIAS "GetFocus" () AS LONG
SUB NextDlg_QTBtn(NextPrevTab AS LONG)
DIM hwnd5 AS LONG, hwnd6 AS LONG
ReleaseCapture_QTBtn
hwnd6 = GetFocus_QTBtn()
hwnd5 = GetNextDlgTabItem_QTBtn(GetParent_QTBtn(hwnd6),hwnd6, NextPrevTab)
CALL SetFocus_QTBtn(hwnd5)
END SUB
TYPE OSVERSIONINFO_QTBtn
dwOSVersionInfoSize AS LONG
dwMajorVersion AS LONG
dwMinorVersion AS LONG
dwBuildNumber AS LONG
dwPlatformId AS LONG
szCSDVersion AS STRING * 128
END TYPE
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, maxnumbmp AS INTEGER
maxnumbmp = 4
PixelFormatFix_QTBtn = maxnumbmp
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 _
PixelFormatFix_QTBtn = 4
END IF
Mem_QTBtn.CLOSE
END SUB
CALL GetVersion_QTBtn
DECLARE SUB BMPStretch_Property (Sender AS QBUTTON)
SUB FixKind (oldvalue AS INTEGER, Sender AS QBUTTON)
Sender.NumBMPs = oldvalue
END SUB
DIM RequestRelease AS INTEGER
DECLARE SUB OnMouseEnterLeave_EventTemplate (X AS INTEGER, Y AS INTEGER, Shift AS INTEGER, Sender AS QBUTTON)
SUB SetIndex (Index AS INTEGER, Hwnd AS LONG)
AllQTBtnsHandle.AddItems STR$(Hwnd)
AllQTBtnsGrouped.AddItems STR$(Index)
END SUB
DIM rWidth AS INTEGER, _
rHeight AS INTEGER
rWidth = 75
rHeight = 25
TYPE QTButton EXTENDS QBUTTON
WITH QTButton
Dest AS QRECT
Source AS QRECT
BMPBtn AS QBITMAP
BMPtmp AS QBITMAP
ICOBMP AS QBITMAP
ActAsToolBar AS INTEGER
PrevFocus AS LONG
Align AS INTEGER PROPERTY SET SetAlign
CAPTION AS STRING PROPERTY SET SetCaption
Enabled AS INTEGER PROPERTY SET SetEnabled
Height AS INTEGER PROPERTY SET SetHeight
Width AS INTEGER PROPERTY SET SetWidth
Layout AS INTEGER PROPERTY SET SetLayout
Spacing AS INTEGER PROPERTY SET SetSpacing
NumBMPs AS INTEGER PROPERTY SET SetNumBMPs
NumICOBMPs AS INTEGER PROPERTY SET SetNumICOBMPs
Kind AS INTEGER PROPERTY SET SetKind
Down AS INTEGER PROPERTY SET SetDown
GroupIndex AS INTEGER PROPERTY SET SetGroupIndex
OnMouseLeave AS EVENT(OnMouseEnterLeave_EventTemplate)
OnMouseEnter AS EVENT(OnMouseEnterLeave_EventTemplate)
FUNCTION TextWidth(text AS STRING) AS INTEGER: Result = .BMPBtn.TextWidth(text)
END FUNCTION
FUNCTION TextHeight(text AS STRING) AS INTEGER: Result = .BMPBtn.TextHeight(text)
END FUNCTION
SUB FixBtnSize
IF .Align <> False THEN EXIT SUB
DIM height AS INTEGER, width AS INTEGER
height = super.height: width = super.width
.height = height: .width = width
END SUB
SUB DrawCaption: DIM I AS INTEGER
DIM COLOR AS INTEGER, left AS INTEGER, top AS INTEGER, _
ampandpos AS INTEGER, ampandposwidth AS INTEGER, dampand AS INTEGER, _
capwidth AS INTEGER
DIM supCaption AS STRING
.BMPBtn.Font.Name = .Font.Name
.BMPBtn.Font.Size = .Font.Size
.BMPBtn.Font.COLOR = .Font.COLOR
.BMPBtn.Font.Bold = .Font.Bold
.BMPBtn.Font.Italic = .Font.Italic
.BMPBtn.Font.Underline = .Font.Underline
COLOR = IIF(super.enabled = 1, .font.COLOR, -2147483631)
top = ((.Height -.TextHeight(.CAPTION)) \2) +True
dampand = TALLY(super.CAPTION, "&&")
supCaption = Super.CAPTION
IF dampand = False THEN _
ampandpos = INSTR(SupCaption, CharAnd): _
ampandposwidth = .TextWidth(LEFT$(SupCaption -CharAnd, ampandpos)) _
ELSE ampandposwidth = False
capwidth = (.Width -( .TextWidth( FIELD$( .CAPTION _
-IIF(dampand = False, CharAnd, ""), CHR$(10), True) ) )) \2
IF .ICOBMP.Empty = False THEN
.ICOBMP.PixelFormat = PixelFormatFix_QTBtn
.ICOBMP.Transparent = 1
END IF
DIM startFrom AS INTEGER, endTo AS INTEGER
IF .Enabled = True THEN
startFrom = False
endTo = .NumBMPs -True
ELSE
startFrom = True
endTo = True
END IF
DIM J AS INTEGER
DIM LineCount AS INTEGER
DIM Down AS INTEGER
IF .CAPTION <> "" THEN
FOR I = startFrom TO endTo STEP 2
IF I = False AND .Down = True THEN _
Down = True _
ELSE Down = False
left = capwidth +(I *(.Width +3)) +True
IF .ICOBMP.Empty = False THEN
IF .Layout = False THEN
left = left +(.ICOBMP.Width \.NumICOBMPs) \2 _
+IIF(.Layout < 2, -(.Spacing \2), False) +.Spacing +Down
ELSEIF .Layout = True THEN
left = left -(((.ICOBMP.Width \.NumICOBMPs) \2) _
+IIF(.Layout < 2, -(.Spacing \2), False) +.Spacing) +Down
END IF
END IF
LineCount = TALLY(.CAPTION, CHR$(10)) +True
IF LineCount > True THEN
FOR J = True TO LineCount
.BMPBtn.TextOut( left +Down, _
top +(.TextHeight(.CAPTION) *((LineCount -True) /2)) _
+(.TextHeight(.CAPTION) *-(LineCount -J)) +Down, _
FIELD$(.CAPTION, CHR$(10), J), _
COLOR, -True)
NEXT J
ELSE
.BMPBtn.TextOut( left +Down, _
top +IIF(.Layout > True AND .ICOBMP.Empty = False, _
IIF(.Layout = 2, .ICOBMP.Height, -.ICOBMP.Height) \2, _
False ) +Down, _
.CAPTION, _
COLOR, -True)
END IF
IF dampand = False AND TALLY(SupCaption, CharAnd) = True THEN
DIM LineTop AS INTEGER
LineTop = top +.TextHeight(.CAPTION) -True _
-IIF(.Layout > True, _
IIF(.Layout = 2, -.ICOBMP.Height +True, .ICOBMP.Height) \2 -True,_
False) +Down
.BMPBtn.Line( left +ampandposwidth -.TextWidth( MID$(SupCaption -CharAnd, ampandpos, True) ) _
+Down, _
LineTop, _
left +ampandposwidth -True +Down, _
LineTop, _
COLOR)
END IF
NEXT I
END IF
IF .ICOBMP.Empty = False THEN
DIM ICOtmp AS QBITMAP
ICOtmp.Width = .ICOBMP.Width \.NumICOBMPs
ICOtmp.Height = .ICOBMP.Height
WITH Dest: .Left = False: .Right = ICOtmp.Width
.Top = False: .Bottom = ICOtmp.Height
END WITH
FOR I = startFrom TO endTo STEP 2
left = IIF(.Layout > True, .Width \2, capwidth)
left = left +(I *(.Width +3)) +True _
+IIF(.Layout < 2 AND .CAPTION <> "", _
IIF(.Layout = False, -((.ICOBMP.Width \.NumICOBMPs) +.Spacing) \2, _
(.ICOBMP.Width \.NumICOBMPs) \2), _
-(.ICOBMP.Width \.NumICOBMPs) \2 -True)
WITH Source: .Left = I *(QTButton.ICOBMP.Width \QTButton.NumICOBMPs)
.Right = .Left +(QTButton.ICOBMP.Width \QTButton.NumICOBMPs)
.Top = False: .Bottom = ICOtmp.Height
END WITH
ICOtmp.CopyRect(QTButton.Dest, QTButton.ICOBMP, QTButton.Source)
ICOtmp.Transparent = True
.BMPBtn.Draw ( left, _
(.Height +3 -.ICOBMP.Height) \2 _
+IIF(.Layout > True AND .CAPTION <> "", _
IIF(.Layout = 2, -.ICOBMP.Height, .ICOBMP.Height) \2, _
False), _
ICOtmp.BMP)
NEXT I
END IF
.BMP = .BMPBtn.BMP
END SUB
SUB ReDraw
rWidth = .Width
rHeight = .Height
IF .Width = False OR .Height = False THEN .FixBtnSize
STATIC checkICO AS INTEGER
IF checkICO = False AND .kind = False THEN
.ICOBMP.BMP = .BMP
checkICO = True
END IF
IF .NumBMPs > maxnumbmp THEN .NumBMPs = maxnumbmp
BMPStretch_Property (QTButton)
.BMPBtn.BMP = .BMP
.BMPBtn.PixelFormat = DefPixelFormat
IF .CAPTION = "" THEN
Super.Layout = 0
ELSE: .BMPBtn.Height = .BMPBtn.Height +.TextHeight(.CAPTION) +2
.BMPBtn.Paint (True, .BMPBtn.Height -True, clPurple, clPurple)
Super.Layout = 3
END IF
.BMPtmp.Height = .BMPBtn.Height
.DrawCaption
IF .NumBMPs >= maxnumbmp THEN
WITH Dest: .Left = False: .Right = (QTButton.BMPBtn.Width -True) \QTButton.NumBMPs
.Top = False: .Bottom = QTButton.BMPBtn.Height
END WITH
WITH Source: .Left = False: .Right = QTButton.Dest.Right
.Top = False: .Bottom = QTButton.BMPBtn.Height
END WITH
.BMPtmp.Width = .Dest.Right: .BMPtmp.Height = .BMPBtn.Height
.BMPtmp.CopyRect(QTButton.Dest, QTButton.BMPBtn, QTButton.Source)
END IF
END SUB
SUB DrawDownUp
IF .NumBMPs >= 3 THEN
WITH Dest: .Left = QTButton.Down: .Right = .Left +(QTButton.BMPBtn.Width -True) \QTButton.NumBMPs
.Top = QTButton.Down: .Bottom = .Top +QTButton.BMPBtn.Height
END WITH
IF .Down = True THEN
WITH Source: .Left = (QTButton.Dest.Right -True) *2
.Right = .Left +QTButton.Dest.Right -True
.Top = False: .Bottom = QTButton.BMPBtn.Height
END WITH
.BMPBtn.CopyRect(QTButton.Dest, QTButton.BMPBtn, QTButton.Source)
ELSE
.BMPBtn.StretchDraw(QTButton.Dest, QTButton.BMPtmp.BMP)
END IF
.BMP = .BMPBtn.BMP
.DrawCaption
END IF
END SUB
SUB ReleaseHotTrack
ReleaseCapture_QTBtn
.Font.COLOR = -2147483630
IF .NumBMPs => maxnumbmp AND .Down = False THEN
WITH Dest: .Left = False: .Right = (QTButton.BMPBtn.Width -True) \QTButton.NumBMPs
.Top = False: .Bottom = QTButton.BMPBtn.Height
END WITH
.BMPBtn.StretchDraw(QTButton.Dest, QTButton.BMPtmp.BMP)
END IF
.DrawCaption
END SUB
EVENT OnMouseUp(btn AS INTEGER, X AS INTEGER, Y AS INTEGER, Shift AS INTEGER)
.ReleaseHotTrack
IF .GroupIndex > False THEN
IF AllQTBtnsRequester = False AND btn = False THEN
STATIC currHwnd AS LONG
DIM I AS INTEGER
AllQTBtnsRequester = .Handle
IF AllQTBtnsRequesterParent = False THEN _
AllQTBtnsRequesterParent = GetParent_QTBtn(QTButton.Handle)
FOR I = False TO AllQTBtnsHandle.ItemCount -True
IF VAL(AllQTBtnsGrouped.Item(I)) = .GroupIndex AND _
GetParent_QTBtn(VAL(AllQTBtnsHandle.Item(I))) = AllQTBtnsRequesterParent THEN
currHwnd = VAL(AllQTBtnsHandle.Item(I))
IF IsWindowEnabled_QTBtn(currHwnd) = True THEN
IF currHwnd <> .Handle THEN
$TYPECHECK Off
CALL SendMessage_QTBtn(currHwnd, WM_LBUTTONUP_QTBtn, False, BYVAL 0&)
CALL SendMessage_QTBtn(currHwnd, WM_MOUSELAST_QTBtn, False, BYVAL 0&)
$TYPECHECK ON
ELSEIF currHwnd = .Handle THEN
.Down = True
END IF
END IF
END IF
NEXT I
IF .ActAsToolBar = False THEN _
SetFocus_QTBtn(.Handle)
currHwnd = False
AllQTBtnsRequester = False
AllQTBtnsRequesterParent = False
.DrawDownUp
ELSEIF (AllQTBtnsRequester <> False AND AllQTBtnsRequester <> .Handle) AND _
GetParent_QTBtn(QTButton.Handle) = AllQTBtnsRequesterParent THEN
IF VAL(AllQTBtnsGrouped.Item(AllQTBtnsHandle.IndexOf(STR$(AllQTBtnsRequester)))) = .GroupIndex AND _
.Down = True THEN
.Down = False
.DrawDownUp
END IF
END IF
END IF
END EVENT
EVENT OnMouseMove(X AS INTEGER, Y AS INTEGER, Shift AS INTEGER)
STATIC PosX AS INTEGER, PosY AS INTEGER
IF .ActAsToolBar = True AND GetFocus_QTBtn() <> .Handle THEN _
.PrevFocus = GetFocus_QTBtn()
WITH Dest: .Left = False: .Right = (QTButton.BMPBtn.Width -True) \QTButton.NumBMPs
.Top = False: .Bottom = QTButton.BMPBtn.Height
END WITH
IF (X < False) OR (Y < False) OR (X > .Width) _
OR (Y > .Height) THEN
.ReleaseHotTrack
CALLFUNC(.OnMouseLeave, X, Y, Shift, QTButton)
ELSEIF (GetCapture_QTBtn() <> .Handle) AND (RequestRelease = False _
AND PosX <> X AND PosY <> Y) THEN
PosX = X
PosY = Y
SetCapture_QTBtn .Handle
.Font.COLOR = -2147483635
IF .NumBMPs => maxnumbmp AND .Down = False THEN
WITH Source: .Left = QTButton.Dest.Right *(QTButton.NumBMPs -True)
.Right = .Left +QTButton.Dest.Right
.Top = False: .Bottom = QTButton.BMPBtn.Height
END WITH
.BMPBtn.CopyRect(QTButton.Dest, QTButton.BMPBtn, QTButton.Source)
END IF
.DrawCaption
CALLFUNC(.OnMouseEnter, X, Y, Shift, QTButton)
ELSEIF RequestRelease = True THEN
.ReleaseHotTrack
END IF
IF (PosX <> X AND PosY <> Y) THEN RequestRelease = False
END EVENT
EVENT OnKeyDown(Key AS WORD, Shift AS INTEGER)
IF RequestRelease = False THEN
SELECT CASE Key
CASE 40, 39, 9: CALL NextDlg_QTBtn(True)
CASE 38, 37: CALL NextDlg_QTBtn(False)
END SELECT
END IF
RequestRelease = True
END EVENT
PROPERTY SET SetLayout (lplayout AS INTEGER)
.Layout = lplayout
.DrawCaption
END PROPERTY
PROPERTY SET SetSpacing (lpspacing AS INTEGER)
.Spacing = lpspacing
.ReDraw
END PROPERTY
PROPERTY SET SetCaption (lpcaption AS STRING)
IF TALLY(lpcaption, ChardAnd) = True THEN _
.CAPTION = REPLACESUBSTR$(lpcaption, ChardAnd, CharAnd) _
ELSE _
.CAPTION = lpcaption -CharAnd
Super.CAPTION = lpcaption -CHR$(10) -CHR$(13)
.ReDraw
END PROPERTY
PROPERTY SET SetEnabled (lpenabled AS INTEGER)
Super.Enabled = lpenabled: .Enabled = lpenabled
.DrawCaption
END PROPERTY
PROPERTY SET SetHeight (lpheight AS INTEGER)
.Height = lpheight: Super.Height = lpheight
.ReDraw
END PROPERTY
PROPERTY SET SetWidth (lpwidth AS INTEGER)
.Width = lpwidth: Super.Width = lpwidth
.ReDraw
END PROPERTY
PROPERTY SET SetNumBMPs (lpnumbmps AS INTEGER)
.NumBMPs = lpnumbmps: Super.NumBMPs = lpnumbmps
.ReDraw
END PROPERTY
PROPERTY SET SetNumICOBMPs (lpnumicobmps AS INTEGER)
.NumICOBMPs = lpnumicobmps
.DrawCaption
END PROPERTY
PROPERTY SET SetKind (lpkind AS INTEGER)
DIM numbmps AS INTEGER
numbmps = .NumBMPs
IF lpKind > False THEN
.Kind = lpkind: Super.Kind = lpkind
.NumICOBMPs = 2
.ICOBMP.BMP = .BMP
END IF
CALL FixKind (numbmps, QTButton)
.ReDraw
END PROPERTY
PROPERTY SET SetGroupIndex (lpIndex AS INTEGER)
.GroupIndex = lpIndex
CALL SetIndex(lpIndex, .Handle)
END PROPERTY
PROPERTY SET SetDown (lpDown AS INTEGER)
.Down = lpDown
.DrawDownUp
END PROPERTY
CONSTRUCTOR
BMPtmp.PixelFormat = DefPixelFormat
BMPBtn.PixelFormat = DefPixelFormat
Spacing = maxnumbmp
Enabled = True
NumBMPs = True
NumICOBMPs = True
Layout = False
Down = False
END CONSTRUCTOR
END WITH
END TYPE
DIM DrawCount AS INTEGER
SUB BMPStretch_Property
DIM Dest AS QRECT, Source AS QRECT
DIM Bitmap1 AS QBITMAP
DIM Width1 AS INTEGER, Height1 AS INTEGER
DIM Width2 AS INTEGER, Height2 AS INTEGER
DIM btnCount AS INTEGER
btnCount = Sender.NumBMPs
IF btnCount > maxnumbmp THEN
btnCount = maxnumbmp
sender.numbmps = btncount
END IF
Width1 = ((Sender.Width +3) *btnCount) +True
Height1 = Sender.Height +3
DOEVENTS
IF QTBtnOptimize <> True OR _
((rWidth > False OR rHeight > False) AND _
(Bitmap1.Width <> Width1 AND Bitmap1.Height <> Height1 AND _
Width2 <> Bitmap1.Width AND Height2 <> Bitmap1.Width)) THEN
DrawCount ++
WITH Bitmap1
.Width = Width1
.Height = Height1
.FillRect(False, False, Bitmap1.Width, Bitmap1.Height, clPurple)
.PixelFormat = DefPixelFormat
END WITH
Width1 = Sender.Width *btnCount
Height1 = Sender.Height
DIM J AS INTEGER, I AS INTEGER
FOR J = False TO btnCount -True
WITH Dest
.Left = ((Width1 \btnCount) *J) +3 +(True *(J +True)) +(J *2) -IIF(J = 2, True, False)
.Top = maxnumbmp -IIF(J=2, True, False)
.Right = .Left +(Width1 \btnCount) -6
.Bottom = Height1 -2 -IIF(J = 2, True, False)
END WITH
WITH Source: .Left = ((QTBtnBMP.Width \btnCount) *J) +3: .Top = 3: _
.Right = .Left +(QTBtnBMP.Width \btnCount) -6
.Bottom = QTBtnBMP.Height -3
END WITH
Bitmap1.CopyRect(Dest, QTBtnBMP, Source)
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 = ((QTBtnBMP.Width \btnCount) *J) _
+IIF(I = False OR I = 2, False, (QTBtnBMP.Width \btnCount) -3)
.Top = IIF(I < 2, False, QTBtnBMP.Height -3)
.Right = .Left +3
.Bottom = .Top +3
END WITH
Bitmap1.CopyRect(Dest, QTBtnBMP, Source)
NEXT I
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 = (QTBtnBMP.Width \btnCount) *J +3
.Top = IIF(I = False, False, QTBtnBMP.Height -3)
.Right = .Left +(QTBtnBMP.Width \btnCount) -6
.Bottom = .Top +3
END WITH
Bitmap1.CopyRect(Dest, QTBtnBMP, Source)
NEXT I
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 = maxnumbmp -IIF(J = 2, True, False)
.Right = .Left +3
.Bottom = Height1 -2 -IIF(J = 2, True, False)
END WITH
WITH Source
.Left = ((QTBtnBMP.Width \btnCount) *J) +IIF(I = False, False, (QTBtnBMP.Width \btnCount) -3)
.Top = 3
.Right = .Left +3
.Bottom = QTBtnBMP.Height-3
END WITH
Bitmap1.CopyRect(Dest, QTBtnBMP, Source)
NEXT I
NEXT J
Bitmap1.PixelFormat = DefPixelFormat
END IF
Width2 = ((Sender.Width +3) *btnCount) +True
Height2 = Sender.Height +3
Sender.BMP = Bitmap1.BMP
END SUB
|
|