smartplant materials applying a color schema to custom screens

35
SmartPlant Materials Applying a Color Schema to Custom Screens Version 2008 (6.3.1) June 2008 DMAR1-PE-200071B

Upload: others

Post on 12-Mar-2022

4 views

Category:

Documents


0 download

TRANSCRIPT

SmartPlant Materials Applying a Color Schema to Custom Screens

Version 2008 (6.3.1) June 2008 DMAR1-PE-200071B

Copyright Copyright © 2007-2008 Intergraph Corporation. All Rights Reserved.

Including software, file formats, and audiovisual displays; may be used pursuant to applicable software license agreement; contains confidential and proprietary information of Intergraph and/or third parties which is protected by copyright law, trade secret law, and international treaty, and may not be provided or otherwise made available without proper authorization.

Restricted Rights Legend Use, duplication, or disclosure by the government is subject to restrictions as set forth below. For civilian agencies: This was developed at private expense and is “restricted computer software” submitted with restricted rights in accordance with subparagraphs (a) through (d) of the Commercial Computer Software - Restricted Rights clause at 52.227-19 of the Federal Acquisition Regulations (“FAR”) and its successors, and is unpublished and all rights are reserved under the copyright laws of the United States. For units of the Department of Defense (“DoD”): This is “commercial computer software” as defined at DFARS 252.227-7014 and the rights of the Government are as specified at DFARS 227.7202-3.

Unpublished – rights reserved under the copyright laws of the United States. Intergraph Corporation Huntsville, Alabama 35894-0001

Warranties and Liabilities All warranties given by Intergraph Corporation about equipment or software are set forth in your purchase contract, and nothing stated in, or implied by, this document or its contents shall be considered or deemed a modification or amendment of such warranties. Intergraph believes the information in this publication is accurate as of its publication date.

The information and the software discussed in this document are subject to change without notice and are subject to applicable technical product descriptions. Intergraph Corporation is not responsible for any error that may appear in this document.

The software discussed in this document is furnished under a license and may be used or copied only in accordance with the terms of this license.

No responsibility is assumed by Intergraph for the use or reliability of software on equipment that is not supplied by Intergraph or its affiliated companies. THE USER OF THE SOFTWARE IS EXPECTED TO MAKE THE FINAL EVALUATION AS TO THE USEFULNESS OF THE SOFTWARE IN HIS OWN ENVIRONMENT.

Intergraph is not responsible for the accuracy of delivered data including, but not limited to, catalog, reference and symbol data. Users should verify for themselves that the data is accurate and suitable for their project work.

Trademarks Intergraph, the Intergraph logo, PDS, SmartPlant, SmartSketch, FrameWorks, INtools, MARIAN, ISOGEN, and IntelliShip are registered trademarks and SupportModeler and SupportManager are trademarks of Intergraph Corporation. Microsoft and Windows are registered trademarks of Microsoft Corporation. Other brands and product names are trademarks of their respective owners.

Table of Contents

SmartPlant Materials Applying a Color Schema to Custom Screens 3

Table of Contents Introduction ........................................................................................................................4 

Roadmap .............................................................................................................................5 

Create / Edit Library File .................................................................................................6 

Coding for the Library Procedure .................................................................................7 Create / Update Library File .......................................................................................11 

Update the Color Palette of Forms .................................................................................12 

Create or Edit Colors ..................................................................................................13 Create WHITE .................................................................................................................. 14 Create BLACK .................................................................................................................. 15 Create CANVAS ............................................................................................................... 16 Create BLUE ..................................................................................................................... 17 Create GREEN .................................................................................................................. 18 

Create Visual Attributes .................................................................................................19 

CG$TITLE ..................................................................................................................19 CG$PUSH_BUTTON ................................................................................................20 CG$CANVAS ............................................................................................................21 QMS$CURRENT_RECORD .....................................................................................22 CG$ITEM ...................................................................................................................23 CG$DISPLAY_ITEM ................................................................................................24 REQUIRED_ITEMS ..................................................................................................25 QUERY_ITEM ...........................................................................................................26 CG$MANDATORY_RADIO_BUTTON ..................................................................27 CG$OPTIONAL_RADIO_BUTTON ........................................................................28 CG$ MANDATORY_CHECK_BOX ........................................................................29 CG$OPTIONAL_CHECK_BOX ...............................................................................30 

Attach Library to Form ..................................................................................................31 

Implement Library Call ..................................................................................................33 

Introduction

4 SmartPlant Materials Applying a Color Schema to Custom Screens

Introduction This document describes how to configure and adapt customer-created ORACLE Forms to predefined SmartPlant Materials Themes.

Roadmap

SmartPlant Materials Applying a Color Schema to Custom Screens 5

Roadmap 1. Write (copy) the Procedure to activate the colors. The Procedure should be the

content of an already existing libraryfile. If you have no library (xxx.pll/plx), create one and add the procedure to the libraryfile.

2. Edit the Color Palette of Forms, and create SmartPlant Materials color palette colors (canvas, white, black, blue, yellow, and green).

3. Create named property classes that include SmartPlant Materials standard visual attributes and add them into your forms.

4. Attach the library to all involved user created forms. 5. Implement a library procedure call in when-new-form-instance trigger at form

level.

Create / Edit Library File

6 SmartPlant Materials Applying a Color Schema to Custom Screens

Create / Edit Library File The library procedure can be copied as-is. This procedure activates the SmartPlant Materials Theme colors when a user form is opened.

We provide you with code that can be copied completely into a library editor. This code will display your user forms with your defined or selected themes. If no theme is selected, then the software will appear with the default SmartPlant Materials Theme ('NEW THEME') colors.

Create / Edit Library File

SmartPlant Materials Applying a Color Schema to Custom Screens 7

Coding for the Library Procedure ----------------Code for your library procedure “Set_user_color” ----begin------------ PROCEDURE set_user_color IS v_color_test m_theme_colors.mtc_id%type; my_user m_theme_colors.m_usr_id%type := name_in ('GLOBAL.user'); my_project m_projects.proj_id%type := NAME_IN ('GLOBAL.proj_id' ); my_dp_id m_disciplines.dp_id%type := NAME_IN ('GLOBAL.dp_id' ); v_pgr_id m_projects.pgr_id%TYPE; cursor get_color is select RGB_CANVAS , RGB_REQUIRED_ITEM , RGB_QUERY_ITEM, RGB_ITEM , RGB_QUERY_MODE , RGB_SCROLLBAR, RGB_BUTTON , RGB_CALENDAR , RGB_CURR_INDIC from m_theme_colors where mtc_id = v_color_test; BEGIN ---check which colors to set ---user level begin begin select u.mtc_id into v_color_test from m_theme_colors c, m_users u where u.M_USR_ID = my_user and c.mtc_id = u.mtc_id; exception when no_data_found then null; begin Select b.pgr_id into v_pgr_id from m_projects b where b.proj_id = my_project; SELECT PARM_VALUE INTO v_color_test FROM m_ppd_defaults WHERE pgr_id = (Select b.pgr_id

Create / Edit Library File

8 SmartPlant Materials Applying a Color Schema to Custom Screens

from m_projects b where b.proj_id = my_project) AND proj_id = my_project AND dp_id = my_dp_id AND parm_id = (SELECT parm_id FROM m_appl_parm WHERE parm_code = 'ZX_THEME') and parm_value <> './.'; exception when no_data_found then v_pgr_id := null; begin --proj_setting SELECT PARM_VALUE INTO v_color_test FROM m_ppd_defaults WHERE pgr_id = (Select b.pgr_id from m_projects b where b.proj_id = my_project) AND proj_id = my_project AND dp_id is null AND parm_id = (SELECT parm_id FROM m_appl_parm WHERE parm_code = 'ZX_THEME') and parm_value <> './.'; exception when no_data_found then begin --Dba_setting select mtc_id into v_color_test from m_theme_colors

where color_code = m_pck_dba_settings.get_value('THEME_COLOR');

exception when others then v_color_test := null; end; end; end; end; end; begin ---set default NEW THEME if v_color_test is null then begin

select mtc_id into v_color_test from m_theme_colors where color_code = 'NEW THEME'

Create / Edit Library File

SmartPlant Materials Applying a Color Schema to Custom Screens 9

and personal = 'N'; exception when others then null; end;

end if; end; --set colors begin if v_color_test is not null then for i in get_color loop if i.RGB_QUERY_MODE is not null then

set_va_property ('QUERY_MODE', background_color, i.RGB_QUERY_MODE);

end if; if i.RGB_REQUIRED_ITEM is not null then

set_va_property ('REQUIRED_ITEMS', background_color, i.RGB_REQUIRED_ITEM);

end if; if i.RGB_ITEM is not null then

set_va_property ('CG$ITEM', background_color, i.RGB_ITEM);

end if; if i.RGB_SCROLLBAR is not null then

set_va_property ('CG$DISPLAY_ITEM', background_color, i.RGB_SCROLLBAR);

end if; if i.RGB_BUTTON is not null then

set_va_property ('CG$PUSH_BUTTON', background_color, i.RGB_BUTTON );

end if; if i.RGB_CANVAS is not null then

set_va_property ('CG$CANVAS', background_color, i.RGB_CANVAS);

end if; if i.RGB_CURR_INDIC is not null then

set_va_property ('QMS$CURRENT_RECORD', background_color, i.RGB_CURR_INDIC );

end if;

Create / Edit Library File

10 SmartPlant Materials Applying a Color Schema to Custom Screens

-- CG$CURRENT_RECORD --corresponding items if i.rgb_canvas is not null then

set_va_property ('CG$MANDATORY_CHECK_BOX', background_color, i.RGB_CANVAS ); set_va_property ('CG$OPTIONAL_CHECK_BOX', background_color, i.RGB_CANVAS ); set_va_property ('CG$MANDATORY_RADIO_Button', background_color, i.RGB_CANVAS ); set_va_property ('CG$OPTIONAL_RADIO_Button', background_color, i.RGB_CANVAS ); set_va_property ('CG$TITLE', background_color, i.rgb_canvas);

end if; end loop; end if; end; end; ----------------Code for your library procedure “Set_user_color” ----end-------------

Create / Edit Library File

SmartPlant Materials Applying a Color Schema to Custom Screens 11

Create / Update Library File 1. Start Forms Builder. 2. Open existing library,

or

Create new library FILE / NEW / PL/SQL Library.

3. Create the Procedure Program Unit “set_user_color”.

and click OK.

4. When the Editor opens, delete all code and copy the sample code into the editor. 5. Compile and save the library to the SmartPlant Materials FMX directory.

Update the Color Palette of Forms

12 SmartPlant Materials Applying a Color Schema to Custom Screens

Update the Color Palette of Forms Because the SmartPlant Materials visual attributes use predefined colors from the SmartPlant Materials Color Palette, your color palette has to be updated and modified.

1. Open Forms Builder. 2. In the Forms Builder, click Edit > Preferences, and set the Colour Mode to

"Editable". 3. Close Forms Builder (this is a must). 4. Open Forms Builder again. 5. Open the user form. 6. Open the layout editor for canvases, then click Edit > Layout Options > Color

Palette. This will bring up the palette editor, and you will be able to edit or rename colors (the lower-left region of the palette contains eight empty cells into which you can place custom-defined colors).

Update the Color Palette of Forms

SmartPlant Materials Applying a Color Schema to Custom Screens 13

Create or Edit Colors The colors of the two regions on the left are to be modified.

Update the Color Palette of Forms

14 SmartPlant Materials Applying a Color Schema to Custom Screens

Create WHITE Select one field in the two left rows, and type WHITE into the field’s current color, and then click Edit.

Type 255 in the Rot (red) box .

Type 255 in the Grün (green) box.

Type 255 in the Blau (blue) box.

Click Farben hinzufügen (add colors), and click OK.

Update the Color Palette of Forms

SmartPlant Materials Applying a Color Schema to Custom Screens 15

Create BLACK Select the next field in the two left rows, and type “black” into the field’s current color, and then click Edit.

Type 0 in the Rot (red) box.

Type 0 in the Grün (green) box.

Type 0 in the Blau (blue) box.

Click Farben hinzufügen (add colors), and click OK.

Update the Color Palette of Forms

16 SmartPlant Materials Applying a Color Schema to Custom Screens

Create CANVAS Select the next field in the two left rows, and type “canvas” into the field’s current color, and then click Edit.

Type 192 in the Rot (red) box.

Type 192 in the Grün (green) box.

Type 192 in the Blau (blue) box.

Click Farben hinzufügen (add colors), and click OK.

Update the Color Palette of Forms

SmartPlant Materials Applying a Color Schema to Custom Screens 17

Create BLUE Select the next field in the two left rows, and type “blue” into the field’s current color, and then click Edit.

Type 0 in the Rot (red) box.

Type 0 in the Grün (green) box.

Type 255 in the Blau (blue) box.

Click Farben hinzufügen (add colors), and click OK.

Update the Color Palette of Forms

18 SmartPlant Materials Applying a Color Schema to Custom Screens

Create GREEN Select the next field in the two left rows, and type “green” into the field’s current color, and then click Edit.

Type 0 in the Rot (red) box.

Type 255 in the Grün (green) box.

Type 0 in the Blau (blue) box.

Click Farben hinzufügen (add colors), and click OK.

Create Visual Attributes

SmartPlant Materials Applying a Color Schema to Custom Screens 19

Create Visual Attributes CG$TITLE

The visual attribute group named CG$TITLE is used for fields that are used as dynamic prompts.

Create Visual Attributes

20 SmartPlant Materials Applying a Color Schema to Custom Screens

CG$PUSH_BUTTON Use the visual attribute group named CG$PUSH_BUTTON for buttons.

Create Visual Attributes

SmartPlant Materials Applying a Color Schema to Custom Screens 21

CG$CANVAS With the exception of the canvas named QMS$TOOLBAR (SmartPlant Materials standard canvas for the menu), the CG$CANVAS visual attribute group must be assigned to all canvasses.

Create Visual Attributes

22 SmartPlant Materials Applying a Color Schema to Custom Screens

QMS$CURRENT_RECORD QMS$CURRENT_RECORD is a visual attribute to be assigned to the current record indicator of a SmartPlant Materials forms data block.

Create Visual Attributes

SmartPlant Materials Applying a Color Schema to Custom Screens 23

CG$ITEM Use the visual attribute group named CG$ITEM for editable (updatable) text fields like SHORT DESC or DESCRIPTION.

Create Visual Attributes

24 SmartPlant Materials Applying a Color Schema to Custom Screens

CG$DISPLAY_ITEM The visual attribute group named CG$DISPLAY_ITEM is used for fields that are not editable (updatable) after creation.

Create Visual Attributes

SmartPlant Materials Applying a Color Schema to Custom Screens 25

REQUIRED_ITEMS This visual attribute is not to be applied to an item.

During runtime, when the user inserts a new record, all fields with the property “required” are displayed as in this visual attribute configuration.

Create Visual Attributes

26 SmartPlant Materials Applying a Color Schema to Custom Screens

QUERY_ITEM This visual attribute is not to be applied to an item.

During runtime, when the user has chosen query modus, all fields with the property “queryable” are displayed as in this visual attribute configuration.

Create Visual Attributes

SmartPlant Materials Applying a Color Schema to Custom Screens 27

CG$MANDATORY_RADIO_BUTTON Use the visual attribute group named CG$MANDATORY_RADIO_BUTTON for the elements of a radio group that have the property “required”.

Create Visual Attributes

28 SmartPlant Materials Applying a Color Schema to Custom Screens

CG$OPTIONAL_RADIO_BUTTON Use the visual attribute group named CG$OPTIONAL_RADIO_BUTTON for the elements of a radio group that do not have the property “required”.

Create Visual Attributes

SmartPlant Materials Applying a Color Schema to Custom Screens 29

CG$ MANDATORY_CHECK_BOX Use the visual attribute named CG$MANDATORY_CHECK_BOX for a check box that has the property “required”.

Create Visual Attributes

30 SmartPlant Materials Applying a Color Schema to Custom Screens

CG$OPTIONAL_CHECK_BOX Use the visual attribute named CG$OPTIONAL_CHECK_BOX for a check box that has the property “required”.

Attach Library to Form

SmartPlant Materials Applying a Color Schema to Custom Screens 31

Attach Library to Form

Highlight ATTACHED LIBRARIES, and click +.

Click Browse.

Attach Library to Form

32 SmartPlant Materials Applying a Color Schema to Custom Screens

Select your library, and click öffnen (open).

Click Attach.

Click Yes (make sure your library file is in the fmx directory of the SmartPlant Materials directory structure).

Implement Library Call

SmartPlant Materials Applying a Color Schema to Custom Screens 33

Implement Library Call Access the trigger called WHEN-NEW-FORM-INSTANCE at the forms level.

For this example, the created library file is called MY_LIBRARY.

Double-click the WHEN-NEW-FORM-INSTANCE trigger, or create WHEN-NEW-FORM-INSTANCE if it is not present in the forms trigger area.

Implement Library Call

34 SmartPlant Materials Applying a Color Schema to Custom Screens

Create similar coding, compile, and generate the runtime versions (xxx.fmx files).

Implement Library Call

SmartPlant Materials Applying a Color Schema to Custom Screens 35

Create similar coding, compile, save, and generate the runtime versions (fmx files) of your forms.

Now your forms should appear in the selected color theme of SmartPlant Materials.