π€ This blog post was created with AI assistance
If you're working with Uniface 10.4, you might need to customize how your Windows application looks and behaves. The Application Shell is the container for your entire application, and it offers many properties you can configure. Let's explore what you can do! π
π What is an Application Shell?
Think of an Application Shell as the main window frame of your desktop application. It's the outer container that holds everything together - your menus, panels, and content. In Uniface, you can customize this shell to match your application's needs and branding.
π¨ Presentation Properties
These are the basic building blocks of your application shell. You can set them using the Properties Inspector in the Application Shell Editor:
- Title: The text shown in the title bar of your window
- Library: The library where your shell is stored
- Menu Bar: The main menu at the top of your window
- Pop-up Menu: Context menus that appear on right-click
- Panel: The main content area
- Session Panel: A panel that stays active during the session
- Panel Position: Where panels appear in the window
Important Note β οΈ: These presentation properties cannot be changed at runtime using ProcScript. You need to set them during design time.
πͺ Window Properties
Window properties control how users interact with your application window. Here's what you can configure:
Control Properties
- CanClose: Allows users to close the window using the X button
- CanIconize: Enables the minimize button
- CanZoom (Maximize): Enables the maximize button
- CanResize: Lets users resize the window by dragging edges
- SysMenu: Shows the system menu (accessed via the window icon)
Appearance Properties
- BackColor: The background color of your application window
- Caption: The text displayed in the title bar
- MessageLine: A line for displaying messages to users
Behavior Properties
- Dialog: Makes the window behave as a dialog box
- MaximizedForms: Controls whether forms open maximized
- Setup: Configuration settings for the shell
π‘ Example Use Case
Let's say you're building a data entry application. You might want:
- CanClose = true (users can close the window)
- CanIconize = true (users can minimize to work on other tasks)
- CanZoom = false (prevent maximizing to maintain consistent layout)
- CanResize = false (fixed size for consistent data entry forms)
- MessageLine = true (show validation messages and hints)
πΌοΈ Background Image Properties
Want to add some visual appeal? You can set a background image for your application shell! Here are the properties you can configure:
- BackImage: The path to your background image file
- HAlign: Horizontal alignment (left, center, right)
- VAlign: Vertical alignment (top, center, bottom)
- HScale: Horizontal scaling factor
- VScale: Vertical scaling factor
- PreserveAspect: Keep the image's original aspect ratio
π― Example: Corporate Branding
Imagine you want to add your company logo as a subtle watermark:
- BackImage = "company_logo.png"
- HAlign = center
- VAlign = center
- PreserveAspect = true
- HScale = 0.5 (50% of original size)
- VScale = 0.5 (50% of original size)
βοΈ Configuration Tips
Using the Properties Inspector
Most properties are accessible directly through the Properties Inspector in the Application Shell Editor. This is your main tool for configuring the shell during development.
Advanced Window Settings
For window and image properties, click the "More" icon in the Window/App property section. This opens a detailed dialog where you can fine-tune all window behaviors and image settings.
Default Values with usys.ini
You can set default values for BackColor, MessageLine, and image properties using the Shell setting in the usys.ini file. This is useful when you want consistent settings across multiple application shells.
π¨ Common Pitfalls to Avoid
- Runtime Changes: Remember that presentation properties cannot be modified at runtime with ProcScript. Plan your shell properties carefully during design time.
- Image Size: Large background images can slow down your application. Use optimized images and appropriate scaling.
- User Experience: Don't disable CanClose unless you have a good reason. Users expect to be able to close windows!
- Resolution Differences: Test your shell on different screen resolutions to ensure background images and layouts look good everywhere.
π Best Practices
- Keep it Simple: Don't overwhelm users with too many visual elements. A clean interface is often better.
- Consistent Branding: Use BackColor and BackImage to maintain your application's visual identity.
- Accessibility: Ensure good contrast between background and foreground elements for readability.
- Test Thoroughly: Verify all window properties work as expected in your target environment.
- Document Your Choices: Keep notes on why you chose specific property values for future maintenance.
π¬ Conclusion
Windows Application Shell properties in Uniface 10.4 give you powerful control over your application's appearance and behavior. By understanding and properly configuring these properties, you can create professional, user-friendly desktop applications that meet your specific requirements.
Whether you're building a simple data entry tool or a complex enterprise application, taking time to configure your shell properties properly will result in a better user experience and easier maintenance in the long run. β¨
Happy coding! π¨βπ»π©βπ»
Top comments (0)