Macros and User Forms

Similar documents
A method is a procedure that is always associated with an object and defines the behavior of that object.

The scripting system handles two types of components: Visual and Non-visual components.

Getting Started Manual. SmartList To Go

VISUAL BASIC 2 EDITOR

SCHOOL COLLABORATION SITES Reference Guide

PCB Design View. Contents


SPARK. User Manual Ver ITLAQ Technologies

Here is a step-by-step guide to creating a custom toolbar with text

DbSchema Forms and Reports Tutorial

Creating Fill-able Forms using Acrobat 7.0: Part 1

NiceForm User Guide. English Edition. Rev Euro Plus d.o.o. & Niceware International LLC All rights reserved.

Motion Control Products Application note How to display a page to indicate communication error

DbSchema Forms and Reports Tutorial

Wiki App Guide. Blackboard Web Community Manager

Starting Excel application

This document describes how to use the CAP workbook with Excel It applies to version 6b of the workbook.

Sample A2J Guided Interview & HotDocs Template Exercise

Forms for Android Version Manual. Revision Date 12/7/2013. HanDBase is a Registered Trademark of DDH Software, Inc.

For more detailed information on the differences between DelphiScript and Object Pascal, refer to the DelphiScript Reference document.

POS Designer Utility

JScript Reference. Contents

(1) Trump (1) Trump (2) (1) Trump ExampleU ExampleP (2) Caption. TrumpU (2) Caption. (3) Image FormTrump. Top 0 Left 0.

Published on Online Documentation for Altium Products (

P3e REPORT WRITER CREATING A BLANK REPORT

MyNIC Team Site - Document Sharing

MOBILOUS INC, All rights reserved

Nikon Capture NX "How To..." Series

Contents. Properties: Field Area Fields Add a Table to a Form... 23

CS-Studio Display Builder

Navigating a Database Efficiently

Customizing FrontPage

Layout Assistant Help

Figure 1 Forms category in the Insert panel. You set up a form by inserting it and configuring options through the Properties panel.

AN-POV-003 Using the radio button and check-box objects

TIDY LABELS. User Guide

Creating Interactive PDF Forms

QRG: Adding Images, Files and Links in the WYSIWYG Editor

AlphaCam Routing Example

Adding Disclaimer Text Field to your Salesforce Org

13 FORMATTING WORKSHEETS

Table Basics. The structure of an table

The standard InTouch keyboard or keypad. This is the default keyboard.

TTWeb Quick Start Guide

Board Options. Modified by Phil Loughhead on 27-Jan Parent page: PCB Dialogs. Old Content - visit altium.com/documentation

Working with Confluence Pages

Inserting or deleting a worksheet

INTRODUCTION... 3 INSTALLATION GUIDE FOR ECLIPSE 3.1 AND INSTALLATION GUIDE FOR ECLIPSE 3.3 TO

User s Manual for ArpEdit

Vector Issue Tracker and License Manager - Administrator s Guide. Configuring and Maintaining Vector Issue Tracker and License Manager

Toufee Banner Rotator User Guide

Contents. Add a Form Element to a Group Box Add a Field to a Form... 22

Grapher 10 Ribbon Bar

Folders Projects, Folders and Menus. Table of Contents. 1.0 Folder Types. 2.0 Folder Menu Commands

Report Composer Version 6.0. What's New

Viewer. Quick Reference Guide

Creating a Website in Schoolwires

MockupScreens - User Guide

Customizing Wizards with Cisco Prime Network Activation Wizard Builder

Workshop BOND UNIVERSITY Bachelor of Interactive Multimedia and Design Beginner Game Dev Character Control Building a character animation controller.

Developer s Tip Print to Scale Feature in Slide

Editing the Home Page

TECH-NOTE. The Keyboard Macro Editor. The Keyboard Macro Editor Dialog Box

Configuring Ad hoc Reporting. Version: 16.0

OIG 11G R2 Field Enablement Training

Arch Guide Creating an Instructional Plan

How to use the ruler, grid, guides, and the Align panel

ADJUST TABLE CELLS-ADJUST COLUMN AND ROW WIDTHS

Intellicus Enterprise Reporting and BI Platform

This example shows how you can input a Sales Order ID and bring back the Country and Net Amount for that ID to the first screen of the transaction.

The Newsletter will contain a Title for the newsletter, a regular border, columns, Page numbers, Header and Footer and two images.

User Guide. Chapter 6. Teacher Pages

Connecting a GPS Rover to a Modem or Base Network

Index. Smart Image Processor 2 Manual DMXzone.com

Published on Online Documentation for Altium Products (

InDesign CC 2014 Intermediate Skills

SCH Inspector. Modified by Admin on Dec 12, SCH Filter. Parent page: Panels. Old Content - visit altium.com/documentation.

Drill Table. Summary. Availability. Modified by on 19-Nov Parent page: Objects

Create engaging demonstrations, simulations and evaluations with Adobe Captivate. Creating from a PowerPoint. Importing a presentation

FACT-BVH Tutorial. Part I: Setting up the model. In Life Forms. In ElectricImage. 6. Open a New Animation. 7. Import the Fact model

Read More: Index Function Excel [Examples, Make Dynamic Range, INDEX MATCH]

How to Create Greeting Cards using LibreOffice Draw

Enterprise Architect. User Guide Series. Wireframe Models. Author: Sparx Systems Date: 15/07/2016 Version: 1.0 CREATED WITH

Delegating Access & Managing Another Person s Mail/Calendar with Outlook. Information Technology

SelectSurvey.NET Developers Manual

Information Systems Center. FrontPage 2003 Reference Guide for COMM 321 & 421

The Bliss GUI Framework. Installation Guide. Matías Guijarro

Wordpress Editor Guide. How to Log in to Wordpress. Depending on the location of the page you want to edit, go to either:

Library Editor Workspace

Grids (tables) is one type of content available in the web Front end s tabs.

Microsoft Access 2010

Product Interface Design using Axure RP Pro 7.0

Links Menu (Blogroll) Contents: Links Widget

Chapter 4: Programming with MATLAB

Aware IM Version 8.2 Aware IM for Mobile Devices

Collaborate, Compare and Merge Panel. Contents

INTRODUCTION TO THE MATLAB APPLICATION DESIGNER EXERCISES

User Manual. pdoc Forms Designer. Version 3.7 Last Update: May 25, Copyright 2018 Topaz Systems Inc. All rights reserved.

Perch Documentation. U of M - Department of Computer Science. Written as a COMP 3040 Assignment by Cameron McKay, Marko Kalic, Riley Draward

Setting Up Netscape 4.61 to read the IMAP Server

Transcription:

Macros and User Forms INTRODUCTION Toad Data Modeler supports macros. You can create a macro in Package Explorer or Script Explorer and modify its properties to display the macro either in main menu or pop-up menu (of particular object or on the Workspace etc.). Older Toad Data Modeler versions allowed you to define such macros via a script written in Script Editor. To execute the script directly, you simply selected the macro in the particular menu. Current BETA version is bringing some improvements for using macros - visual components for macros (User Forms). So, now when you select a macro, a user form can display. Examples of User Forms: Right-click the Workspace displays the Macros item. Two user macros are available there: Copyright: 2009 Quest Software, Inc. 1/12

Mark Procedures as Generate macro opens the following user form: Select the procedures for which you want to clear the Generate box. Click Close to execute the macro. Add Prefix macro opens the following user form: Define a prefix for attributes. Click Execute to execute the macro. These have just been examples of user forms that you can create on your own. User Forms - Brief Information: You can create and use user forms to interact with Toad Data Modeler during script and macro execution. You can enter input parameters or see some output information. Function Main only creates and displays the user form. Other functionalities must be implemented/added via form events or its controls. So, a form is not a dialog. Copyright: 2009 Quest Software, Inc. 2/12

MACRO Create Macro Use Case: You want to create a macro that will add a particular prefix to all attributes in your model. Solution: You will create a macro Add Prefix. The macro will be available via right-click menu on the Workspace. You want to create a user form where you will define the prefix and decide if you want to apply the change in Caption of attributes too. 1. Open Script Explorer. 2. Right-click the Macros item and select Add New Macro. 3. Right-click the new item and select Properties. 4. On tab General, define properties of the macro. Copyright: 2009 Quest Software, Inc. 3/12

Important! Name of macro mustn t contain spaces and other forbidden characters. The name must start with a character (not number). Then you can use characters, numbers or possibly _. The rules don t refer to caption. Caption can be any title you want. 5. On tab Visibility, select where you want to apply the macro Physical Model. 6. On tab Menu, define whether you want to display the macro in: - Macro menu, - pop-up menu, - both places. Parameter Path specifies position in main menu or pop-up menu. Feel free to define e.g. Test\My Items. In this example, you decide to display it only in pop-up menu. Path box is empty as Macros item is set as default. Copyright: 2009 Quest Software, Inc. 4/12

7. On tab Object Types, select in which object pop-up menu you want to display it. Select Workspace. 8. Confirm OK. Copyright: 2009 Quest Software, Inc. 5/12

9. Double-click the macro to open Script Editor. Modify the default code. function Main() var App = System.GetInterface("Application"); var Model = App.ActiveModel; var WS = App.ActiveWorkSpace; var Log = System.CreateObject("Log"); var form, lb, ed, chb; //Create form form = System.CreateForm('Form','Add Prefix to Attributes',200, 170); //Add script that should be executed after you click the Execute button form.executescriptname = 'AddPrefix'; form.executemethodname = 'Execute'; form.closeafterexecute = true; //Add component Label on the form lb = form.addcontrol('label', 5); lb.caption = 'Prefix:'; //Add component Edit on the form ed = form.addcontrol('edprefix', 1); ed.width = 160; //Add component Checkbox on the form chb = form.addcontrol('chbonlyname', 2); chb.caption = 'Modify Caption'; chb.checked = true; Copyright: 2009 Quest Software, Inc. 6/12

//Macro can be executed for Attributes, Model or Workspace //If macro is executed only for attributes, it relates only to selected attributes. var OnlyAttributes = true; var i, SelectObject; for(i=0; i<this.count;i++) SelectObject = This.GetObject(i); if (SelectObject.ObjectType!=2003) //2003 = Attribute OnlyAttributes = false; //Variable will be accessible also in event via calling Instance.VariableName (Instance.OnlyAttributes) form.adduservariable('onlyattributes',onlyattributes); //Registered objects will be accessible in events. form.registerobject(this, 'SelectedObjects'); form.registerobject(model,'model'); form.registerobject(log,'log'); form.showmodal(); function RenameAttribute(Attribute) Log.Information('Attribute has been renamed from "'+Attribute.Name+'" to "'+EdPrefix.Text+Attribute.Name+'"'); if (ChbOnlyName.Checked) Attribute.Caption = EdPrefix.Text+Attribute.Caption; else Attribute.Name = EdPrefix.Text+Attribute.Name; function Execute() var i, j, SelectObject, Ent; if (Instance.OnlyAttributes) for(i=0; i<selectedobjects.count;i++) SelectObject = SelectedObjects.GetObject(i); RenameAttribute(SelectObject); Copyright: 2009 Quest Software, Inc. 7/12

else for(i=0; i<model.entities.count; i++) Ent = Model.Entities.GetObject(i); for(j=0; j<ent.attributes.count; j++) SelectObject = Ent.Attributes.GetObject(j); RenameAttribute(SelectObject); Model.RefreshModel(); 10. Click Commit and Save. Result: Right-click the Workspace Macros Add Prefix to open the user form. Copyright: 2009 Quest Software, Inc. 8/12

FORM Create a Form To create a form, use the object System that is registered in every script. The method you need is called CreateForm and has four optional parameters: Example: var form = System.CreateForm( FormName, Form Caption, 200, 150); 1. First Parameter Name of form (it mustn t contain spaces and other invalid/not permitted characters). 2. Second Parameter Caption that will be displayed in the heading of the form. 3. Third Parameter Width of the form. 4. Fourth Parameter Height of the form. Functions of Form AddControl(ControlName: widestring, ControlType: Integer): IDispatch; - ControlName Name under which the control is accessible. - ControlType Number of control type that should be created. See the following table: - 1 - Edit Box - 2 - Check Box - 3 - Memo - 4 - Panel - 5 - Label - 6 - Group Box - 7 - Radio Button - 8 - Combo Box - 9 - List Box - 10 - Button This function adds control on the form. ShowModal() This function displays the form. Copyright: 2009 Quest Software, Inc. 9/12

Procedures of Form AddUserVariable(AName: widestring, DefaultValue) - AName Name under which a variable is accessible in events of forms. - DefaultValue Default value. It can be of types integer, widestring or boolean. This procedure adds a variable on the form. The variable is then accessible in events via calling the Instance.VariableName. The variable is accessible across events. If you change a content of the variable in one event, the changed status will be accessible in another event. RegisterObject(AName: widestring, AObject: IDispatch) - AName Name of object via which it will be accessible in events. - Aobject Object that is registered. Use this procedure to register objects in events. Properties of Form Caption Heading of the form. CloseAfterExecute True When you click Execute, the code will be executed and the form closed. False The form will not close after execution. False is set up by default. ExecuteMethodName Name of method that should be executed when you press the Execute button. ExecuteScriptName Name of script for calling out the method when you click the Execute button. Note: If you don t want to use the button Execute, do not set up the properties ExecuteMethodName and ExecuteScriptName. The button will not be visible on the form then. Copyright: 2009 Quest Software, Inc. 10/12

EVENTS To assign events, assign the component of particular event to properties of names NameEventScriptName, NameEventMethodName with reference to particular service method. Example: Button.OnClickScriptName = MyScript ; Button.OnClickMethodName = DoOnClick ; CONTROL Control is an ancestor from which all controls, including the form, inherit. Properties of Control Align Alignment of control. Possible values to use: 0 No alignment 1 Alignment - Top 2 Alignment - Bottom 3 Alignment - Left 4 Alignment - Right 5 Alignment Justify AnchorTop, AnchorBottom, AnchorLeft, AnchorRight Determines the position of control. Default place top left-hand corner. Parent Control on which a control is placed. Default position of all controls is on the form and this property is not set up. Note: Description of value Align 0..5: alnone - The control remains where it was placed. This is the default value. altop - The control moves to the top of its parent and resizes to fill the width of its parent. The height of the control is not affected. albottom - The control moves to the bottom of its parent and resizes to fill the width of its parent. The height of the control is not affected. alleft - The control moves to the left side of its parent and resizes to fill the height of its parent. The width of the control is not affected. alright - The control moves to the right side of its parent and resizes to fill the height of its parent. The width of the control is not affected. alclient - The control resizes to fill the client area of its parent. If another control already occupies part of the client area, the control resizes to fit within the remaining client area. Copyright: 2009 Quest Software, Inc. 11/12

BUTTON Event OnClick Occurs when you click the button. CHECKBOX Event OnClick Occurs when the check in checkbox is changed. COMBO-BOX Event OnSelect - Occurs when combo box is selected. EDIT Event OnChangeText Occurs when text in edit box is changed. MEMO Event OnChangeText Occurs when text in memo is changed. RADIO BUTTON Event OnClick Occurs when the button is selected. For more properties, please read the Reference Guide (Help menu Reference, Expert mode must be selected). See objects: UserButton, IUserCheckBox, IUserComboBox, UserControl, UserEdit, UserFormBasic, UserForm, UserGroupBox, IUserLabel, UserListBox, UserMemo, IUserPanel, UserRadioButton, UserStrings. Note: Reference Guide is not being updated for Beta versions. The document will be updated for next commercial release of Toad Data Modeler. Thank you. Copyright: 2009 Quest Software, Inc. 12/12