\defineenumeration[Theorem]
[%text=Theorem ,
style=,
% title=yes,
prefix=yes,
prefixsegments=chapter,
way=bychapter,
number=yes,
before={\blank[big]},
after=\blank]
\defineenumeration[Definition]
[text=Definition,
style=,
% title=yes,
prefix=yes,
prefixsegments=chapter,
way=bychapter,
number=yes,
before={\blank[big]},
after=\blank]
\startuseMPgraphic{FunnyFrame}
picture p ; numeric o ; path a, b ; pair c ;
p := textext.rt(\MPstring{FunnyFrame}) ;
o := BodyFontSize ;
a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
p := p shifted (2o,OverlayHeight-ypart center p) ;
drawoptions (withpen pencircle scaled 1pt withcolor .625red) ;
b := a superellipsed .95 ;
%fill b withcolor .85white ;
draw b ;
b := (boundingbox p) superellipsed .95 ;
fill b withcolor .425green;%.85white ;
draw b ;
draw p withcolor black ;
setbounds currentpicture to a ;
\stopuseMPgraphic
\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
\defineframedtext[FunnyText][frame=off,background=FunnyFrame, offset=\bodyfontsize, width=\textwidth]%\overlaywidth]%
\def\StTheorem{\startFunnyText\startTheorem}
\def\SpTheorem {\stopTheorem\stopFunnyText }
\def\FrameTitle#1%
{\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut\ss\bf\white #1\hss}}}
\starttext
This is a test for Framed Theorem.
\StTheorem
This is a theorem in the Funny Frame.
\SpTheorem
I'd like to put \quote{Theorem \#1(Some Title)} in a small frame and the main text in the big frame.
\blank[big]
{\FrameTitle{Theorem 2(Title of Theorem)}
\StTheorem
I want to show the main text without \quote{Theorem 2} in this frame.
\SpTheorem
\stoptext
%%%%%%%%%%%%%%%%%%