Kbase P126095: How to use Manual-Highlight attribute and what it's for?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  22/10/2007 |
|
Status: Unverified
GOAL:
How to use Manual-Highlight attribute and what it's for?
GOAL:
Sample Manual-Highlight
GOAL:
Example of Manual-Highlight
GOAL:
Why doesn't Manual-Highlight work with my button?
FACT(s) (Environment):
All Supported Operating Systems
Progress/OpenEdge Versions
FIX:
The manual-highlight attribute was introduced to Progress back in Version 7, when event-driven programming and the User Interface Builder was created, but it is a little used feature of the 4GL and this article is intended to explain when and how to use it.
The attribute was implemented with a visual application builder interface in mind. Progress provided such a interface with the UIB and AppBuilder and made the language components it uses available for developers to write their own implementations of it. This is essentially part of that.
The MANUAL-HIGHLIGHT attribute itself provides the developer the ability to change the default selection visualization that Progress provides with the SELECTABLE attribute and modifies the default behavior of the RESIZABLE attribute.
By default, with SELECTABLE and RESIZABLE set to TRUE for a widget, when the user selects the widget they see a box around the widget with resize handles. This causes the mouse cursor to change when moved over one of the resize handles to indicate the user can grab there and start resizing.
When the MANUAL-HIGHLIGHT attribute is turned on these handles are not available, so it's not a terribly friendly attribute if you are going to make your widget resizable.
To use MANUAL-HIGHLIGHT you must set it to TRUE for the widget and also you must set SELECTABLE to TRUE. Then you need to define a behavior for the widget and implement it in the SELECTION and DESELECTION triggers for the widget.
A good example of the intent of this attribute can be demonstrated with the RECTANGLE widget. The code below shows the color of the RECTANGLE change when it is selected.
Note: BUTTON color on Windows is determined by the Windows environment so, while the attribute is available for buttons it is not useful for the changing background or foreground color of the widget. P8351, "Button color: Why does MS-Windows ignore color changes?"
/* Rectangle example with Manual-Highlight */
DEFINE RECTANGLE rect-1 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL SIZE 19 BY 2.14.
DEFINE FRAME a rect-1 WITH THREE-D SIZE 60 BY 12.
ASSIGN rect-1:MANUAL-HIGHLIGHT IN FRAME a = TRUE
rect-1:SELECTABLE IN FRAME a = TRUE
rect-1:MOVABLE IN FRAME a = TRUE
rect-1:BGCOLOR IN FRAME a = 3.
ON SELECTION OF rect-1 IN FRAME a
SELF:FILLED = TRUE.
ON DESELECTION OF rect-1 IN FRAME a
SELF:FILLED = FALSE.
ENABLE ALL WITH FRAME a.
WAIT-FOR CLOSE OF THIS-PROCEDURE.