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

SetStyle()

I have been testing the SetStyle() and have bee able to change the look on within the form on the screen. In my application I was wanting to change the color of and font in a data field based on values and then print the record on the screen to a PDF...

Product: Dataease [{8}]FIVE. Written by Edward Gordley 04/12/15 at 14:20:16

Re:SetStyle()

Just at add a little more information. I used an OML script in DE7.2 to print out color coded production tickets using "Red.Color := 127.... writing code for each color and condition. I thought SetStyle() would be a dream for this type on application....

Product: Dataease [{8}]FIVE. Written by Edward Gordley 08/12/15 at 14:29:27

Re:SetStyle()

Up to DataEase 8 the general thinking of the DataEase development team was - Swiss Army Knife.&nbsp;One product and one functionality should cover everything.This has led to a product that ended up not being very good at anything.<...

Product: Dataease [{8}]FIVE. Written by DataEase 08/12/15 at 16:25:13

Re:SetStyle()

You can see how you can build a HTML based body on DQL here.http://www.dataease.com/DG3_BlogList/?ParentID=000...In HTML you can simply defin...

Product: Dataease [{8}]FIVE. Written by DataEase 08/12/15 at 17:41:55

Problems with GetCurrent() and SetStyle() in a subform.

I am using DE8.5.0.2115.The problem I am having is to do with sub forms and SetStyle to the record that I am actively on when I scroll down through the sub form. I have used a virtual field “vManip” with the following script: SetVar("RowNr", Ge...

Product: Dataease [{8}]FIVE. Written by Henry Gondorf 27/01/16 at 18:37:07

Re:Problems with GetCurrent() and SetStyle() in a subform.

1. The GetCurrent("RowNumber") reports the correct RowNumber most of the time. Due to the intricacies of the DataEase Multiview it can report 2 for row Number one, but it is consistent when it first happen so then you can just deduct one as you have h...

Product: Dataease [{8}]FIVE. Written by DataEase 27/01/16 at 20:13:36

Re:Re:Problems with GetCurrent() and SetStyle() in a subform.

Thank you for your reply.Item 1. I am not using this script in OML. It is being used as a derivation in a virtual field, “vManip1”, that I created on the table view specifically for this action.Item 2. I created the variable “RowNr” so...

Product: Dataease [{8}]FIVE. Written by Henry Gondorf 28/01/16 at 09:57:36

Re:Re:Re:Problems with GetCurrent() and SetStyle() in a subform.

Download Sample You are right (and wrong) and so am I ;-) Firstly I applaud...

Product: Dataease [{8}]FIVE. Written by DataEase 28/01/16 at 11:06:23

Subform + SetStyle

Hi all,I've a form with a subform which I want to change font style of field texto_codigonivel_1 according the value of a field nivel, as follows :Nivel Value loaded event :d...

Product: Dataease [{8}]FIVE. Written by afonso santos 26/05/18 at 18:28:48

Re:Subform SetStyle

A lot of the features in DE8 is "edging" what DataEase for WIndows was designed to do.&nbsp; DFW was desinged in a different time and age where what we want today wa...

Product: Dataease [{8}]FIVE. Written by DataEase 29/05/18 at 11:40:30

Re:Re:Subform SetStyle

Download Sample Sorry,was a little quick on the save button....

Product: Dataease [{8}]FIVE. Written by DataEase 29/05/18 at 12:15:47

Re:Re:Re:Subform SetStyle

This is a good sample. But, one of my client running two sub-forms.DataEase version&nbsp;8.5.0.2535ScheduleingFrm (Main form).Record1..all the main form fields..rScheduleDetails (Sub form one)...Record1...

Product: Dataease [{8}]FIVE. Written by Jeyarajah Arulrajah 02/08/18 at 22:37:31

Re:Re:Re:Re:Subform SetStyle

Tried the following with no luckretval := SetStyle(concat("Record#",vCount),vStyle).retval := SetStyle(concat("Record1#",vCount),vStyle).retval := SetStyle(concat("rScheduleDetails.Record#",vCount),vStyle)....

Product: Dataease [{8}]FIVE. Written by Jeyarajah Arulrajah 02/08/18 at 22:43:33

Re:Re:Re:Re:Re:Subform SetStyle

Hi Arul. There is a lot in the FRM object models that left to be desired... In 8.5 somewhere we did a fix that allow you to change the name of the Reco...

Product: Dataease [{8}]FIVE. Written by DataEase 03/08/18 at 10:00:20

Re:Re:Re:Re:Re:Re:Subform SetStyle

Renamed the subform row to SubFormOne as you were showing on the image.They tried this code. Still coloring is not working.define "retval" Number .define "vCount" Number .define "vEVV" Text 3 .define "vStyle" text .<...

Product: Dataease [{8}]FIVE. Written by Jeyarajah Arulrajah 03/08/18 at 17:20:44

Re:Re:Re:Re:Re:Re:Re:Subform SetStyle

Does it work on the first but not on the second, or not at all?Do you have the styles in your style sheet?...

Product: Dataease [{8}]FIVE. Written by DataEase 03/08/18 at 22:26:32

Subform SetStyle

Does not work at all.&nbsp;It goes through the DQL and IF logic...etc.But, it seems like SetStyle is not working....

Product: Dataease [{8}]FIVE. Written by Jeyarajah Arulrajah 04/08/18 at 05:34:03

Re:Subform SetStyle

OK Got It!When you said style in style sheet. I did not understand. But, after creating a style called Green and White in that style sheet, it worked.Also, another interesting thing I noticed. You have to display the field within the com...

Product: Dataease [{8}]FIVE. Written by Jeyarajah Arulrajah 06/08/18 at 17:16:51

Re:Re:Subform SetStyle

There is a number of rules both in Windows and DataEase for what should be computed.If a virtual field is outside the screen view it will only be computed if something IN the screen view depend on it.Windows will equally not send si...

Product: Dataease [{8}]FIVE. Written by DataEase 07/08/18 at 19:51:49

Enable/Disable based on Global variable using SetStyle(),SetState(),SetVar(),GetVar(),MoveObject()

If a customer doesn't have a support agreement with us there is no rule that we should supply the solution to a problem the said customer is encountering in using DataEase for Development.However we do answer questions that is of general inter...

Product: LegEasy 9 Developer. Written by DataEase 03/10/24 at 15:49:41

On the blog about SetStyle

DataEase 8.2 - Forgotten Treasure: SetStyle()

Download SetStyle() Sample It would be a lie if we said that developing a product like DataEase 8 or even DataEase in general was done by designing the product and then implem...

Product: Dataease [{8}]FIVE. Written by DataEase 13/09/14 at 11:01:59

New Sample 8.5 BETAII.2 - Showcase MoveObject, Label Alignment, Transparent Fields, SetStyle() (Ver. 8.5.0.1767)

We are sorry that the link was a "dud", this has now been fixed! Download Sample <img...

Product: Dataease [{8}]FIVE. Written by DataEase 10/04/15 at 16:27:00

Enable/Disable based on Global variable using SetStyle(),SetState(),SetVar(),GetVar(),MoveObject()

Download Sample! We got a request from a user on how to control the users...

Product: . Written by DataEase 25/09/15 at 08:54:32

DataEase 8.5 - SetState(), SetStyle(), SetColor(), MoveObject() all now support wildcard (Ver. 8.5.0.2001)

New Features create New Demands....SetState(), SetStyle(), SetColor() and MoveObject() are between the most popular and besides ExecDQLClass the most used new features in DataEase 8.We very quickly realised that you needed to be able t...

Product: Dataease [{8}]FIVE. Written by DataEase 01/12/15 at 15:06:26

How to highlight active record in a subform by using GetCurrent("RowNumber"), SetStyle(with * and #) and GotFocus/Mousdown.

Download Sample We got a very good question o...

Product: Dataease [{8}]FIVE. Written by DataEase 28/01/16 at 11:26:05

Re:Enable/Disable based on Global variable using SetStyle(),SetState(),SetVar(),GetVar(),MoveObject()

is it possible to download the sample still ?thank You...

Product: . Written by Ihor Zakharchenko 03/10/24 at 16:23:54

Re:Re:Enable/Disable based on Global variable using SetStyle(),SetState(),SetVar(),GetVar(),MoveObject()

got it! converted to LE9. testedthank You...

Product: LegEasy 9 Developer. Written by Ihor Zakharchenko 04/10/24 at 14:53:40


dg3_HelpView