这是我用来获取鼠标单击位置的功能:
Call BindComboBox(ComboBox1,"select stage from sample where stage like '%" + ComboBox1.Text + "%'","stage","stage")
Call BindComboBox(cboCompanies,"SELECT CompanyID,CompanyName,FROM Companies","CompanyID","CompanyName")
完整代码:
void Window::mouseButtonCallback(GLFWwindow * WindowObject,int button,int action,int mods)
{
double xpos,ypos;
if (button == GLFW_MOUSE_BUTTON_RIGHT && action == GLFW_PRESS)
{
glfwgetcursorPos(WindowObject,&xpos,&ypos);
cout << " XPOS : " << xpos << endl;
cout << " YPOS : " << ypos << endl;
}
if (button == GLFW_MOUSE_BUTTON_RIGHT && action == GLFW_RELEASE)
{
cout << "Mouse Button Released" << endl;
}
}
glfwSetMouseButtonCallback(this->WindowObject,mouseButtonCallback);