النتائج 1 إلى 2 من 2
- 14-04-2012, 03:11 AM #1
ممكن مساعدة فى هذا الاكسبرت لجعل كل زر يقوم بعملية محددة
السلام عليكم
عندى هذا الاكسبرت
http://www.mediafire.com/?aaj0h2t10enx8io
أريد كل button يعمل و ظيفته
ولكن لا استطيع ان اظبط الاحداثيات
المفتاح فى هذا الكود
////////////....................//////////
//logic of x1 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<540 && XY[1]<29) ///adddddddd
{
click=0;
continue;
}
//logic of x3 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<400 && XY[1]<29) ///aass
{
click=11;
continue;
}
//logic of x5 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<100 && XY[1]<29) ///adddddddd
{
click=14;
continue;
}
//logic of x7 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<100 && XY[1]<29) ///adddddddd
{
click=17;
continue;
}
//logic of x9 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<100 && XY[1]<29) ///adddddddd
{
click=20;
continue;
}
//logic of x11 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<100 && XY[1]<29) ///adddddddd
{
click=23;
continue;
}
//logic of x13 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<100 && XY[1]<29) ///adddddddd
{
click=26;
continue;
}
//logic of x15 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<100 && XY[1]<29) ///adddddddd
{
click=29;
continue;
}
//////////////...................///////////
//////////////////////////////////////////////////////
bool OnClick(int& XY[2], int& WindowSize[2])
{int pci[5];
int lpRect[4];
static bool clicked;
static int prevcursor;
bool result=false;
int click = GetAsyncKeyState(1);
if(GetTopWindow(parent2)!=parent1) return(false);
if(GetForegroundWindow() != parent3) return(false);
pci[0]=20;
if(GetCursorInfo(pci))
{if(GetWindowRect(WindowHandle(Symbol(),Period()), lpRect))
{if(!clicked && prevcursor==cursor && click<0 && pci[3]>lpRect[0]+5 && pci[3]<lpRect[2]-42 && pci[4]>lpRect[1]+5 && pci[4]<lpRect[3]-21)
{clicked = true;
result = true;
XY[0] = pci[3]-(lpRect[0]+5);
XY[1] = pci[4]-(lpRect[1]+5); }
WindowSize[0] = (lpRect[2]-42) - (lpRect[0]+5);
WindowSize[1] = (lpRect[3]-21) - (lpRect[1]+5); }
if(click==0) clicked = false;
prevcursor = pci[2]; }
return(result); }
bool XY2PriceBar(int XY[],int Size[], double& PriceTime[])
{int PXperBar = (Size[0]/WindowBarsPerChart()/2)*2;
if(PXperBar<1) PXperBar=1;
int Clicked_Bar = WindowFirstVisibleBar() - NormalizeDouble((XY[0]-0.0)/PXperBar,0);
double PXperPoint = Size[1]/((WindowPriceMax()-WindowPriceMin())/Point);
double Clicked_Price = NormalizeDouble(WindowPriceMax() - XY[1]/PXperPoint*Point ,Digits);
if(Clicked_Bar<0) Clicked_Bar=0;
PriceTime[0] = Clicked_Price;
PriceTime[1] = Clicked_Bar;
if(PriceTime[0]>Point && PriceTime[1]>EMPTY) return(true);
else return(false);}
/////////////////////////////////////////////////////////
ولكن لا أعلم
what is xy and what is WindowSize
ممكن مساعدة عن طريق التعديل او كيفية التعديل عن طريق معرفة المتغيرات التالية
xy[0]
xy[1]
WindowSize [0]
شكرا مقدما
- 14-04-2012, 06:05 AM #2
task completed thanks all
//logic of x1 button
if(WindowSize[0]-XY[0]>500 && WindowSize[0]-XY[0]<540 && XY[1]<29) ///adddddddd
{
click=0;
continue;
}
//logic of x3 button
if(WindowSize[0]-XY[0]>450 && WindowSize[0]-XY[0]<490 && XY[1]<29) ///aass
{
click=11;
continue;
}
//logic of x5 button
if(WindowSize[0]-XY[0]>400 && WindowSize[0]-XY[0]<440 && XY[1]<29) ///adddddddd
{
click=14;
continue;
}
//logic of x7 button
if(WindowSize[0]-XY[0]>350 && WindowSize[0]-XY[0]<390 && XY[1]<29) ///adddddddd
{
click=17;
continue;
}
//logic of x9 button
if(WindowSize[0]-XY[0]>300 && WindowSize[0]-XY[0]<340 && XY[1]<29) ///adddddddd
{
click=20;
continue;
}
//logic of x11 button
if(WindowSize[0]-XY[0]>225 && WindowSize[0]-XY[0]<285 && XY[1]<29) ///adddddddd
{
click=23;
continue;
}
//logic of x13 button
if(WindowSize[0]-XY[0]>150 && WindowSize[0]-XY[0]<210 && XY[1]<29) ///adddddddd
{
click=26;
continue;
}
//logic of x15 button
if(WindowSize[0]-XY[0]>75 && WindowSize[0]-XY[0]<135 && XY[1]<29) ///adddddddd
{
click=29;
continue;
}
//