update help treebox data

This commit is contained in:
Jim
2015-06-17 21:11:38 -07:00
parent 8854dcc7de
commit c5bc2b25f4
5 changed files with 1465 additions and 378 deletions

View File

@@ -757,7 +757,7 @@ TREEBOX REMOVE TreeBox$, ListItem$
Removes the first list item ListItem$ from the tree. Note: this also removes all subitems!
n = TREEBOX COUNT TreeBox$
Returns the number of entries in TreeBox$
Item$ = TREEBOX GET TreeBox$, Position
Item$ = TREEBOX GET$ TreeBox$, Position
Returns the Item$ at position Position in TreeBox$.
TREEBOX EXPAND TreeBox$, Head$
Expands Head$ in TreeBox$.

View File

@@ -2,16 +2,18 @@
window open 100,100 to 560,320, "WView", "SliderWorld"
slider 20,20 to 350,50, "Slider1", "1. Slider with block thumb from 0.1 to 1", 1, 10, "WView"
layout "left,top","WView"
slider 20,70 to 350,100, "Slider2", "2. Slider with triangle thumb from 1 to 100 and limit labels; set to 20", 1, 100, "triangle", "WView"
slider 20,10 to 350,40, "Slider1", "1. Slider with block thumb from 0.1 to 1", 1, 10, "WView"
slider 20,50 to 350,80, "Slider2", "2. Slider with triangle thumb from 1 to 100 ", 1.5, 100, "triangle", "WView"
slider label "Slider2", "Foo", "Bar"
slider set "Slider2", 20
slider 20,120 to 350,150, "Slider3", "3. Slider from 50 to 75, with 5 bottom hash markings, disabled", 50, 75, "WView"
slider 20,110 to 350,140, "Slider3", "3. Slider from 50 to 75,", 50, 75, "WView"
slider label "Slider3", "Foo", "Bar"
slider set "Slider3", "bottom", 5
option set "Slider3", "enabled", false
slider set "Slider3", "bottom", 25
//option set "Slider3", "enabled", false
slider 20,170 to 350,200, "Slider4", "4. Slider from -20 to 20, with colors", -20, 20, "WView"
slider color "Slider4", "barcolor", 240,140,140

View File

@@ -0,0 +1,174 @@
#!yab
############# Prologue #############
ProgramName$ = "Teditor"
AuthorName$ = "Joe Bloggs"
ProgramVersion$ = "V0.1"
ProgramBriefDescription$ = "My unbelievable first yab program."
ProgramLicense$ = "Public Domain"
ProgramAcknowledgements$ ="With thanks to Michel Clasquin-Johnson for writing Teditor and to  Marc-Oliver Ihm, Jan Bungeroth and Jim Saxton for creating yab!"
//*****Global Variables****
## Technically, yab does not require you to declare global variables, it just is a really, really good idea to do it anyway.
// set DEBUG = 1 to print out all messages on the console
DEBUG = 1
//change this to DEBUG = 0 when you are ready to bind the program for distribution
OpenWindow()
#######End of Prologue#######
############# Main Message Loop #############
dim msg$(1)
while(not leavingLoop)
nCommands = token(message$, msg$(),"|")
for everyCommand = 1 to nCommands
if(DEBUG and msg$(everyCommand)<>"") print msg$(everyCommand)
switch(msg$(everyCommand))
case "_QuitRequested":
case "MainWindow:_QuitRequested":
case "MainWindow:File:Quit":
leavingLoop = true
break
case "MainWindow:File:Save":
SaveFile()
break
case "MainWindow:File:New":
NewFile()
break
case "MainWindow:File:Open":
OpenFile()
break
case "MainWindow:Edit:Undo/Redo":
textedit set "EditSpace", "undo"
break
case "MainWindow:Edit:Cut":
textedit set "EditSpace", "cut"
break
case "MainWindow:Edit:Copy":
textedit set "EditSpace", "copy"
break
case "MainWindow:Edit:Paste":
textedit set "EditSpace", "paste"
break
case "MainWindow:Edit:Select All":
textedit set "EditSpace", "select-all"
break
case "MainWindow:Help:About":
Alert ProgramName$ + " " + ProgramVersion$ + "\n" + "by " + AuthorName$ +"\n\n" + ProgramBriefDescription$ + "\n" + ProgramLicense$ + "\n" + ProgramAcknowledgements$, "OK", "none"
default:
break
end switch
next everyCommand
wend
CloseWindow()
end
#######End of Main Loop#######
sub CloseWindow()
//Close down the main window
NewFile()
window close "MainWindow"
end sub
sub MakeMenu()
//Create menu in MainWindow
menu "File", "New", "N", "MainWindow"
menu "File", "Open", "O", "MainWindow"
menu "File", "Save", "S", "MainWindow"
menu "File", "Quit", "Q", "MainWindow"
menu "Edit", "Undo/Redo", "Z", "MainWindow"
menu "Edit", "Cut", "X", "MainWindow"
menu "Edit", "Copy", "Z", "MainWindow"
menu "Edit", "Paste", "Z", "MainWindow"
menu "Edit", "Select All", "A", "MainWindow"
menu "Help", "About", "", "MainWindow"
end sub
sub NewFile()
local sos
if textedit get$ "EditSpace" <> "" then
sos = alert "Save Current Text First?", "Yes", "No", "", "none"
if sos = 1 SaveFile()
textedit clear "EditSpace"
endif
end sub
sub OpenFile()
local file2open$, anewline$
NewFile()
file2open$ = filepanel "load-file", "Open Which File?", "/boot/home"
if file2open$ <> "" then
open file2open$ for reading as #1
while(not(eof(1)))
line input #1 anewline$
textedit add "EditSpace", anewline$ + "\n"
wend
close #1
textedit set "EditSpace", "gotoline", 1
endif
end sub
sub OpenWindow()
//Setup the main window here
Window open 100,100 to 600,500, "MainWindow", "Teditor"
textedit 0,20 to 499, 399, "EditSpace", 3, "MainWindow"
textedit set "EditSpace", "wordwrap", 0
MakeMenu()
end sub
sub SaveFile()
local file2save$,filename$
file2save$ = textedit get$ "EditSpace"
if file2save$ <> "" then
filename$ = filepanel "save-file", "Save File As ...", "/boot/home"
if filename$= "" return
open filename$ for writing as #1
print #1 file2save$
close #1
endif
end sub

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff