LCG AA Meeting 26 April 2006 User Interface Developments in ROOT Ilka Antcheva on behalf of ROOT GUI Work Package.

Slides:



Advertisements
Similar presentations
Designing a Graphical User Interface (GUI) 10 IST – Topic 6.
Advertisements

Rapid Application Design with the ROOT GUI Classes 24 April 2007 Ilka Antcheva, Bertrand Bellenot, René Brun, Fons Rademakers, Valeriy Onuchin * CERN,
Data Access Worldwide May 16 – 18, 2007 Copyright 2007, Data Access Worldwide May 16 – 18, 2007 Copyright 2007, Data Access Worldwide Building Great Looking.
MP IP Strategy Stateye-GUI Provided by Edotronik Munich, May 05, 2006.
A graphical user interface (GUI) is a pictorial interface to a program. A good GUI can make programs easier to use by providing them with a consistent.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
1 Chapter 7 Graphics and Event Handling. 2 Overview The java.awt and javax.swing packages and their subpackages support graphics and event handling. Many.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Cross-platform approach to create the interactive application based on ROOT and Qt GUI libraries Rene Brun (CERN) Valeri Fine (BNL,
1 Introduction to Human Computer Interaction  Livecode Overview  Based on Livecode User Guide from RunRev Ltd. (2010) 
Module 3 Productivity Programs Common Features and Commands Microsoft Office 2007.
Oct ROOT 2002, CERN, Geneva Qt-Based Implementation of Low Level ROOT Graphical Layer By V.Fine.
Access Tutorial 10 Automating Tasks with Macros
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
ROOT Tutorials - Session 51 ROOT Tutorials – Session 8 GUI, Signal/Slots, Image Processing, Carrot Fons Rademakers.
Bertrand Bellenot ROOT Users Workshop Mar ROOT GUI Builder Status & Plans ROOT & External GUI World MFC, FOX, Qt, PVSS… Snapshot of the Future.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
IE 411/511: Visual Programming for Industrial Applications
Introduction to Matlab & Data Analysis
3461A Readings from the Swing Tutorial. 3461A Overview  The follow is the Table of Contents from the trail “Creating a GUI with JFC/Swing” in the “The.
In the next step you will enter some data records into the table. This can be done easily using the ‘Data Browser’. The data browser can be accessed via.
ROOT Team Meeting October 1 st 2010 GUI thinking and testing ideas OpenGL GUI Root Team meeting 01/10/2010.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Lection №5 Modern integrated development environment.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
CC111 Lec7 : Visual Basic 1 Visual Basic(1) Lecture 7.
CNS 1410 Graphical User Interfaces. Obectives Students should understand the difference between a procedural program and an Event Driven Program. Students.
LCG AA Meeting 30 June 2004 Valeriy Onuchin GUI Builder.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Dale Roberts Introduction to Visual Programming Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
CITA 342 Section 2 Visual Programming. Allows the use of visual expressions (such as graphics, drawings, or animation) in the process of programming.
Java Beans. Definitions A reusable software component that can be manipulated visually in a ‘builder tool’. (from JavaBean Specification) The JavaBeans.
9-Nov-97Tri-Ada '971 TASH An Alternative to the Windows API TRI-Ada ‘97 Terry J. Westley
H.G.Essel: Go4 - J. Adamczewski, M. Al-Turany, D. Bertini, H.G.Essel, S.Linev ROOT 2002 GSI Online Offline Object Oriented Go4.
GUIs Basic Concepts. GUI GUI : Graphical User Interface Window/Frame : a window on the screen Controls/Widgets : GUI components.
ROOT Users Workshop September 2005 Ilka Antcheva GUI Status and Development.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
April 27, 2006 The New GANGA GUI 26th LHCb Software Week C L Tan
Graphics Editor in ROOT I l ka Antcheva*, René Brun, Fons Rademakers CERN, Geneva, Switzerland CERN, Geneva, Switzerland * funded by PPARK, Swindon, UK.
LCG AA Meeting 31 October 2007 The new dynamically and extensively customizable ROOT browser Bertrand Bellenot.
Techniques for List Creation (2) Data formatting and control level processing Basics for Interactive Lists Detail lists The Program Interface Interactive.
S.Linev: Go4 - J.Adamczewski, H.G.Essel, S.Linev ROOT 2005 New development in Go4.
TOOLBOX. The Toolbox Intrinsic Controls - always included in the Toolbox ActiveX Controls - separate files with ocx file extension Insertable Objects.
MATLAB and SimulinkLecture 61 To days Outline Graphical User Interface (GUI) Exercise on this days topics.
CHEP06, Mumbai, India February 2006 General Status of ROOT GUI Ilka Antcheva, Bertrand Bellenot, René Brun, Valeriy Onuchin *, Fons Rademakers CERN,
1 G4UIRoot Isidro González ALICE ROOT /10/2002.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
LCG AA Meeting 30 June 2004 Ilka Antcheva Graphics User Interface in ROOT.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
July FLTK The Fast Light Toolkit • A C++ graphical user interface toolkit • Can be used under X, Windows, MacOS • Supports OpenGL • Provides: – Interactive.
LCG AA Internal Review 30 March 2005 ROOT Graphical User Interface Ilka Antcheva, Bertrand Bellenot, Valeri Fine, Valeriy Onuchin, Fons Rademakers.
1. 2 Qt Toolkit ● C++ toolkit for cross-platform GUI application development – GUI functions (GUI = graphical user interface) – Data access components,
Graphical User Interface in MATLAB
Introduction to Computer CC111
Chapter 2 – Introduction to the Visual Studio .NET IDE
Distributed object monitoring for ROOT analyses with Go4 v.3
1. Introduction to Visual Basic
DB Implementation: MS Access Forms
Go4 CHEP 2001 Multithreaded Inter-Task Communication with ROOT -
Chapter 2 Adding Web Pages, Links, and Images
CIS16 Application Development Programming with Visual Basic
DB Implementation: MS Access Forms
User Interface Classes Signals / Slots
Go4 GUI and GSI's QtROOT interface
Go4 GUI and GSI's QtROOT interface
Chapter 4 Enhancing the Graphical User Interface
Presentation transcript:

LCG AA Meeting 26 April 2006 User Interface Developments in ROOT Ilka Antcheva on behalf of ROOT GUI Work Package

Ilka Antcheva LCG AA Meeting 26 April Overview Basic Features Widgets Signals/Slots C++ Code Generation Applications Canvas Interface Object Browser GUI Builder ROOT and Qt Conclusions

Ilka Antcheva LCG AA Meeting 26 April Cross-platform GUIs – consistent look everywhere All machine dependent low graphics calls are abstracted via TVirtualX The GUI class library contains a rich and complete set of widgets and layout managers and supports both: Conventional model of event processing Signals/Slots communication mechanism, integrated into ROOT core by TQObject, TQConnection, TQClass. It uses dictionary information and the CINT interpreter to connect signal methods to slot methods Important classes: TGClient – sets up the graphics system TGResourcePool – global resource manager Basic Features (1)

Ilka Antcheva LCG AA Meeting 26 April Base classes TGObject – window identifier; connection to the graphics system TGWidget – important for event processing TGWindow – creates a new window with common characteristics TGFrame – base class for simple widgets TGCompositeFrame – base container class TGMainFrame – main application window interacting with the system WM TGTransientFrame – transient window, typically used for dialogs GUI widgets Buttons: text, picture, check, radio Menus: menu bar, menu title, popup menu, cascaded menus Containers: combo and list boxes, tabs, shutters, tool bar, dockable frames, MDI classes Text widgets: label, text entry, number entry, text edit, tool tip Color: color selector, color dialog, palette Whiteboard: canvas (container & view port), list tree Miscellaneous: slider, splitter, scroll bar, status bar, progress bar, 3 Dlines, etc. Basic Features (2)

Ilka Antcheva LCG AA Meeting 26 April fText = new TGTextEntry(fMain, new TGTextBuffer(100)); fText->SetToolTipText("Enter the label and hit Enter key"); fText->Connect("ReturnPressed()", "MyDialog", this, "DoSetlabel()"); fMain->AddFrame(fText, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5)); fGframe = new TGGroupFrame(fMain, "Last File"); fLabel = new TGLabel(fGframe, "No Intut "); fGframe->AddFrame(fLabel, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5)); fMain->AddFrame(fGframe, new TGLayoutHints(kLHintsExpandX, 2, 2, 1, 1)); … // fText = new TGTextEntry(fMain, new TGTextBuffer(100)); // fText->SetToolTipText("Enter the label and hit Enter key"); // fText->Connect("ReturnPressed()", "MyDialog", this, "DoSetlabel()"); // fMain->AddFrame(fText, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5)); fGframe = new TGGroupFrame(fMain, "Last File"); fLabel = new TGLabel(fGframe, "No Intut "); fGframe->AddFrame(fLabel, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5)); fText = new TGTextEntry(fGframe, new TGTextBuffer(100)); fText->SetToolTipText("Enter the label and hit Enter key"); fText->Connect("ReturnPressed()", "MyDialog", this, "DoSetlabel()"); fText->Resize(150, fText->GetDefaultHeight()); fGframe->AddFrame(fText, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5)); fMain->AddFrame(fGframe, new TGLayoutHints(kLHintsExpandX, 2, 2, 1, 1)); root [0].x myDialog.C root [1] root [0].x myDialog.C root [1].x myDialog.C Basic Features (3) Fast GUI prototyping thanks to the CINT – command and script interpreter supporting pure C++ code: From simple sequence of statements to complex class and method definitions No need for special preprocessors or compilation

Ilka Antcheva LCG AA Meeting 26 April On interactions, widgets send out various signals (event senders) Public object methods can be used as slots (event receivers) Signals and slots can be connected together sl->Connect("PositionChanged()", “MyClass", this, "DoSlider()"); virtual void PointerPositionChanged() { Emit("PointerPositionChanged()"); } //*SIGNAL* void MyClass::DoSlider() { // Slot method. Redraw the function in the canvas // window according to the slider pointer fFunc->SetParameters(sl->GetPointerPosition()); fFunc->Draw(); fCanvas->Update(); } Basic Features (4)

Ilka Antcheva LCG AA Meeting 26 April Basic Features (5) Using Ctrl+S any GUI can be saved as a C++ macro via the SavePrimitive() methods This macro can be edited and then can be interpreted or compiled via ACLiC Executing the macro restores the complete original GUI Signal/slot connections are restored in a global way // 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); root [0].x example.C

Ilka Antcheva LCG AA Meeting 26 April The dockable tool bar provides shortcuts for menu’s and buttons for primitive drawing The Editor frame provides a GUI according to the selected objects in the canvas window Editor Frame Toolbar Canvas Interface

Ilka Antcheva LCG AA Meeting 26 April Object Browser Any executed C++ macro can be modified and re-executed New toolbar buttons history navigation refreshing browser content run/interrupt/save the executed macro Dynamic icon generation

Ilka Antcheva LCG AA Meeting 26 April GUI Builder (1) First prototype by V. Onuchin took place in ROOT v4.02 (2004) New design prototype (March 2006) is under development and validation Advantages: GUI can be rapidly prototyped and implemented Allows users to select from pre-defined sets of widgets, and place them on the working area Drag-and-drop of already existing GUI elements between main frames, and after that modify them Easy widget alignments Easy layout settings Easy attribute settings of widgets via context menus and property editors

Ilka Antcheva LCG AA Meeting 26 April GUI Builder (2) Save current design in a macro that can be edited and executed via the CINT interpreter: root [0].x example.C root [1].x example.C++ The design process can start from a macro Prototypes related to the new Fit Panel

Ilka Antcheva LCG AA Meeting 26 April ROOT and Qt (1) Qt BNL by Valeri Fine Announced in ACAT 2002 In ROOT CVS since July 2004 SLOC ~ Standard ROOT “plug-in” shared library, allows to be turned ON at run time if.rootrc setings are Gui.Backend qt Gui.Factory qt Uses Qt v.3 Planned support of Qt v.4 Qt GSI by M. Al-Turani [ D. Bertini [ Works since 2001 on Linux In ROOT CVS in April 2006 SLOC ~2100 How it works is explained in details at Uses Qt v.3 Planned native Qt v.4 support

Ilka Antcheva LCG AA Meeting 26 April ROOT and Qt (2) Qt BNL Uses Qt as a render engine for all ROOT graphics (GUI and Canvas) via TGQt (a Qt-based implementation of TVirtualX) ROOT Canvases can be embedded in Qt widgets and can be used with other Qt-based components and Qt-based 3 rd part libraries

Ilka Antcheva LCG AA Meeting 26 April ROOT and Qt (3) Qt GSI Lightweight interface that uses the Qt event loop to drive Qt widgets and the ROOT event loop to handle all ROOT events: GUI, timers, signals, etc. Qt widgets are rendered via Qt, ROOT widgets are rendered either via TGX11 or TGWin32GDK ROOT Canvases can be embedded in Qt widgets For more information on Qt GSI, see ROOT v 5.11/02 release notes at

Ilka Antcheva LCG AA Meeting 26 April Conclusions The ROOT GUI is a rich and powerful scriptable cross-platform user interface library It provides a solid basis for the development of many additional widgets and GUI components, like a Fit Panel, Help browser, object editors and event displays The GUI builder will make the task of designing user interfaces much easier The different ROOT/Qt integration interfaces give Qt users easy access to the ROOT graphics.

LCG AA Meeting 26 April 2006 Embedding ROOT TCanvas in any non “Root GUI” Application/Toolkit Bertrand Bellenot

Bertrand Bellenot LCG AA Meeting 26 April 2006 Allows to embed a TCanvas into any external application or any toolkit, using only a few lines of code, as soon as it is possible to: Obtain a Window ID (XID on X11, HWND on Win32). Create a timer to handle Root events. Forward (i.e. mouse) events to the Canvas Features 2

Bertrand Bellenot LCG AA Meeting 26 April 2006 How it Works 3 In the application constructor or in main(), create a TApplication: gMyRootApp = new TApplication("My ROOT Application", &argc, argv); gMyRootApp->SetReturnFromRun(true); Create a timer to process Root events : void MyWindow::OnRefreshTimer() { gApplication->StartIdleing(); gSystem->InnerLoop(); gApplication->StopIdleing(); } Get the id of the window where you want to embed the TCanvas: void MyWindow::Create() { int wid = gVirtualX->AddWindow((ULong_t)getid(), getWidth(), getHeight()); fCanvas = new TCanvas("fCanvas", getWidth(), getHeight(), wid); } Forward messages to the Canvas. i.e: void MyWindow::OnPaint() { if (fCanvas) fCanvas->Update(); } void MyWindow::OnLMouseDown() { if (fCanvas) fCanvas->HandleInput(kButton1Down, ev->x, ev->y); }

Bertrand Bellenot LCG AA Meeting 26 April 2006 CMFCRootApp::CMFCRootApp() { int argc = 1; char *argv[] = { "MFCRootApp.exe", NULL }; gMFCRootApp = new TApplication("MFC ROOT Application", &argc, argv); gMFCRootApp->SetReturnFromRun(true); } VOID CALLBACK MyTimerProc(HWND hwnd, UINT message, UINT idTimer, DWORD dwTime) { gApplication->StartIdleing(); gSystem->InnerLoop(); gApplication->StopIdleing(); } int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; … SetTimer(1, 20, (TIMERPROC) MyTimerProc); // timer callback return 0; } Example with MFC (1) Application and Timer Creation: 4

Bertrand Bellenot LCG AA Meeting 26 April 2006 void CChildView::OnPaint() { CPaintDC dc(this); // device context for painting RECT rect; if (fCanvas == 0) { GetWindowRect(&rect); int width = rect.right-rect.left; int height = rect.bottom-rect.top; int wid = gVirtualX->AddWindow((ULong_t)m_hWnd, width, height); fCanvas = new TCanvas("fCanvas", width, height, wid); } else fCanvas->Update(); } void CChildView::OnLButtonUp(UINT nFlags, CPoint point) { if (fCanvas) fCanvas->HandleInput(kButton1Up, point.x, point.y); CWnd::OnLButtonUp(nFlags, point); } Canvas creation and event forwarding: Example with MFC (2) 5

Bertrand Bellenot LCG AA Meeting 26 April 2006 Example of QtGSI Main File 6 #include "TQtApplication.h" #include "TQtRootApplication.h" #include "MyWidget1.h" int main( int argc, char ** argv ) { TQRootApplication a( argc, argv, 0); TQApplication app("uno",&argc,argv); MyWidget1 *w = new Mywidget1; w->show(); a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT( quit() ) ); return a.exec(); } Where in blue are the differences to a standard Qt main file More information on QtGSI implementation, see ROOT v 5.11/02 release notes : QtGSI main(): #include "QApplication.h" #include "MyWidget1.h" int main( int argc, char ** argv ) { QApplication a(argc,argv); MyWidget1 *w = new Mywidget1; w->show(); a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT( quit() ) ); return a.exec(); } Standard Qt main():

Bertrand Bellenot LCG AA Meeting 26 April 2006 ROOT and PVSS ROOT & PVSS Screenshot (in collaboration with Piotr Golonka)

Bertrand Bellenot LCG AA Meeting 26 April 2006 Screenshots 7