Simplicty and flexibility!


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.

Reference

See Also


SetColor()
SetState()
SetFocus()

On the forum about SetStyle

[@EOF@]...

Product: . Written by alembagheri tahmas 07/12/13 at 13:37:32

Hi there,I am trying to use an external MySQL DB in dataease. I have successfully create the ODBC link and added the DB to dataease. I can also access the DB from dataease. Now, just for testing purposes, I am trying to create a simple report b...

Product: DataEase for Windows 7.x. Written by George Washington 11/04/14 at 08:26:17

no se pude exportar ahora archivos a pdf, ni a excel o otros cosa mala. en verdad creo que hace faltaen las versiones anteriores me funcionaba mas o menos bien. le hace falta a los aplicativos que se desarrollan en Dataeasegr...

Product: DataEase 8 Reporter. Written by eduardo paez 02/05/14 at 14:40:11

Thanks. Anyway I'm trying to use this fuction but it seems to me that it doesn't work on 8.2. I tried also in a DQL.There's something wrong?<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA9IAAAJ3CAYAAAB4NWk3AAAAAXNSR0IArs4...

Product: . Written by Marco Marchesi 15/02/16 at 14:50:46

[@EOF@]...

Product: Dataease [{8}]FIVE. Written by Chamil Rajindra 21/02/19 at 10:17:46

Thanks for the very good explanation!AS...

Product: . Written by afonso santos 28/10/19 at 00:50:14

I am pleased to see that the migration from Dos 4.53 is then sa 5.5 works. A really useful thing would be a compiler of SQL languages. Will you get there?Original Text:Mi compiaccio a vedere che la migrazione da Dos 4.53 รจ poi sa 5.5 funzio...

Product: . Written by Grossi Gioacchino 18/11/19 at 14:33:44

How can i delete a Style sheet?...

Product: Dataease [{8}]FIVE. Written by Rainer 22/03/21 at 11:13:10

I run W7 and since a few days&nbsp;Dataease 8.5 is not starting any more, do you have an idea? i installed it again but that did not help....

Product: Dataease [{8}]FIVE. Written by Rainer 08/06/21 at 14:12:40

[@EOF@]...

Product: . Written by Hiralal Rampul 01/12/21 at 17:47:10

On the blog about SetStyle


dg3_HelpView