value__ntId__ntName  __ntTemplatetitle viewBounds viewFormat stepChildren viewFlags beforeScript viewJustify declareSelf drawframeoptionsmyStyle  __ntDatatype __ntFlags( CLAS@    TEXTDragonDrop    RECT     NUMBD    ARAY    text  viewTransferModeviewFont viewSetupFormScript   h PROT@    EVAL""    lefttoprightbottomP           *ROM_fontSystem10bold )   T    8// be sure to call inherited:?ViewSetupFormScript() func() begin self.text:=" " && kappname && "(Concept Version)"; inherited:?ViewSetupFormScript(); end SCPTprotoStaticText    __ntDeclare  viewSetupDoneScript copy   fsSpec The Tornado$BDГDragonDropViewΪPRTONTP1DragonDrop - 0d1Г:The Tornado:Desktop Folder:DragonDrop - 0d1:DragonDropView afpm9YuRD5/2 jXopher & The Tornado The TornadoJ. Christopher Bell USER@     - . / 0d   func() begin // When we start this application, create a single new dragon. // :AddNewSymbol(30,30,"integral"); viewName := "view1"; end 8         BOOL userProto View1      $ viewLineSpacingViewDragFeedbackScript    4 @     - . / 0(        )"ROM_fontsystem12    D    P   Xfunc(dragInfo, dragPoint, show) begin local ourBox := :LocalBox(); // For our feedback, we draw a thick gray rectangle using the Xor transfer mode. // By using Xor, calling this with show=true and then show=nil will erase the // feedback rectangle. Note that we use DoDrawing to ensure correct clipping. :DoDrawing('DrawShape, [MakeRect(ourBox.left + 1, ourBox.top + 1, ourBox.right - 1, ourBox.bottom - 1), {transferMode: modeXor, penSize:3, penPattern:vfGray}]); true; // let the Drag and Drop system know that you did draw something. end 8     clEditView    ;   = >ViewDropScriptViewDropMoveScript    @ B@     - . / 0(       |func() begin // When we start this application, create a single new dragon. foreach index,element in drawframe do :AddNewSymbol(30,30, element.example); viewName := "View2"; end 8    I   rfunc(dropType, dropData, dropPt) begin return true; end 8   func(dragRef, offset, lastDragPt, copy) begin // dragRef.view:OffsetView(offset.x, offset.y); return nil; end 8 J View2     menuLeftButtons    D '@     - . / 0   .[ protoInfoButton, ]; )     newtStatusBar       ./* Descended from: ** Newton Developer Technical Support Sample Code ** DragonDrop, a drag and drop example modified by Ashish Mishra */ )        'base )   #&{ integrate: {viewjustify: vjSiblingRightH + vjParentFullV, viewbounds: {left:0,right:20,top:0,bottom:0}, example : "integrate(a^2,b^2)", image:func(r,context,style) begin local garray:=[]; local mypoint:=nil; // for the limits local annotate:=getroot().(kappsymbol):options(context, "integrate"); if length(annotate)=2 then begin r.right:=max(annotate[0][1].right,annotate[1][1].right)+10; annotate[1][0]:=offsetshape(annotate[1][0],10,0); v:=shapebounds(annotate[0][0]); annotate[0][0]:=offsetshape(annotate[0][0],10,r.bottom-v.bottom); addarrayslot(garray,annotate[0][0]); addarrayslot(garray,annotate[1][0]); end; mypoint:=makepolygon([2,r.bottom-4 ,4,r.bottom-2 ,6,r.bottom-4 ,6,4, 8,2, 10,4]); addarrayslot(garray,mypoint); return [garray,r]; end, }, |^|: {viewjustify: vjSiblingRightH + vjParentCenterV, viewbounds: {left:0,right:20,top:0,bottom:20}, example : "x^2", image:func(r,context,style) begin local garray:=[]; local mypoint:=nil; caret:=strpos(context,"^",0); first:=substr(context,0,caret); second:=substr(context,caret+1,strlen(context)); // calculate the images size r.bottom:=style.font.size+8; fs:=strfontwidth(first,style.font); ss:=strfontwidth(second,style.font); r.right:=fs+ss+2; mypoint:=maketext(first,0,4,fs,r.bottom-4); addarrayslot(garray, mypoint); mypoint:=maketext(second,fs,0,fs+ss,r.bottom-8); addarrayslot(garray, mypoint); return [garray,r]; end, }, |_|: {viewjustify: vjSiblingRightH + vjParentCenterV, viewbounds: {left:0,right:20,top:0,bottom:20}, example : "a_0", image:func(r,context,style) begin local garray:=[]; local mypoint:=nil; caret:=strpos(context,"_",0); first:=substr(context,0,caret); second:=substr(context,caret+1,strlen(context)); // calculate the images size r.bottom:=style.font.size+8; fs:=strfontwidth(first,style.font); ss:=strfontwidth(second,style.font); r.right:=fs+ss+2; mypoint:=maketext(first,0,0,fs,r.bottom-4); addarrayslot(garray, mypoint); mypoint:=maketext(second,fs,0,fs+ss,r.bottom); addarrayslot(garray, mypoint); return [garray,r]; end, }, |/|: {viewjustify: vjSiblingRightH + vjParentCenterV, viewbounds: {left:0,right:20,top:0,bottom:20}, example : "1/2", image:func(r,context,style) begin local garray:=[]; local mypoint:=nil; caret:=strpos(context,"/",0); first:=substr(context,0,caret); second:=substr(context,caret+1,strlen(context)); // calculate the images size r.bottom:=style.font.size*2+4; fs:=strfontwidth(first,style.font); ss:=strfontwidth(second,style.font); r.right:=max(fs,ss)+4; middle:=rinttol(r.bottom/2); mypoint:=maketext(first,2,0,r.right,middle-2); addarrayslot(garray, mypoint); mypoint:=makeline(2,middle,r.right-2,middle); addarrayslot(garray, mypoint); mypoint:=maketext(second,2,middle,r.right,r.bottom-2); addarrayslot(garray, mypoint); return [garray,r]; end, }, pi: {viewjustify: vjSiblingRightH + vjParentCenterV, viewbounds: {left:0,right:20,top:0,bottom:20}, example : "pi", image:func(r,context,style) begin local garray:=[]; local mypoint:=nil; // calculate the images size r.bottom:=style.font.size+8; r.right:=strfontwidth(context,style.font)+1; local replace:=clone(Context); strreplace(context,"pi","",nil); mypoint:=maketext(context,0,4,r.right,r.bottom-4); addarrayslot(garray, mypoint); return [garray,r]; end, }, text: {viewjustify: vjSiblingRightH + vjParentCenterV, viewbounds: {left:0,right:20,top:0,bottom:20}, example : "text", image:func(r,context,style) begin local garray:=[]; local mypoint:=nil; // calculate the images size r.bottom:=style.font.size+8; r.right:=strfontwidth(context,style.font)+2; mypoint:=maketext(context,0,4,r.right,r.bottom-4); addarrayslot(garray, mypoint); return [garray,r]; end, }, |!|: {viewjustify: vjSiblingRightH + vjParentFullV, viewbounds: {left:0,right:10,top:0,bottom:0}, example: "!", image:func(r,context,style) begin local garray:=[]; local mypoint:=[]; middle:=rinttol(r.right/2); mypoint:=makeline(middle,0,middle,r.bottom); addarrayslot(garray,mypoint); return [garray,r]; end; }, } )   Hfunc(context,function) begin // no nesting! params:=clone(context); nc:=strreplace(params,function,"",nil); if nc>1 then self:notify(knotifyqalert,kappname,"Nesting of secondary symbols is not permitted." && " You may only nest primary symbols such as text, or superscripts, or subscripts, etc."); local annotate:=substr(params,1,strlen(params)-2); b:=strtokenize(annotate,$,); local da:=[]; local data:=call b with (); while data do begin addarrayslot(da, data); data:=call b with (); end; local garray:=[]; foreach ts in da do begin local sym:=nil; foreach index, element in drawframe do if strpos(ts,sprintobject(index),0)<>nil then begin sym:=index; break; end; if sym=nil then sym:='text; local newimage:=drawframe.(sym):image({top:0,bottom:0,right:0,left:0},ts,mystyle); addarrayslot(garray,newimage); end; return garray; end 8   nil )clView myapp