root graphical user interface

20
LCG AA Internal Review 30 March 2005 ROOT Graphical User Interface ROOT Graphical User Interface Ilka Antcheva , Bertrand Bellenot, Valeri Fine, Valeriy Onuchin, Fons Rademakers

Upload: dalia

Post on 13-Jan-2016

33 views

Category:

Documents


1 download

DESCRIPTION

ROOT Graphical User Interface. Ilka Antcheva , Bertrand Bellenot, Valeri Fine, Valeriy Onuchin, Fons Rademakers. Overview. Main Goals TVirtualX Interface ROOT and Qt Application Example GUI Widgets Graphics Editor GUI Builder Tree Viewer Undo/Redo Tools. Main Goals. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005

ROOT Graphical User InterfaceROOT Graphical User Interface

Ilka Antcheva, Bertrand Bellenot, Valeri Fine, Valeriy Onuchin, Fons Rademakers

Page 2: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005 2

OverviewOverview

• Main Goals• TVirtualX Interface• ROOT and Qt • Application Example• GUI Widgets• Graphics Editor• GUI Builder• Tree Viewer• Undo/Redo Tools

Page 3: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005 3

Main GoalsMain Goals

• Cross-platform GUIs – consistent look everywhere• All machine dependent low graphics calls abstracted via

TVirtualX• X11• Win32GDK• Qt layer - standard

ROOT “plug-in” share library, allows to be turned on/off at run time with no changes of the user’s code

• No needs to implement specific code for each platform – that simplifies the code maintenance

Page 4: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005 4

TVirtualX InterfaceTVirtualX Interface• Concrete versions of TVirtualX:

• X11 (Fons Rademakers)• Win32GDK (Bertrand Bellenot,

Valeriy Onuchin) – solved the problem with not thread safe gdk environment

• Qt (Valeri Fine) – gives access to a rich set of ready-to-use GUI Qt-based widgets

• The benefit of applications running on different platforms is obvious - it increases the program’s robustness, makes their maintenance easier and improves the reusability of the code.

Page 5: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005 5

ROOT and QtROOT and Qt

Qt event loop• Qt controls the event loop

via QApplication::exec() • TQtWidget class provides the

embedded ROOT canvas

ROOT event loop• ROOT controls the event loop via

TApplication::Run() • Transformed QEvent into Event_t

structure allows event piping

ROOT as Framework or Toolkit

Page 6: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005 6

GUI Widgets (1)GUI Widgets (1)

Current Status• Based on the XClass

library from Hector Peraza

• Provide standard components for application environment with windows ‘look and feel’

• Object-oriented, event-driven programming model

Page 7: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005 7

GUI Widgets (3)GUI Widgets (3)

Next Steps• Not finished GUI tasks

• Keyboard navigation• Menu hot keys: + = pops up File menu = Save, pops up a submenu should create c1.ps • Dialogs:

Enter = OK, Esc = Cancel• Combo boxes:

Up/Down arrows, Home, End, PgUp, PgDn

• List view improvements, etc.

• Cleanup tools

FAlt

S

P

Page 8: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005 8

GUI Widgets (2)GUI Widgets (2)

• Containers - use of ROOT container classes for fast object look up

• Any widgets can be extended via inheritance

• Layout managers• Signals/slots

communication - uses dictionary information and interpreter to connect signals to slots

Page 9: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005 9

• Data acquisition display

Application Example (1)Application Example (1)

Page 10: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005 10

Application Example (2)Application Example (2)• Statistics on the last 30 min of acquisition

Page 11: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005 11

Application Example (3)Application Example (3)• Temperature evolution on the last 30 min

Page 12: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005 12

GUI Widgets (4)GUI Widgets (4)

• Code optimization• Layout algorithms• GUI Dialogs

• Qt layer • Validation tests of interaction with ROOT GUI classes with the

same ‘look and feel’• To solve problems with so-called "popup widgets", like menus,

drop down combo boxes, etc. and actions that require full-scale X11 - like mouse pointer grabbing

• To complete the reference documentation of GUI classes

Page 13: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005 13

Graphics Editor (1)Graphics Editor (1)

• ROOT graphics editor can be:• Embedded – connected

only with the canvas in the application window

• Global – has own application window and can be connected to any created canvas (under development)

Page 14: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005 14

Graphics Editor (2)Graphics Editor (2)

• Modular – it loads the corresponding object editor xxxEditor according to the selected object xxx in the canvas respecting the class inheritance.

• Can be extended easily by any user-defined object editor - this makes GUI design easier and adaptive to the users’ profiles

• This way the GUI complexity is reduced by hiding some interface elements and revealing them when necessary.

• Rules to follow:• Derive in the code the object editor from the base class

TGedFrame • Correct naming • Register the object editor in the list TClass::fClassEditors

Page 15: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005 15

Graphics Editor (3)Graphics Editor (3)

• Different object editors

Page 16: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005 16

Graphics Editor (4)Graphics Editor (4)

Next Steps• To include ROOT commands

in tool tips of the GUI widgets• Help• Global graphics editor

• To show the related canvas title• Close button

• Hide/Show objects in a canvas• New object editors

development• Style manager – summer

student project• Fit Panel GUI root[9] gPad->SetLogy(1);

Page 17: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005 17

GUI Builder (1)GUI Builder (1)

• GUI Builder greatly simplifies the process of designing GUIs based on ROOT widgets’ classes.

• Using Ctrl+S or SaveAs dialog, users can generate C++ code in a macro that can be edited and executed via the CINT interpreter:root[0] .x example.C

// transient frame TGTransientFrame *frame2 = new TGTransientFrame(gClient->GetRoot(),760,590); // group frame TGGroupFrame *frame3 = new TGGroupFrame(frame2,"curve"); TGRadioButton *frame4 = new TGRadioButton(frame3,"gaus",10); frame3->AddFrame(frame4); frame2->SetWindowName(“Fit Panel"); frame2->MapSubwindows(); frame2->Resize(frame2->GetDefaultSize()); frame2->MapWindow();}

Page 18: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005 18

GUI Builder (2)GUI Builder (2)

Current status• Tests and validation of the current version

• Layout a GUI quickly by dragging widgets, setting layout managers, changing options in the right-click context menus.

• Final design can be saved as a C++ macro

Next steps• To complete the GUI widgets’ palette with combo/list boxes,

double sliders, list view, list tree, shutters, button group, etc.• To develop tools for signals/ slots mechanism of

communication.• To provide examples for several basic types of GUIs (as

tutorials)

Page 19: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005 19

Tree ViewerTree Viewer

• Tree Viewer improvements to adapt the user interface to latest TTree developments

Page 20: ROOT Graphical User Interface

LCG AA Internal Review 30 March 2005 20

Undo/Redo ToolsUndo/Redo Tools

• Allow users to recover from mistakes - very important part of GUI that will provide:• A stack of states/actions to go back • Confirmation of destructive actions: overwrite, delete, etc.

• Main idea: all editing in an application is done by creating instances of so-called command objects

• Tests and validation of already implemented classes:• TQCommand – each command knows how to undo its changes to

bring the edited object back to its previous state. • TQCommandHistory • TQUndoManager – recorder of undo and redo operations; it is

the command history list which can be traversed backwards and upwards performing undo/redo operations.