單位1;
介面
用途
Windows,Messages,Sysutils,變體,類,圖形,控件,表單,表單,
對話框,Extctrls,stdctrls,jpeg;
const lmousedown = false;
類型
tform1 = class(tform)
edit1:tedit;
面板2:tpanel;
面板1: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;
Button 1:Tbutton;
過程edit1mousemove(發送者:tobject; shift:tshiftstate; x,
Y:整數);
過程Edit1Mousedown(發件人:tobject;按鈕:tmousebutton;
Shift:tshiftstate; X,Y:整數);
過程Edit1Mouseup(發送者:TOBJECT;按鈕:TmouseButton;
Shift:tshiftstate; X,Y:整數);
過程formmousedown(發件人:tobject;按鈕:tmousebutton;
Shift:tshiftstate; X,Y:整數);
過程按鈕1MOUSEDOWN(發件人:tobject;按鈕:tmousebutton;
Shift:tshiftstate; X,Y:整數);
過程button1mousemove(發送者:tobject; shift:tshiftstate; x,
Y:整數);
過程button1mouseup(發件人:tobject;按鈕:tmousebutton;
Shift:tshiftstate; X,Y:整數);
私人的
{私人聲明}
民眾
{公開聲明}
結尾;
var
form1:tform1;
s,A:布爾值;
執行
{$ r *.dfm}
過程manipulatecontrol(控制: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;
結尾
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~
//光標在控件的最右側***************************************** ************************************************** *********************************** *************** **
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~
否則if(x> = control.width precision)和(y> precision)和(y <control.height-precision)
然後開始
sc_ manipulate:= $ f002;
control.cursor:= crsizewe;
結尾
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~
//光標在控件的最上側****************************************** ************************************************** ************************************************** ************ **************
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~
否則(x> precision)和(x <control.width-precision)和(y <= precision)
然後開始
sc_ manipulate:= $ f003;
Control.Cursor:= crsizens;
結尾
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~
//光標在控件的左上角****************************************** ************************************************** ************************************************** ************ **************
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~
否則if(x <= precision)和(y <= precision)
然後開始
sc_ manipulate:= $ f004;
Control.Cursor:= crsizenwse;
結尾
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~
//光標在控件的右上角****************************************** ************************************************** ************************************************** ************ **************
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~
否則if(x> = control.width precision)和(y <= precision)
然後開始
sc_ manipulate:= $ f005;
Control.Cursor:= crsizenesw;
結尾
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~
//光標在控件的最下側***************************************** ************************************************** *********************************** *************** **
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~
否則(x> precision)和(x <control.width precision)和(y> = control.height-precision)
然後開始
sc_ manipulate:= $ f006;
Control.Cursor:= crsizens;
結尾
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~
//光標在控件的左下角****************************************** ************************************************** ************************************************** ************ **************
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~
否則if(x <= precision)和(y> = control.height-precision)
然後開始
sc_ manipulate:= $ f007;
Control.Cursor:= crsizenesw;
結尾
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~
//光標在控件的右下角****************************************** ************************************************** ************************************************** ************ **************
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~
否則if(x> = control.width precision)和(y> = control.height-precision)
然後開始
sc_ manipulate:= $ f008;
Control.Cursor:= crsizenwse;
結尾
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~
// 光標在控件的客戶區(移動整個控件)************************************* ************** *****
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~
否則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(發件人:tobject; shift:tshiftstate; x,
Y:整數);
開始
manipulatecontrol(((發送者為tcontrol),Shift,x,y,9);
edit1.hint:='edit1:tedit'+chr(13)+'rount:'+inttostr(edit1.top)+',','
+inttoStr(edit1.left)+';'+'size:'+inttoStr(edit1.width)+inttoStr(edit1.height)+chr(13)+'tab stop:ture; ture; order; order; order; order; 0';
如果s = true
開始
答:= false;
面板1.可見:= true;面板2.可視:= true;面板3.可見:= true;
面板4.可視:= true;面板5.可視:= true;
面板6.可見:= true;面板7.可見:= true;面板8.可視:= true;
面板1.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+editit1.height;
面板3. left:= edit1.left-6;
panel4.top:= edit1.top-6;
面板4.left:= edit1.left+(edit1.width div 2);
panel5.top:= edit1.top+editit1.height;
面板5.left:= edit1.left+(edit1.width div 2);
panel6.top:= edit1.top-6;
panel6.left:= edit1.left+edit1.width;
panel7.top:= edit1.top+(edit1.height div 2)-3;
panel7.left:= edit1.left+edit1.width;
panel8.top:= edit1.top+editit1.height;
面板8. left:= edit1.left+edit1.width;
結尾;
結尾;
過程tform1.edit1mousedown(發件人:tobject;按鈕:tmousebutton;
Shift:tshiftstate; X,Y:整數);
開始
面板11.可見:= false; panel22. Visible:= false; PANEL33.VISIBLE:= false;
面板44.可視:= false;面板55.可視:= false;
PANEL66.VISIBLE:= false;面板77.可見:= false;面板88.可見:= false;
S:= true;
答:= false;
面板1.可見:= true;面板2.可視:= true;面板3.可見:= true;
面板4.可視:= true;面板5.可視:= true;
面板6.可見:= true;面板7.可見:= true;面板8.可視:= true;
面板1.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+editit1.height;
面板3. left:= edit1.left-6;
panel4.top:= edit1.top-6;
面板4.left:= edit1.left+(edit1.width div 2);
panel5.top:= edit1.top+editit1.height;
面板5.left:= edit1.left+(edit1.width div 2);
panel6.top:= edit1.top-6;
panel6.left:= edit1.left+edit1.width;
panel7.top:= edit1.top+(edit1.height div 2)-3;
panel7.left:= edit1.left+edit1.width;
panel8.top:= edit1.top+editit1.height;
面板8. left:= edit1.left+edit1.width;
結尾;
過程tform1.edit1mouseup(發件人:tobject;按鈕:tmousebutton;
Shift:tshiftstate; X,Y:整數);
開始
如果s = true
開始
答:= false;
S:= false;
面板1.可見:= true;面板2.可視:= true;面板3.可見:= true;
面板4.可視:= true;面板5.可視:= true;
面板6.可見:= true;面板7.可見:= true;面板8.可視:= true;
面板1.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+editit1.height;
面板3. left:= edit1.left-6;
panel4.top:= edit1.top-6;
面板4.left:= edit1.left+(edit1.width div 2);
panel5.top:= edit1.top+editit1.height;
面板5.left:= edit1.left+(edit1.width div 2);
panel6.top:= edit1.top-6;
panel6.left:= edit1.left+edit1.width;
panel7.top:= edit1.top+(edit1.height div 2)-3;
panel7.left:= edit1.left+edit1.width;
panel8.top:= edit1.top+editit1.height;
面板8. left:= edit1.left+edit1.width;
結尾;
結尾;
過程tform1.formmousedown(發件人:tobject;按鈕:tmousebutton;
Shift:tshiftstate; X,Y:整數);
開始
答:= false;
S:= false;
面板1.可見:= false;面板2.可視:= false;面板3.可見:= false;
面板4.可視:= false;面板5.可視:= false;
面板6.可見:= false;面板7.可見:= false;面板8.可見:= false;
// **********
面板11.可見:= false; panel22. Visible:= false; PANEL33.VISIBLE:= false;
面板44.可視:= false;面板55.可視:= false;
PANEL66.VISIBLE:= false;面板77.可見:= false;面板88.可見:= false;
結尾;
過程tform1.button1mouseup(發件人:tobject;按鈕:tmousebutton; shift:tshiftstate; x,y:integer);
如果a = true開始,則開始
開始
答:= false;
S:= false;
面板1.可見:= false;面板2.可視:= false;面板3.可見:= false;
面板4.可視:= false;面板5.可視:= false;
面板6.可見:= false;面板7.可見:= false;面板8.可見:= false;
面板11.可見:= true;
panel22. Visible:= true;
PANEL33.VISIBLE:= true;
面板44.可視:= true;
面板55.可視:= true;
面板66.可見:= true;
面板77.可見:= true;
面板88.可見:= true;
panel11.top:= button1.top-6;
面板11. left:= button1.left-6;
panel22.top:= button1.top+(button1.height div 2)-3;
面板22. left:= button1.left-6;
panel33.top:= button1.top+button1.height;
面板33. left:= button1.left-6;
panel44.top:= button1.top-6;
面板44. left:= button1.left+(button1.Width div 2);
panel55.top:= button1.top+button1.height;
面板55. left:= button1.Left+(button1.Width div 2);
panel66.top:= button1.top-6;
面板66. left:= button1.Left+button1.width;
panel77.top:= button1.top+(button1.height div 2)-3;
面板77. left:= button1.Left+button1.width;
panel88.top:= button1.top+button1.height;
面板88. left:= button1.left+button1.width;
結尾;
結尾;
過程tform1.button1Mousedown(發件人:tobject;按鈕:tmousebutton;
Shift:tshiftstate; X,Y:整數);
開始
答:= true;
S:= false;
面板1.可見:= false;面板2.可視:= false;面板3.可見:= false;
面板4.可視:= false;面板5.可視:= false;
面板6.可見:= false;面板7.可見:= false;面板8.可見:= false;
面板11.可見:= true; panel22. Visible:= true; PANEL33.VISIBLE:= true;
面板44.可視:= true;面板55.可視:= true;
面板66.可見:= true;面板77.可見:= true;面板88.可見:= true;
panel11.top:= button1.top-6;
面板11. left:= button1.left-6;
panel22.top:= button1.top+(button1.height div 2)-3;
面板22. left:= button1.left-6;
panel33.top:= button1.top+button1.height;
面板33. left:= button1.left-6;
panel44.top:= button1.top-6;
面板44. left:= button1.left+(button1.Width div 2);
panel55.top:= button1.top+button1.height;
面板55. left:= button1.Left+(button1.Width div 2);
panel66.top:= button1.top-6;
面板66. left:= button1.Left+button1.width;
panel77.top:= button1.top+(button1.height div 2)-3;
面板77. left:= button1.Left+button1.width;
panel88.top:= button1.top+button1.height;
面板88. left:= button1.left+button1.width;
結尾;
過程tform1.button1mousemove(發件人:tobject; shift:tshiftstate; x,
Y:整數);
開始
manipulatecontrol(((發送者為tcontrol),Shift,x,y,9);
edit1.hint:='button1:tbutton'+chr(13)+'rount:'+inttoStr(button1.top)+',','
+inttoStr(button1.left)+';'+'size:'+inttoStr(button1.width)+inttoStr(button1.height)+chr(13)+'tab stop:ture; ture; order; order; order; order; 0';
如果a = true
開始
S:= false;
面板1.可見:= false;面板2.可視:= false;面板3.可見:= false;
面板4.可視:= false;面板5.可視:= false;
面板6.可見:= false;面板7.可見:= false;面板8.可見:= false;
面板11.可見:= true; panel22. Visible:= true; PANEL33.VISIBLE:= true;
面板44.可視:= true;面板55.可視:= true;
面板66.可見:= true;面板77.可見:= true;面板88.可見:= true;
panel11.top:= button1.top-6;
面板11. left:= button1.left-6;
panel22.top:= button1.top+(button1.height div 2)-3;
面板22. left:= button1.left-6;
panel33.top:= button1.top+button1.height;
面板33. left:= button1.left-6;
panel44.top:= button1.top-6;
面板44. left:= button1.left+(button1.Width div 2);
panel55.top:= button1.top+button1.height;
面板55. left:= button1.Left+(button1.Width div 2);
panel66.top:= button1.top-6;
面板66. left:= button1.Left+button1.width;
panel77.top:= button1.top+(button1.height div 2)-3;
面板77. left:= button1.Left+button1.width;
panel88.top:= button1.top+button1.height;
面板88. left:= button1.left+button1.width;
結尾;
結尾;
結尾。