π This blog post was created with AI assistance to help explain Uniface development concepts in simple terms.
If you're working with Uniface 10.4 and want to make your forms more visually appealing and user-friendly, the $curoccvideo
function is your go-to tool! π Let's break down this powerful function that controls how your form fields look and feel.
π€ What is $curoccvideo?
The $curoccvideo
function allows you to set or retrieve video properties (visual styling) for fields in the current occurrence of your Uniface forms. Think of it as your styling brush that can highlight, color, and modify how users see and interact with your form data.
π Basic Syntax
The function works in two ways:
// Setting video properties
$curoccvideo(Entity, "Option") = "AttributeList"
// Getting video properties
AttributeList = $curoccvideo(Entity, "Option")
π§ Key Parameters Explained
Entity Parameter
- Entity name: Targets a specific entity (like "CUSTOMER")
- "*": Applies to all entities in the form
- Omitted: Only affects the current entity
Option Parameter
- "inner": Applies styling to inner entities only π―
- "up": Affects only entities drawn as up entities
- "off": Turns off video highlighting completely β
π¨ Visual Attributes You Can Use
Attribute | Effect | Description |
---|---|---|
BLI | β¨ Blinking | Makes text blink (use sparingly!) |
BOR | π² Border | Adds a border around fields |
BRI | βοΈ Bright | Makes text appear brighter |
HLT | π Highlight | Uses system highlight color (highest priority) |
INV | π Inverse | Inverts foreground/background colors |
UND | π Underline | Underlines the text |
COL=n | π¨ Color | Sets specific color using color codes |
π‘ Practical Examples
Example 1: Basic Highlighting
// Make current CUSTOMER occurrence appear highlighted
$curoccvideo("CUSTOMER") = "HLT"
Example 2: Custom Colors
// White text on blue background for inner entities
$curoccvideo("CUSTOMER", "inner") = "COL=57"
π Color code 57 = 56 (white foreground) + 1 (blue background)
Example 3: Multiple Attributes
// Bright, underlined text with border
$curoccvideo("ORDER") = "BRI;UND;BOR"
Example 4: Turning Off Highlighting
// Remove highlighting from inner entities
vOptions = "inner,off"
$curoccvideo("CUSTOMER", vOptions)
β‘ Pro Tips for Better User Experience
- π― Use HLT for consistency: The HLT attribute always takes precedence and uses system colors that users are familiar with
- π Mind the active field: Remember that active field properties can override current occurrence settings
- π± Test color combinations: Ensure your color choices don't make selected text invisible
- βοΈ Balance is key: Don't overuse blinking or too many bright colors - it can be distracting
π¨ Common Gotchas
- Single occurrences: This function doesn't affect entities used as single occurrences (unless they're up entities)
- Priority conflicts: Field-level video properties can override occurrence-level ones
- System compatibility: HLT attribute might conflict with Windows text selection highlighting
π― When to Use $curoccvideo
This function is perfect for:
- π Highlighting the currently selected record in data grids
- π Drawing attention to important or error fields
- π¨ Creating visual hierarchy in complex forms
- βΏ Improving accessibility and user navigation
π Getting Started
Start simple! Try adding basic highlighting to your current occurrence:
// In your form's trigger
$curoccvideo() = "HLT"
Then gradually experiment with more advanced options as you become comfortable with the function.
Remember, good visual design enhances user experience without overwhelming the interface. Happy coding! π
Top comments (0)