Exemplo n.º 1
0
void
MouseMoveScrollCanvas::OnMouseMove(wxMouseEvent &event)
{
	wxPoint thisPos = event.GetPosition();
	mScrolledLastMove = false;
	if (ShouldScrollOnMouseEvent(event))
	{
		wxPoint changeInOffset = thisPos - mLastPos;
		ChangeOffset(changeInOffset);
		mScrolledLastMove = true;
	}
	mLastPos = thisPos;
}
void CtestDlg::OnBnClickedButton1()
{
	CString temp,Alph;
	text.GetWindowTextW(temp);
	int * l=new int[255];
	for(int i=0;i<255;i++)
		l[i]=0;
	for(int i=0;i<temp.GetLength();i++)
		l[temp[i]]++;
	int max=0;
	int cur=0;
	for(int i=0;i<255;i++)
	{
		if(max<l[i])
		{
			max=l[i];
			cur=i;
		}
	}
	alphabet.GetWindowTextW(Alph);
	int add=Alph.Find(' ')-Alph.Find(cur);
	ChangeOffset(add);
}
void CtestDlg::OnBnClickedButton2()
{
	ChangeOffset(-1);
}
Exemplo n.º 4
0
void
ScrollZoomCanvas::ResetScrollToOrigin()
{
	ChangeOffset(-mOffset);
}
Exemplo n.º 5
0
void
ScrollZoomCanvas::SetOffset(wxPoint newOffset)
{
	ChangeOffset(mOffset - newOffset);
}