Quote: "Forum etiquette deems that you should post your 'fixed' version for other users to benefit from."
I hacked so that I don't think anyone would really benefit... besides making the showext work, but I'll post it anyways.
Function FileSelect(ProjDir$,Title$,Filter$,Mode3D,ShowExt)
TFont$=TEXT FONT$()
TSize=TEXT SIZE()
Set Text Font "Tahoma",1
Set Text Size 14
Set Text Transparent
CentreX=Screen Width()/2: TLX=CentreX-127
CentreY=Screen Height()/2: TLY=CentreY-153
OldDir$=Get Dir$()
Selected=0
Get Image 21000,0,0,Screen Width(),Screen Height()
If Mode3D = 1 Then Set Camera View 0,0,1,1
Sync
FileOffset(0)=0: Cancel=0: OK=0
Rem -------------------------------------------------------
Ink rgb(255,255,255),0
Rectangle(TLX,TLY,254,300): Rem Top Left Highlight
Ink rgb(120,120,120),0
Rectangle(TLX+1,TLY+1,253,299): Rem Bottom Right Shadow
Ink rgb(200,200,200),0: Rem Med Grey Background
Box TLX+1,TLY+1,TLX+253,TLY+299
Rem -------------------------------------------------------
Ink rgb(120,120,120),0: Rem Dark Grey Bits
Rectangle(TLX+12,TLY+29,229,20): Rem Path Box
Rectangle(TLX+12,TLY+57,148,177): Rem Files List Box
Rectangle(TLX+48,TLY+242,193,19): Rem Filename Box
Rectangle(TLX+162,TLY+57,20,15): Rem Up Button
Rectangle(TLX+162,TLY+74,20,143): Rem Scroll Box
Rectangle(TLX+162,TLY+219,20,15): Rem Down Button
Rem -------------------------------------------------------
Ink rgb(255,255,255),0: Rem White Bits
Rectangle(TLX+13,TLY+30,228,19): Rem Path Box
Rectangle(TLX+13,TLY+58,147,176): Rem Files List Box
Rectangle(TLX+49,TLY+243,192,18): Rem Filename Box
Rectangle(TLX+163,TLY+58,19,14): Rem Up Button
Rectangle(TLX+163,TLY+75,19,142): Rem Scroll Box
Rectangle(TLX+163,TLY+220,19,14): Rem Down Button
Rem -------------------------------------------------------
Ink rgb(220,220,220),0: Rem Write-To Panels
Box TLX+13,TLY+30,TLX+240,TLY+48: Rem Clear Path Box
Box TLX+13,TLY+58,TLX+159,TLY+233: Rem Clear Files Box
Box TLX+49,TLY+243,TLX+240,TLY+260: Rem Clear Filename Box
Box TLX+163,TLY+58,TLX+181,TLY+71: Rem Up Button
Box TLX+163,TLY+75,TLX+181,TLY+216 : Rem Scroll Box
Box TLX+163,TLY+220,TLX+181,TLY+233: Rem Down Button
Rem -------------- BUTTONS ----------------------------------
Ink rgb(120,120,120),0: Rectangle(TLX+12,TLY+272,110,20): Rem OK Box Down
Ink rgb(255,255,255),0: Rectangle(TLX+13,TLY+273,109,19): Rem OK Box Down
Ink rgb(220,220,220),0: Box TLX+13,TLY+273,TLX+121,TLY+291: Rem OK Box Down
Ink rgb(255,255,255),0: Text TLX+62,TLY+277,"OK"
Ink 0,rgb(200,200,200): Text TLX+61,TLY+276,"OK"
Get Image 21001,TLX+12,TLY+272,TLX+12+111,TLY+272+21
Ink rgb(255,255,255),0: Rectangle(TLX+12,TLY+272,110,20): Rem OK Box Up
Ink rgb(120,120,120),0: Rectangle(TLX+13,TLY+273,109,19): Rem OK Box Up
Ink rgb(220,220,220),0: Box TLX+13,TLY+273,TLX+121,TLY+291: Rem OK Box Up
Ink rgb(255,255,255),0: Text TLX+61,TLY+276,"OK"
Ink 0,rgb(200,200,200): Text TLX+60,TLY+275,"OK"
Get Image 21002,TLX+12,TLY+272,TLX+12+111,TLY+272+21
Ink rgb(120,120,120),0: Rectangle(TLX+132,TLY+272,110,20): Rem Cancel Box Down
Ink rgb(255,255,255),0: Rectangle(TLX+133,TLY+273,109,19): Rem Cancel Box Down
Ink rgb(220,220,220),0: Box TLX+133,TLY+273,TLX+241,TLY+291: Rem Cancel Box Down
Ink rgb(255,255,255),0: Text TLX+170,TLY+277,"Cancel"
Ink 0,rgb(200,200,200): Text TLX+169,TLY+276,"Cancel"
Get Image 21003,TLX+132,TLY+272,TLX+132+111,TLY+272+21
Ink rgb(255,255,255),0: Rectangle(TLX+132,TLY+272,110,20): Rem Cancel Box Up
Ink rgb(120,120,120),0: Rectangle(TLX+133,TLY+273,109,19): Rem Cancel Box Up
Ink rgb(220,220,220),0: Box TLX+133,TLY+273,TLX+241,TLY+291: Rem Cancel Box Up
Ink rgb(255,255,255),0: Text TLX+169,TLY+276,"Cancel"
Ink 0,rgb(200,200,200): Text TLX+168,TLY+275,"Cancel"
Get Image 21004,TLX+132,TLY+272,TLX+132+111,TLY+272+21
Rem -------------- LABELS ----------------------------------
Ink rgb(255,255,255),0: Rem Filename Label
Center Text CentreX,TLY+7,Title$: Rem Panel Title Text
Text TLX+7,TLY+245, "FName:": Rem Filename Label
Arrow(1,TLX+172,TLY+60)
Arrow(2,TLX+171,TLY+228): Rem Up/Down Arrows
Ink 0,rgb(200,200,200)
Center Text CentreX-1,TLY+6,Title$
Text TLX+6,TLY+244, "FName:"
Arrow(1,TLX+173,TLY+61)
Arrow(2,TLX+172,TLY+229): Rem Up/Down Arrows
CD ProjDir$
DriveBoxes(TLX,TLY)
FO=FileOffset(0)
Scroll=0
NumFiles=UpdatePanel(TLX,TLY,Filter$,ProjDir$,FO,Selected,0,Scroll,ShowExt)
SlidePos=TLY+75
SliderTop=DrawSlider(TLX,TLY,NumFiles)
Show Mouse
Repeat
FSx=MouseX(): FSy=MouseY(): FSc=MouseClick(): OldMMz=MMz: MMz=MouseMoveZ()/100
If FSx>TLX+12 and FSx<TLX+160 and FSy>TLY+57 and FSy<TLY+234 and FSc=1 : Rem Files/Dir List area
Selected=Int((FSy-TLY-58)/16)+1+FileOffset(0): FileClick=1
REM **********************
REM SELECT A NEW DIRECTORY
REM **********************
If Files$(Selected,2)="Dir": Rem Open Directory And Re-Read
Repeat
Until MOUSECLICK()=0
T=Timer()
DClick=0
Repeat: Rem Double Click routine
TClock=Timer()-T
DClick=MOUSECLICK()
Until DClick=1 or TClock>=200
If DClick=1: Rem Mouse was double-clicked
Scroll=0
FileOffset(0)=0: FileClick=0: Selected=0
FO=FileOffset(0)
NumFiles=UpdatePanel(TLX,TLY,Filter$,ProjDir$,FO,Selected,OldNumFiles,Scroll,ShowExt)
FO=FileOffset(0)
SliderTop=DrawSlider(TLX,TLY,NumFiles)
Else: Rem Mouse was single-clicked
Scroll=1: OldNumFiles=NumFiles
FO=FileOffset(0)
NumFiles=UpdatePanel(TLX,TLY,Filter$,ProjDir$,FO,Selected,OldNumFiles,Scroll,ShowExt)
SliderTop=DrawSlider(TLX,TLY,NumFiles)
Endif
Filename$(0)=""
Repeat
Until MouseClick()=0
Sync
Endif
REM **********************
REM SELECT A FILE
REM **********************
If Files$(Selected,2)="File" and FileClick=1: Rem Clicked On Filename
Filename$(0)=Files$(Selected,1)
Repeat
Until MOUSECLICK()=0
T=Timer()
DClick=0
Repeat: Rem Double Click routine
TClock=Timer()-T
DClick=MOUSECLICK()
Until DClick=1 or TClock>=200
If DClick=1
OK=1: Rem OK to leave fileselector
Path$(0)=GET DIR$()
If Right$(Path$(0),1)<>"" Then Path$(0)=Path$(0)+""
Else
Rem Single Clicked
Ink rgb(220,220,220),0: Box TLX+49,TLY+243,TLX+240,TLY+260: Rem Clear Filename Box
Ink 0,0: Text TLX+53,TLY+244,Filename$(0): Rem Display Selected file's name
Sync
FO=FileOffset(0)
Scroll=1: OldNumFiles=NumFiles
NumFiles=UpdatePanel(TLX,TLY,Filter$,ProjDir$,FO,Selected,OldNumFiles,Scroll,ShowExt)
Endif
Endif
Repeat
Until MouseClick()=0
Sync
Endif
REM **********************
REM SCROLL WHEEL
REM **********************
If MMz <> OldMMz
If MMz > OldMMz
FileOffset(0)=FileOffset(0)-1
If FileOffset(0)<0 Then FileOffset(0)=0
FO=FileOffset(0)
Scroll=1: OldNumFiles=NumFiles
NumFiles=UpdatePanel(TLX,TLY,Filter$,ProjDir$,FO,Selected,OldNumFiles,Scroll,ShowExt)
SliderTop=DrawSlider(TLX,TLY,NumFiles)
Endif
If MMz < OldMMz
FileOffset(0)=FileOffset(0)+1
If FileOffset(0)+11 > NumFiles
FileOffset(0) = NumFiles-11
Endif
FO=FileOffset(0)
Scroll=1: OldNumFiles=NumFiles
NumFiles=UpdatePanel(TLX,TLY,Filter$,ProjDir$,FO,Selected,OldNumFiles,Scroll,ShowExt)
SliderTop=DrawSlider(TLX,TLY,NumFiles)
Endif
OldMMz = MMz
Endif
REM **********************
REM SCROLL FILES UP
REM **********************
If FSx>TLX+162 and FSx<TLX+182 and FSy>TLY+57 and FSy<TLY+72 and FSc=1: Rem Scroll List Of Files Up
FileOffset(0)=FileOffset(0)-1
If FileOffset(0)<0 Then FileOffset(0)=0
FO=FileOffset(0)
Scroll=1: OldNumFiles=NumFiles
NumFiles=UpdatePanel(TLX,TLY,Filter$,ProjDir$,FO,Selected,OldNumFiles,Scroll,ShowExt)
SliderTop=DrawSlider(TLX,TLY,NumFiles)
Endif
REM **********************
REM SCROLL FILES DOWN
REM **********************
If FSx>TLX+162 and FSx<TLX+182 and FSy>TLY+219 and FSy<TLY+234 and FSc=1: Rem Scroll List Of Files Down
FileOffset(0)=FileOffset(0)+1
If FileOffset(0)+11>NumFiles
FileOffset(0)=FileOffset(0)-1
Endif
FO=FileOffset(0)
Scroll=1: OldNumFiles=NumFiles
NumFiles=UpdatePanel(TLX,TLY,Filter$,ProjDir$,FO,Selected,OldNumFiles,Scroll,ShowExt)
SliderTop=DrawSlider(TLX,TLY,NumFiles)
Endif
REM **********************
REM DRAG SCROLLBAR
REM **********************
If FSx>TLX+163 and FSx<TLX+181 and FSy>SliderTop and FSy<SliderTop+SliderHeight(0)
If FSc=1: Rem Slider Bar
Repeat
MouseDiff = FSy-SliderTop
SliderTop = MoveSlider(TLX,TLY,MouseDiff,NumFiles,Selected)
FSc=0
Sync
Until MouseClick()=0
Else
Ink RGB(210,210,210),0: Box TLX+163+3,SliderTop+3,TLX+181-3,SliderTop+SliderHeight(0)-2
Endif
Repeat
Sync
Until MouseX()<TLX+163 Or MouseX()>TLX+181 Or MouseClick()=1
Ink RGB(200,200,200),0: Box TLX+163+3,SliderTop+3,TLX+181-3,SliderTop+SliderHeight(0)-2
Endif
REM *************************
REM CLICK ABOVE SCROLLBAR
REM *************************
If FSx>TLX+162 and FSx<TLX+182 and FSy>TLY+74 and FSy<SliderTop and FSc=1: Rem Slider Bar
FileOffset(0)=FileOffset(0)-11
If FileOffset(0)<0 Then FileOffset(0)=0
FO=FileOffset(0)
Scroll=1: OldNumFiles=NumFiles
NumFiles=UpdatePanel(TLX,TLY,Filter$,ProjDir$,FO,Selected,OldNumFiles,Scroll,ShowExt)
SliderTop=DrawSlider(TLX,TLY,NumFiles)
Sleep 20
Sync
Endif
REM *************************
REM CLICK BELOW SCROLLBAR
REM *************************
If FSx>TLX+162 and FSx<TLX+182 and FSy>SliderTop+SliderHeight(0) and FSy<TLY+217 and FSc=1: Rem Slider Bar
FileOffset(0)=FileOffset(0)+11
If FileOffset(0)+11>NumFiles
FileOffset(0)=NumFiles-11
Endif
FO=FileOffset(0)
Scroll=1: OldNumFiles=NumFiles
NumFiles=UpdatePanel(TLX,TLY,Filter$,ProjDir$,FO,Selected,OldNumFiles,Scroll,ShowExt)
SliderTop=DrawSlider(TLX,TLY,NumFiles)
Sleep 20
Sync
Endif
REM **********************
REM ENTER NEW FILENAME
REM **********************
If FSx>TLX+42 and FSx<TLX+242 and FSy>TLY+242 and FSy<TLY+262 and FSc=1: Rem Clicked on Filename Entry Box
Ink RGB(100,255,100),0: Box TLX+49,TLY+243,TLX+241,TLY+260: Rem Clear Filename Box Colour
Ink 0,RGB(100,255,100): Set Cursor TLX+53,TLY+244: Print "_";
Set Cursor TLX+53,TLY+244: Input Fn$: Set Cursor 0,0
Ink RGB(220,220,220),0
Box TLX+49,TLY+243,TLX+241,TLY+261: Rem Clear Filename
If Filter$="*.*"
Filename$(0)=Fn$
Else
ExtTest$="."+Filter$
If Upper$(Right$(Fn$,4)) <> Upper$(ExtTest$)
Filename$(0)=Fn$+"."+Filter$: Rem Add . and extension
Else
Filename$(0)=Fn$: Rem Extension already added
Endif
Endif
Ink 0,RGB(220,220,220): Text TLX+53,TLY+244,Filename$(0)
Files$(Selected,1) = Filename$(0)
Path$(0)=GET DIR$()
If Right$(Path$(0),1)<>"" Then Path$(0)=Path$(0)+""
Endif
REM **********************
REM OK BUTTON
REM **********************
If FSx>TLX+12 and FSx<TLX+122 and FSy>TLY+272 and FSy<TLY+292 and FSc=1: Rem OK
Paste Image 21001,TLX+12,TLY+272
Repeat
Sync
Until MouseClick()=0
If Len(Files$(Selected,1)) > 2
OK=1
Else
Paste Image 21002,TLX+12,TLY+272
Sync
Endif
Endif
REM **********************
REM CANCEL BUTTON
REM **********************
If FSx>TLX+132 and FSx<TLX+242 and FSy>TLY+272 and FSy<TLY+292 and FSc=1: Rem Cancel
Paste Image 21003,TLX+132,TLY+272
Filename$(0)=""
Path$(0)=""
OK=0: Cancel=1
CD OldDir$
Repeat
Sync
Until MouseClick()=0
If FileName$(0)=""
Paste Image 21004,TLX+132,TLY+272
Sync
Endif
Endif
REM **********************
REM SELECT DRIVE
REM **********************
If FSx>TLX+198 and FSx<TLX+242 and FSy>TLY+57 and FSy<TLY+217 and FSc=1: Rem Drives
DrBoxX=(FSx-TLX+198)/22: DrBoxY=(FSy-TLY+57)/20
DrNum=DrBoxY*2+DrBoxX+65
If Chr$(DrNum)+":"=Drv$(DrNum-64)
Ink rgb(220,220,220),0: Box TLX+13,TLY+30,TLX+240,TLY+48: Rem Clear Path Box
CurDrive$=Chr$(DrNum)+":"
CD CurDrive$
DriveBoxes(TLX,TLY): Rem Highlight selected drive
FO=FileOffset(0)
Scroll=0
NumFiles=UpdatePanel(TLX,TLY,Filter$,ProjDir$,FO,Selected,OldNumFiles,Scroll,ShowExt)
DrawSlider(TLX,TLY,NumFiles)
Sync
Repeat
Until MouseClick()=0
Endif
Endif
Sync
Until Cancel=1 or OK=1
Repeat
Until MOUSECLICK()=0
Ink rgb(255,255,255),0
Set Text Font TFont$
Set Text Size TSize
Paste Image 21000,0,0
If Mode3D = 1 Then Set Camera View 0,0,Screen Width(),Screen Height()
EndFunction OK
Function UpdatePanel(TLX,TLY,Filter$,ProjDir$,FO,Selected,OldNumFiles,Scroll,ShowExt)
FileOffset(0)=FO
If Scroll=1: Rem Scrolling so no need to re-read files back in
NumFiles=OldNumFiles
Else
For N=1 To 1000: Rem Clear Out Old Directory Entries
Files$(N,1)="": Files$(N,2)=""
Temp$(N,1)="": Files$(N,2)=""
Next N
Count=1: Filename$(0)="": DirCount=0: FileCount=0
Find First
Repeat
FileType=Get File Type()
If FileType=0: Rem If Type Is 'File'
FullName$=Get File Name$()
Ext$=Right$(FullName$,3)
If Filter$="*.*": Rem Display ALL Files
Files$(Count,1)=FullName$
Files$(Count,2)="File"
Inc Count
Inc FileCount
Else: Rem Use Filter
If Upper$(Ext$)=Filter$
Files$(Count,1)=FullName$
Files$(Count,2)="File"
Inc Count
Inc FileCount
Endif
Endif
Endif
If FileType=1: Rem If Type Is 'Directory'
FullDirName$=Get File Name$()
If FullDirName$<>".."
Files$(Count,1)=FullDirName$
If Files$(Count,1)="." then Files$(Count,1)=". <Parent>"
Files$(Count,2)="Dir"
Inc Count
Inc DirCount
Endif
Endif
Find Next
Until Get File Type()=-1: Rem No more files
NumFiles = Count-1
Rem Sort All Entries For Display
Repeat
Swap=0
For N=1 To NumFiles-(DirCount-1)-1
Fl1=Asc(Upper$(Files$(N,1)))
Fl2=Asc(Upper$(Files$(N+1,1)))
If Fl1 > Fl2: Rem Characters in wrong position
Swap=1
T1$=Files$(N,1)
T2$=Files$(N,2)
Files$(N,1)=Files$(N+1,1)
Files$(N,2)=Files$(N+1,2)
Files$(N+1,1)=T1$
Files$(N+1,2)=T2$
Endif
Next N
Until Swap=0
FCount=1: DCount=1
For N=1 To NumFiles
If Files$(N,2)="Dir" : Rem Separate Directories
Temp$(DCount,1)=Files$(N,1)
Temp$(DCount,2)=Files$(N,2)
Inc DCount
Else: Rem Separate Files
Temp$(FCount+DirCount,1)=Files$(N,1)
Temp$(FCount+DirCount,2)=Files$(N,2)
Inc FCount
Endif
Next N
For N=1 To NumFiles: Rem Put back into main array
Files$(N,1)=Temp$(N,1)
Files$(N,2)=Temp$(N,2)
Next N
Rem Print New Path in Path box
Ink rgb(220,220,220),0: Box TLX+13,TLY+30,TLX+240,TLY+48: Rem Clear Path Box
Ink 0,rgb(220,220,220)
Path$(0)=Get Dir$()
If Right$(Path$(0),1)<>"" Then Path$(0)=Path$(0)+""
If Len(Path$(0))>39
TempPath$=Left$(Path$(0),2)+"..."+Right$(Path$(0),32)
Text TLX+16,TLY+32,TempPath$: Rem Path Position on Fileselector
Else
Path$=ProjDir$
Text TLX+16,TLY+32,Path$(0): Rem Path Position on Fileselector
Endif
Endif
Rem *******************
Rem DISLAY ENTRIES
Rem *******************
TextXPos=TLX+30: Ty=TLY+42
Ink rgb(220,220,220),0: Box TLX+13,TLY+58,TLX+159,TLY+233: Rem Clear Files Box
Set text opaque
For N=1 to 11: Rem Fill Files Box (Max 11 Entries)
If FileOffset(0)+N <= NumFiles
If N = Selected-FileOffset(0): Rem Just clicked on entry
Ink rgb(255,255,255),rgb(60,60,255)
Else
Ink 0,rgb(220,220,220)
Endif
If Files$(FileOffset(0)+N,2)="Dir"
Text TextXPos,Ty+N*16,Left$(Files$(FileOffset(0)+N,1),20)
Ink 0,0: Box TextXPos-16,Ty+N*16+2,TextXPos-4,Ty+N*16+12
Ink RGB(255,200,0),0: Box TextXPos-15,Ty+N*16+3,TextXPos-5,Ty+N*16+11
Ink RGB(0,0,0),0: Box TextXPos-10,Ty+N*16+2,TextXPos-4,Ty+N*16+4
Ink RGB(220,220,220),0: Box TextXPos-9,Ty+N*16+2,TextXPos-4,Ty+N*16+3
Else
If ShowExt = 0
T$ = Files$(FileOffset(0)+N,1)
rem If Mid$(T$,Len(T$)-3)="." Then T$=Left$(T$,Len(T$)-4)
t$=left$(t$,len(t$)-4)
Text TextXPos,Ty+N*16,T$
Else
Text TextXPos,Ty+N*16,Left$(Files$(FileOffset(0)+N,1),20)
Endif
Ink RGB(0,0,255),0: Box TextXPos-15,Ty+N*16+2,TextXPos-5,Ty+N*16+12
Ink RGB(255,255,255),0: Box TextXPos-14,Ty+N*16+5,TextXPos-6,Ty+N*16+11
Endif
Endif
Next N
Sync
Set text transparent
EndFunction NumFiles
Function DriveBoxes(TLX,TLY)
CurDrive$=Left$(GET DIR$(),2)
Rem Get Drive List First Time Function Called
If GotDrives(0)=0
GotDrives(0)=1
Perform Checklist For Drives
DrCount=0
For T=1 To 26
Drv$(T)="No Drive"
Next T
For T=1 To DrCount
Dl=Asc(Checklist String$(T))-64
Drv$(Dl)=Checklist String$(T)
Next T
Endif
N=1
remstart
For N2=0 to 7: Rem Draw Drive Buttons
For N1=0 to 1
D$=Chr$(64+N)+":" : Rem Drives A: To P:
Ink rgb(255,255,255),0
Rectangle(N1*22+TLX+198, N2*20+TLY+57,22,20): Rem White Border
Ink rgb(200,200,200),0
If CurDrive$=D$
Ink rgb(170,170,170),0: Rem Centre OK
Endif
Box N1*22+TLX+199,N2*20+TLY+58, N1*22+TLX+219, N2*20+TLY+76: Rem Draw Box Background
rem if calculated drive letter = Drive letter from checklist
If D$=Drv$(N)
Ink rgb(255,255,255),0
Text N1*22+TLX+205, N2*20+TLY+60,D$: Rem the drive letter
Ink 0,0
Text N1*22+TLX+204, N2*20+TLY+59,D$: Rem the drive letter
Else: Rem Grey out cos drive does not exist
Ink rgb(255,255,255),0
Text N1*22+TLX+205, N2*20+TLY+60,D$: Rem the drive letter
Ink rgb(150,150,150),0
Text N1*22+TLX+204, N2*20+TLY+59,D$: Rem the drive letter
Endif
Inc N
Next N1
Next N2
remend
Sync
EndFunction
Function Rectangle(tlx,tly,w,h)
Line tlx,tly,tlx+w,tly
Line tlx+w,tly,tlx+w,tly+h
Line tlx+w,tly+h,tlx,tly+h
Line tlx,tly+h,tlx,tly
endfunction
function Arrow(Atype,AXpos,AYpos)
If AType=1
Rem Up Arrow
Line AXpos,AYpos,AXpos-6,AYpos+6
Line AXpos,AYpos,AXpos+6,AYpos+6
Line AXpos,AYpos+1,AXpos-6,AYpos+6+1
Line AXpos,AYpos+1,AXpos+6,AYpos+6+1
Endif
If AType=2
Rem Down Arrow
For I=0 to 5
Dot AXPos+I,AYPos-I
Dot AXPos+I+1,AYPos-I
Dot AXPos-I+1,AYPos-I
Dot AXPos-I,AYPos-I
Next I
Endif
endfunction
Function DrawSlider(TLX,TLY,NumFiles)
Items=NumFiles
SliderHeight(0)=Int(11*(142.0/Items))
MoveRange#=142.0-SliderHeight(0)
If Items=11
MoveRatio#=MoveRange#/1
Else
MoveRatio#=MoveRange#/(Items-11)
Endif
SlidePos=Int(TLY+75+FileOffset(0)*MoveRatio#)
If SlidePos+SliderHeight(0)>TLY+215 Then SlidePos=TLY+215-SliderHeight(0)
If Items<12
SliderHeight(0)=140: SlidePos=TLY+75
Endif
Ink rgb(220,220,220),0: Rem Write-To Panels
Box TLX+163,TLY+75,TLX+181,TLY+216: Rem Scroll Box
Ink rgb(255,255,255),0: Rem White Bits
Box TLX+163,SlidePos,TLX+165+16,SlidePos+SliderHeight(0)+1: Rem Scroll Button
Ink rgb(120,120,120),0: Rem Dark Grey Bits
Box TLX+164,SlidePos+1,TLX+165+16,SlidePos+SliderHeight(0)+1: Rem Scroll Button
Ink rgb(200,200,200),0: Rem Write To Panel Colour
Box TLX+164,SlidePos+1,TLX+165+15,SlidePos+SliderHeight(0): Rem Scroll Button
EndFunction SlidePos
Function MoveSlider(TLX,TLY,MouseDiff,NumFiles,Selected)
Items = NumFiles
MoveRange# = 142.0-SliderHeight(0)
MoveRatio# = MoveRange#/(Items-10)
Repeat
FSx=MouseX():FSy=MouseY()
SlidePos=FSy-MouseDiff
If SlidePos<TLY+75 Then SlidePos=TLY+75
If SlidePos+SliderHeight(0)>TLY+215 Then SlidePos=TLY+215-SliderHeight(0)
Ink rgb(220,220,220),0: Rem Write-To Panels
Box TLX+163,TLY+75,TLX+181,TLY+216: Rem Scroll Box
Ink rgb(255,255,255),0: Rem White Bits
Box TLX+163,SlidePos,TLX+165+16,SlidePos+SliderHeight(0)+1: Rem Scroll Button
Ink rgb(120,120,120),0: Rem Dark Grey Bits
Box TLX+164,SlidePos+1,TLX+165+16,SlidePos+SliderHeight(0)+1: Rem Scroll Button
Ink rgb(200,200,200),0: Rem Write To Panel Colour
Box TLX+164,SlidePos+1,TLX+165+15,SlidePos+SliderHeight(0): Rem Scroll Button
FileOffset(0)=Int((SlidePos-TLY-75)/MoveRatio#)
TextXPos=TLX+30: Ty=TLY+42
Ink rgb(220,220,220),0
Box TLX+13,TLY+58,TLX+159,TLY+233: Rem Clear Files Box
Rem ***** DISPLAY ENTRIES *****
Set text opaque
For N=1 to 11: Rem Fill Files Box (Max 11 Entries)
If FileOffset(0)+N<=NumFiles
If N=Selected-FileOffset(0): Rem Currently Selected Entry
Ink rgb(255,255,255),rgb(60,60,255)
Else
Ink 0,rgb(220,220,220)
Endif
If Files$(FileOffset(0)+N,2)="Dir"
Text TextXPos,Ty+N*16,Left$(Files$(FileOffset(0)+N,1),20)
Ink 0,0: Box TextXPos-16,Ty+N*16+2,TextXPos-4,Ty+N*16+12
Ink RGB(255,200,0),0: Box TextXPos-15,Ty+N*16+3,TextXPos-5,Ty+N*16+11
Ink RGB(0,0,0),0: Box TextXPos-10,Ty+N*16+2,TextXPos-4,Ty+N*16+4
Ink RGB(220,220,220),0: Box TextXPos-9,Ty+N*16+2,TextXPos-4,Ty+N*16+3
Else
Text TextXPos,Ty+N*16,Left$(Files$(FileOffset(0)+N,1),20)
Ink RGB(0,0,255),0: Box TextXPos-15,Ty+N*16+2,TextXPos-5,Ty+N*16+12
Ink RGB(255,255,255),0: Box TextXPos-14,Ty+N*16+5,TextXPos-6,Ty+N*16+11
Endif
Endif
Next N
Sync
Until MouseClick()=0
Set text transparent
Sync
EndFunction SlidePos
I took out the Parent folder, disabled all the drive boxes, and made the showext parameter work.
Seriously, how do you make the little blue text come up below your message?
