initiaql check-in, moved repository -- no-longer a fork of

haikuarchives/yab
This commit is contained in:
Jim
2015-04-13 13:40:27 -07:00
parent 9e266ef95f
commit 3e33065a02
234 changed files with 77847 additions and 1 deletions

View File

@@ -0,0 +1,49 @@
#!yab
doc Place a description of your
doc program here.
doc
doc Author, date, license
// set DEBUG = 1 to print out all messages on the console
DEBUG = 0
OpenWindow()
// 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":
leavingLoop = true
break
default:
break
end switch
next everyCommand
wend
CloseWindow()
end
// Setup the main window here
sub OpenWindow()
window open 100,100 to 600,500, "MainWindow", "Main Window"
return
end sub
// Close down the main window
sub CloseWindow()
window close "MainWindow"
return
end sub

View File

@@ -0,0 +1,7 @@
#!yab
doc Place a description of your
doc program here.
doc
doc Author, date, license

1
yab-IDE/Templates/Empty Normal file
View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,69 @@
#!yab
doc Place a description of your
doc program here.
doc
doc Author, date, license
// set DEBUG = 1 to print out all messages on the console
DEBUG = 0
OpenWindow()
// 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 "MainView:_QuitRequested":
case translate$("MainView:File:Quit"):
leavingLoop = true
break
case translate$("MainView:Help:Help"):
alert "The Help button was pressed", "Cool !", "idea"
break
default:
break
end switch
next everyCommand
wend
CloseWindow()
end
// Setup the main window here
sub OpenWindow()
window open 100,100 to 600,500, "MainView", "Menu Template"
menu "File", "New", "N", "MainView"
menu "File", "Open...", "O", "MainView"
menu "File", "Save", "S", "MainView"
menu "File", "Save As...", "", "MainView"
menu "File", "--", "", "MainView"
menu "File", "Quit", "Q", "MainView"
menu "Edit", "Cut", "X", "MainView"
menu "Edit", "Copy", "C", "MainView"
menu "Edit", "Paste", "V", "MainView"
menu "View", "Options...", "", "MainView"
menu "Help", "Help", "H", "MainView"
menu "Help", "About", "A", "MainView"
return
end sub
// Close down the main window
sub CloseWindow()
window close "MainView"
return
end sub

View File

@@ -0,0 +1,28 @@
#
Empty
Templates/img/emptytemplate.png
Create an empty file.
#
Basic Template
Templates/img/basictemplate.png
Create a new program with a window.
#
Command Line Template
Templates/img/terminaltemplate.png
Create a new command line program.
#
Menu Template
Templates/img/menutemplate.png
Create a new program with a menu bar.
#
Toolbar Template
Templates/img/toolbartemplate.png
Create a new program with a toolbar.
#
#

View File

@@ -0,0 +1,91 @@
#!yab
// This file uses the toolbar.yab library located in ~/config/settings/yab
import Toolbar
doc Place a description of your
doc program here.
doc
doc Author, date, license
// set DEBUG = 1 to print out all messages on the console
DEBUG = 1
OpenWindow()
// 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 "MainView:_QuitRequested":
case "_QuitRequested":
case translate$("MainView:File:Quit"):
leavingLoop = true
break
case "Help":
case translate$("MainView:Help:Help"):
alert "The Help button was pressed", "Cool !", "idea"
break
default:
break
end switch
next everyCommand
wend
CloseWindow()
end
// Setup the main window here
sub OpenWindow()
window open 100,100 to 500,300, "MainView", "Toolbar Template"
window set "MainView","MinimumTo", 190,50
menu "File", "New", "N", "MainView"
menu "File", "Open...", "O", "MainView"
menu "File", "Save", "S", "MainView"
menu "File", "Save As...", "", "MainView"
menu "File", "--", "", "MainView"
menu "File", "Quit", "Q", "MainView"
menu "Edit", "Cut", "X", "MainView"
menu "Edit", "Copy", "C", "MainView"
menu "Edit", "Paste", "V", "MainView"
menu "View", "Options...", "", "MainView"
menu "Help", "Help", "H", "MainView"
menu "Help", "About", "A", "MainView"
// Toolbar Template uses /boot/home/yab_work/Programs/img for the image path.
MainDir$="/boot/home/yab_work/Programs/"
// Use your own path to your images.
ToolbarCreate(0,peek("menuheight"),400, "Toolbar", MainDir$+"img/", "MainView")
ToolbarAddIcon("ToolbarNew", "New", "newp.png", "newn.png", "newd.png")
ToolbarAddIcon("ToolbarOpen", "Open", "openp.png", "openn.png", "opend.png")
ToolbarAddIcon("ToolbarSave", "Save", "savep.png", "saven.png", "saved.png")
ToolbarAddSeparator()
ToolbarAddIcon("ToolbarCut", "Cut", "cutp.png", "cutn.png", "cutd.png")
ToolbarAddIcon("ToolbarCopy", "Copy", "copyp.png", "copyn.png", "copyd.png")
ToolbarAddIcon("ToolbarPaste", "Paste", "pastep.png", "pasten.png", "pasted.png")
ToolbarAddSeparator()
ToolbarAddIcon("ToolbarHelp", "Help", "helpp.png", "helpn.png", "helpd.png")
return
end sub
// Close down the main window
sub CloseWindow()
window close "MainView"
return
end sub

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB