Back Midas Rome Roody Rootana
  Rome Analyzer Framework  Not logged in ELOG logo
Entry  02 Sep 2015, Farrukh Azfar, Forum, ARGUS display with canvas and pads ...  
    Reply  03 Sep 2015, Ryu Sawada, Forum, ARGUS display with canvas and pads ...  
       Reply  03 Sep 2015, Farrukh Azfar, Forum, ARGUS display with canvas and pads ...  
          Reply  04 Sep 2015, Farrukh Azfar, Forum, ARGUS display with canvas and pads ...  
             Reply  04 Sep 2015, Ryu Sawada, Forum, ARGUS display with canvas and pads ...  
       Reply  03 Sep 2015, Farrukh Azfar, Forum, ARGUS display with canvas and pads ...  
          Reply  04 Sep 2015, Ryu Sawada, Forum, ARGUS display with canvas and pads ...  
       Reply  07 Sep 2015, Ryu Sawada, Forum, ARGUS display with canvas and pads ...  
Message ID: 159     Entry time: 07 Sep 2015     In reply to: 149
Author: Ryu Sawada 
Topic: Forum 
Subject: ARGUS display with canvas and pads ...  
I found rather easy way for the Method 3 (click on pad).

I implemented in the same example,
namely, the third tab in $ROMESYS/examples/argus/menu.

You can add a macro which is executed when an event occurs on each pad  with,
   fCanvas->GetCanvas()->GetPad(1)->AddExec("ex1", ".x OpenCanvas.C");

Then you can write any function in the macro.
In this example, it opens a copy of canvas and save the clicked pad into a PDF file.

Ryu

> 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 
ELOG V3.1.4-2e1708b5