Dear Farrukh
What you want to do is probably possible ( I will write a possible method later.).
However TPad has already several mouse operations (zoom, right-click menu, select active pad and so on); so I am not sure it is the best idea to add own mouse operation (which
could override other pre-implemented operations.)
I will write three solutions below.
I wrote an example of the first method.
== Method 1 : Menu ==
For this solutions, I modified an example in the ROME package.
The update is done only in the 'develop' branch.
You can read the example by 'git checkout develop' command after you clone the ROME package.
The example is in $ROMESYS/examples/argus/menu and the third tab (T3) is one for that.
In ROME, you can easily add menu items in the menu bar. In the example, menu items to open and save a specific tab are prepared.
== Method 2 : dedicated buttons ==
If you prefer buttons instead of menu, you can put dedicated buttons to trigger "OpenPad" function in the example instead of adding menus. The buttons can be implemented
either of the following two methods,
1) TGTextButton, which can work as the same way as your Save button
2) Writing own class derived from TBox or TMarker. A box or maker can be put on each canvas.
I hope the first method is obvious for you. You can make another button similar to your Save button and call "OpenPad" function.
The second method is a little more complicated; you make your own class and override "ExecuteEvent" method.
In the overriding function, you can call any functions when the box or marker is single-clicked, double-clicked, mouse-over and so on.
A disadvantage is that the box or marker is always visible, and will be drawn in the output PDF files too.
== Method 3: click on Pad ==
You can probably do what you write with making own class derived from TPad; then you override "ExecuteEvent" function for calling a function to make a separated canvas and
draw a clone of itself.
You may also need own TCanvas and TRootEmbeddedCanvas for using the customized classes instead of regular TPad and TCanvas.
If you are satisfied with the first method, please try the example.
The second method with TGTextButton must not be very difficult.
If you prefer the second (using TBox or TMarker) and third method, I will investigate if it is actually possible.
For the two methods, I think you need to write your own classes.
Best regards,
Ryu
> Dear Colleagues,
>
> We are succesfully running a ROME executable both online and offline with an
> ARGUS display with a canvas that has multiple pads on it. We have also
> implemented a "Save" button which one can click on and save the _entire_ canvas
> (containing all the pads) and saves it to pdf.
>
> I was wondering how one would go about making the following modification :
>
> When a user moves a mouse over to a particular pad and clicks on it - then only
> the histogram on that pad is displayed on a separate canvas (so the user can
> examine it closely) and also save just this one histogram - with a save button
> similar to the one we've already written.
>
> many thanks for any insight
>
> Farrukh |