Cosmos

Technical Notes v. 7.0

This version of Cosmos is not completely compatible with Windows XP, Windows Server 2003 and earlier versions of Windows.

To run Cosmos applications developed with versions prior to 7.0 it is recommended to recompile the project.

NEW UTILITY INCLUDED FROM THIS VERSION

CosSignPdf. The CosSignPdf dll (cossignpdf.dll) allows you to sign PDF documents from Cosmos using a digital certificate. This certificate must be installed in the system, either in the Windows certificate store or in a certificate store (file). (PDF version)

ImplementationsTop

Cosmos 7 sample application

Cosmos 7 sample application

Automatic edit modeTop

An automatic mode has been implemented to modify the records of a table.

This mode can only be used in:

  1. Maintenance Forms using the predefined Form commands (editing and non-editing modes).
  2. Whether the control used in the maintenance of the table is a Grid.
  3. The table is in Browse status.

Activation

This mode can be activated at the module level, in the Form class or globally.

Module level:
Module.SetOption("AUTOEDITMODE", TRUE)

Form class level:
objForm.SetOption("AUTOEDITMODE", TRUE)

Globally:
Environment variable AUTOEDITMODE=TRUE

How it works

Cosmos Edit Mode
Whether this mode is activated, launching the On-click event in the Grid control of a Formtable will edit the child control and the table will be edited for modification. Automatically:

  1. The AcceptEdit and CancelEdit commands wil be activated.
  2. The querying and delete commands will be deactivated.
  3. The EditUpdate command and the On Edit table event of the current table will be sent.
  4. The record will be locked.

Whether the field value is not modified, the CancelEdit command will be sent automatically.

Whether the value is modified, the AcceptEdit command will be sent when the current file is changed.

When the cursor is on the last row of the Grid control and the down arrow key is pressed, the Formtable will be set to status New. To add the record, press the up arrow to change the active row, or execute the AcceptEdit command.

Cosmos Not Edit Mode
Whether this mode is activated, launching the On-Click event in the Grid control of a Formtable will edit the child control. Whether the field value is modified, the command Update will be executed automatically. Whether the field is not modified, no command will be executed.

Whether de cursor is positioned in the last row of the Grid control and the down arrow key is pushed, the Formtable will be set to New state. In order to add the new row, the up arrow key must be pushed, or run the Add command.

Keyboard keys

a) Moving the cursor between rows of the grid:
In order to moving the cursor from one row to the next or previous row, you can use the next keys:

NOTE: If the control that is being edited at that moment has these keys captured, the focus will not change row, but the actions assigned to that control will be executed. For example, in the case of a drop list, when you press the up arrow or the down arrow keys, we go through the elements of the list and the current row will not be changed.

b) Scrolling between the columns of a row:

Custom style on Form controlsTop

A new display style has been implemented for the controls of a Form.

In this new style the controls will be drawn with rectangular borders and flat colors, without taking into account the visual style of the Windows OS where the application is running.

In addition, you can change the default colors of the background and text of all controls, by type of control, respecting the colors of those who were assigned a color other than this at design time or at runtime.

These changes will only have an effect on execution, they can’t be viewed at design time.

To activate this new display mode it will be necessary:

  1. Define the COSMOSVISUALMODE environment variable in the project configuration file.
    The value of this variable must be 7.
  2. Create a new section in this file with the name [Custom Colors].
    This section will only have to be defined if you want to change the colors that Cosmos assigns by default.
    Indicate the name of the property and assign it a color. The color can be assigned by:
    1. The expression Rgb (red, green, blue), being red, green and blue the shades of color in base 10.
    2. With the hexadecimal value represented by the color, using an expression in the following format: #RRGGBB, where RR, GG and BB are the hexadecimal value corresponding to red, green and blue respectively.

For further information see the PDF document

Rich text in Edit ControlTop

The possibility of using an editing control as an editing control with rich text has been implemented.

To do this, you have to check the Check control "Rich Text" in the properties dialog of the control in the General tab.

Methods

All the methods listed below belong to the SimpleControl class, but are indicated in this section for clarity.

Properties

Name Description
ALIGNMENT Indicates the alignment of the paragraph where the cursor is located:
1: left, 2: right, 3: centered.
BACKCOLOR Background color.
BOLD The selected text will be shown in bold. If it is already in bold, the property will be removed.
CARETPOSITION Cursor position. The first character is 0.
FILE File assigned to the control.
FONT Text font.
FORECOLOR Text color.
ITALIC The selected text will be displayed in italics. If it is already in italics, the property will be removed.
LEFTINDENT Indicates the indentation of the paragraph where the cursor is located with respect to the current indentation of the paragraph.
A negative indent indicates that it will be suppressed to the extent indicated in the parameter.
The unit that is used is the "twip". 1,440 twips correspond to 1 inch, or 57 twips to 1 mm.
LINESPACING Spacing between lines.
Allowed values:
  0  Simple spacing.
  1  1,5 lines spacing.
  2  Double spacing.
NUMBERINGBULLET Graphical point of enumeration of the paragraph where the cursor is located.
NUMBERINGLETTER Lowercase letter for the enumeration of the paragraph where the cursor is located.
NUMBERINGNUMBER Integer number for the enumeration of the paragraph where the cursor is located.
NUMBERINGROMAN Roman numeral in lowercase letters for the enumeration of the paragraph where the cursor is located.
NUMBERINGULETTER Capital letter for the enumeration of the paragraph where the cursor is located.
NUMBERINGUROMAN Roman numeral in capital letters for the enumeration of the paragraph where the cursor is located.
UNDERLINE The selected text will be underlined. If it is already underlined, the property will be removed.

SplitButton ControlTop

The Split button is a more complex control than a Push Button control. It is a split button that has a predetermined action followed by a divider line and an arrow.

If you press the secondary button of the control (on the arrow) a menu or a form will be displayed, and it will not execute the predefined action of the button. If you click on the primary button, the default action will be executed (On Click event or the associated button command), that is, it will work as a Push Button control.

These buttons are defined at runtime, not at design time, by invoking the SetSplitButton method of the SimpleControl class.

Environment variablesTop

SimpleControl class methodsTop

EventsTop

The events implemented in this version are the following:

Constant values in Page Class and Prnpag32.dll APITop

A series of constants has been implemented in the Page class and in the "* .pag" files used by the "prnpag" dll.

These constants are defined at design time in the Label property of the Text controls. It will be the runtime of Cosmos responsible for assigning the corresponding value during its execution.

The constants are:

Constant Description
%PAGE% Assigns the current page number to the control.
%TOTALPAGES% It will assign to the control the total number of pages in the list. This value will be correct if the last page has not yet been sent to the printer, that is, all the pages in the list are in the buffer.
%YYYY% It will assign to the control the year of the current date with four digits.
%MM% It will assign to the control the month of the current date with two digits.
%DD% It will assign to the control the month day of the current date with two digits.
%MON% It will assign to the control the abbreviated name of the month of the current date.
%MONTH% It will assign to the control the full name of the month of the current date.
%DY% It will assign to the control the abbreviated name of the day of the week of the current date.
%DAY% It will assign to the control the full name of the day of the week of the current date.
%USERNAME% It will assign to the control the name of the user that executes the listing process.

TTToolsTop

Two new parameters have been added to the TTTools index check and repair tool.

Sintaxis:

TTTools [-ndl | dl] [-all] [path] [table]

Parameters:

Parameter Description
[-ndl | dl] Optional and self-excluding parameters:
ndl      The indexes are regenerated with no duplicate limit.
dl        The indexes are regenerated with a limit of duplicates (32,767).
If no value is indicated, the indexes are regenerated without limit of duplicates.
[-all] Optional parameter. All the tables in the database will be repaired. The process does not ask for confirmation.
[path] Optional parameter. Directory of the database without the extension (dbs).
[table] Optional parameter. Name of the table to be repaired.

NOTA: The parameters [-all] and [table] are self-excluding.

Bug fixesTop

In this version, we have performed corrections in the following components: