topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday April 19, 2024, 4:42 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Alpha list of files with Numeric drop down to select and display  (Read 4333 times)

schnarkle

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 11
    • View Profile
    • Donate to Member
I play guitar at church and would like to be able to select a song order from a list of .pdf files, hit submit and have the songs display in correct order while I page down from one song to the next.

sample.jpg

The list of pdf files is in a single directory online.  I'm thinking php to do this?
I would like to be able to just drop new pdfs in the folder via ftp and have them listed out on the fly if possible.

The image is an idea of what I'm thinking it could look like...

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
 :) Try AlphaList!

It's just a quick hack, but give it a go.
To change the folder, edit the line folder=.

Skrommel

;AlphaList.ahk
; Order and run a list of PDF files, switch files using PgUp and PgDown
;Skrommel @ 2009

#NoEnv
#SingleInstance,Force
CoordMode,Mouse,Screen

;Edit this line to change folder
folder=C:\PDFs
type=*.pdf

Gui,1:Add,Button,Default GRUN,&Run
Gui,1:Add,ListView,GLISTVIEW Vlistview AltSubmit -ReadOnly,Order|Filename|Path
items=_
Loop,%folder%\%type%,0,1
{
  items=%items%|%A_Index%
  LV_Add("","_",A_LoopFileName,A_LoopFileLongPath)
}
Gui,1:+LastFound +Resize
guiid1:=WinExist()
LV_ModifyCol(2,"Auto")
LV_ModifyCol(3,0)
Gui,1:Show
Return


ITEM:
Gui,2:Submit
ToolTip,%item%.%row%
Gui,1:Default
LV_Modify(row,"",item)
Return


LISTVIEW:
If A_GuiEvent In E,Normal
{
  row:=A_EventInfo
  Gui,1:Default
  LV_GetText(order,row,1)
  MouseGetPos,mx,my
  Gui,2:Destroy
  Gui,2:+Owner1
  Gui,2:Margin,0,0
  Gui,2:-Caption ;+AlwaysOnTop
  Gui,2:Add,ListBox,% "GITEM Vitem Choose" order+1,%items%
  Gui,2:Show,% "X" mx "Y" my
}
Return


RUN:
LV_ModifyCol(1,"Sort")
rows:=LV_GetCount()
current=0
Gosub,NEXT
Return


#IfWinExist AlphaList
PgDn::
NEXT:
current+=1
If (current>rows)
  current=%rows%
Gosub,SHOW
Return


#IfWinExist AlphaList
PgUp::
PREVIOUS:
current-=1
If (current<rows)
  current=1
Gosub,SHOW
Return


SHOW:
LV_GetText(filename,current,3)
Run,%filename%
Return



GuiSize:
If A_EventInfo=1  ;Minimized
  Return
GuiControl,Move,listview,% "W" . (A_GuiWidth-20) . " H" . (A_GuiHeight - 40)
Return
« Last Edit: January 31, 2009, 11:09 AM by skrommel »

schnarkle

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 11
    • View Profile
    • Donate to Member
skrommel,

Wow, fantastic!

Only problem is that it only loads the first pdf file for some reason and does not load the others at all?   A minor fix?

anyway I LOVE the implementation!