void toolbar_button::layout_items_completed() { push_button::layout_items_completed(); if (capturing()) { point pt = label().position(); pt += point{ 1.0, 0.0 }; label().move(pt); } }
void Win3D::render() { if (mCapture) { capturing(); glutSwapBuffers(); screenshot(); return; } glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(mPersp, static_cast<double>(mWinWidth)/static_cast<double>(mWinHeight), 0.1, 10.0); gluLookAt(mEye[0], mEye[1], mEye[2], 0.0, 0.0, -1.0, mUp[0], mUp[1], mUp[2]); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); initGL(); mTrackBall.applyGLRotation(); glEnable(GL_DEPTH_TEST); glDisable(GL_TEXTURE_2D); glDisable(GL_LIGHTING); glLineWidth(2.0); if (mRotate || mTranslate || mZooming) { glColor3f(1.0f, 0.0f, 0.0f); glBegin(GL_LINES); glVertex3f(-0.1f, 0.0f, -0.0f); glVertex3f(0.15f, 0.0f, -0.0f); glEnd(); glColor3f(0.0f, 1.0f, 0.0f); glBegin(GL_LINES); glVertex3f(0.0f, -0.1f, 0.0f); glVertex3f(0.0f, 0.15f, 0.0f); glEnd(); glColor3f(0.0f, 0.0f, 1.0f); glBegin(GL_LINES); glVertex3f(0.0f, 0.0f, -0.1f); glVertex3f(0.0f, 0.0f, 0.15f); glEnd(); } glScalef(mZoom, mZoom, mZoom); glTranslatef(mTrans[0]*0.001, mTrans[1]*0.001, mTrans[2]*0.001); initLights(); draw(); if (mRotate) mTrackBall.draw(mWinWidth, mWinHeight); glutSwapBuffers(); }
void button::mouse_button_released(mouse_button aButton, const point& aPosition) { bool wasCapturing = capturing(); widget::mouse_button_released(aButton, aPosition); if (wasCapturing && client_rect().contains(aPosition)) { if (aButton == mouse_button::Left) { destroyed_flag destroyed(*this); handle_clicked(); if (!destroyed) released.trigger(); } } }