# wkshTree - Eric Wallengren Univel 1993, extracted from
# widgetTree from USL written by Betty Dall.
#
# A Windowing Korn Shell application used to display all widgets
# known by wksh and some resources for each of those widgets.
#
# Thanks to Steve Pendergrast and Betty Dall for their
# help in putting this application together.
#
# Most widgets in wkshTree are created by creating a popupWindowShell
# and defining the type of widget created as a child of the
# popupWindowShell. They follow the following basic outline:
#
# createWidget WIDGET name widget PARENT \
# resource:value \
# resource:value
#
# help PARENT title -f filename
# popup popupWindowShell
#
# where
#
# createWidget - createManagedWidget - cmw
# createPopupShell - cps
#
# WIDGET - name referenced by the shell
#
# name - unique name which can be referenced by
# some resources
#
# widget - the widget known to wksh
#
# PARENT - the parent widget
#
# resource - the resource to be set
#
# value - the value to be applied to the resource
#
# help - OlRegisterHelp - orh
#
# PARENT - parent to which attach help, in most cases
# here, the popupWindowShell
#
# title - title to print on help window
#
# -f filename - file to include for help, in this example
# all of the individual widgets would have to
# be broken down into individual components
X
# Load widgets unknown to wksh
widload category
widload stub
widload text
X
# Popdown callback. Popdown widget named in arg
PopdownCB()
{
X pd $1
}
X
# Destroy callback. Destroy widget named in arg
DestroyCB()
{
X dw $1
}
X
# Usefull for debugging. At needed point in app, make this a callback.
Debug()
{
X widlist >envfile
X for i in `widlist -h`
X do
X widlist -R $i >>envfile
X done
}
X
# Create menuShell from button pressed by user
MenuShell()
{
X cps POPUP "WkshTree:Menu" popupWindowShell $PANE \
X maxHeight:100 maxWidth:200
X
X acb $POPUP popdownCallback "PopdownCB $POPUP"
X
X cps MENUSHELLPOP "Menu" menuShell $POPUP_UCA \
X pushpin:out
X cmw TMP ca controlArea $MENUSHELLPOP_MP \
X layoutType:fixedcols measure:1
X
X cmw SAVE Save... oblongButton $TMP \
X buttonType:$BUTTON
X cmw OPEN Open... oblongButton $TMP \
X buttonType:$BUTTON
X cmw PROP Properties... oblongButton $TMP \
X buttonType:$BUTTON
X cmw EXIT Exit... oblongButton $TMP \
X buttonType:$BUTTON
X
X cmw STRING text staticText $POPUP_UCA \
X string:"MenuShell: Press MenuButton for menu"
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X orh $POPUP "MenuShell Source" -f `pwd`/MenuShell
X
X pu $POPUP GrabNone
}
X
# Create modalShell from button selected by user
Modalshell()
{
X cps POPUP modalshell modalShell $PANE \
X emanateWidget:$PANE
X
X acb $POPUP popdownCallback "pd $POPUP"
X
X cmw TEXT staticText staticText $POPUP \
X string:"Error: ModalShell displays modal messages" \
X gravity:center
X
X cmw OK Ok flatButtons $POPUP \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X sv $OK selectProc:"PopdownCB $POPUP"
X
X orh $POPUP "ModalShell Source" -f `pwd`/Modalshell
X
X pu $POPUP GrabExclusive
}
X
# Create noticeShell from button selected by user
NoticeShell()
{
X cps NOTICE notice noticeShell $PANE \
X title:"Information Dialog" \
X noticeType:information \
X emanateWidget:$PANE
X
X acb $NOTICE popdownCallback "dw $NOTICE"
X
X sv $NOTICE_TA string:"Information: NoticeShell displays messages"
X
X cmw OK Ok flatButtons $NOTICE_CA \
X numItems:1 \
X numItemFields:2 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X orh $NOTICE "NoticeShell Source" -f `pwd`/Noticeshell
X
X pu $NOTICE GrabExclusive
X
}
X
# PopupMenuShell not fully implemented with this release but
# provided as part of the wkshTree anyway
PopupMenuShell()
{
X cps POP PopupMenu popupWindowShell $PANE
X
X acb $POP popdownCallback "dw $POP"
X
X cmw POPCAP PopupMenu caption $POP_UCA \
X font:OlDefaultBoldFont \
X label:"PopupMenu:"
X cmw TEXT text staticText $POPCAP \
X string:"Press MenuButton for menu"
X
X cps PMS PopupMenu popupMenuShell $POP \
X ancestorSensitive:true \
X title:"PopupMenu"
X
X cmw SAVE Save... oblongButton $PMS \
X buttonType:$BUTTON
X cmw OPEN Open... oblongButton $PMS \
X buttonType:$BUTTON
X cmw PROP Properties... oblongButton $PMS \
X buttonType:$BUTTON
X cmw EXIT Exit oblongButton $PMS \
X buttonType:$BUTTON \
X select:"pd $PMS"
X cmw OK Ok flatButtons $POP_LCA \
X numItems:1 \
X numItemFields:2 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X orh $POP "PopupMenuShell Source" -f `pwd`/Popupmenushell
X
X pu $POP GrabNone
}
X
# PopupWindowShell
PopupWindowShell()
{
X cps POP PopupWindowShell popupWindowShell $PANE \
X title:"PopupWindowShell" \
X apply:" " \
X reset:" " \
X resetFactory:" " \
X setDefaults:" "
X
X acb $POP popdownCallback "dw $POP"
X
X cmw CAP1 caption caption $POP_UCA \
X label:"Bell:"
X
X cmw CAP1BUT buttons flatButtons $CAP1 \
X buttonType:rectbtn exclusives:true \
X numItems:2 itemFields:'{label}' \
X items:'{On}, {Off}'
X
X cmw CAP2 size caption $POP_UCA \
X label:"Point Size:"
X
X cmw CAP2BUT buttons flatButtons $CAP2 \
X buttonType:rectbtn exclusives:true \
X numItems:7 itemFields:'{label}' \
X items:'{6}, {8}, {10}, {12}, {14}, {18}, {24}'
X
X cmw FOOT footer footer $POP_FP \
X leftFoot:"Left" rightFoot:"Right"
X
X orh $POP "PopupWindowShell Source" -f `pwd`/Popupwindowshell
X
X pu $POP GrabNone
}
X
# BulletinBoard
BulletinBoard()
{
X cps TRANSHELL transient transientShell $PANE \
X title:"WkshTree: BulletinBoard"
X
X cmw CAP1 caption caption $TRANSHELL \
X font:OlDefaultBoldFont \
X label:"BulletinBoard:" \
X position:top \
X alignment:left
X
X cmw BBOARD bulletinBoard bulletinBoard $CAP1 \
X width:200 \
X height:150 \
X borderWidth:1
X
X cmw ONE 0x0 staticText $BBOARD \
X string:"(0,0)"
X
X cmw TWO 100x100 staticText $BBOARD \
X string:"(150,100)" \
X x:100 y:100
X
X cmw THREE 80x0 staticText $BBOARD \
X string:"(80,0)" \
X x:80 y:0
X
X cmw OK OK flatButtons $BBOARD \
X x:90 y:130 \
X numItems:1 \
X itemFields:'{label}' \
X items:'{OK}'
X
X sv $OK selectProc:"PopdownCB $TRANSHELL"
X
X orh $TRANSHELL "BulletinBoard Source" -f `pwd`/Bulletinboard
X
X pu $TRANSHELL GrabNone
}
X
# Create caption widget
Caption()
{
X cmw POPCAPTION popupWidget popupWindowShell $PANE \
X title:"Caption"
X
X acb $POPCAPTION popdownCallback "dw $POPCAPTION"
X
X cmw CAP1 leftcaption caption $POPCAPTION_UCA \
X label:"Position Left:" \
X font:OlDefaultBoldFont \
X position:left \
X borderWidth:0
X
X cmw CAP2 rightcaption caption $CAP1 \
X label:":Position Right" \
X font:OlDefaultBoldFont \
X position:right \
X borderWidth:1
X
X cmw CAP3 topcaption caption $CAP2 \
X label:"Position Top:" \
X font:OlDefaultBoldFont \
X position:top \
X borderWidth:1
X
X cmw CAP4 topcaption caption $CAP3 \
X label:"Position Bottom:" \
X font:OlDefaultBoldFont \
X position:bottom \
X borderWidth:1
X
X cmw ABV abbrevmenu abbrevMenuButton $CAP4
X
X
X cmw MENUITEMS menuitems flatButtons $ABV_MP \
X numItems:3 \
X itemFields:'{label}' \
X items:'{Open...}, {Save...}, {Exit}'
X
X cmw OK Ok flatButtons $POPCAPTION_LCA \
X numItems:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X orh $POPCAPTION "Caption Source" -f `pwd`/Caption
X
X pu $POPCAPTION GrabNone
}
X
#Create Category widget
Category()
{
X PAGE1_ITEMS="{Red}, {Orange}, {Yellow}, {Green}, {Blue},
X {Indigo}, {Violet}"
X
X PAGE2_ITEMS="{Apples}, {Oranges}, {Banannas}, {Grapes},
X {Watermellon}"
X
X PAGE3_ITEMS="{Lions}, {Tigers}, {Bears}, {Elephants},
X {Zebras}, {Monkeys}, {Hippos}, {Deer},
X {Duck Billed Platypus}"
X
X cps POPUP popup popupWindowShell $PANE \
X title:"WkshTree: Category"
X
X cmw CATEGORY category category $POPUP_UCA \
X categoryLabel:"Category:" \
X leftFoot:"LeftFoot" \
X rightFoot:"RightFoot" \
X showFooter:true
X
X cmw COLORS colors flatButtons $CATEGORY \
X pageLabel:"Colors" \
X layoutType:fixedcols \
X exclusives:true \
X buttonType:rectBtn \
X numItems:7 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:"$PAGE1_ITEMS"
X
X cmw FRUITS fruits flatButtons $CATEGORY \
X pageLabel:"Fruits" \
X layoutType:fixedcols \
X exclusives:true \
X buttonType:rectBtn \
X numItems:5 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:"$PAGE2_ITEMS"
X
X cmw ANIMALS animals flatButtons $CATEGORY \
X pageLabel:"Animals" \
X layoutType:fixedcols \
X exclusives:true \
X buttonType:rectBtn \
X numItems:9 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:"$PAGE3_ITEMS"
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X orh $POPUP "Catogory Source" -f `pwd`/Category
X
X pu $POPUP GrabNone
}
X
# Create controlArea
ControlArea()
{
X THEFRUIT="{Apples}, {Oranges}, {Banannas}, {Grapes},
X {Watermelon}, {Kiwi}"
X
X THECOLOR="{Red}, {Orange}, {Yellow}, {Green}, {Blue},
X {Indigo}, {Violet}, {Black}"
X
X THEANIMAL="{Lions}, {Tigers}, {Bears}, {Elephants},
X {Zebras}, {Monkeys}, {Hippos}, {Deer},
X {Duck Billed Platypus}"
X
X cps POPCONTROLA transientShell transientShell $PANE \
X title:"WkshTree: ControlArea"
X
X cmw CAPTION caption caption $POPCONTROLA \
X label:"ControlArea:" \
X font:OlDefaultBoldFont \
X position:top \
X alignment:left
X
X cmw CONTROLAREA controlarea controlArea $CAPTION \
X alignCaptions:true \
X layoutType:fixedcols \
X center:true \
X hSpace:10
X
X cmw FRUITS caption caption $CONTROLAREA \
X label:"Fruits:"
X
X cmw FRUITBUTTONS fruitbuttons flatButtons $FRUITS \
X layoutType:fixedcols \
X buttonType:rectBtn \
X exclusives:true \
X measure:3 \
X numItems:6 \
X itemFields:'{label}' \
X items:"$THEFRUIT"
X
X cmw COLORS caption caption $CONTROLAREA \
X label:"Colors:"
X
X cmw COLORBUTTONS colorButtons flatButtons $COLORS \
X layoutType:fixedcols \
X buttonType:rectBtn \
X exclusives:true \
X measure:4 \
X numItems:8 \
X itemFields:'{label}' \
X items:"$THECOLOR"
X
X cmw ANIMALS caption caption $CONTROLAREA \
X label:"Animals:"
X
X cmw ANIMALBUTTONS animalButtons flatButtons $ANIMALS \
X layoutType:fixedcols \
X buttonType:rectBtn \
X exclusives:true \
X measure:3 \
X numItems:9 \
X itemFields:'{label}' \
X items:"$THEANIMAL"
X
X cmw OK Ok flatButtons $CONTROLAREA \
X numItems:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X sv $OK selectProc:"PopdownCB $POPCONTROLA"
X
X orh $POPCONTROLA "ControlArea Source" -f `pwd`/Controlarea
X
X pu $POPCONTROLA GrabNone
}
X
# Create exclusives widget
Exclusives()
{
X cps POPEXCLUSIVES exclusives popupWindowShell $PANE \
X title:"Exclusives"
X
X acb $POPEXCLUSIVES popdownCallback "dw $POPEXCLUSIVES"
X
X cmw CAPTION caption caption $POPEXCLUSIVES_UCA \
X label:"Exclusives:" \
X font:OlDefaultFont
X
X cmw EXCLUSIVES exclusives exclusives $CAPTION
X
X cmw ON On rectButton $EXCLUSIVES
X
X cmw OFF Off rectButton $EXCLUSIVES
X
X cmw OK Ok oblongButton $POPEXCLUSIVES_LCA \
X buttonType:$BUTTON \
X select:"pd $POPEXCLUSIVES"
X
X orh $POPEXCLUSIVES "Exclusives Source" -f `pwd`/Exclusives
X
X pu $POPEXCLUSIVES GrabNone
}
X
# Create form widget
Form()
{
X cps POPFORM transientShell transientShell $PANE \
X title:"WkshTree: Form"
X
X cmw CAPTION caption caption $POPFORM \
X label:"Form:" \
X position:top \
X alignment:left
X
X cmw FORM form form $CAPTION \
X width:150 \
X height:150 \
X shadowThickness:0
X
X cmw ATTACHLEFT AttachLeft staticText $FORM \
X string:"Attach Left" \
X yOffset:50
X
X cmw ATTACHTOP AttachTop staticText $FORM \
X string:"Attach Top" \
X xRefName:AttachLeft \
X xAddWidth:true
X
X cmw ATTACHRIGHT AttachRight staticText $FORM \
X string:"Attach Right" \
X xAttachRight:true \
X xAddWidth:true \
X xVaryOffset:true \
X yOffset:50 \
X xRefName:AttachTop
X
X cmw OK Ok oblongButton $FORM \
X buttonType:$BUTTON \
X yAttachBottom:true \
X yRefName:AttachTop \
X yAddHeight:true \
X yVaryOffset:true \
X xOffset:85
X
X sv $OK select:"PopdownCB $POPFORM"
X
X orh $POPFORM "Form Source" -f `pwd`/Form
X
X pu $POPFORM GrabNone
}
X
# Create scrollingList widget
ScrollingList()
{
X THECOLOR="Red Green Blue Orange Purple Pink Black White"
X
X cps POPUP scrollinglist popupWindowShell $PANE \
X title:"WkshTree: ScrollingList"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw CAPTION caption caption $POPUP_UCA \
X label:"Scrolling List:"
X
X cmw SLIST scrollingList scrollingList $CAPTION \
X viewHeight:3
X
X sladd $SLIST $THECOLOR
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X orh $POPUP "ScrollingList Source" -f `pwd`/Scrollinglist
X
X pu $POPUP GrabNone
}
X
# Create nonexclusives widget
Nonexclusives()
{
X cps NONEXCPOPUP Nonexclusives popupWindowShell $PANE \
X title:"FlatNonexclusives"
X
X acb $NONEXCPOPUP popdownCallback "dw $NONEXCPOPUP"
X
X cmw CAPTION caption caption $NONEXCPOPUP_UCA \
X label:"Nonexclusives"
X
X cmw NEXC nonexclusives nonexclusives $CAPTION
X
X cmw RED Red rectButton $NEXC
X
X cmw GREEN Green rectButton $NEXC
X
X cmw BLUE Blue rectButton $NEXC
X
X cmw OK Ok oblongButton $NONEXCPOPUP_LCA \
X buttonType:$BUTTON
X
X orh $NONEXCPOPUP "Nonexclusives Source" -f `pwd`/Nonexclusives
X
X pu $NONEXCPOPUP GrabNone
}
X
# Create panes widget
Panes()
{
X cps POPUP transientShell transientShell $PANE \
X title:"WkshTree: Panes"
X
X cmw CAPTION caption caption $POPUP \
X label:"Panes:" \
X font:OlDefaultBoldFont \
X position:top \
X alignment:left
X
X cmw PANES panes panes $CAPTION
X
X cmw PANE_0 pane_0 $TYPEBUTTON $PANES \
X buttonType:$BUTTON \
X weight:0
X
X cmw PANE_1 pane_1 $TYPEBUTTON $PANES \
X buttonType:$BUTTON \
X weight:1 \
X refName:"pane_0" \
X refPosition:bottom
X
X cmw PANE_2 pane_2 $TYPEBUTTON $PANES \
X buttonType:$BUTTON \
X weight:2 \
X refName:"pane_1" \
X refPosition:right
X
X cmw PANE_3 pane_3 $TYPEBUTTON $PANES \
X buttonType:$BUTTON \
X weight:2 \
X refName:"pane_2" \
X refPosition:bottom
X
X cmw OK Ok flatButtons $PANES \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}' \
X gravity:center
X
X acb $PANE_0 select "ButtonCB $PANE_0"
X acb $PANE_1 select "ButtonCB $PANE_1"
X acb $PANE_2 select "ButtonCB $PANE_2"
X acb $PANE_3 select "ButtonCB $PANE_3"
X
X sv $OK selectProc:"PopdownCB $POPUP"
X
X orh $POPUP "Panes Source" -f `pwd`/Panes
X
X pu $POPUP GrabNone
}
X
# This is the callback used to reset buttons when running in motif mode
ButtonCB()
{
X sv $1 set:false
}
X
# Create rubberTile widget
Rubbertile()
{
X cps POPUP transientShell transientShell $PANE \
X title:"WkshTree: RubberTile" \
X sensitive:true
X
X cmw CAPTION caption caption $POPUP \
X label:"RubberTile:" \
X font:OlDefaultBoldFont \
X position:top \
X alignment:left
X
X cmw RUBBERTILE rubberTile rubberTile $CAPTION \
X orientation:vertical
X
X cmw WEIGHT_0 weight_0 $TYPEBUTTON $RUBBERTILE \
X buttonType:$BUTTON \
X weight:0
X
X cmw WEIGHT_1 weight_1 $TYPEBUTTON $RUBBERTILE \
X buttonType:$BUTTON \
X weight:1
X
X cmw WEIGHT_2 weight_2 $TYPEBUTTON $RUBBERTILE \
X buttonType:$BUTTON \
X weight:2
X
X cmw RUBBERTILE2 rubberTile2 rubberTile $RUBBERTILE \
X weight:0 \
X orientation:horizontal \
X shadowThickness:0
X
X cmw OK Ok flatButtons $RUBBERTILE2 \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}' \
X weight:0
X
X acb $WEIGHT_0 select "ButtonCB $WEIGHT_0"
X acb $WEIGHT_1 select "ButtonCB $WEIGHT_1"
X acb $WEIGHT_2 select "ButtonCB $WEIGHT_2"
X
X sv $OK selectProc:"PopdownCB $POPUP"
X
X orh $POPUP "RubberTile Source" -f `pwd`/Rubbertile
X
X pu $POPUP GrabNone
}
X
# Create footerPanel widget
Footerpanel()
{
X cps FOOTERPOPUP Footerpanel transientShell $PANE \
X title:"WkshTree: FooterPanel"
X
X cmw FOOTERPANEL footerpanel footerPanel $FOOTERPOPUP
X
X cmw OK Ok flatButtons $FOOTERPANEL \
X gravity:center \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X sv $OK selectProc:"PopdownCB $FOOTERPOPUP"
X
X cmw FOOTER footer footer $FOOTERPANEL \
X leftFoot:"Left Message" \
X rightFoot:"Right Message"
X
X orh $FOOTERPOPUP "FooterPanel Source" -f `pwd`/Footerpanel
X
X pu $FOOTERPOPUP GrabNone
}
X
# This is used to describe how help is put together
Help()
{
X cps POPUP help popupWindowShell $PANE \
X title:"WkshTree: Help"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw CAPTION caption caption $POPUP_UCA \
X font:OlDefaultBoldFont \
X label:"Help:"
X
X cmw TEXT statictext staticText $CAPTION \
X string:"The Help Widget is not explicitly created and manipulated by an application. The OlRegisterHelp function is used in an application to register a help file, a help string, or a help function that is displayed when the user presses the Hel key (F1). The Help widget is a shell that contains a magnifying glass to indicate the context, and a TextEdit widget to display the help message. \n\nPosition the curser here and press F1 for help." \
X alignment:left \
X width:350 \
X recomputeSize:false
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X orh $POPUP "Help Source" -f `pwd`/Help
X
X pu $POPUP GrabNone
}
X
# Create flatButtons widget
Flatbuttons()
{
X LOWER_ITEMS="{Ok}, {Apply}, {Reset}, {Cancel}, {Help}"
X ONOFF_ITEMS="{On}, {Off}"
X COLOR_ITEMS="{Red}, {Green}, {Blue}"
X PERMISSION_ITEMS="{Read}, {Write}, {Execute}"
X
X MENU_BUTTON_ITEMS="{Flat Menu Button}"
X MENU_ITEMS="{Menu Item 1}, {Menu Item 2}, {Menu Item 3}"
X SUB_MENU_ITEMS="{Menu Item 1}"
X
X cmw POPUP popupWindowShell popupWindowShell $PANE \
X title:"WkshTree: Flatbuttons"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw BELL bell caption $POPUP_UCA \
X label:"Bell:"
X
X cmw ONOFF onoff flatButtons $BELL \
X buttonType:rectBtn \
X exclusives:true \
X numItems:2 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:"$ONOFF_ITEMS"
X
X cmw COLOR color caption $POPUP_UCA \
X label:"Color:"
X
X cmw SIZE size flatButtons $COLOR \
X buttonType:rectBtn \
X numItems:3 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:"$COLOR_ITEMS"
X
X cmw PERMISSION permission caption $POPUP_UCA \
X label:"Permissions:"
X
X cmw PERMISSIONS permissions flatButtons $PERMISSION \
X buttonType:checkbox \
X numItems:3 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:"$PERMISSION_ITEMS"
X
X cmw MENU_BUTTON menu_button caption $POPUP_UCA \
X label:"Flat Menu Button:"
X
X cmw MENU_BUTTON_ITEM menu_button_item menuButton $MENU_BUTTON \
X buttonType:$BUTTON \
X label:"Flat Menu Button"
X
X cmw CA controlarea controlArea $MENU_BUTTON_ITEM_MP \
X layoutType:fixedcols measure:1
X
X cmw MENU_ITEM menu_items flatButtons $CA \
X layoutType:fixedcols \
X measure:1 \
X numItems:3 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:"$MENU_ITEMS"
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:5 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:"$LOWER_ITEMS"
X
X orh $POPUP "FlatButtons Source" -f `pwd`/Flatbuttons
X
X pu $POPUP GrabNone
}
X
# Create flatList widget
Flatlist()
{
X COLOR_ITEMS="{Red}, {Green}, {Blue}, {Orange}, {Purple},
X {Pink}, {Black}, {White}"
X
X cps POPUP popup popupWindowShell $PANE \
X title:"WkshTree: FlatList"
X
X cmw CAPTION caption caption $POPUP_UCA \
X label:"Flat List:"
X
X cmw SW sw scrolledWindow $CAPTION \
X forceVerticalSB:true
X
X cmw FLIST flist flatList $SW \
X exclusives:true \
X viewHeight:4 \
X numItems:8 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:"$COLOR_ITEMS"
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X orh $POPUP "FlatList Source" -f `pwd`/Flatlist
X
X pu $POPUP GrabNone
}
X
# Create scrollwdWindow widget
Scrolledwindow()
{
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"WkshTree: ScrolledWindow"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw CAPTION caption caption $POPUP_UCA \
X label:"Scrolled Window:" \
X font:OlDefaultBoldFont \
X position:top \
X alignment:left
X
X cmw SCROLLEDWINDOW scrolledwindow scrolledWindow $CAPTION \
X recomputeWidth:false \
X recomputeHeight:false \
X forceHorizontalSB:true \
X forceVerticalSB:true
X
X cmw TEXT textedit textEdit $SCROLLEDWINDOW \
X source:"The TextEdit widget displays multi-line text." \
X width:200 \
X height:200
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X sv $OK selectProc:"PopdownCB $POPUP"
X
X orh $POPUP "ScrolledWindow Source" -f `pwd`/Scrolledwindow
X
X pu $POPUP GrabNone
}
X
# CReate abbreviatedButton widget
Abbrevbutton()
{
X MENUITEMS="{Restart}, {Cancel}, {Abort}"
X
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"WkshClass: AbbreviatedMenuButton"
X
X acb $POPUP popdownCallback "pd $POPUP"
X
X cps WINDOW popup popupWindowShell $POPUP \
X title:"AbbreviatedButton Window"
X
X cmw CAPTION caption caption $POPUP_UCA \
X label:"AbbreviatedButton (Window):" \
X font:OlDefaultBoldFont
X
X cmw ABW abbreviatedButton abbreviatedButton $CAPTION \
X buttonType:windowBtn \
X popupWidget:$WINDOW
X
X cps MENU menu popupMenuShell $POPUP
X
X cmw BUTTONS buttons flatButtons $MENU \
X numItems:3 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:"${MENUITEMS}"
X
X cmw CAPTION2 caption caption $POPUP_UCA \
X label:"AbbreviatedButton (Menu):" \
X font:OlDefaultBoldFont
X
X cmw ABWC abbreviatedButton abbreviatedButton $CAPTION2 \
X popupWidget:$MENU
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X sv $OK selectProc:"PopdownCB $POPUP"
X
X orh $POPUP "AbbreviatedButton Source" -f `pwd`/Abbrevbutton
X
X pu $POPUP GrabNone
}
X
# Create abbreviatedMenuButton widget
AbbrevMenuButton()
{
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"AbbreviatedMenuButton"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw CAPTION caption caption $POPUP_UCA \
X label:"AbbreviatedMenuButton:" \
X font:OlDefaultBoldFont
X
X cmw ABBREV abbrevMenuButton abbrevMenuButton $CAPTION
X
X cmw OPEN Open... oblongButton $ABBREV_MP \
X buttonType:$BUTTON
X
X cmw SAVE Save... oblongButton $ABBREV_MP \
X buttonType:$BUTTON
X
X cmw EXIT Exit oblongButton $ABBREV_MP \
X buttonType:$BUTTON
X
X cmw OK Ok oblongButton $POPUP_LCA \
X buttonType:$BUTTON
X
X orh $POPUP "AbbreviatedMenuButton Source" -f `pwd`/Abbrevmenubutton
X
X pu $POPUP GrabNone
}
X
# Create checkBox widget
Checkbox()
{
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"Checkbox"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw CHECKBOX checkbox checkBox $POPUP_UCA \
X label:"Checkbox:" \
X font:OlDefaultBoldFont \
X set:true
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X orh $POPUP "CheckBox Source" -f `pwd`/Checkbox
X
X pu $POPUP GrabNone
}
X
# Create flatCheckBox widget
Flatcheckbox()
{
X RWXITEMS="{Read}, {Write}, {Execute}"
X
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"FlatCheckBox"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw CAPTION caption caption $POPUP_UCA \
X label:"FlatCheckBox:"
X
X cmw FLATCBOX perrmission flatCheckBox $CAPTION \
X numItems:3 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:"$RWXITEMS"
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X orh $POPUP "FlatCheckBox Source" -f `pwd`/Flatcheckbox
X
X pu $POPUP GrabNone
}
X
# Create flatExclusives widget
Flatexclusives()
{
X ONOFFITEMS="{On}, {Off}"
X
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"FlatExclusives"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw EXCLUSIVE exclusive caption $POPUP_UCA \
X label:"FlatExclusive:"
X
X cmw ONOFF onoff flatExclusives $EXCLUSIVE \
X numItems:2 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:"$ONOFFITEMS"
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X orh $POPUP "FlatExclusives Source" -f `pwd`/Flatexclusives
X
X pu $POPUP GrabNone
}
X
# Create flatNonexclusives widget
Flatnonexclusives()
{
X RWXITEMS="{Read}, {Write}, {Execute}"
X
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"FlatNonexclusives"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw CAPTION lights caption $POPUP_UCA \
X label:"FlatNonexclusive:"
X
X cmw PERMS permission flatNonexclusives $CAPTION \
X numItems:3 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:"$RWXITEMS"
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X orh $POPUP "FlatNonexclusives Source" -f `pwd`/Flatnonexclusives
X
X pu $POPUP GrabNone
}
X
# Create foorter widget
Footer()
{
X cps POPUP popupWindowShell popupWindowShell $PANE \
X resizeCorners:true \
X title:"WkshTree: Footer"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X sv $POPUP_UCA width:295
X
X cmw FOOTER footer footer $POPUP_FP \
X leftFoot:"Left footer message" \
X leftWeight:1 \
X rightFoot:"Right footer message" \
X rightWeight:1
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X orh $POPUP "Footer Source" -f `pwd`/Footer
X
X pu $POPUP GrabNone
}
X
Gauge()
{
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"Gauge"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw CAPTION caption caption $POPUP_UCA \
X label:"Gauge:" \
X font:OlDefaultBoldFont \
X position:left
X
X cmw GAUGE gauge gauge $CAPTION \
X span:100 \
X sliderValue:33 \
X minLabel:"0" \
X maxLabel:"100" \
X ticks:10 \
X tickUnit:percent \
X showValue:true
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X orh $POPUP "Gauge Source" -f `pwd`/Gauge
X
X pu $POPUP GrabNone
}
X
# Create menuButton widget
Menubutton()
{
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"MenuButton"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw MENUBUTTON menuButton menuButton $POPUP_UCA \
X label:"Menu Button Widget"
X
X cmw OPEN Open... oblongButton $MENUBUTTON_MP \
X buttonType:$BUTTON
X
X cmw SAVE Save... oblongButton $MENUBUTTON_MP \
X buttonType:$BUTTON
X
X cmw EXIT Exit oblongButton $MENUBUTTON_MP \
X buttonType:$BUTTON
X
X cmw OK Ok oblongButton $POPUP_LCA \
X buttonType:$BUTTON
X
X orh $POPUP "MenuButton Source" -f `pwd`/Menubutton
X
X pu $POPUP GrabNone
}
X
# Create oblongButton widget
Oblongbutton()
{
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"Oblongbutton"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw OBW "Oblong Button Widget" oblongButton $POPUP_LCA \
X buttonType:$BUTTON \
X accelerator:"Ctrl<z>"
X
X orh $POPUP "Oblongbutton Source" -f `pwd`/Oblongbutton
X
X pu $POPUP GrabNone
}
X
# Create rectButton widget
Rectbutton()
{
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"RectButton"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw RECTB "Rect Button Widget" rectButton $POPUP_UCA
X
X cmw OK Ok oblongButton $POPUP_LCA \
X buttonType:$BUTTON
X
X orh $POPUP "RectButton Source" -f `pwd`/Rectbutton
X
X pu $POPUP GrabNone
}
X
# Create scrollbar widget
Scrollbar()
{
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"Scrollbar"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw CAPTION caption caption $POPUP_UCA \
X label:"Scrollbar" \
X font:OlDefaultBoldFont \
X position:left \
X width:200
X
X cmw SCROLLBAR scrollbar scrollbar $CAPTION \
X height:100 \
X proportionLength:40 \
X showPage:right \
X currentPage:2
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X orh $POPUP "Scrollbar Source" -f `pwd`/Scrollbar
X
X pu $POPUP GrabNone
}
X
# Create slider widget
Slider()
{
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"Slider"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw CAPTION caption caption $POPUP_UCA \
X label:"Slider:" \
X font:OlDefaultBoldFont \
X position:left
X
X cmw SLIDER slider slider $CAPTION \
X span:100 \
X sliderValue:33 \
X minLabel:0 \
X maxLabel:100 \
X ticks:10 \
X tickUnit:percent \
X showValue:true
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X orh $POPUP "Slider Source" -f `pwd`/Slider
X
X pu $POPUP GrabNone
}
X
# Create staticText widget
Statictext()
{
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"WkshTree: StaticText"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw CAPTION caption caption $POPUP_UCA \
X label:"StaticText:" \
X font:OlDefaultBoldFont
X
X cmw STEXT1 staticText staticText $CAPTION \
X string:"StaticText can be selected and copied.\nEach line cane be centered.\nIt is not editable." \
X alignment:center
X
X cmw STEXT2 staticText staticText $POPUP_UCA \
X string:"olDefaultFont" \
X font:OlDefaultFont \
X alignment:center
X
X cmw TEXT3 staticText staticText $POPUP_UCA \
X string:"olDefaultBoldFont" \
X font:OlDefaultBoldFont \
X alignment:center
X
X cmw TEXT4 staticText staticText $POPUP_UCA \
X string:"olDefaultFixedFont" \
X font:OlDefaultFixedFont \
X alignment:center
X
X cmw TEXT5 staticText staticText $POPUP_UCA \
X string:"olDefaultItalicFont" \
X font:OlDefaultItalicFont \
X alignment:center
X
X cmw TEXT6 staticText staticText $POPUP_UCA \
X string:"olDefaultBoldItalicFont" \
X font:OlDefaultBoldItalicFont \
X alignment:center
X
X cmw TEXT7 staticText staticText $POPUP_UCA \
X string:"olDefaultNoticeFont" \
X font:OlDefaultNoticeFont \
X alignment:center
X
X cmw TEXT8 staticText staticText $POPUP_UCA \
X string:"xtDefaultFont" \
X font:XtDefaultFont \
X alignment:center
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X orh $POPUP "StaticText Source" -f `pwd`/Statictext
X
X pu $POPUP GrabNone
}
X
# Used for stub widget
SeperatorInitialize()
{
X gv $STUB width:w
X gv $STUB height:h
X XDraw -lin $STUB width $w height $h
}
X
# Create Stub widget
Stub()
{
X cmw POPUP transient transientShell $PANE \
X title:"Stub"
X
X cmw RT rubberTile rubberTile $POPUP \
X orientation:vertical
X
X cmw CAPTION caption caption $RT \
X label:"Stub:" \
X font:OlDefaultBoldFont \
X position:top \
X alignment:left
X
X cmw STUB stub stub $CAPTION \
X width:100 \
X traversalOn:true \
X shadowThickness:10 \
X height:25
X
X cmw OK Ok flatButtons $RT \
X gravity:center \
X weight:0 \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X sv $OK selectProc:"PopdownCB $POPUP"
X
X orh $POPUP "Stub Source" -f `pwd`/Stub
X
X pu $POPUP GrabNone
}
X
# Create Text widget
Text()
{
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"WkshTree: Text"
X
X acb $POPUP popdownCallback "DestroyCB $POPUP"
X
X cmw CAPTION caption caption $POPUP_UCA \
X label:"Text:" \
X font:OlDefaultBoldFont \
X position:top \
X alignment:left
X
X cmw TEXT text text $CAPTION \
X width:200 \
X height:100
X
X cmw OK Ok $TYPEBUTTON $POPUP_LCA
X
X orh $POPUP "Text Source" -f `pwd`/Text
X
X pu $POPUP GrabNone
}
X
# Create Textedit widget
Textedit()
{
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"WkshTree: TextEdit"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw CAPTION caption caption $POPUP_UCA \
X label:"TextEdit" \
X font:OlDefaultBoldFont \
X position:top \
X alignment:left
X
X cmw TEXTEDIT textEdit textEdit $CAPTION \
X source:"The TextEdit widget displays multi-line text. It can wrap on white space" \
X width:200 \
X height:100
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X sv $OK selectProc:"PopdownCB $POPUP"
X
X orh $POPUP "TextEdit Source" -f `pwd`/Textedit
X
X pu $POPUP GrabNone
}
X
# Create Textfield widget
Textfield()
{
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"WkshTree: TextField"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw CAPTION caption caption $POPUP_UCA \
X label:"TextField:" \
X font:OlDefaultBoldFont \
X position:left
X
X cmw TEXT textField textField $CAPTION \
X string:"initial string" \
X charsVisible:15
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}' \
X
X sv $OK selectProc:"PopdownCB $POPUP"
X
X orh $POPUP "TextField Source" -f `pwd`/Textfield
X
X pu $POPUP GrabNone
}
X
# Create IntegerField widget
Integerfield()
{
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"IntegerField"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw CAPTION caption caption $POPUP_UCA \
X label:"IntegerField:" \
X font:OlDefaultBoldFont \
X position:left
X
X cmw INTFIELD integerField integerField $CAPTION \
X value:10 \
X charsVisible:3
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X sv $OK selectProc:"PopdownCB $POPUP"
X
X orh $POPUP "IntegerField Source" -f `pwd`/Integerfield
X
X pu $POPUP GrabNone
}
X
# Create StepField widget
Stepfield()
{
X NUM=0
X
X MONTHS="January February March April May June July
X August September October November December"
X
X for i in `echo $MONTHS`
X do
X MON[NUM]=$i
X ((NUM=$NUM+1))
X done
X
X WHERE=0
X INC=true
X
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"StepField:"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw CAPTION caption caption $POPUP_UCA \
X label:"Stepfield" \
X font:OlDefaultBoldFont \
X position:left
X
X cmw STEP stepField stepField $CAPTION \
X string:"January" \
X charsVisible:8 \
X canIncrement:true \
X canDecrement:false \
X displayPosition:1
X
X acb $STEP stepped "SteppedCB $WHERE"
X
X cmw OK Ok flatButtons $POPUP_LCA \
X numItems:1 \
X numItemFields:1 \
X itemFields:'{label}' \
X items:'{Ok}'
X
X sv $OK selectProc:"PopdownCB $POPUP"
X
X orh $POPUP "StepField Source" -f `pwd`/Stepfield
X
X pu $POPUP GrabNone
}
X
# Callback used for StepField widget
SteppedCB()
{
X
X MIN=0
X MAX=11
X
X if [[ $INC = "true" ]]
X then
X ((WHERE=$WHERE+1))
X else
X ((WHERE=$WHERE-1))
X fi
X
X if [[ $WHERE -eq $MAX ]]
X then
X INC=false
X sv $STEP canDecrement:true
X sv $STEP canIncrement:false
X fi
X
X if [[ $WHERE -eq $MIN ]]
X then
X INC=true
X sv $STEP canDecrement:false
X sv $STEP canIncrement:true
X fi
X
X sv $STEP string:"${MON[$WHERE]}"
X
}
X
# Create oblongButtonGadget widget
Oblongbuttongadget()
{
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"OblongButtonGadget"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw OBG oblongButtongadget oblongButtonGadget $POPUP_LCA \
X label:"Oblong Button Gadget"
X
X orh $POPUP "OblongButtonGadget Source" -f `pwd`/Oblongbuttongadget
X
X pu $POPUP GrabNone
}
X
# Create menuButtonGadget widget
Menubuttongadget()
{
X cps POPUP popupWindowShell popupWindowShell $PANE \
X title:"Menu Button Gadget"
X
X acb $POPUP popdownCallback "dw $POPUP"
X
X cmw MENUGADGET menuGadget menuButtonGadget $POPUP_UCA \
X label:"Menu Button Gadget"
X
X cmw OPEN Open... oblongButtonGadget $MENUGADGET_MP
X
X cmw SAVE Save... oblongButtonGadget $MENUGADGET_MP
X
X cmw EXIT Exit oblongButtonGadget $MENUGADGET_MP
X
X cmw OK Ok oblongButtonGadget $POPUP_LCA
X
X orh $POPUP "MenuButtonGadget Source" -f `pwd`/Menubuttongadget