Uniface Lectures Webinar – Modernization Techniques (February 2016)

Author: adrian.gosbell@synapse-i.jp (Adrian Gosbell)

Details of the powerpoint (Slideshare), and the video recordings (YouTube) will be posted here.  Please post any follow up questions here and we will get them answered.  We will also share questions that were asked during the online webinars. 

20 Comments

  1. sochaz said Hello, here are my 3 basic questions which I asked during webinar. 1, Will the curoccvideo statement support RGB colors? Every new feature in Uniface seems to be using modern colors (web or system name or RGB). In the webinar there were some utilities to convert old index colors to a new RGB colors. Unfortunately, the curoccvideo still supports only old index colors. And according to ulibrary we should not mix old index colors and new colors. But curoccvideo is one of the most used features (it is used in all our fomrs). So we're trapped... will this be resolved? I mean, as for us, as long as curoccvideo does not support RGB colors and index/RGB colors can't be used together, all other color features are useless. 2, If we set Attach property of multiocc entity to VSize and user makes form higher, will there be more occurrences visible? 3, Let's have a multiocc entity with 16 fields (forming 16 columns). Let's set the attach property of multiocc entity to HSize. Can we set which fields (which columns) are made bigger (wider) and which columns just move (some columns will be partly moved partly resized)? For example: we need the 2nd, 3rd, 4th, 10th and 13th columns to be dynamic, all other stay the same size (and just move accordingly). King redards, Zdenek Socha

      Hi Zdenek, 1) $curroccvideo DOES support RGB colors, in a roundabout way.  You can set $curroccvideo in proc or $CUROCC_VIDEO in asn to HLT, and in your assignment file you set $CUROCC_VIDEO_HLT = backcolor=255,255,255 forecolor=red  Unfortunately we do not have something similar for $ACTIVE_FIELD. 2) In a Grid you will get more occurrences, in a "normal" multi-occ entity not. 3) In a Grid you can set the grid property autosizeablecolumn to the (single!) column (number!) that needs to be resized. In a "normal" multi-occ entity I did some experiments for you, best I can do is set the first field to HSIZE and the other fields to HMOVE, so unfortunately quite limited. Unless somebody has a better plan...


    Author: Theo Neeskens (tneeskens@itblockz.nl)
  2. Hello Theo, 1) My question was "Will the curoccvideo statement support RGB colors?" So the answer is, no, it does NOT support RGB colors. Your solution is interesting, but it must be set in the .asn file, which means, it's useless. :-) It might be fine in single user environment. But our application is used by many users and every single user can set its own color for currocc - this is set in our application and then applied using the curoccvideo statement. Unfortunatelly this sattement does not support modern colors in Uniface. In a real word, or at leas for our applications, the .ini and .asn files are used for general settings, but many things must be modified during runtime. I can't imagine that we would have so many .asn files (for every single user) and I can't imagine the end-user modifying the .asn file and trying to find the RGB they would like to use. No, this will never work in a real application. Sorry. 2) and 3) What's the point of the Attach property for multi-occ entity? It seems that the only reason is to move the scroll-bar, right? It would be more useful, if it would resize/move the fields of an entity... otherwise it's a bit questionable, how this would help us in the need of "dynamic forms"? Zdeněk Socha


    Author: sochaz (zdenek.socha@fullsys.cz)
  3. Hi Zdenek, "2) and 3) What’s the point of the Attach property for multi-occ entity?" We have added this because it is useful for entities painted as a single occurrence. We thought about disabling it when it is a multi-occurrence, but decided not to. It can still be nice for some situations. Theo


    Author: Theo Neeskens (tneeskens@itblockz.nl)
  4. @Adrian, here are my questions arising from the lecture: 1) Will you deliver a fix for the new "round" edges of entityframes, so that they are actual round and not "c64 pixel style" in the near future? 2) Will the right mouse button context-menu be back any time in Model editor in IDF? (IDF Session Panel) 3) Even though I asked this in the morning session already, some people might have the same question: Will the Start-Screen be customizable? The left and the middle part at least. I want to remove Web and Mobile from the left part and add Global Proc and Messages to the middle part. Editing the startpage_def doesn't really help, even tho I can remove sections from there, its just an xml overlay for the predefined buttons in the yellow area. 4) Will there be a fix, so the Editbox and the Dropdownlists are the same width when painted beneath each other? In the new modernized environment, the the horizontal shift between those two widgets concerning their borders is more present than before and is, sorry, annoying. You can also see this very good, when using windows 10 native widgets in uniface (not using uniface representations). 5) Is it possible to change the blue backcolor of the Menus in the IDF (File, Edit, ...) to another color?   Not a question, but it would have been nice to see an "old" application beeing redesigned with those new modern options (e.x. Windows 10 Style on a Windows 7 maschine) and then show us how you got there. Maybe that would be something for another lecture on moderinzation.


    Author: Daniel_Kurz (kurzster@gmail.com)
  5. Daniel We are currently busy with updating our GUI to a new layout with the new features of U97. And it is nice so see that it is less complex then U96. We also changed the background color for menus.


    Author: Stijn Courtheyn (stijn.courtheyn@xperthis.be)
  6. 5) Is it possible to change the blue backcolor of the Menus in the IDF (File, Edit, …) to another color? Yes it is! Please have a look at the Sample that I made on Menu's. You can find it on Uniface.info by select Download from the red bar at the top, then Uniface Samples, and then scroll dow until you see it. Or look in uLibrary for the properties you can set like menu=umenu(backcolor=yellow)


    Author: Theo Neeskens (tneeskens@itblockz.nl)
  7. Hi Everyone--Here is the link to the presentation from the webinar yesterday: http://www.slideshare.net/Uniface/u97-gui-modernization-webinar-58454903 As soon as the recording is available we will let everyone know.


    Author: Christy Hillebrink (christy.hillebrink@uniface.com)
  8. We were watching the webinar yesterday so wanted to try and get a simple grid resizing which I have by setting the grid to attach to window border right and bottom with attachmargin to 15px and autosizablecolumn set to 2. This works ok but I think somehow using the hsize, vsize when the window is resized it will auto extend all the fields rather than just the one chosen (field 2 in this case) I cannot seem to get this to work so if you could give me some help on this it would be good. Thanks


    Author: Steve Richards (steve.richards@sanderson.com)
  9. Hello, here are my 3 basic questions which I asked during webinar. 1, Will the curoccvideo statement support RGB colors? Every new feature in Uniface seems to be using modern colors (web or system name or RGB). In the webinar there were some utilities to convert old index colors to a new RGB colors. Unfortunately, the curoccvideo still supports only old index colors. And according to ulibrary we should not mix old index colors and new colors. But curoccvideo is one of the most used features (it is used in all our fomrs). So we're trapped... will this be resolved? I mean, as for us, as long as curoccvideo does not support RGB colors and index/RGB colors can't be used together, all other color features are useless. 2, If we set Attach property of multiocc entity to VSize and user makes form higher, will there be more occurrences visible? 3, Let's have a multiocc entity with 16 fields (forming 16 columns). Let's set the attach property of multiocc entity to HSize. Can we set which fields (which columns) are made bigger (wider) and which columns just move (some columns will be partly moved partly resized)? For example: we need the 2nd, 3rd, 4th, 10th and 13th columns to be dynamic, all other stay the same size (and just move accordingly). King redards, Zdenek Socha


    Author: sochaz (zdenek.socha@fullsys.cz)
  10. Whilst the new border frame properties are great, they are incompatible with the old frames. The new frame border is at the extreme edge of the area/entity, whereas the old area frame (or line frame) was in the middle of the character cell. As the line is now at the extreme edge you can't paint a field at the edge, as the field overwrites the frame border, which looks very odd. This means if you have two framed "panels" one above each other, previously you used one row for the frame line. The line appeared exactly half a line space between the bottom field of the top panel, and the top field of the bottom panel. Now you need to use two lines - with a whole character cell below the bottom field of the top panel and the line, and then another whole character cell between the line and the top field of the bottom panel. The same is true for side-by-side panels - now using two character cells, rather than one character cell. The more panels the screen is divided into, the more "waste" space you now need. This makes the screen unnecessarily longer and/or wider as it doubles all the gaps. It also means that even if you use the conversion tools, you still need to adjust the layout on the paint tableau where you have a multi-panel style layout. Maybe Uniface would consider adding a new "BorderPosition" type attribute, with values such as "Outside", "Middle" or "Inside", with "Middle" being broadly compatible with the old frames? There is also one other known issue with the new border frames: if you use a local ini file, the settings are not read from the default usys.ini file (this has been raised as BUG 31136). I also hope that in the Uniface 10 IDF/IDE we will be able to set all these new properties easily, and will also see the effect of them in the form paint tableau.


    Author: Mark Rennison (mark.rennison@tribalgroup.com)
  11. As mentioned by Daniel Kurz above, please restore the right mouse button context-menu back in the Model editor! In Response to item 3 also from Daniel Kurz: You can't customise the left of the new IDF start screen - but you can add or remove items from the middle section. The top section of the startpage.def file defines the four categories (Mobile, Web, Desktop & Integration). Each category has a comma delimited list of object types (in <TYPES> ... </TYPES>). The individual object types are defined in the bottom section of startpage.def (see <OBJTYPE>). You will find an object type for Global Proc named 'CPRC', and one for Messages called 'MESG'. Therefore to add links for Global Proc and Messages add ",CPRC,MESG" to the appropriate <TYPES> list.   I would also agree with Zdenek Socha: curoccvideo, $DEF_CUROCC_VIDEO & $CUROCC_VIDEO should all support the modern RGB / HEX / named colors. In Response to item 2 from Zdenek Socha: No, none of the new attach properties show any more occurrences of a (non-grid) multi-occurrence entity, it just makes the new border frame bigger.Frown


    Author: Mark Rennison (mark.rennison@tribalgroup.com)
  12. Hi Everyone--Here is the link to the recorded version of the session which is on our YouTube channel: https://www.youtube.com/watch?v=WF6big7Q6Zg&feature=youtu.be&list=PLec4UnOD-AILHqEFbFfaJiNgrP9NIPqas


    Author: Christy Hillebrink (christy.hillebrink@uniface.com)
  13. Mark Rennison said As mentioned by Daniel Kurz above, please restore the right mouse button context-menu back in the Model editor! In Response to item 3 also from Daniel Kurz: You can't customise the left of the new IDF start screen - but you can add or remove items from the middle section. The top section of the startpage.def file defines the four categories (Mobile, Web, Desktop & Integration). Each category has a comma delimited list of object types (in ... ). The individual object types are defined in the bottom section of startpage.def (see ). You will find an object type for Global Proc named 'CPRC', and one for Messages called 'MESG'. Therefore to add links for Global Proc and Messages add ",CPRC,MESG" to the appropriate list.

    Hey Mark, thanks very much for this insight! Got the yellowish middle area now customized for our needs. Added Global Procs, Include Procs, Global Variables and Messages. My Developers are happy now :) But beware: Editor Shortcut "RELC" for Relationship is not supported and you can only define 9 Items for in the yellow area, even though there is enough space for at least 4 more items. If you define more you will lose the first ones.   @Uniface: Why don't you tell your customers/users about those possibilties? Is it that much of a secret? :-/ - Its also the little things that makes it more comfy to work with the IDF.


    Author: Daniel_Kurz (kurzster@gmail.com)
  14. Daniel_Kurz said
    Mark Rennison said As mentioned by Daniel Kurz above, please restore the right mouse button context-menu back in the Model editor! In Response to item 3 also from Daniel Kurz: You can't customise the left of the new IDF start screen - but you can add or remove items from the middle section. The top section of the startpage.def file defines the four categories (Mobile, Web, Desktop & Integration). Each category has a comma delimited list of object types (in ... ). The individual object types are defined in the bottom section of startpage.def (see ). You will find an object type for Global Proc named 'CPRC', and one for Messages called 'MESG'. Therefore to add links for Global Proc and Messages add ",CPRC,MESG" to the appropriate list.
    Hey Mark, thanks very much for this insight! Got the yellowish middle area now customized for our needs. Added Global Procs, Include Procs, Global Variables and Messages. My Developers are happy now :) But beware: Editor Shortcut "RELC" for Relationship is not supported and you can only define 9 Items for in the yellow area, even though there is enough space for at least 4 more items. If you define more you will lose the first ones.   @Uniface: Why don't you tell your customers/users about those possibilties? Is it that much of a secret? :-/ - Its also the little things that makes it more comfy to work with the IDF.

    @Daniel - our approach is that if something is documented, then it was intended, should be supported, we have tests for it, and should remain working. If you find backdoors and unsupported ways to achieve things, that's great, but there can be a risk that things change, either intentionally or unintentionally in the future.  In the case of the Uniface 9 developer environment, we are doing work on it as part of the mobile project, so code is being touched. The upside is that if there is developer time available, we might be able to pick up some if the feedback mentioned in this thread. 


    Author: Adrian Gosbell (adrian.gosbell@synapse-i.jp)
  15. Thanks for your reply Adrian. I understand your politics on the topic of "undocumented features". Then pleases take a note, that a customizable idf Frontpage would be nice to have as a standard feature and pass it on to the developers :)


    Author: Daniel_Kurz (kurzster@gmail.com)
  16.  Re: Steve Richards "We were watching the webinar yesterday so wanted to try and get a simple grid resizing which I have by setting the grid to attach to window border right and bottom with attachmargin to 15px and autosizablecolumn set to 2. This works ok but I think somehow using the hsize, vsize when the window is resized it will auto extend all the fields rather than just the one chosen (field 2 in this case) I cannot seem to get this to work so if you could give me some help on this it would be good. Thanks"   Hi Steve, I tried to find out what your problem could be, but could not reproduce it. For me in both these situations column 2 is the only one that changes size:

    • $entityproperties("UFORM","attach·;attachmargin·;autosizeablecolumn") = "attach=hsize,vsize·;attachmargin=15,15,15,15·;autosizeablecolumn=2"
    • $entityproperties("UFORM","attach·;attachmargin·;autosizeablecolumn") = "attach=bottom,right·;attachmargin=15,15,15,15·;autosizeablecolumn=2"

    Are there any other specific circumstance that cause your problem, or do you also expeience it on a very simple test form?   Theo


    Author: Theo Neeskens (tneeskens@itblockz.nl)
  17. Theo Neeskens said  Re: Steve Richards "We were watching the webinar yesterday so wanted to try and get a simple grid resizing which I have by setting the grid to attach to window border right and bottom with attachmargin to 15px and autosizablecolumn set to 2. This works ok but I think somehow using the hsize, vsize when the window is resized it will auto extend all the fields rather than just the one chosen (field 2 in this case) I cannot seem to get this to work so if you could give me some help on this it would be good. Thanks"   Hi Steve, I tried to find out what your problem could be, but could not reproduce it. For me in both these situations column 2 is the only one that changes size:
    • $entityproperties("UFORM","attach·;attachmargin·;autosizeablecolumn") = "attach=hsize,vsize·;attachmargin=15,15,15,15·;autosizeablecolumn=2"
    • $entityproperties("UFORM","attach·;attachmargin·;autosizeablecolumn") = "attach=bottom,right·;attachmargin=15,15,15,15·;autosizeablecolumn=2"
    Are there any other specific circumstance that cause your problem, or do you also expeience it on a very simple test form?   Theo

    Sorry I was not clear. I can get it to work with just one column changing size but can you get all the columns to change size when extending the grid (ie they will all get bigger when you make the window bigger and smaller again when you shrink it down)


    Author: Steve Richards (steve.richards@sanderson.com)
  18. Hi everybody, I have uploaded Jasper's demo component that I have used in part two of the Uniface 9.7 GUI Modernization Lecture (the part on Styling Entities and Area frames). The demo is called 'U97 Styling properties demo' and can be found in the Community Samples area of this site. Please read the README file that is contained in the zip. Cheers, Arjen


    Author: Arjen van Vliet (arjen.van.vliet@uniface.com)
  19.    Steve Richards said
    Sorry I was not clear. I can get it to work with just one column changing size but can you get all the columns to change size when extending the grid (ie they will all get bigger when you make the window bigger and smaller again when you shrink it down)

    I think you'll have to roll your own here in the Viewport_resized extended trigger. This would involve removing the autosizeablecolumn setting and taking the input columnwidths (columnwidthspx), summing them up, and using the widthpx/sum as a ratio to multiply them by to get the new sizes.  In the Column_resized function, sum up the columnwidthspx, and then add viewportwidthPx-sum to the width of the 'autosizeable' column before re-applying to the entityproperties.  Note, there are some tricks to using the input columnwidthspx string against the entityproperties("COLUMNWIDTH"), in that (I think) it arrives labelled fieldname.entityname, but requires the entityname stripping off before use in entityproperties, and that it arrives without a px on the number but needs one to set the data. Also watch for trying to set a column width of 0, this either fails, or crashes uniface, I forget which.  So 

    ViewportResized  forlist v_item in columnWidthsPx     v_sum = v_sum+$valuepart(v_item)  endfor  forlist v_column in columnwidthsPx    if($valuepart(v_column) > 0)        v_width = $valuepart(v_column)        v_fullcolumn = $idpart(v_column)       v_new_width = ($valuepart(v_column)*(widthpx/v_sum))[r,0]       if($scan(v_fullcolumn,".") > 0)        v_column = v_fullcolumn[1,$scan(v_fullcolumn,".")-1]       else        v_column = v_fullcolumn       endif       if(v_new_width > 0)          putitem/id v_newwidths,v_column,$concat(v_new_width,"px")       else          putitem/id v_newwidths,v_column,$concat(v_width,"px")       endif    endif  endfor    ; set entity properties.  putitem/id $entityproperties("<$entname>.<$modelname>"),"COLUMNWIDTH",v_newwidths

     

    ColumnResized forlist v_item in columnWidthsPx    v_sum = v_sum+$valuepart(v_item) endfor forlist v_column in columnwidthsPx    if($valuepart(v_column) > 0)       v_width = $valuepart(v_column)       v_fullcolumn = $idpart(v_column)       if($scan(v_fullcolumn,".") > 0)          v_column = v_fullcolumn[1,$scan(v_fullcolumn,".")-1]       else          v_column = v_fullcolumn       endif       if(v_column = "Name of autosize column")          v_new_width = v_width + (ViewportWidthpx-v_sum)       else          v_new_width = v_width       endif       if(v_new_width > 0)          putitem/id v_newwidths,v_column,$concat(v_new_width,"px")       else          putitem/id v_newwidths,v_column,$concat(v_width,"px")       endif    endif endfor

      Something similar to this may give you what you want, changing the form size makes all the columns change size, changing the size of one column makes the 'autosize' one change size to compensate.    Iain   P.S. Ye gods it is hard to get usable code snippets pasted into this forum. Makes me long for my old phpBB days.... 


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  20. Uli asked during one the the sessions about $user, he also mentioned this in the blog posting I created on the lectures.  So, assuming we are all understanding each other, this is bug 31145 and it's been fixed in the G102 patch. And will be included in Uniface 9.7.02. (although we have just had a discussion why that isn't clearer in the bug details).  I'm sure we will hear from Uli if this doesn't address the issue. 


    Author: Adrian Gosbell (adrian.gosbell@synapse-i.jp)