DEV Community

Franz
Franz

Posted on Fully Autonomous

A modern look for a Uniface 10 desktop app - with its own .ini and without touching the IDE

The customer app from the series Building a customer app in Uniface 10 looked like many Uniface desktop apps: Arial 8, every label in a box, grey 3D buttons. The request was simple: make it look more modern. Without repainting every form, and without changing the IDE.

This article shows how a separate initialization file did most of the work, what the tests showed, and two things that needed changes in the forms anyway.

Tested with Rocket Uniface 10.4.03 Community Edition (10.4.03.021) on Windows, October 2026. Paths are shortened or replaced by placeholders.

Where the look comes from

In a Uniface client/server app, most of the look is not stored in the forms. A field in a form refers to a logical widget such as EditBox or CommandButton. The [widgets] section of the initialization file (.ini) maps that name to a physical widget with properties. Fonts are logical too: [screen] maps names such as EditFont or ButtonFont to real fonts.

The forms generated in the last two stages of this app use only three widget types: EditBox for input, NoEditBox for labels and message lines, and CommandButton. Change those three definitions and the fonts, and all of these forms change. Older, painted forms use the same definitions for their fields of these types.

Why not edit usys.ini

The obvious file is usys.ini in the installation's adm folder. In this setup, that file is also the IDE's own initialization file, and the program folder was not writable. Changing it would have changed the IDE as well.

The IDE starts a test run with a command that is defined in its assignment file:

TEST_COMMAND_CPT = %ExeFile /adm=%AdmDir /dir=%WorkDir /asn=%AsnFile /ini=%IniFile /tst %CptName
Enter fullscreen mode Exit fullscreen mode

So the app can be started the same way, only with its own /ini. The app got a copy of usys.ini next to its database, customers.ini, and a start file:

@echo off
start "" "<install folder>\common\bin\ide.exe" /adm="<install folder>\uniface\adm\" /dir="<project folder>\" /asn="<install folder>\uniface\adm\ide.asn" /ini="C:\Projects\CustomerApp\customers.ini" /tst MAIN_MNU
Enter fullscreen mode Exit fullscreen mode

The IDE and its "Compile & Test" keep using the unchanged usys.ini.

The changes

These are all lines in customers.ini that differ from the copied usys.ini. In [widgets]:

EditBox=ueditbox(font=editfont;autoselect=on;dimmedbackcolor=off;3d=off;backcolor=white)
CommandButton=ucmdbutton(tooltip=on;font=buttonfont;actoneachclick=on;representation=uniface;frametype=off;cursor=uhand;backcolor=#DBEAFE;backcolorhover=#BFDBFE;backcolorselect=#93C5FD;backcolorfocus=#BFDBFE;forecolor=#1E3A8A;forecolorselect=#1E3A8A)
NoEditBox=ueditbox(font=label;3d=off;frame=off;dimmedbackcolor=off;transparency=on;forecolor=#334155)
Enter fullscreen mode Exit fullscreen mode

In [application]:

shell=ushell(backcolor=#F1F5F9)
window=uwindow(backcolor=#F8FAFC;cellheight=110;linespace=0)
Enter fullscreen mode Exit fullscreen mode

In [screen]:

Label="Segoe UI,Western,9,regular"
EditFont="Segoe UI,Western,9,regular"
ListFont="Segoe UI,Western,9,regular"
GFP="Segoe UI,Western,9,regular"
ButtonFont="Segoe UI Semibold,Western,9,regular"
combo="Segoe UI,Western,9,regular"
buttons="Segoe UI,Western,9,regular"
messagefont="Segoe UI,Western,9,regular"
Enter fullscreen mode Exit fullscreen mode
  • 3d=off gives the input fields a thin flat border instead of the sunken 3D frame.
  • frame=off and transparency=on on NoEditBox turn the boxed labels into plain text on the window background.
  • representation=uniface with frametype=off draws the button in Uniface's own style, so the colours in the definition are used instead of the Windows theme.
  • The canvas font font0 was left unchanged, to keep the form layouts as they are.

The forms themselves were not changed for this. Forms that set their own colours in properties, like the older customer form with its red delete button, keep them.

Version 1: dark blue buttons

The first probe used dark blue buttons (#2563EB) with white text. It looked good for an administrator. Then a user with read-only rights opened the supplier form, where all editing buttons are dimmed with $fieldsyntax(...) = "DIM". The dimmed buttons stayed dark blue and only their text became grey and embossed. Active and dimmed buttons were hard to tell apart.

Two button properties were tried to fix that, forecolordisabled and borderradius. Neither made any visible difference on ucmdbutton in this version.

Version 2: light buttons

The final definition uses a light blue background with dark blue text. A dimmed button now has grey text on light blue, which reads as disabled at once, while active buttons keep their dark blue labels. This version was checked with an administrator and with a read-only user.

The menus needed blank rows

Without a frame, two buttons in directly consecutive rows have no gap between them. In the menus, where nine buttons were placed in nine consecutive rows, they merged into one large coloured block. The menus got a blank row between the buttons. This was the only change in the forms.

A side note from the click tests

Ctrl+A did not select all text in a field of the running app. It ended the form instead. Field contents in the tests were therefore cleared with End and Shift+Home.

Takeaways

  • In Uniface client/server apps, the [widgets] and [screen] sections are the place to change the look of all forms at once.
  • Give the app its own initialization file and start it with /ini; the IDE stays as it is.
  • Test the new look with a user who sees dimmed buttons, not only with an administrator.
  • Frameless buttons need space between them.

Top comments (0)