;group box palmode=1 ;screenのモード(フルカラー=0,パレット=1) prgwid=640: prgheit=480 ;入力ボックス初期値 ;ウィンドウ表示 wid=448: heit=192: wx=(dispx-12-wid)/2: wy=(dispy-61-heit)/2 screen 0,wid,heit,palmode,wx,wy: gsel 0,1 ;画面を灰色でクリア if paluse|palmode { palette 245,191,191,191: palfade } color 191,191,191: boxf ;フォント設定 fontheit=16: font "MS ゴシック",fontheit ;group box 描画 x=16: y=16: w=320: h=68: txt="ウィンドウ初期サイズ": gosub *l_groupbox ;入力ボックス表示 color 0,0,0 pos 56,42: mes "横幅:": pos 106,36: input prgwid,50,28,4 pos 188,42: mes "縦幅:": pos 238,36: input prgheit,50,28,4 ;フォーカス設定 objsel 0 stop ;------------------------------------------------------------------------------ ;グループボックスを描く ; 「MS Pゴシック」等のプロポーショナルフォントは不可 ; システム・ウィンドウのいずれかがパレットモードなら次の1行を実行しておくこと ; palette 245,191,191,191: palfade ;入力:x,y,w(width),h(height),txt ; fontheit:フォントサイズ(フォントを設定しない場合は20にすること) ;出力:なし ;破壊:c,d,l,m,n,p,q ;------------------------------------------------------------------------------ *l_groupbox d=(fontheit+1)/2: f=fontheit\2 c=d-1: p=x+c: q=y+c: m=x+w-d: n=y+h-d color 127,127,127 line p,q,m,q: line p,n: line m,n: line m,q color 255,255,255 p++: q++: m++: n++ line p,q,m-2,q: line p,n-1: line m,n,p,n: line m,q-1 strlen l,txt color 191,191,191: boxf x+fontheit,q-1,(l+2-f)*d+x,q color 0,0,0: pos x+fontheit,y+1: mes txt return