Function::Internal
SetStyle
SetStyle(ObjectName,Style)
SetStyle("MyObject","MyStyle")
SetStyle("Button 1","Normal")
SetStyle("Record1",ToggleField)
retval:=SetStyle("Button 1","RedStyle") .

In DataEase 8 manipulation is one of the new key elements. Pre 8, you had to use OML to manipulate or change DT properties in RT. In DataEase 8 we have introduced a number of new functions to give the developer the opportunity to change the appearance of the form based on runtime actions. SetColor() and SetState() being to key functions. SetColor() has the "drawback" that it basically change the colour of an object (Limited to Font,Fill,Border if applicable).

SetColor() is a great addition but as "web style" approach is what we are going for in DE8, it would be nice if one could change the style on objects the same way one can in HTML/CSS. This way the developer can simply change a style instead of finding the code where he changed the colour. You will also be able to change all the properties of an object in one small action.

When using SetColor() for for-instance mouse-over on a button, you will need to know the colours to change back to on mouse out etc, but with SetStyle you can simply have ButtonNormal and ButtonOver and toggle them with SetStyle().

Parameters

ObjectName : String

Name of object that you want to manipulate need to be text field or string in quotes. All Object names are case sensitive.

Style: String

Name of style you want to change to. Need to be text field or string in quotes.

Returns/Result

Nothing
Examples

Example 1 - OML

MyButton::MouseEnter
define "reval" text .
retval := SetStyle("MyButton","MouseOver") .

MyButton::MouseExit
define "reval" text .
retval := SetStyle("MyButton","Normal") .

When defining the style you simply define Normal as the look you want when the function is not Selected, and MouseOver the way you want it to look when the mouse is hovering over. No reason why you should do the same for Clicked etc.