Apply "skins/theme" to forms | Uniface 9 | Forum

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

—  Results per page  —








— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters
For a group of consecutive words like 'end of support' use Match phrase

sp_Feed Topic RSS sp_TopicIcon
Apply "skins/theme" to forms
18 Apr 2017
9:27 am
Avatar
Claudio
Italy
Member
Forum Posts: 83
Member Since:
05 Jun 2016
sp_UserOfflineSmall Offline

Hello Unifacers,
is there a way to apply themes or skins (or in any way beautify) the Uniface Forms?
Our software is aimed at a large scale of customers, and some potential customers were uncertain, judging it a bit archaic because of not modern UI.

What I mean with “theme” or “skin”: https://community.embarcadero.com/blogs/entry/how-to-skin-vcl-apps-with-custom-vcl-styles-in-delphi-and-c-builder

Thanks all
Claudio

19 Apr 2017
1:53 pm
Avatar
Theo Neeskens
Member
Forum Posts: 333
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Claudio,

While Uniface does not has a full “skinning” functionality, there is a lot that you can do to change the look and feel of your application without changing the code.

For forms, entities, area frames, and widgets you can set dozens of properties through the .ini configuration file.

Especially in the Uniface 9.6 / 9.7 time frame many options have been added.

You can find everything in the documentation, but for inspiration you can also have a look at the blog posts:

 

http://unifaceinfo.com/modern-…..-are-flat/

http://unifaceinfo.com/styling…..iface-9-7/

http://unifaceinfo.com/moderni…..asy-steps/

http://unifaceinfo.com/moderni…..-7-part-2/

http://unifaceinfo.com/moderni…..e-buttons/

http://unifaceinfo.com/tab-wid…..ns-9-6-04/

http://unifaceinfo.com/moderni…..creen-idf/   <- This looks the most like skinning

http://unifaceinfo.com/overvie…..ex-widget/

http://unifaceinfo.com/moderni…..plication/

19 Apr 2017
3:04 pm
Avatar
Claudio
Italy
Member
Forum Posts: 83
Member Since:
05 Jun 2016
sp_UserOfflineSmall Offline

Thank you very much Theo,
often “skinning” mean adjust objects on forms, but this is a nice starting point!

Is there a way to centralize different color profiles, without having to change the file before the application starts?

Regards
Claudio

19 Apr 2017
4:22 pm
Avatar
luis.vila
Spain
Member
Forum Posts: 29
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Claudio

In my case I implemented skins based on PNGs and background colors. 

  • Every form has an operation called theme that changes its own skin (background colors and PNGs at buttons) and executing “show”. Another approach I discarded was dynamically change glyphs based on nomenclature but doing so user help and manual would be more complex to maintain. 
  • There is a global variable that keeps current skin. 
  • And there is a point in the app from where skin can be changed. This point triggers the operation theme for all forms in execution.

Also in ini file, I defined “usystheme=project_folder\theme\” so every PNG can be changed with $concat(“@usystheme:”, $$UMO_VCTHEME, “\button_def.png”). That is, every button has its own glyph AND a backgroud PNG. As $$UMO_VCTHEME can hold 1, 2 or 3… it is mandatory that exists these PNG at project_folder\theme\1, project_folder\theme\2 and project_folder\theme\3.

Result:

Three skinsImage Enlarger

19 Apr 2017
5:52 pm
Avatar
ulrich-merkel
Frankfurt/Germany
Member
Forum Posts: 1677
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Luis,

nice concept.

I assume the point to change the skin is somewhere topmost in the application.

Or do you have some solution for the
“change skin when returning to an existing form after the change”
which doesn’t consume a lot of performance checking the change?

Perhapts triggering a skinchange operation in all existing components or so?

Greetings from 7°C Frankfurt to a hopefully warmer Spain,
Uli

19 Apr 2017
9:07 pm
Avatar
luis.vila
Spain
Member
Forum Posts: 29
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Thanks Uli. 

It’s nice. I developed for a GUI modernization demo in an User Event. 

It is in start-up shell. It receives an Asynchronous message from settings form and call every $detachedinstace and $instancechildren (recursively). It’s a blink. There are about 20 forms involved including tabs, non-modal forms and form containers. The images are very small 1-5KB except the biggest one that is a background of 29KB.

Also, every form starts by setting properties according with current theme, so skin remains always coherent with $$UMO_VCTHEME.

 

Windy and sunny. Ideal for sailing with a boat, if you have any. Cool

20 Apr 2017
3:42 pm
Avatar
Claudio
Italy
Member
Forum Posts: 83
Member Since:
05 Jun 2016
sp_UserOfflineSmall Offline

luis.vila said
Hi Claudio

In my case I implemented skins based on PNGs and background colors. 

  • Every form has an operation called theme that changes its own skin (background colors and PNGs at buttons) and executing “show”. Another approach I discarded was dynamically change glyphs based on nomenclature but doing so user help and manual would be more complex to maintain. 
  • There is a global variable that keeps current skin. 
  • And there is a point in the app from where skin can be changed. This point triggers the operation theme for all forms in execution.

Also in ini file, I defined “usystheme=project_folder\theme\” so every PNG can be changed with $concat(“@usystheme:”, $$UMO_VCTHEME, “\button_def.png”). That is, every button has its own glyph AND a backgroud PNG. As $$UMO_VCTHEME can hold 1, 2 or 3… it is mandatory that exists these PNG at project_folder\theme\1, project_folder\theme\2 and project_folder\theme\3.
  

Thanks Luis,
very very interesting!

Unfortunately, it is impossible for me to implement, because I have 1000+ forms in my app Frown.
But the result is very nice!

Bye from windy north of Italy
Claudio

20 Apr 2017
4:33 pm
Avatar
ulrich-merkel
Frankfurt/Germany
Member
Forum Posts: 1677
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Claudio,

even with 1000+ forms:

 

Assuming you have followed some coding standards,
all you need is some clever supporting tool to place the code into the existing forms.

Once you got some basic templates to do the job, it takes only a couple of hours to adapt.
I used it in my now nearly 25 years with uniface a lot to do bulk modifications (especially on migration jobs).

20 Apr 2017
4:58 pm
Avatar
Claudio
Italy
Member
Forum Posts: 83
Member Since:
05 Jun 2016
sp_UserOfflineSmall Offline

ulrich-merkel said
Hi Claudio,

even with 1000+ forms:

 

Assuming you have followed some coding standards,
all you need is some clever supporting tool to place the code into the existing forms.

Once you got some basic templates to do the job, it takes only a couple of hours to adapt.
I used it in my now nearly 25 years with uniface a lot to do bulk modifications (especially on migration jobs).  

Hi Uli,
you mean fiddle with Uniface’s data dictionary?

20 Apr 2017
10:07 pm
Avatar
gianni
Member
Forum Posts: 237
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Claudio,

I can answer your last question easily: it means to build uniface components able to programmatically change your repository.

Uniface is distributing UMETA.xml containg definition of repository tables.
You should learn about where and how objects like forms, services, reports (and all remaining uniface objects…) are saved and you could build a program to change them.

“Fiddle with Uniface’s data dictionary” means to use a program to manage your sources instead of doing it manually.

Gianni

21 Apr 2017
9:09 am
Avatar
luis.vila
Spain
Member
Forum Posts: 29
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Claudio

Then the only way to implement something similar to skins is changing glyphs.

Assuming you are using standard deployment (no DOL). Every glyph is a file in gly folder.

Assuming app resources are in local (no network drives to share these files between users). 

When a user applies a skin you can programmatically replace original *.gly files by others. And put a message “New skin will take place after restarting application“.

Problem: if user don’t restart… forms already in execution still use old skin and new forms will use the new one. Ugly and disturbing.

 

Another option is play with language. Assuming you are using $language=I. It can be understood ‘I’ as Italian with default skin. But you can define global objects for language ‘I1’, ‘I2’, ‘I3’, … for Italian with skin1, 2, 3. Change skin is done by $language=I2

Problem: text objects (messages, menus are duplicated). And if your application is multi-language… it can be a mess.

 

Getting back to first path… change *.gly files. Another option.

Let’s say you have a resources section in you ASN file. Extract it to another file called resources.asn (including #file resources.asn in your original asn)

resources.asn could be as:

[RESOURCES]
everything.uar
skin1.uar
skin2.uar
skin3.uar

everything.uar contains everything ;-). And skin?.uar contains only glyphs for skins. When user change to another skin, your program only need to reorder resources.asn lines. For example, to apply skin2, the file should be changed to this one:

[RESOURCES]
skin2.uar
everything.uar
skin1.uar
skin3.uar

Now, when Uniface look for a glyph, it will be found in skin2.uar first. So, it is applying skin2 (after restart)

How to prepare this uars? With a different repository where you import all existing glyphs. Replace them for those belonging to skin?, create skin?.uar, export to skin?.xml and go next.

 

Hope [this time] it helps 😉

Luis 

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 131

Currently Online: CeccilCet, DinaSlake
14 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

ulrich-merkel: 1677

Iain Sharp: 596

Theo Neeskens: 333

gianni: 237

rogerw: 228

lalitpct: 197

istiller: 192

-GHAN-: 171

Knut: 168

sochaz: 165

Member Stats:

Guest Posters: 3

Members: 4798

Moderators: 0

Admins: 8

Forum Stats:

Groups: 1

Forums: 62

Topics: 1982

Posts: 8560

Newest Members:

emmawu60, Ariafah, OgovorGor, JosephDrype, raybangr, WalterLip, nellmx18, mollycb3, NatashaBam, annmariedw16

Administrators: admin: 23, Adrian Gosbell: 268, diseli: 786, Bob Maier: 2, Nico Peereboom: 58, Michael Rabone: 4, richiet: 406, JanCees: 25