Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: 1 ... 3 4 [5] 6 7 ... 10
 41 
 on: October 11, 2024, 06:15:45 pm 
Started by Roland W. - Last post by Sebastien F.
Roland,

I do never use DISPLAY BY NAME, because I use the UNBUFFERED attribute in all my dialogs.

Seb

 42 
 on: October 11, 2024, 04:32:08 pm 
Started by Sean H. - Last post by Sean H.
Thanks Reuben, No I wasn't aware of that openFiles frontcall; I will pick this up on Monday but that looks perfect for what I need.

Have a good weekend.
Regards
Sean

 43 
 on: October 11, 2024, 10:44:15 am 
Started by Roland W. - Last post by Roland W.
Reuben,

OK, that's what I have missed. However, why not just adding the STYLE=... to the ATTRIBUTES section, which in my opition, would make sense for single DISPLAY BY NAME statements. Depending on how many elements are displayed with DISPLAY BY NAME statement, this would save multiple calls to setFieldStyle() or setElementStyle() for each individual element. I see that the request https://4js.com/support/issue/FGL-03783 has been rejected, too bad.

Sorry Sebastien, I was mainly referring to the display of individual edit elements, not to the display of a complete array/table.

So, I guess I have to use setFieldStyle() or setElementStyle() to decorate single Edit fields. It was at least worth a try.

Kind regards
Roland

 44 
 on: October 11, 2024, 10:29:59 am 
Started by Roland W. - Last post by Reuben B.
Roland,

This was requested way back in 2005 ! See https://4js.com/support/issue/?id=FGL-03783
and in 2006 for the array case https://4js.com/support/issue/?id=FGL-1470

These can always be revisited but need to have the appropriate level of demand captured and would probably need to add a compelling argument that we need to take into account now.

Quote
So if I want to display an element differently (e.g. to indicate an error), I only have the option of either specifying this directly in the form or manipulating the AUI tree directly.
Wouldn't it be more practical if this could also be specified via a STYLE attribute in future instead of being restricted to the TTY attributes? Or is there another option that I have missed?

For the non-array case, you do have the ui.Form.setFieldStyle method https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_ClassForm_setFieldStyle.html which I suspect you have missed.

So something like ...
Code
  1. -- If > 80, display as red, if > 60 display as orange, otherwise display as green
  2. DISPLAY BY NAME rec.value
  3. CALL f.setFieldStyle("value", IIF(rec.value > 80, "red", IIF (rec.value > 60, "orange", "green")))
  4.  

There is a weakness in the setFieldStyle method if you are in the habit of specifying multiple styles for individual fields.  You may want to write your own library function to add / remove styles to the space delimited list of styles. https://github.com/FourjsGenero/fgl_auitree/blob/master/auitree.4gl#L216-L255




Reuben







 

  

 45 
 on: October 11, 2024, 10:28:42 am 
Started by Roland W. - Last post by Sebastien F.
Oh I see what you mean:

Code
  1. FUNCTION define_collapsible_group_style()
  2.    DEFINE attdefs DICTIONARY OF STRING
  3.    LET attdefs["collapsible"] = "yes"
  4.    LET attdefs["backgroundColor"] = "lightBlue"
  5.    CALL style_define("Group.collapsible", attdefs)
  6. END FUNCTION
  7.  

Yes, this is direct AUI tree manipulation, to create a new style for groups, from the program instead of adding a .4st file to the tool.
Since .4st style files have no inheritance, if you want to use the latest changes in FGLDIR/lib/default.4st, this is the best solution I found.

Regarding style usage in DISPLAY ARRAY to decorate individual cells with setArrayAttributes(), we have the request https://4js.com/support/issue/?id=FGL-01470#startissue, to use styles instead of simple colors, but that is rejected, and anyway would not help you since you don't like setArrayAttributes().

I do not see how DISPLAY ARRAY ... ATTRIBUTES(STYLE=...) would help to decorate individual cells.
Are you asking for a way to defined a global style that would apply to all data rows in the TABLE?
This is possible by specifying a STYLE in the TABLE definition in the .per.
I am not sure to understand your request.

Seb

 46 
 on: October 11, 2024, 10:12:01 am 
Started by Roland W. - Last post by Roland W.
Sebastien,

there's a function style_define() in fglsqldebug.4gl (https://github.com/FourjsGenero/tool_fglsqldebug/blob/master/fglsqldebug.4gl) to apply a generic style to a Group element.

Anyway, maybe you could think of adding the STYLE=... syntax to the ATTRIBUTES section for display elements.

Kind regards
Roland

 47 
 on: October 11, 2024, 10:04:04 am 
Started by Roland W. - Last post by Sebastien F.
Roland,

Sorry if DIALOG.setArrayAttributes() does not satisfy your needs.
I am using this in many Genero programs, and I think this is a great feature easy to program.


Quote
Funnily enough, in your example code, the AUI tree is also manipulated directly to assign a style to an element
???
What code example are you referring to?
I see no direct AUI tree manipulation.
What do you mean?

Seb

 48 
 on: October 11, 2024, 09:45:48 am 
Started by Roland W. - Last post by Roland W.
Hello Sebastien,

I'm aware of the setArrayAttributes() function, although this only works for arrays/tables but not for single elements such as Edit fields.
Funnily enough, in your example code, the AUI tree is also manipulated directly to assign a style to an element. So there does seem to be a need for a simpler solution.

Apart from that, I always found the possibility of specifying the attributes via the setArrayAttributes() and setCellAttributes() functions unsatisfactory because you have to define the array structure again separately. If you then add or delete a new column, you always have to bear in mind that you also have to adapt the second array. From my kind of view it would be more practical to be able to specify the attributes directly when defining the array, similar to how it is already possible to specify the attributes for JSON or XML syntax (https://4js.com/online_documentation/fjs-fgl-manual-html/index.html#fgl-topics/c_fgl_Arrays_attributes.html and https://4js.com/online_documentation/fjs-fgl-manual-html/index.html#fgl-topics/c_fgl_variables_attributes.html).

Kind regards
Roland

 49 
 on: October 11, 2024, 09:26:26 am 
Started by Roland W. - Last post by Sebastien F.
Hello Roland,

Did you consider using DIALOG.setArrayAttributes(), to put specific colors on individual cells?

https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_prog_dialogs_cell_attr.html

There was once a request to specify a style for each cell but I think using simple colors and TTY attributes like reverse is sufficient.

We are using this in the FGLSQLDEBUG viewer, see screenshot here:

https://github.com/FourjsGenero/tool_fglsqldebug

Seb

 50 
 on: October 11, 2024, 09:10:49 am 
Started by Roland W. - Last post by Roland W.
Hello everyone,

Is there a reason why the DISPLAY ARRAY/AT/TO/BY NAME statements do not allow a STYLE to be specified for the attributes (https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_record_display_DISPLAY_BY_NAME.html)?
In contrast to MESSAGE (https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_message_display_MESSAGE.html) and ERROR (https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_message_display_ERROR.html), only the TTY attributes can be used here.
So if I want to display an element differently (e.g. to indicate an error), I only have the option of either specifying this directly in the form or manipulating the AUI tree directly.
Wouldn't it be more practical if this could also be specified via a STYLE attribute in future instead of being restricted to the TTY attributes? Or is there another option that I have missed?

Kind regards
Roland

Pages: 1 ... 3 4 [5] 6 7 ... 10
Powered by SMF 1.1.21 | SMF © 2015, Simple Machines