For Programmers: Free Programming Magazines  


Home > Archive > Clarion > September 2004 > how to start the window









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author how to start the window
google

2004-09-24, 3:55 pm

ok,, not really maybe understandable routines...
but in sake of those.. who learn by looking at codes from others

(instead of a bunch technical bla bla)

NormalizeWindowR
Routine

DATA


LineHeightPixels Byte

CurrentYPos ULong
G ULong
LineHeight ULong
MaxRows ULong
ImageWidth Long
ImageHeight Long
CurrentRow Long






Code

LocalQFTree_YPos = 1
?QFTree{Prop:YPos} = 1


LocalXPos = 3
LocalYPos = CWY[14] + CWH[14]
LocalWidth = CWX[10] - 3

CWX[3] = LocalXPos
CWY[3] = LocalYPos
CWW[3] = LocalWidth
LocalHeight = CWY[17] - CWY[3]
If LocalHeight < 100
LocalHeight = 100
End
CWH[TWA] = LocalHeight

ThisWin{Prop:XPos} = LocalXPos
ThisWin{Prop:YPos} = LocalYPos
ThisWin{Prop:Width} = LocalWidth
ThisWin{Prop:Height} = LocalHeight

CurrentRow = 0
ImageWidth = LocalQFTree_Width
LineHeight = 16
Get(QFolders,1)
LastLevel# = QFolders:Level
LastIsExp# = QFolders:IsExp
G# = 0
Loop
G# = G# + 1
If G# > Records(QFolders)
Break
End
Get(QFolders,G#)
If LastLevel# < QFolders:Level And LastIsExp# = 0
Cycle
End
CurrentRow = CurrentRow + 1
LastLevel# = QFolders:Level
LastIsExp# = QFolders:IsExp
End
NewImageHeight = (CurrentRow * LineHeight) + (16 * 3)
If NewImageHeight < LocalHeight !+ (16 * 3)
NewImageHeight = LocalHeight !+ (16 * 3)
End
LocalScrollBar_Height = LocalHeight
?QFTree{Prop:XPos} = 1
If VScrollBar = 0
If ?QFTree{Prop:Width} <> LocalWidth
?QFTree{Prop:Width} = LocalWidth
LocalQFTree_Width = LocalWidth
End
Else
If ?QFTree{Prop:Width} <> LocalWidth - 18
?QFTree{Prop:Width} = LocalWidth - 18
LocalQFTree_Width = LocalWidth - 18
End
End
!QFTreePropHeight
QFTreePropHeight = NewImageHeight
If ?QFTree{Prop:Height} <> QFTreePropHeight !NewImageHeight
?QFTree{Prop:Height} = QFTreePropHeight !NewImageHeight
End
ThumbYPos = 16
?Thumb{Prop:YPos} = 16
MDownYPos = 16
MouseInThumbYPos = 1
If NewImageHeight =< LocalHeight
?ScrollBar{Prop:Hide} = 1
?Thumb{Prop:Hide} = 1
VScrollbar = 0
If ?QFTree{Prop:Width} <> LocalWidth
?QFTree{Prop:Width} = LocalWidth
LocalQFTree_Width = LocalWidth
End
!ThumbYPos = 17
Else
If ?QFTree{Prop:Width} <> LocalWidth - 17
?QFTree{Prop:Width} = LocalWidth - 17
LocalQFTree_Width = LocalWidth - 17
End
If VScrollbar = 0
!ThumbYPos = 17
VScrollbar = 1
End

ThumbHeight = (LocalScrollBar_Height - 32) /
(NewImageHeight / LocalScrollBar_Height)

?ScrollBar{Prop:XPos} = LocalQFTree_Width + 1
?ScrollBar{Prop:YPos} = 0
?ScrollBar{Prop:Height} = LocalScrollBar_Height
?ScrollBar{Prop:Width} = 16

?Thumb{Prop:XPos} = LocalQFTree_Width + 1
?Thumb{Prop:YPos} = ThumbYPos
?Thumb{Prop:Height} = ThumbHeight
?Thumb{Prop:Width} = 16

Do PaintScrollBarR
Do PaintScrollBarThumbR

?ScrollBar{Prop:Hide} = 0
?Thumb{Prop:Hide} = 0

MoveSpace = LocalScrollBar_Height -
ThumbHeight - 16

End

ThumbYPos = 16
?Thumb{Prop:YPos} = 16
MDownYPos = 16
MouseInThumbYPos = MouseY()

TotalVSpanHeight = LocalScrollBar_Height - 32

ThumbUnitPixels = (TotalVSpanHeight / NewImageHeight)

! QFTreePropYPos = ?QFTree{Prop:YPos}
!
! TotalVSpanHeight = ((LocalScrollBar_Height - 16) -
(ThumbYPos + ThumbHeight)) + (ThumbYPos - 16)
!
! VScrollPercentagePos = (100 / (TotalVSpanHeight /
(ThumbYPos-16)))
!
! NextQFTreePropYPos = QFTreePropHeight / 100
!
! ?QFTree{Prop:YPos} = (((NewImageHeight-LocalHeight)/100)
* VScrollPercentagePos) * -1
!
! Display(?QFTree)
!
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com