Handling the unzoom

Hello,
I’m developing a standalone application compiled with gcc.
I need to handle the UnZoom method because in the same pad I have a lot of TGraph and when I made the UnZoom() in one TGraph with the mouse I would like to call the UnZoom for all the TGraph via code.
How is possible to do this?
Thank you very much
Best regards
Andrea Bulgarelli

To Unzoom , call TAxis::UnZoom for the object used to compute the pad range,
then call gPad->Modified(); gPad->Update();
All other objects in the pad will be automatically redrawn.

Rene

Ok, but the first call to the unzoom method is performed by user using the contextual menu and the mouse. How is possible to intercept the Unzoom selected with the mouse from the contextual menu of the TAxis?

Thank you very much
Andrea Bulgarelli

Hi Andrea,

The method UnZoom() concerns the selected axis and it will reset the axis range redrawing all graphs in the pad. If you call this method via the program one more time it will not change anything, i.e. it will have no effect for the same pad.

If you have several pads in the canvas you might want to call UnZoom method for everyone, but it is not clear from your message is this what you want.

Thank you, Ilka

When Zoom is called the software creates two lables with informations about the new data range. After that UnZoom is called by the mouse via a contextual menu on TAxis: how can I intercept this event to redraw the labels?

Thank you
Andrea&Alessio

Hi Andrea & Alessio,

What I understand is that you want to keep the two labels created by the Zoom method after the UnZoom is called. Is it correct?

If you provide as short as possible example (macro) it will save our time to gess what do you need.

Thank you, Ilka

Hello,
I have added a simple example. Run the script, push the Add button and try the make the zoom with the mouse on x axis. The two label that display the min and max value showed into the x axis change.
But if I make the unzoom with the right buttom of the mouse above the x axis the two label don’t change.
How is possible to intercept the unzoom call performed via contextual menu?
Thank you
Andrea
unzoom.c (4.63 KB)

Hi Andrea,

What you get after running your macro is corect acording to the code. There is no emitted signal ProcessedEvent(Int_t, Int_t, Int_t,TObject *) while calling UnZoom - that means no call of your method drawStatusBar(Int_t, Int_t, Int_t,TObject *). You need to find another way to update your labels in this case (a possible hint: check the TAxis fFirst and fLast data members if both are 0, because after UnZoom they are set to 0).

Best regards, Ilka