event.load
extern.close("{APP_NAME}") // Only one instance allowed
app.init("{APP_ID}", "{APP_NAME}", "{APP_VERSION}", "{APP_BUILD}", "{CREATE_LOG}")
app.booster(true)
&data = "" // Data not saved in this prototype
window.main.autoClose(false, false)
// Load Bitmaps
window.main.shape.load(path.rsc("Shape.bmp"), false)
draw.main.load(path.rsc("Notes.jpg"))
draw.main.paint()
&iButtons = draw.mem.createFromFile(path.rsc("Buttons.jpg"))
// Icons for pages
&A = CreateButton(5, 5, true)
&B = CreateButton(25, 25, false)
&C = CreateButton(45, 45, false)
&D = CreateButton(65, 65, false)
&E = CreateButton(85, 85, false)
&MinX = screen.width() - 52
&MaxX = screen.width() - window.main.width()
&Wanted = &MaxX
&Current = &MinX
// Window pos
window.main.movable(yOnly)
&pX = screen.width() - window.main.width()
window.main.pos.now(&Current, 250)
// Input box
inputBox.main.pos(67, 14,200, 118)
inputBox.main.visible(true)
inputBox.main.text.tabsStops(8)
inputBox.main.text.font("Arial")
inputBox.main.text.size(9)
inputBox.main.scrollbar.visible(true)
&CurrentPage = 1
inputBox.main.text.set(&Data[1])
// Boutons
&CloseID = window.main.create(true, btClose, false, false, false, false)
window.&CloseID.pos(36, 121, 15, 15)
draw.&CloseID.load(Path.Rsc("close.bmp"))
mouse.&CloseID.Cursor(hotspot)
doEvent.continue()
event.end
event.continue
// Temps to allow input box to get focus
inputBox.main.setFocus
doEvent.animate()
event.end
event.mouse:click
&Wanted = ?(&Wanted = &MinX, &MaxX, &MinX)
doEvent.Animate()
event.end
event.Animate
&Set = 20
// Slide the window
if(&Current < &Wanted)
Var.Inc(Current, &Set, &Wanted)
&DoIt = true
if.end
if(&Current > &Wanted)
Var.Dec(Current, &Set, &Wanted)
&DoIt = true
if.end
window.main.pos.now = &Current, null, (screen.width()-&Current), null
if(&DoIt = true)
doEvent.Animate = 20
if.else
if(&Current = &MaxX)
window.&CloseID.visible(true)
if.else
window.&CloseID.visible(false)
if.end
if.end
&DoIt = false
event.end
event.mouse:Click:PageButton
mouse.cursor = Hourglass
&ID = window.eventAuthor()
&Data[&CurrentPage] = inputBox.main.text.get()
// Redraw buttons
for(&ptr, 1, 6)
draw.&ptr.copyFrom.&iButtons(?(&ID = &ptr, 21, 0), &SrcY[&ptr], 21, 18, 0, 0, 21, 18)
draw.&ptr.paint()
for.next
&CurrentPage = &ID
inputBox.main.text.set(&Data[&ID])
inputBox.main.setFocus()
mouse.cursor(normal)
event.end
function.createButton(&SrcY, &TarY, &Selected)
&ID = window.main.create(true, PageButton, false, false, false, false, false)
mouse.&ID.cursor(hotspot)
&SrcY[&ID] = &SrcY
window.&ID.pos.now = 32, &TarY, 21, 18
draw.&ID.copyFrom.&iButtons(?(&Selected = true, 21, 0), &SrcY[&ID], 21, 18, 0, 0, 21, 18)
draw.&ID.paint
return(&ID)
function.end
// Close
event.mouse:click:btClose
window.main.visible(false)
app.close()
event.end
event.terminate
&Data[&CurrentPage] = InputBox.main.Text.Get()
// The array Data should be saved on disk here
event.end
|