Note: This blog post was created with AI assistance to help developers understand Uniface UI concepts.
π Introduction
If you're working with Uniface 10.4, understanding how user interfaces work is essential. The way your application looks and responds to users depends on several key concepts: presentation components, widgets, and styling properties. Let's break these down in simple terms! π
πΌοΈ What Are Presentation Components?
Presentation components are the parts of your Uniface application that users actually see and interact with. Think of them as the "face" of your application - the buttons, text fields, lists, and forms that make up your user interface.
The way these components look on screen depends on three main factors:
- Layout - How elements are positioned and arranged
- Styling properties - Colors, fonts, borders, and other visual aspects
- Operating system - Windows, Linux, or other platforms may render things differently
π§© Understanding Widgets
Widgets are the building blocks of your user interface. They represent individual objects in your application and control how users interact with them. Every visual element you see in a Uniface application is powered by a widget.
Two Types of Widgets π§
1. Implicit Widgets (Built-in)
Some widgets are implicit, meaning they're automatically built into certain objects. You don't need to choose or configure them - they're just there. Examples include:
- Components themselves
- Occurrences (repeated data structures)
- Application shells (the main window framework)
Example: When you create a component in Uniface, it automatically has a widget that handles its basic display and behavior.
2. Explicit Widgets (Customizable)
Other widgets are explicit, which means you get to choose which type to use. This gives you flexibility in how data is displayed and how users interact with it. Examples include:
- Fields (text boxes, dropdowns, checkboxes)
- Entities (data structures)
Example: For a customer name field, you could choose:
- A simple text field widget for basic input
- A label widget for display-only
- A dropdown widget if selecting from predefined names
π¨ Styling Your Interface
Every widget has properties that let you control two important aspects:
- Visual styling - How the widget looks (colors, fonts, sizes)
- User interactions - How the widget responds to user actions (clicks, typing, hovering)
Example: A button widget might have properties like:
-
BackgroundColor
- Sets the button's color -
FontSize
- Controls text size -
Enabled
- Determines if users can click it -
Visible
- Shows or hides the button
π‘ Key Takeaways
- β Presentation components create the user interface
- β Widgets are the building blocks that make objects visible and interactive
- β Implicit widgets are automatic; explicit widgets are customizable
- β Widget properties control appearance and behavior
- β The final look depends on layout, styling, and the operating system
π― Practical Application
When building a Uniface application, start by identifying which parts need user interaction. For each interactive element, choose the appropriate explicit widget type that matches your needs. Then use widget properties to style and configure the behavior to create a user-friendly interface.
Remember: The more you understand about widgets and their properties, the more control you have over your application's user experience! π
Happy coding with Uniface 10.4! π
Top comments (0)