ユニットユニット1;
インタフェース
用途
窓、メッセージ、sysutils、バリアント、クラス、グラフィック、コントロール、フォーム、
ダイアログ、extctrls、stdctrls、jpeg;
const lmousedown = false;
タイプ
tform1 = class(tform)
編集1:tedit;
パネル2:Tpanel;
パネル:Tpanel;
パネル3:Tpanel;
パネル4:Tpanel;
パネル5:Tpanel;
パネル6:Tpanel;
パネル7:Tpanel;
パネル8:Tpanel;
パネル11:Tpanel;
パネル22:Tpanel;
パネル33:Tpanel;
パネル44:Tpanel;
パネル55:Tpanel;
パネル66:Tpanel;
パネル77:Tpanel;
パネル88:Tpanel;
Button1:Tbutton;
手順edit1mousemove(sender:tobject; shift:tshiftstate; x、
Y:整数);
手順edit1Mousedown(sender:tobject; button:tmousebutton;
シフト:tshiftState; x、y:整数);
手順edit1mouseup(sender:tobject; button:tmousebutton;
シフト:tshiftState; x、y:整数);
手順FormMousedown(送信者:tobject; button:tmousebutton;
シフト:tshiftState; x、y:整数);
手順Button11Mousedown(送信者:tobject; button:tmousebutton;
シフト:tshiftState; x、y:整数);
手順button1mousemove(sender:tobject; shift:tshiftstate; x、
Y:整数);
手順button1mouseup(sender:tobject; button:tmousebutton;
シフト:tshiftState; x、y:整数);
プライベート
{プライベート宣言}
公共
{公開宣言}
終わり;
var
form1:tform1;
S、A:boolean;
実装
{$ r *.dfm}
手順ManipulateControl(Control:TControl; Shift:TshiftState; X、Y、Precision:Integer);
var sc_manipulate:word;
始める
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
//光标在控件的最左侧************************************* ***************
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
if(x <= precision)および(y> precision)および(y <control.height-precision)
次に、始めます
sc_manipulate:= $ f001;
control.cursor:= crsizewe;
終わり
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
//光标在控件的最右侧************************************* ***************
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
else if(x> = control.width-precision)および(y> precision)および(y <control.height-precision)
次に、始めます
sc_manipulate:= $ f002;
control.cursor:= crsizewe;
終わり
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
//光标在控件的最上侧********************************** **************
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
else if(x> precision)および(x <control.width-precision)および(y <= precision)
次に、始めます
sc_manipulate:= $ f003;
control.cursor:= crsizens;
終わり
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
//光标在控件的左上角********************************** **************
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
else if(x <=精度)および(y <=精度)
次に、始めます
sc_manipulate:= $ f004;
control.cursor:= crsizenwse;
終わり
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
//光标在控件的右上角********************************** **************
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
else if(x> = control.width-precision)および(y <= precision)
次に、始めます
sc_manipulate:= $ f005;
control.cursor:= crsizenesw;
終わり
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
//光标在控件的最下侧************************************* ***************
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
else if(x> precision)および(x <control.width-precision)および(y> = control.height-precision)
次に、始めます
sc_manipulate:= $ f006;
control.cursor:= crsizens;
終わり
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
//光标在控件的左下角********************************** **************
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
else if(x <= precision)および(y> = control.height-precision)
次に、始めます
sc_manipulate:= $ f007;
control.cursor:= crsizenesw;
終わり
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
//光标在控件的右下角********************************** **************
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
else if(x> = control.width-precision)および(y> = control.height-precision)
次に、始めます
sc_manipulate:= $ f008;
control.cursor:= crsizenwse;
終わり
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
// 光标在控件的客户区(移动整个控件) ******************************* *****
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
else if(x> 5)および(y> 5)および(x <control.width-5)および(y <control.height-5)
次に、始めます
sc_manipulate:= $ f009;
control.cursor:= crsizeall;
終わり
それ以外の場合は始まります
sc_manipulate:= $ f000;
control.cursor:= crdefault;
終わり;
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
Shift = [SSLEFT]の場合
始める
解放された。
control.perform(wm_syscommand、sc_manipulate、0);
終わり;
終わり;
手順tform1.edit1mousemove(sender:tobject; shift:tshiftstate; x、
Y:整数);
始める
manipulatecontrol((tcontrolとしての送信者)、shift、x、y、9);
edit1.hint:= 'edit1:tedit'+chr(13)+'origin:'+inttostr(edit1.top)+'、'
+inttostr(edit1.left)+';'+'size:'+inttostr(edit1.width)+inttostr(edit1.height)+chr(13)+'tab stop:ture; order:0';
s = trueの場合
始める
a:= false;
panel1.visible:= true; panel2.visible:= true; panel3.visible:= true;
panel4.visible:= true; panel5.visible:= true;
panel6.visible:= true; panel7.visible:= true; panel8.visible:= true;
panel1.top:= edit1.top-6;
パネル1.Left:= edit1.Left-6;
panel2.top:= edit1.top+(edit1.height div 2)-3;
パネル2.Left:= edit1.Left-6;
panel3.top:=edit1.top+edit1.height;
panel3.left:= edit1.left-6;
panel4.top:= edit1.top-6;
パネル4.Left:= edit1.Left+(edit1.width div 2);
panel5.top:= edit1.top+edit1.height;
panel5.left:= edit1.left+(edit1.width div 2);
panel6.top:= edit1.top-6;
パネル6.Left:= edit1.Left+edit1.width;
panel7.top:= edit1.top+(edit1.height div 2)-3;
パネル7.Left:= edit1.Left+edit1.width;
panel8.top:= edit1.top+edit1.height;
パネル8.Left:= edit1.Left+edit1.width;
終わり;
終わり;
手順tform1.edit1mousedown(sender:tobject; button:tmousebutton;
シフト:tshiftState; x、y:整数);
始める
panel11.visible:= false; panel22.visible:= false; panel33.visible:= false;
panel44.visible:= false; panel55.visible:= false;
panel66.visible:= false; panel77.visible:= false; panel88.visible:= false;
s:= true;
a:= false;
panel1.visible:= true; panel2.visible:= true; panel3.visible:= true;
panel4.visible:= true; panel5.visible:= true;
panel6.visible:= true; panel7.visible:= true; panel8.visible:= true;
panel1.top:= edit1.top-6;
パネル1.Left:= edit1.Left-6;
panel2.top:= edit1.top+(edit1.height div 2)-3;
パネル2.Left:= edit1.Left-6;
panel3.top:=edit1.top+edit1.height;
panel3.left:= edit1.left-6;
panel4.top:= edit1.top-6;
パネル4.Left:= edit1.Left+(edit1.width div 2);
panel5.top:= edit1.top+edit1.height;
panel5.left:= edit1.left+(edit1.width div 2);
panel6.top:= edit1.top-6;
パネル6.Left:= edit1.Left+edit1.width;
panel7.top:= edit1.top+(edit1.height div 2)-3;
パネル7.Left:= edit1.Left+edit1.width;
panel8.top:= edit1.top+edit1.height;
パネル8.Left:= edit1.Left+edit1.width;
終わり;
手順tform1.edit1mouseup(sender:tobject; button:tmousebutton;
シフト:tshiftState; x、y:整数);
始める
s = trueの場合
始める
a:= false;
s:= false;
panel1.visible:= true; panel2.visible:= true; panel3.visible:= true;
panel4.visible:= true; panel5.visible:= true;
panel6.visible:= true; panel7.visible:= true; panel8.visible:= true;
panel1.top:= edit1.top-6;
パネル1.Left:= edit1.Left-6;
panel2.top:= edit1.top+(edit1.height div 2)-3;
パネル2.Left:= edit1.Left-6;
panel3.top:=edit1.top+edit1.height;
panel3.left:= edit1.left-6;
panel4.top:= edit1.top-6;
パネル4.Left:= edit1.Left+(edit1.width div 2);
panel5.top:= edit1.top+edit1.height;
panel5.left:= edit1.left+(edit1.width div 2);
panel6.top:= edit1.top-6;
パネル6.Left:= edit1.Left+edit1.width;
panel7.top:= edit1.top+(edit1.height div 2)-3;
パネル7.Left:= edit1.Left+edit1.width;
panel8.top:= edit1.top+edit1.height;
パネル8.Left:= edit1.Left+edit1.width;
終わり;
終わり;
手順tform1.formmousedown(sender:tobject; button:tmousebutton;
シフト:tshiftState; x、y:整数);
始める
a:= false;
s:= false;
panel1.visible:= false; panel2.visible:= false; panel3.visible:= false;
panel4.visible:= false; panel5.visible:= false;
panel6.visible:= false; panel7.visible:= false; panel8.visible:= false;
// **********
panel11.visible:= false; panel22.visible:= false; panel33.visible:= false;
panel44.visible:= false; panel55.visible:= false;
panel66.visible:= false; panel77.visible:= false; panel88.visible:= false;
終わり;
手順tform1.button1mouseup(sender:tobject; button:tmousebutton; shift:tshiftstate; x、y:integer);
a = trueの場合は開始します
始める
a:= false;
s:= false;
panel1.visible:= false; panel2.visible:= false; panel3.visible:= false;
panel4.visible:= false; panel5.visible:= false;
panel6.visible:= false; panel7.visible:= false; panel8.visible:= false;
panel11.visible:= true;
panel22.visible:= true;
panel33.visible:= true;
panel44.visible:= true;
panel55.visible:= true;
panel66.visible:= true;
panel77.visible:= true;
panel88.visible:= true;
panel11.top:=button1.top-6;
パネル11.左:= button1.left-6;
panel22.top:=button1.top+(button1.height div 2)-3;
Panel22.Left:= button1.left-6;
panel33.top:=button1.top+button1.height;
panel33.left:= button1.left-6;
panel44.top:=button1.top-6;
Panel44.Left:= button1.Left+(button1.width div 2);
panel55.top:=button1.top+button1.height;
panel55.left:= button1.left+(button1.width div 2);
panel66.top:=button1.top-6;
panel66.left:= button1.left+button1.width;
panel77.top:=button1.top+(button1.height div 2)-3;
PANER77.LEFT:= BUTTON1.LEFT+BUTTON1.WIDTH;
panel88.top:=button1.top+button1.height;
PANER88.LEFT:= BUTTON1.LEFT+BUTTON1.WIDTH;
終わり;
終わり;
手順tform1.button1mousedown(sender:tobject; button:tmousebutton;
シフト:tshiftState; x、y:整数);
始める
a:= true;
s:= false;
panel1.visible:= false; panel2.visible:= false; panel3.visible:= false;
panel4.visible:= false; panel5.visible:= false;
panel6.visible:= false; panel7.visible:= false; panel8.visible:= false;
panel11.visible:= true; panel22.visible:= true; panel33.visible:= true;
panel44.visible:= true; panel55.visible:= true;
panel66.visible:= true; panel77.visible:= true; panel88.visible:= true;
panel11.top:=button1.top-6;
パネル11.左:= button1.left-6;
panel22.top:=button1.top+(button1.height div 2)-3;
Panel22.Left:= button1.left-6;
panel33.top:=button1.top+button1.height;
panel33.left:= button1.left-6;
panel44.top:=button1.top-6;
Panel44.Left:= button1.Left+(button1.width div 2);
panel55.top:=button1.top+button1.height;
panel55.left:= button1.left+(button1.width div 2);
panel66.top:=button1.top-6;
panel66.left:= button1.left+button1.width;
panel77.top:=button1.top+(button1.height div 2)-3;
PANER77.LEFT:= BUTTON1.LEFT+BUTTON1.WIDTH;
panel88.top:=button1.top+button1.height;
PANER88.LEFT:= BUTTON1.LEFT+BUTTON1.WIDTH;
終わり;
手順tform1.button1mousemove(sender:tobject; shift:tshiftstate; x、
Y:整数);
始める
manipulatecontrol((tcontrolとしての送信者)、shift、x、y、9);
edit1.hint:= 'button1:tbutton'+chr(13)+'origin:'+inttostr(button1.top)+'、'
+inttostr(button1.left)+';'+'size:'+inttostr(button1.width)+inttostr(button1.height)+chr(13)+'tab stop:ture; order:0';
a = trueの場合
始める
s:= false;
panel1.visible:= false; panel2.visible:= false; panel3.visible:= false;
panel4.visible:= false; panel5.visible:= false;
panel6.visible:= false; panel7.visible:= false; panel8.visible:= false;
panel11.visible:= true; panel22.visible:= true; panel33.visible:= true;
panel44.visible:= true; panel55.visible:= true;
panel66.visible:= true; panel77.visible:= true; panel88.visible:= true;
panel11.top:=button1.top-6;
パネル11.左:= button1.left-6;
panel22.top:=button1.top+(button1.height div 2)-3;
Panel22.Left:= button1.left-6;
panel33.top:=button1.top+button1.height;
panel33.left:= button1.left-6;
panel44.top:=button1.top-6;
Panel44.Left:= button1.Left+(button1.width div 2);
panel55.top:=button1.top+button1.height;
panel55.left:= button1.left+(button1.width div 2);
panel66.top:=button1.top-6;
panel66.left:= button1.left+button1.width;
panel77.top:=button1.top+(button1.height div 2)-3;
PANER77.LEFT:= BUTTON1.LEFT+BUTTON1.WIDTH;
panel88.top:=button1.top+button1.height;
PANER88.LEFT:= BUTTON1.LEFT+BUTTON1.WIDTH;
終わり;
終わり;
終わり。