void emMainPanel::Notice(NoticeFlags flags) { if (flags&NF_LAYOUT_CHANGED) { UpdateCoordinates(); } emPanel::Notice(flags); }
/** * @brief Actions that are performed when the mouse button is clicked * * Actions that are performed when the mouse button is clicked. Updates the * coordinates of the clicked point and sends them to the GPU * * @param event The QMouseEvent object created by the GUI on the click */ void ClickTool::MouseClick(QMouseEvent *event) { mousePressed = true; mouseMoved = false; visible = true; xPixel = oldX = event->x(); yPixel = oldY = event->y(); UpdateCoordinates(); if (glLoaded) UpdateGL(); emit Instructions(QString("Release to select Element, move to pan")); }
void emMainPanel::DoubleClickSlider() { if (UnifiedSliderPos<0.01) { if (MainConfig->ControlViewSize<0.01) { MainConfig->ControlViewSize=0.7; MainConfig->Save(); } UnifiedSliderPos=MainConfig->ControlViewSize; } else { UnifiedSliderPos=0.0; } UpdateCoordinates(); UpdateSliderHiding(false); }
void emMainPanel::UpdateFullscreen() { if (!GetWindow()) return; if (GetWindow()->GetWindowFlags()&emWindow::WF_FULLSCREEN) { if (!FullscreenOn) { FullscreenOn=true; if (MainConfig->AutoHideControlView) { UnifiedSliderPos=0.0; UpdateCoordinates(); UpdateSliderHiding(false); } } } else { if (FullscreenOn) { FullscreenOn=false; if (MainConfig->AutoHideControlView) { UnifiedSliderPos=MainConfig->ControlViewSize; UpdateCoordinates(); UpdateSliderHiding(false); } } } }
void emMainPanel::DragSlider(double deltaY) { double y,n; y=SliderY+deltaY; if (y<=SliderMinY) y=SliderMinY; else if (y>SliderMaxY) y=SliderMaxY; n=(y-SliderMinY)/(SliderMaxY-SliderMinY); if (UnifiedSliderPos!=n) { UnifiedSliderPos=n; UpdateCoordinates(); UpdateSliderHiding(false); MainConfig->ControlViewSize=UnifiedSliderPos; MainConfig->Save(); } }
emMainPanel::emMainPanel( ParentArg parent, const emString & name, double controlTallness ) : emPanel(parent, name), SliderTimer(GetScheduler()) { MainConfig=emMainConfig::Acquire(GetRootContext()); ControlEdgesColor=emTkLook().GetBgColor(); ControlEdgesImage=emGetInsResImage(GetRootContext(),"emMain","ControlEdges.tga"); ControlViewPanel=new emSubViewPanel(this,"control view"); ContentViewPanel=new emSubViewPanel(this,"content view"); Slider=new SliderPanel(*this,"slider"); GetControlView().SetViewFlags( emView::VF_POPUP_ZOOM | emView::VF_ROOT_SAME_TALLNESS | emView::VF_NO_ACTIVE_HIGHLIGHT ); GetControlView().SetBackgroundColor(emTkLook().GetBgColor()); GetContentView().SetViewFlags( emView::VF_ROOT_SAME_TALLNESS ); ControlTallness=controlTallness; UnifiedSliderPos=MainConfig->ControlViewSize; FullscreenOn=false; OldMouseX=0.0; OldMouseY=0.0; ContentViewPanel->ActivateLater(); AddWakeUpSignal(GetControlView().GetEOISignal()); AddWakeUpSignal(SliderTimer.GetSignal()); if (GetWindow()) AddWakeUpSignal(GetWindow()->GetWindowFlagsSignal()); UpdateCoordinates(); UpdateFullscreen(); UpdateSliderHiding(false); }