I have an MFC application in which I have instantiated a 2D slider widget. Everything works out fine <br>till I resize the window. The slider does not adjust the position in a proportionate manner. If I then<br>click any mouse button down inside the window, it then adjusts its position properly. It seems that<br>
the mouse button event does the right thing.<br><br>I would like to put some appropriate code within the RESIZE command handler to that the slider<br>size and position adjust properly when the window is resized.<br><br>My code snippet is below.<br>
<br>Any help would be greatly appreciated as I have trolled the user groups and spent quite some<br>time trying to figure this out.<br><br>Imran<br><br>***************************************************************************************************<br>
<br> sliderRep = vtkSliderRepresentation2D::New();<br> <br> sliderRep->SetRenderer(this->Renderer);<br><br> sliderRep->GetPoint1Coordinate()->SetCoordinateSystemToNormalizedViewport();<br> sliderRep->GetPoint1Coordinate()->SetValue(0.26,0.012); <br>
sliderRep->GetPoint2Coordinate()->SetCoordinateSystemToNormalizedViewport();<br> sliderRep->GetPoint2Coordinate()->SetValue(0.95,0.012); <br><br> sliderRep->SetSliderLength(0.015); <br> sliderRep->SetSliderWidth(0.02); <br>
sliderRep->SetEndCapLength(0.005);;<br> sliderRep->SetEndCapWidth(0.02); <br> sliderRep->SetTubeWidth(0.005);<br> sliderRep->SetMinimumValue(minFrameNumber);<br> sliderRep->SetMaximumValue(maxFrameNumber);<br>
sliderRep->SetValue(uFrameNumber);<br> sliderRep->GetSliderProperty()->SetColor(1,1,0);//yellow<br> <br> sliderRep->BuildRepresentation();<br><br> sliderWidget = vtkSliderWidget::New();<br> sliderWidget->SetInteractor(Interactor);<br>
sliderWidget->SetRepresentation(sliderRep);<br> sliderWidget->SetAnimationModeToAnimate();<br><br> vtkSlider2DCallback *callback = vtkSlider2DCallback::New();<br> callback->View = this;<br> sliderWidget->AddObserver(vtkCommand::InteractionEvent,callback);<br>
sliderWidget->EnabledOn();<br><br>