Various widget enhancements and self- explanatory widgets applications of Tcl/Tk GUI Author:Rahul Dashore Mentor Graphics Presenter: Tony Johnson Mentor.

Slides:



Advertisements
Similar presentations
Noadswood Science,  To know how to use Python to produce windows and colours along with specified co-ordinates Sunday, April 12, 2015.
Advertisements

Intermediate Code Generation
Tutorial 12: Enhancing Excel with Visual Basic for Applications
Microsoft Excel 2003 Illustrated Complete A Worksheet Formatting.
Java Programming, 3e Concepts and Techniques Chapter 5 Arrays, Loops, and Layout Managers Using External Classes.
IS 1181 IS 118 Introduction to Development Tools VB Chapter 03.
© The McGraw-Hill Companies, 2006 Chapter 18 Advanced graphics programming.
Get number The ginput command creates crosshairs. When the user clicks the x,y values of the crosshairs are returned.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
CSC110 Fall Chapter 5: Decision Visual Basic.NET.
Tcl and Tk CSE 470 Fall 1999 Revised by Prasad. Objective To use Tcl Tk to develop GUI and prototype of the project.
Guide To UNIX Using Linux Third Edition
To type the VB code behind the command button (named cmdPush), Double-Click on the Push Me (caption) command button As a result the Visual Basic Code Window.
IS 1181 IS 118 Introduction to Development Tools VB Chapter 03.
Data Types.
DT265-2 Object Oriented Software Development 2 Lecture 3 : Windows Programming Lecturer Pat Browne
Chapter 3 Introduction to Event Handling and Windows Forms Applications.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Chapter 8: String Manipulation
Chapter Seven Advanced Shell Programming. 2 Lesson A Developing a Fully Featured Program.
Chapter 3 Working with Symbols and Interactivity.
Syntax Directed Translation. Syntax directed translation Yacc can do a simple kind of syntax directed translation from an input sentence to C code We.
Chapter 4: The Selection Structure
1 Web-Enabled Decision Support Systems Objects and Procedures Don McLaughlin IE 423 Design of Decision Support Systems (304)
Morpho Activity Start Entering/Practicing with real data.
Microsoft Office Illustrated Introductory, Premium Edition A Worksheet Formatting.
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
Chapter 8: Writing Graphical User Interfaces Visual Basic.NET Programming: From Problem Analysis to Program Design.
FireRMS NEMSIS (Part 2) Presented by Laura Small FireRMS Quality Assurance.
GUI development with Matlab: GUI Front Panel Components 1 GUI front panel components In this section, we will look at -GUI front panel components -Programming.
Basic Controls & Properties Chapter 2. Overview u VB-IDE u Basic Controls  Command Button  Label  Text Box  Picture Box u Program Editor  Setting.
Ray Konopka Developing Custom.NET Component Designers DevCon Course No: 4106.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Pointers OVERVIEW.
Lossless Compression CIS 465 Multimedia. Compression Compression: the process of coding that will effectively reduce the total number of bits needed to.
GUI Design Spreadsheet-Based Decision Support Systems Chapter 23: Aslı Sencer MIS 463.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
DB Implementation: MS Access Forms. MS Access Forms  Purpose Data entry, editing, & viewing data in tables Forms are user-friendlier to end-users than.
CONTENTS Processing structures and commands Control structures – Sequence Sequence – Selection Selection – Iteration Iteration Naming conventions – File.
Applications Development
© Copyright 2012 by Pearson Education, Inc. All Rights Reserved. Chapter 9 GUI Programming Using Tkinter 1.
Graphical User Interface You will be used to using programs that have a graphical user interface (GUI). So far you have been writing programs that have.
Building the Events Components– Lesson 111 Building the Events Components Lesson 11.
JavaScript, Fourth Edition
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 13 GUI Programming.
Object-Oriented Application Development Using VB.NET 1 Chapter 10 VB.NET GUI Components Overview.
Data Representation. What is data? Data is information that has been translated into a form that is more convenient to process As information take different.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al- ajmi Chapter 3 Some Visual Basic Controls and Events Visual Basic. NET.
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
Unit 6 Repetition Processing Instructor: Brent Presley.
Microsoft FrontPage 2003 Illustrated Complete Working on the Web Site’s Hyperlinks and Appearance.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
Proofing Documents Lesson 9. Validating Content By Using Spelling and Grammar Checking Options It is a good business practice to proof a document to ensure.
XP Tutorial 8 Adding Interactivity with ActionScript.
Integrating Components and Dynamic Text Boxes with the Animated Map– Lesson 101 Integrating Components and Dynamic Text Boxes with the Animated Map Lesson.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Visual Basic.NET BASICS Lesson 9 Nested If Statements and Radio Buttons.
Working with Tables A table is a grid of cells arranged in rows and columns. Tables can be customized and are useful for various tasks such as presenting.
DB Implementation: MS Access Forms. MS Access Forms: Purpose Data entry, editing, & viewing data in Tables Forms are user-friendlier to end-users than.
Apply Procedures to Develop Menus, List Box and Combo Box Objects
Digital Electronics Jess 2008.
Apply Procedures to Develop Menus, List Box and Combo Box Objects
Variables and Arithmetic Operations
12 Product Configurator
More Selections BIS1523 – Lecture 9.
PHP.
Review Session Biggest discrepancy questions
Topics Graphical User Interfaces Using the tkinter Module
Web Development Using ASP .NET
CodePainter Revolution Trainer Course
Presentation transcript:

Various widget enhancements and self- explanatory widgets applications of Tcl/Tk GUI Author:Rahul Dashore Mentor Graphics Presenter: Tony Johnson Mentor Graphics

© 2011 Mentor Graphics Corp. Company Confidential Agenda Overview Enhanced Entry Widget (Flow Chart) Enhanced Entry Widget (Integer/Real/Binary/Time/String) Foldable Widget Dynamic Row Modification Widget Self-explanatory Tree Widget Summary Tessent Shell Overview

© 2011 Mentor Graphics Corp. Company Confidential Overview Tcl/Tk entry widget has basic functionality Sophisticated GUI environment requires fancier and ease to use widgets Enhanced entry widgets provides validation of various data types —Integer —Real —Binary —Time —String A folding widget provides capability of hide/unhide long list of children widgets Dynamic row widget has capability to add/delete rows on demand basis Tessent Shell Overview

© 2011 Mentor Graphics Corp. Company Confidential Enhanced Entry Widget (Flow Chart) Enhanced entry widget provides ability to insert user’s key-press only if it’s valid for specific data type. Such as —Integer —Real —Binary etc. Tessent Shell Overview

© 2011 Mentor Graphics Corp. Company Confidential Enhanced Entry Widget (Integer) Allows to insert numeric values only. Range or list of integers can be provided. —“ ” or { 1, 2, 4, 8, 16 } Pre defined non integer enum values are allowed. Which will be shown at the top of selection list. A developer can plug enhanced widget using following syntax: Tessent Shell Overview advwidgets::entry.frame_path \ -labeltext “input” \ -type “integer” \ -allowed “ ” -negative 1 \ -enum { x, auto, on, off }

© 2011 Mentor Graphics Corp. Company Confidential Enhanced Entry Widget (Real) Allows to insert real values only. —4, 1.2, … Pre defined enum values are allowed. Developer syntax to plug in any frame: Tessent Shell Overview advwidgets::entry.frame_path \ -labeltext “weight” \ -type “real” \ -enum { x, auto, on, off }

© 2011 Mentor Graphics Corp. Company Confidential Enhanced Entry Widget (Binary) Allows to insert binary, octal and hexadecimal values. —o777, h8ade, b1010, 111, 4’b1010 … Default base is binary, but user can specify octal or hex (o or h) prefix for supporting base. User can also specify expected number of bits (e.g. 4’b1010) Pre defined enum values are also allowed. Developer syntax to plug in any frame: Tessent Shell Overview advwidgets::entry.frame_path \ -labeltext “weight” \ -type “binary” \ -allowed { binary, octal, hexadecimal } -enum { x, auto, on, off }

© 2011 Mentor Graphics Corp. Company Confidential Enhanced Entry Widget (Time) Allows only non negative time units. —10ns, 4ms, 2s … Pre defined enum values are allowed. Developer syntax to plug in any frame: Tessent Shell Overview advwidgets::entry.frame_path \ -labeltext “time” \ -type “time” \ -allowed { s, ms, us, ps } \ -enum { x, auto, on, off }

© 2011 Mentor Graphics Corp. Company Confidential Enhanced Entry Widget (String) Similar to basic entry widget. It allows any key-press. It also supports pre defined enum values are allowed. Developer syntax to plug in any frame: Tessent Shell Overview advwidgets::entry.frame_path \ -labeltext “weight” \ -allowed enum \ -default on \ -enum { auto, on, off }

© 2011 Mentor Graphics Corp. Company Confidential Enhanced Entry Widget (Pseudo Code) itcl::class ::advwidgets::entry { #variable list (internal variables used by class) #define variables with default values #constructor code #parses and assign values to corresponding variables #constructs entry widget with following components #top frame #label widget #entry widget #dropdown button #popup listbox #pack label widget, entry widget, dropdown button (left to right order in top frame) #bindings on keypress, select values from listbox etc #validation proc #validate based on different types and specified options } Tessent Shell Overview #validation proc for different types ::itcl::body ::advwidgets::entry::validate { args } { #parse arg #if selected from the listbox it’s always valid #return true #set current_entered_text (which is appended current keypress to entrywidget text) #validate for enum values #set current_entered_length to length of current_enetered_text #foreach specified enumvalues #if current_entered_text is matched with first current_entered_legth of enum_value #return true

© 2011 Mentor Graphics Corp. Company Confidential Enhanced Entry Widget (Pseudo Code) … #based on type different validation: #switch type { #integer: #if allowed_negative and first keypress is ‘–‘ #return true #if current keypress is not an integer #return false #if current_entered_text is not in allowed list or not in range #return false #return true #real: #if keypress is neither an integer nor ‘.’ #return false #if already a ‘.’ present and keypress is ‘.’ #return false #return true #time: #set time_end 0 #if keypress is integer and not time_end #return true #if keypress is in allowed time symbol (s|ms|us|ps) #set time_end 1 #return true #return false Tessent Shell Overview #binary: #if [b|o|h] not specified keypress neither 0 nor 1 #return false #now only for allowed b|o|h binary only is considered above #if keypress is integer and allowed is [b|o|h] #return true #if ‘ is not present in the entry_box_text and keypress is ‘ #set bits_count entry_box_text #return true #if ‘ present already and keypress ‘ #return false #if keypress is not [b|o|h] #retun false #else #set base b|o|h #if keypress is in range of base (b|o|h) set in the above step #return true #else #return false #string: #return true (enum is already considered before) }

© 2011 Mentor Graphics Corp. Company Confidential Foldable Widget In EDA tools a frame may have huge number of children which may have some common properties. Group of similar children widgets can be visible or hidden using folding widget. (+ or – indicates hidden and visible frame) Syntax: Tessent Shell Overview advwidgets::foldablewidget.frame_path \ -labeltext “DataInPort” \ -default collapse \ -foreground “gray”

© 2011 Mentor Graphics Corp. Company Confidential Foldable Widget (Pseudo Code) itcl::class ::advwidgets::foldablewidget { #variable list (internal variables used by class) #define variables with default values #constructor code #parses and assigns values to corresponding variables #constructs following components #top frame #label widget #child site frame #append [+] or [-] in the label text based on –default option #places label at appropriate coordinates (top left corner of widget) #if default is collapse #set visible 0 #else #set visible 1 #binding on mouse-click to show/hide children widgets # proc declaration #showhide proc to collapse/expand children } Tessent Shell Overview #show/hide proc ::itcl::body ::advwidgets::foldablewidget::showhide { } { #if visible is 0 #modify label_text to label_text [-] #pack child site #set visible 1 #else #modify label_text to label_text [+] #packfoget child site #set visible 0 }

© 2011 Mentor Graphics Corp. Company Confidential Dynamic Row Modification Widget Rows can be added and deleted from the widget on demand basis. + & - button can be used to add or delete a row. Any enhanced entry widget can be plugged with this widget. Syntax: Tessent Shell Overview advwidgets::rowidget.frame_path \ -labeltext “decoded_values” \ -default_rows 3 \ -default_values { 3’b100, “”, “” }

© 2011 Mentor Graphics Corp. Company Confidential Dynamic Row Modification Widget(Pseudo Code) itcl::class ::advwidgets::rowwidget{ #variable list (internal variables used by class) #define variables with default values #constructor code #parses and assigns values to corresponding variables #constructs following components #top frame #label widget #child frame #for 0 to –default_rows #create row frame #pack + button – button and enhanced entry widget in row frame #insert default_value for each row #pack row frame in child frame #pack label widget and child frame inside top frame #various widget methods #addrow #deleterow } Tessent Shell Overview ::itcl::body ::advwidgets:: rowwidget::addrow { current_row_path } { #create a new row frame #create + button with associated command #create – button with associated command #created enhanced entry widget #pack + button – button and enhanced entry widget #pack new row frame below current_row_path #adjust indices of each available row (indices required for other functionality) } ::itcl::body ::advwidgets:: rowwidget::deleterow { current_row_path } { #if number of rows in child frame is 1 #return (minimum one row is required) #destroy current row #adjust indices of each available row (indices required for other functionality) }

© 2011 Mentor Graphics Corp. Company Confidential A Self-explanatory Tree Widget Coloring mechanism to indicate different signal on each node: —Red for error —Orange for ancestor of error node Similarly image color can be used for different status: —Green for fail, Red for fail, Grey for default … Tessent Shell Overview

© 2011 Mentor Graphics Corp. Company Confidential Summary Fancier widgets and ease to use. Modular and reusable. Can be plugged with existing Tcl/Tk widgets. Makes developers task easy. Tessent Shell Overview

© 2011 Mentor Graphics Corp. Company Confidential