Description File Examples
//----------------------------------------------------------------------------
// Demo1
//
// A traditional "hello world" example.
//----------------------------------------------------------------------------
Application Demo1
{
Window
{
Panel
{
Translation
{
create AddPushButton(Hello World)
"Hello World" Quit
}
}
}
}
//----------------------------------------------------------------------------
// Demo2
//
// A basic window with a menubar. Messages, generated by the user interacting
// with the window, are handled by "Translation" objects. All objects are sent
// a "create" message when created.
//----------------------------------------------------------------------------
MenuBar Demo2MenuBar
{
Definition
{
Files
{
Quit quit
}
Help
{
"On Help" postMsgBox(This is a sample help message.);
}
}
}
Application Demo2
{
Window Demo2Window
{
Demo2MenuBar
Panel
{
Translation
{
create Demo2Window::setTitle(Visual ADE- Demo2);
Create AddPushButton(Hello World / Goodbye World)
"Hello World / Goodbye World" Quit
}
}
}
}
//----------------------------------------------------------------------------
// Demo3
//
// A basic window which contains a number of widgets and a menubar. Many widgets
// generate a message when the user interacts with them. The messages usually
// are the same as their visible label.
//----------------------------------------------------------------------------
Panel MyPanel
{
Panel
{
Translation
{
create catchErrors(error);
create setLayout(Current, Vertical, 3)
create addLabel(Label)
create addLabelIcon(terminal)
create AddPushButton(Push Button);
create addPushIcon(terminal)
create AddToggleButton(Toggle Button);
create AddToggleIcon(terminal);
create AddOptionMenu(&MyOptionMenu)
}
}
Panel
{
Translation
{
create addSeparator()
}
}
Panel
{
Translation
{
create setLayout(Current, Vertical, 3)
create AddPushButton(MsgBox);
MsgBox postMsgBox(Sample MsgBox)
create AddPushButton(TextEntry);
TextEntry postTextEntryBox(Sample TextEntryBox)
create AddPushButton(SelBox);
SelBox BlockingExecInShell(ls *.dsc > tmp), postSelectionBox(tmp);
}
}
}
Menu MyOptionMenu
{
Definition
{
Option1
{
Option1 PostMsgBox(The option "%1" is NOT supported, InfoMsg);
________
________
Quit quit
}
Help
{
"On Help" postMsgBox(There is no help here, InfoMsg);
"On Version" postMsgBox(Version 0.10, InfoMsg);
}
}
}
MenuBar MyMenuBar
{
Definition
{
Files
{
About... about
________
________
Quit quit
}
Help
{
"On Help" postMsgBox(This is a panel of just some of the widgets available with VisualADE, InfoMsg);
"On Version" postMsgBox(Version 1.00, InfoMsg);
}
}
}
Window MyMainWindow
{
Translation
{
create setTitle(Panel Widgets Demo);
}
MyPanel
MyMenuBar
}
Application Demo3
{
MyMainWindow
}
//----------------------------------------------------------------------------
// Demo4
//
// This creates a window with a 2D vector graphics editor, a birds-eye view
// (locator) and magnifier (scope), and 2 other views of the graphics in the
// main editor.
//----------------------------------------------------------------------------
TreeGraph MyTree
{
Translation TreeXLate
{
Create loadGraphicsFile(grdata1), updateViewToIncludeAllGraphics();
loadfile postTextEntryBox("Enter name of graphics file to load:", grdata, loadit);
loadit deleteContents(), loadGraphicsFile(%1), updateViewToIncludeAllGraphics(), MyEditor::draw();
savefile postTextEntryBox("Enter name of file to save graphics to:", grdata, saveit);
saveit saveGraphicsFile(%1);
}
}
Translation MyPanelXLate
{
create AddPushButton(Pink); // comments here
create AddPushButton(Orange);
create AddToggleButton(Black & White);
Pink MYEDITOR::setbackgroundcolor(pink);
Orange MYEDITOR::setbackgroundcolor(orange);
"Black & White" MYEDITOR::setbackgroundcolor(white);
"~Black & White" MYEDITOR::setbackgroundcolor(black);
create AddToggleButton(2 More Views);
"2 More Views" MyView1::hide(False), MyView2::hide(False);
"~2 More Views" MyView1::hide(True), MyView2::hide(True);
create AddToggleButton(Locator & Scope);
"~Locator & Scope" MyLocator::hide(True), MyScope::hide(True);
"Locator & Scope" MyLocator::hide(False), MyScope::hide(False);
create AddPushButton(Zoom in Area);
"Zoom in Area" MyEditor::centerCursor(), MyEditor::zoomThruArea(In, start);
create AddPushButton(Import Rectangle);
"Import Rectangle" MyTree::addGraphics(Writemode Replace)
"Import Rectangle" MyTree::addGraphics(Rectangle 0 0 1000 1000)
"Import Rectangle" MyEditor::centerCursor()
"Import Rectangle" MyEditor::centerLast()
"Import Rectangle" MyEditor::drawLast()
"Import Rectangle" MyEditor::simpleDrag(start)
create AddPushButton(Import Graphics);
"Import Graphics" MyTree::loadGraphicsFile(grdatafile)
"Import Graphics" MyEditor::centerCursor()
"Import Graphics" MyEditor::centerLast()
"Import Graphics" MyEditor::drawLast()
"Import Graphics" MyEditor::simpleDrag(start)
doSomething printf("Timer\n");
}
Panel MyPanel
{
MyPanelXLate
}
Translation MyTranslation
{
<Defaults> setBackgroundColor(black);
<Defaults> jumpPan
<Defaults> selectArea();
<Defaults> deselectAll();
<Defaults> cumulativeSelect();
<Defaults> zoomAroundCursor();
<Defaults> zoomThruArea();
<Defaults> treeNodeDrag();
<Btn1Click> simpleDrag(end);
<motion> simpleDrag(move);
<Defaults> iCreateRect();
<btn3Drag> MyPanel::sendTimerMsg(readtimer, Disable, readRouter2), smoothPan();
<btn3Up> MyPanel::sendTimerMsg(readtimer, Enable, readRouter2);
<Motion> zoomThruArea(In, Move);
<Btn1Click> zoomThruArea(In, End);
Create setBackgroundColor(gray);
Create setGraph(MyTree);
^<key>g setBackgroundColor(gray);
Ctrl<key>w setBackgroundColor(white);
<WinMap> hideTextIfTooSmall();
Ctrl<key>m printAllMessages();
^<key>d dumpTranslations()
<key>o onePointPan()
<key>r MyTree::placeTopDown();
<key>n showNodes(Toggle), draw
^<key>s MyTree::saveGraphicsFile(data2)
Ctrl<key>n MyScope::locatorToolOptions(attachBoxToMouse, Toggle)
Ctrl<key>a MyScope::locatorToolOptions(locatorHasBox, Toggle)
Ctrl<key>e MyScope::locatorToolOptions(MaintainMagnification, Toggle)
^<key>g MyLocator::locatorToolOptions(anotherGraphicsView, Toggle)
^<key>h MyLocator::dumpTranslations()
^<key>i MyScope::dumpTranslations()
<Defaults> expandCursorFootprint();
setbackcolor blockingExecInShell(cut -c14- /usr/lib/X11/rgb.txt | sed 's/ //g' > rgb), postSelectionBox(rgb, Select Color, setcolor)
setcolor setBackgroundColor(%1);
}
Scope MyScope
{
Translation
{
Create setSourceEditor(MyEditor);
}
}
Editor MyEditor
{
MyTranslation
}
Locator MyLocator
{
Translation
{
Create setSourceEditor(MyEditor);
}
}
View MyView1
{
Translation
{
Create setSourceEditor(MyEditor);
}
}
View MyView2
{
Translation
{
Create setSourceEditor(MyEditor);
}
}
Layout MyLayout
{
# col(MyEditor)
# col(MyEditor, row(MyLocator, MyScope))
# col(MyEditor, row(MyLocator, MyScope), row(View(MyEditor), View(MyEditor)))
# col(row(MyEditor, MyPanel), row(MyLocator, MyScope), row(View(MyEditor), View(MyEditor)))
row(col(MyEditor, row(MyLocator, MyScope), row(MyView1, MyView2)), MyPanel)
# row(col(MyEditor, row(MyLocator, MyScope), row(View(MyEditor), View(MyEditor))), MyPanel)
# col(MyEditor, row(MyLocator, Scope(MyEditor)), row(View(MyEditor), View(MyEditor)))
# col(MyEditor, row(locator(MyEditor), scope(MyEditor)), row(View(MyEditor), View(MyEditor)))
}
MenuBar MyMenuBar
{
Definition
{
Files
{
Open MyTree::sendMsg(loadfile);
Print...
About... about
________
Save MyTree::saveGraphicsFile(data2);
"Save As" MyTree::sendMsg(savefile);
!Close
!New
________
Quit quitWithChangesVerified
}
Edit
{
!Copy
!Paste
!Cut
!Delete
}
Options
{
"Set Background Color..." MyEditor::sendMsg(setbackcolor);
"Set Editor Size Small" MyEditor::setSize(300, 300)
"Set Editor Size Medium" MyEditor::setSize(500, 500)
"Set Editor Size Large" MyEditor::setSize(800, 800)
}
Help
{
"On Help" postMsgBox(Click middle mouse button to zoom in.\nClick right button to zoom out.\nMove mouse with right button down to pan., InfoMsg);
"On Version" postMsgBox(Version 1.00, InfoMsg);
}
}
}
Translation MyWindowXlate
{
create setTitle(Sample VisualADE Rectangle Editor);
}
Window MyMainWindow
{
MyWindowXlate
MyLayout
MyMenuBar
}
Application Demo4
{
MyMainWindow
}
//----------------------------------------------------------------------------
// Demo5
//
// This creates a window that displays a C++ class hierarchy (from a file that
// was previously generated from source code) and allows the user to edit or
// print the files that the displayed classes were defined in.
//----------------------------------------------------------------------------
TreeGraph MyTree
{
Translation
{
create loadDirGraph(classes), assignGraphicsToGraph1(), placeLeftToRight(), updateViewToIncludeAllGraphics();
}
}
Editor MyEditor
{
Translation
{
create hideTextIfTooSmall();
Create setBackgroundColor(gray);
create setGraph(MyTree);
create centerCursor();
create zoomAroundCursor(In);
create zoomAroundCursor(In);
create zoomAroundCursor(In);
create zoomAroundCursor(In);
<Defaults> setBackgroundColor(black);
<Defaults> jumpPan
<Defaults> selectArea();
<Defaults> deselectAll();
<Defaults> cumulativeSelect();
<Defaults> zoomAroundCursor();
<Defaults> zoomThruArea();
<Defaults> smoothPan();
<Defaults> treeNodeDrag();
<Defaults> iCreateRect();
<key>o onePointPan()
<key>r MyTree::placeTopDown();
<key>n showNodes(Toggle), draw
<Defaults> expandCursorFootprint();
}
}
Window otherWin
{
Panel
{
Translation
{
create otherwin::settitle(C++ Browser)
create addLabel(Software Farm)
create addLabelIcon(swfarm.lgo)
create setCursorAppearance(watch), addEditor(&MyEditor), setCursorAppearance();
create addOkCancelHelp(1,0,0,1);
Help postMsgBox(Run the 'makehier' script on your\nC++ code to browse your own classes.);
}
}
}
Panel Panel2A
{
Translation
{
create addLayout(lay2A1, Current, LabelValue) #, 1, CenterJustified)
create addTextField(tlbl, contents here, msgname, Input:,,1)
create addTextField(tlbl, contents here, msgname, Input:,,1)
create addTextField(tlbl, contents here, msgname, Input:,,1)
create addTextField(tlbl, contents here, msgname, Input:,,1)
msgname printf(textfield sent: %1\n);
create addLabel(techlbl, Technology:, None)
create addLabel(manlbl, Manufactuer:, None)
create AddOptionMenu(menu2, &TechOptions,, anOption:)
create addLabel(otherlbl, Other:, None)
create blockingExecInShell(ls *.dsc > tmplist), addScrolledList(tmplist, 4, scrmsg, Description Files:);
create blockingExecInShell(ls *.dsc > tmplist), addScrolledList(tmplist, 4, scrmsg, Description Files:);
create blockingExecInShell(ls *.dsc > tmplist), addScrolledList(tmplist, 4, scrmsg, Description Files:);
}
}
Panel thePanel
{
Panel toppanel
{
Translation
{
create addLabel(Software Farm)
create setcolor(springgreen4)
create setbackgroundcolor(linen)
create addLabelIcon(swfarm.lgo)
create setbackgroundcolor(Software Farm, black)
create setcolor(Software Farm, white)
create setbackgroundcolor(swfarm.lgo, black)
create setbackgroundcolor(black)
create addLayout(lay21, Current, Vertical, 1, CenterJustified)
create addSeparator()
}
}
Panel Panel2
{
Translation
{
create addScrollPanel(&Panel2A, , 19);
create addSeparator()
create AddPushButton(post browser);
"post browser" postWindow(&otherWin);
create AddPushButton("Sample Push Button #1");
create MyMainWindow::setsize(500, 300)
create AddPushButton("Sample Push Button #2");
create addSeparator()
create addLayout(lay67, Current, Vertical, 3)
create AddOptionMenu(menu2, &TechOptions)
}
}
}
Menu TechOptions
{
Definition
{
Option1
{
Option1a PostMsgBox(The option "%1" is NOT supported, InfoMsg);
________
________
Option2a
}
things
{
kind
{
kind1
kind2
}
option
{
option1
}
}
Help
{
!"On Help" postMsgBox(There is no help here, InfoMsg);
"On Version" postMsgBox(Version 1.00, InfoMsg);
}
}
}
MenuBar MyMenuBar
{
Translation
{
Help printf(help\n), postMsgBox(No help for help);
}
Definition
{
Files
{
Print... Demo5::sendMsg(printmenu);
Edit... Demo5::sendMsg(editmenu);
About... about
________
________
Quit quitWithChangesVerified()
}
!View
{
}
Options
{
__________
togglebutton
~opt2 printf("opt2 is off\n");
opt2 printf("opt2 is on\n");
}
Help
{
"On Help" postMsgBox(There is no help here, InfoMsg);
"On Version" postMsgBox(Version 0.10, InfoMsg);
}
}
}
Window MyMainWindow
{
Translation
{
create MyMainWindow::setTitle(VisualADE Demo: Sample Dialog Box with C++ Browser Option);
winClose postMsgBox(User Selected Close Menu\n\n *** Do You REALLY want to Quit? ***), quit();
}
thePanel
MyMenuBar
}
Application Demo5
{
MyMainWindow
Translation
{
create catchErrors(error);
error postMsgBox(" *** Error Detected ***\n\n Class: %e1\n Creator: %e2\n Handler: %e3\n Error: %e4\n Severity: %e5\n Description: %e6", ErrorMsg);
printmenu blockingExecInShell(ls *.dsc > tmplist), postMultiSelectionBox(tmplist, Select File(s) to Print, print)
print printf(printing %1\n);
editmenu blockingExecInShell(ls *.dsc > tmplist), postMultiSelectionBox(tmplist, Select File(s) to Edit, edit)
edit exec(xterm -T 'Config File' -e vi %1);
}
}
//----------------------------------------------------------------------------
// Demo6
//
// This creates a window that can (1) pop up another window that displays a
// C++ class hierarchy (from a file that was previously generated from source
// code), (2) pop up another window that allows text editing, and (3)
// demonstrates the loading and deleting of visualADE description files from
// within a description file.
//----------------------------------------------------------------------------
TreeGraph MyTree
{
Translation
{
create loadDirGraph(classes), assignGraphicsToGraph1(), placeLeftToRight(), updateViewToIncludeAllGraphics();
}
}
Editor MyEditor
{
Translation
{
create hideTextIfTooSmall();
Create setBackgroundColor(gray);
create setGraph(MyTree);
create centerCursor();
create zoomAroundCursor(In);
create zoomAroundCursor(In);
create zoomAroundCursor(In);
create zoomAroundCursor(In);
<Defaults> setBackgroundColor(black);
<Defaults> jumpPan
<Defaults> selectArea();
<Defaults> deselectAll();
<Defaults> cumulativeSelect();
<Defaults> zoomAroundCursor();
<Defaults> zoomThruArea();
<Defaults> smoothPan();
<Defaults> treeNodeDrag();
<Defaults> iCreateRect();
<key>o onePointPan()
<key>r MyTree::placeTopDown();
<key>n showNodes(Toggle), draw
<Defaults> expandCursorFootprint();
}
}
Window otherWin
{
Panel
{
Translation
{
create otherwin::settitle(C++ Browser)
create addLabel(Software Farm)
create addLabelIcon(swfarm.lgo)
create setCursorAppearance(watch), addEditor(&MyEditor), setCursorAppearance();
create addOkCancelHelp(1,0,0,1);
Help postMsgBox(Run the 'makehier' script on your\nC++ code to browse your own classes.);
}
}
}
MenuBar MyTextMenuBar
{
Definition
{
Files
{
Open textWinPanel::sendMsg(loadFile);
Save textWinPanel::sendMsg(saveFile);
"Save As" textWinPanel::sendMsg(saveAsFile);
________
________
Quit quitWithChangesVerified()
}
}
}
Window textWin
{
MyTextMenuBar
Panel textWinPanel
{
Translation
{
create textwin::settitle(Text Editor)
create copyVariable(FILE::m1.dsc, FILE::m1t.dsc)
create copyVariable(m1.dsc, %5)
create copyVariable(FILE::m1.dsc, %4)
create setCursorAppearance(watch), addTextEditor(MyTextEd, %4, apply,,30, 20), setCursorAppearance();
create addOkCancelHelp(1,1,1,1);
#------ Save As ----------------
saveAsFile postTextEntryBox("Enter name of file to save text to:", defaultfilename, saveit);
saveit copyVariable(%1, %2)
saveit getValue(MyTextEd)
saveit copyVariable(%1, FILE::%2)
#------ Save ----------------
saveFile getValue(MyTextEd)
saveFile copyVariable(%1, FILE::%5)
#------ Open/Load ----------------
loadFile postTextEntryBox("Enter name of text file to load:", filename, loadit);
loadit copyVariable(%1, %5)
loadit copyVariable(FILE::%5, %4)
loadit setValue(MyTextEd, %4)
#------ Apply ----------------
apply copyVariable(%1, FILE::%5)
}
}
}
Panel Panel2A
{
Translation xPanel2A
{
create addLayout(lay2A1, Current, LabelValue) #, 1, CenterJustified)
create addTextField(tlbl, contents here, msgname, Input:,,1)
create addTextField(tlbl, contents here, msgname, Input:,,1)
create addTextField(tlbl, contents here, msgname, Input:,,1)
create addTextField(tlbl3, contents here 3, msgname, Input:,,1)
delete delete(tlbl3);
msgname printf(textfield sent: %1\n);
create addLabel(techlbl, Technology:, None)
create addLabel(manlbl, Manufactuer:, None)
create AddOptionMenu(optmenu1, &TechOptions,, anOption:)
create addLabel(otherlbl, Other:, None)
create blockingExecInShell(ls *.dsc > tmplist), addScrolledList(tmplist, 4, scrmsg, Description Files:);
create blockingExecInShell(ls *.dsc > tmplist), addScrolledList(tmplist, 4, scrmsg, Description Files:);
create blockingExecInShell(ls *.dsc > tmplist), addScrolledList(tmplist, 4, scrmsg, Description Files:);
}
}
Panel thePanel
{
Panel toppanel
{
Translation
{
create addLabel(Software Farm)
create setcolor(springgreen4)
create setbackgroundcolor(linen)
create addLabelIcon(swfarm.lgo)
create setbackgroundcolor(Software Farm, black)
create setcolor(Software Farm, white)
create setbackgroundcolor(swfarm.lgo, black)
create setbackgroundcolor(black)
create addLayout(lay21, Current, Vertical, 1, CenterJustified)
create addSeparator()
}
}
Panel Panel2
{
Translation
{
create addScrollPanel(&Panel2A, , 19);
create addSeparator()
create AddPushButton(post browser);
"post browser" postWindow(&otherWin);
create AddPushButton(post text editor);
"post text editor" postWindow(&textWin);
create AddPushButton(,"Delete entity in Scroll Panel", del);
del panel2A::sendMsg(delete);
create MyMainWindow::setsize(500, 300)
create AddPushButton(,"Delete all entity in Scroll Panel", delall);
delall panel2A::deleteContents
create AddPushButton(,"Create all entity in Scroll Panel", creall);
creall panel2A::hide(panel2A, True)
creall panel2A::sendMsg(create)
creall panel2A::hide(panel2A, False)
create AddPushButton("Run Cmd File");
"Run Cmd File" runCommandFile(testfile);
create AddPushButton("Delete Translation");
"Delete Translation" panel2A::deleteContents
"Delete Translation" deleteDescription(xPanel2A)
create AddPushButton("Load Translation");
"Load Translation" loadDescriptionFile(panel.dsc)
"Load Translation" Panel2A::appendTranslation(xPanel2A)
"Load Translation" Panel2A::hide(Panel2A, True)
"Load Translation" Panel2A::sendMsg(create)
"Load Translation" Panel2A::hide(Panel2A, False)
create AddPushButton("Change Option Menu");
"Change Option Menu" Panel2A::delete(optmenu1);
"Change Option Menu" deleteDescription(TechOptions);
"Change Option Menu" loadDescriptionFile(optmenu.dsc)
"Change Option Menu" Panel2A::AddOptionMenu(optmenu1, &TechOptions,, anOption:)
create AddPushButton("Sample Push Button #2");
create addSeparator()
create addLayout(lay67, Current, Vertical, 3)
create AddOptionMenu(menu2, &TechOptions)
}
}
}
Menu TechOptions
{
Definition
{
Option1
{
Option1a PostMsgBox(The option "%1" is NOT supported, InfoMsg);
________
________
Option2a
}
things
{
kind
{
kind1
kind2
}
option
{
option1
}
}
Help
{
!"On Help" postMsgBox(There is no help here, InfoMsg);
"On Version" postMsgBox(Version 1.00, InfoMsg);
}
}
}
MenuBar MyMenuBar
{
Translation
{
Help printf(help\n), postMsgBox(No help for help);
}
Definition
{
Files
{
Print... Demo6::sendMsg(printmenu);
About... about
________
________
Quit quitWithChangesVerified()
}
!View
{
}
Options
{
__________
togglebutton
~opt2 printf("opt2 is off\n");
opt2 printf("opt2 is on\n");
}
Help
{
"On Help" postMsgBox(There is no help here, InfoMsg);
"On Version" postMsgBox(Version 0.10, InfoMsg);
}
}
}
Window MyMainWindow
{
Translation
{
create MyMainWindow::setTitle(VisualADE Demo: Sample Dialog Box with C++ Browser Option);
winClose postMsgBox(User Selected Close Menu\n\n *** Do You REALLY want to Quit? ***), quit();
}
thePanel
MyMenuBar
}
Application Demo6
{
MyMainWindow
Translation
{
create catchErrors(error);
error postMsgBox(" *** Error Detected ***\n\n Class: %e1\n Creator: %e2\n Handler: %e3\n Error: %e4\n Severity: %e5\n Description: %e6", ErrorMsg);
printmenu blockingExecInShell(ls *.dsc > tmplist), postMultiSelectionBox(tmplist, Select File(s) to Print, print)
print printf(printing %1\n);
}
}