Studio Changes

Table Viewer

The Studio now supports a simple tool to open any table in the current workspace then view and edit its data.

Opening a Table

To open a table in the Table Viewer double-click the table’s icon in the Table Explorer. You can also click the new Table Viewer icon in the Table Explorer toolbar or right-click and select View Table from the context menu.

Alternatively you can select Table Viewer from the Database menu. This opens the Table Selector dialog. Use this dialog to sort the tables by table number, table name or description. Select the table you wish to open in the Table Viewer window by double-clicking or highlighting the table then clicking the Select button.

You can open any number of tables from your database. Only one Table Viewer window per table is supported.

Modifying the Layout

When a table is opened in the table viewer the table’s columns are arranged left to right in column number order. Large binary columns are listed, but the text “<binary data>” is shown in place of the actual data.

Remove Column

To remove a column from the display, drag the header (caption) with the mouse until the mouse pointer is positioned outside the grid, then drop the column. When the mouse cursor’s shape changes into a large “X” the column can be dropped.

Column Order

To rearrange the order of columns in the grid, drag the column header left or right until the column is hovering over the position you would like it to be, then drop the column. When the mouse cursor changes to show two red arrows indicating the new position, you can drop the column.

Ensure that you do not move the column outside the header area of the grid otherwise instead of changing the column’s position, the column will be removed. If the mouse cursor is the shape of a large “X” then the column will be removed if you drop it in that location.

Column Width

To change the width of a column, drag the divider that separates one column header (caption) from another. Use the divider to the right of the column whose width you wish to modify.

Inserting a Deleted Column

Each column you remove from the display can be re-inserted by activating the field chooser panel. The field chooser is activated by clicking the Field Chooser button in the Table Viewer’s toolbar, or by selecting Field Chooser from the Table Viewer context menu.

The field chooser displays each table column that you have removed from the current Table Viewer window.

To re-insert a column, drag it with the mouse, out of the Field Viewer and over the grid’s header section where you would like the column to be located and then drop the column. When the mouse cursor changes to show two red arrows indicating the new position, you can drop the column.

If you have multiple Table Viewer windows open at one time, then it is best to close the Field Chooser panel as soon as you have finished using it. Otherwise it can be confusing as to which Field Chooser to use for a given Table Viewer window.

Freeze Column

Normally when the Table Viewer grid is too wide to fit in the display area you will use the horizontal scrollbar to scroll the entire grid to the left or to the right. The “Freeze Column” feature can be used to “freeze” the leftmost ‘x’ columns so that they do not scroll horizontally with the rest of the grid, i.e. they will stay in place.

To freeze one or more columns, right-click in the header (caption) of the column where you want to begin freezing and select “Freeze Column” from the context menu. The column you selected and all columns to the left will remain in-place whenever the grid is scrolled horizontally.

Alternatively, you can click the “Freeze Column” toolbar button. This will freeze the currently focused column plus all columns to its left.

To “un-freeze” repeat the same process, or select “Restore Layout”.

Restoring the Layout

Any changes you have made to the by freezing columns, changing the width or position, or by removing columns, can be restored by selecting “Restore Layout”. Either click the Restore Layout toolbar button or select Restore layout from the context menu.

Sorting and Searching

Initially, the data is sorted using the table’s first index (Index #1). You can change the sort order by clicking in the header (caption) of any indexed column. The index used for sorting will be the clicked column’s “Main index” as per the table definition.

When you sort the data by clicking in a column header, the column used for sorting is shaded and an arrow appears in the header (caption) indicating whether the data is sorted in ascending or descending order by that index.

If you click in the header of a sorted column a second time it will toggle the sort order from ascending to descending and vice versa.

To search for a particular row, click in the data area of any indexed column and enter the indexed value you are searching for then click the “Find LT”, “Find EQ”, or “Find GT” buttons on the toolbar to search for the entered value (or the nearest match).

Editing

To begin editing data click the “Toggle Edit Data” button on the toolbar. This will set Table Viewer into editing mode. In editing mode, all columns in the grid can be selected (except for those storing binary data). Simply click, or tab to the row and column you wish to modify and press enter (or simply start typing) to edit that column.

Once you leave the row that you have modified the changed data will be saved. Alternatively you can click the “Save” button in the toolbar to save immediately without having to change rows.

To delete a row, first select it, and then click the “Delete Record” button in the toolbar.

Once you have finished editing data, click on the “Toggle Edit Data” button once again and the Table Viewer will return to read-only mode.

Be careful when editing data in Table Viewer. None of the usual data dictionary and relational database rules are applied while you are using this tool.

 

Table Editor

When editing the structure of an MSSQL or DB2 Table you can now select the SQL data type directly in the column editor grid. Table Editor will set the default column length and precision according to the selected type.

Each native SQL data type still maps to a DataFlex data type as before. You can review the DataFlex data type for each table column by selecting the column in the Table Editor and reviewing the “df_field_type” attribute in the Properties Panel. Some native SQL types map to multiple DataFlex data types (e.g. the MSSQL datetime type maps to DF_DATE or DF_DATETIME). In these cases, if you want to modify the default type mapping you can do so by adjusting the value for the df_field_type attribute in the Properties Panel. When there is a one to one mapping then the df_field_type attribute is read-only.

Table Explorer / Code Editor

Table Explorer and Code Editor Tooltips on database columns also display the native SQL data types.

Configuration

A new option has been added ("Use native SQL data types") to the Configure Studio dialog’s Database page. This controls whether native SQL data types or the DataFlex data types (legacy mode) should be modelled regardless of the database type. By default native SQL data types are modelled. See Tools menu, Configure Studio.

 

Table Explorer Filtering

The Table Explorer now supports filtering the tables that it shows in its list. A new "Filter Settings" dialog allows you to create, edit or clear filters. Filters are individually set for each workspace. Tables can be filtered by Name, number and or description.

Each filter supports “contains”, “not contains”, “greater than”, “less than” or “equal to” comparison operators.

This feature should simplify working with large databases in the Studio.

 

WebApp Previewer

 

Select Controls in the Previewer

To ease the development of views without writing code the previewer now allows controls to be selected using the mouse. Clicking a control makes it the selected object in the studio highlighting it in the Code Explorer and the Properties Panel. This makes these three panels a powerful combination when manipulating user interfaces. Double clicking a control will bring the cursor in the editor to this object allowing the developers too easily switch to working on its event implementation.

Previewer Toggling

The F7 Hotkey action has been modified so that it toggles the WebApp Previewer open or closed.

The F7 hotkey action for the Windows Designer or Data Dictionary Modeler is unchanged.

Context Menu

The WebApp Previewer now has its own dedicated context menu. This replaces the default Internet Explorer browser menu that was displayed previously. Currently the only option in the context menu is “Refresh” which simply re-renders the currently selected Web View.

 

Class Palette

The Class Palette has been re-organized to make it easier to use.

Class Filtering

Classes shown in the list are filtered based on whether the current project being edited is a Windows Application or a Web Application. The current project is the project indicated in the toolbar at the top of the Workspace Explorer panel. When the current project is a Web Application, only “WebApp” classes and “common” classes are shown. When the project is a Windows application then only “Windows” and “common” classes are shown.

Whether a particular class is categorized as WebApp, Windows or Common is determined by the ClassLibrary meta-tag. Valid settings are: WebApp, Common, and Windows. Example:

{ ClassLibrary=WebApp }

Class cWebView is a cWebWindow

...

End_Class

Whenever you are customizing the arrangement of classes in your workspace then Class Palette will switch to displaying the unfiltered full set of classes until you exit the “Rearrange Palette Mode” (see “Rearrange Palette Mode” in the Class Palette context menu).

New WebApp Class Groups

The WebApp class library has been expanded for DataFlex 18.0, therefore we have divided the class palette for WebApp controls into “Web Controls" and “Web Containers”. The order of these groups has also been changed to place the most used controls in the topmost group.

 

Native SQL Column Type Modeling

The Studio now models native SQL data types instead of using the embedded DataFlex data type for MSSQL and DB2 databases using driver CK 6.0 and above. If you are not using the latest CK driver version then the Studio will model your tables using the DataFlex data types as before.

 

Find In Files

 

Current Project Search

The Find In Files dialog now supports searching by all files in the current project. Every source file in the make path that is used in the current project will be searched. This option will ignore source files in the project make path that are not used by the current project.

To use this option go to the Text menu, Find submenu, select Find In files. Then select the “Current Project Files Only” option.

Find Results Toolbar

A toolbar has been added to the Find Results panel that is displayed after a Find in Files operation. The toolbar contains the following options:

 

Disable WebApp Support

The Studio now supports “disabling” and “enabling” the current workspace’s web application.

Previously, disabling a web application would require the following steps…

  1. Launch the Web Application Administrator

  2. Select the web application you wish to disable

  3. Choose “Properties” from the context menu for that web application to open the web application properties dialog

  4. Click the “Disable Web Application” checkbox

  5. Click OK to close the properties dialog.

Disabling a web application will stop the WebApp.exe from running in the process pool that is managed by the Web Application Administrator. The WebApp.exe process pool is not launched again until the web application is enabled.

The Studio now supports a simpler way to disable a web application: Open the “Project Properties” dialog from the “Project” menu and check the “Disable Web Application” option, then click OK to close the dialog. You must be running the Studio with administrator rights in order to disable or enable a web application in this way.

Disabling a web application is useful at certain times. For example:

When a web application is disabled it cannot be run in the normal way but you will still be able to run a disabled web application in the Studio’s debugger, i.e. disabling a web application does not prevent you from test running it in the debugger.

The Studio’s Workspace Dashboard has been modified to display the enabled/disabled status of the workspace’s web application. Clicking on this item in the Dashboard will open the Project Properties dialog, allowing you to toggle the enabled/disabled state.

Note: Disabling a web application is different from “Stopping” a web application. When you “stop” a web application (from within the Web Application Administrator), the web application pool will be unloaded, however, the web application would be automatically re-started whenever you re-boot your machine, or whenever you re-compile your WebApp.exe. Therefore “stopping” a web application is only temporary. When a web application is disabled, the process pool remains unloaded until the web application is explicitly enabled.

 

Message Tracing

The Studio Debugger’s Message Trace panel has been enhanced with its own toolbar for performing common message trace operations. The toolbar currently supports the following options:

 

Create New

 

Caption Support for Templates

The “Create New” operation has been enhanced so that when you are creating any new component using a template (such as a Windows View or a Web View) you are now prompted to enter a caption. The caption will be used to set the component’s caption (e.g. the cWebView’s psCaption property), plus, if the Studio is configured to create a menu item for the new component (e.g. to activate the new view), then the caption is also used to set the caption in the menu item.

 

Workspace Explorer

The following options have been added to the Workspace Explorer’s context menu:

 

Tab View Context Menu Changes

The context menu that is displayed when you right click on the Tab at the top of the Code Editor has been modified.

 

See Also

What's New in DataFlex 2014 - 18.0