baanfans
27th August 2004, 01:43
Hello all,
Is there any way to show in a form one frame filled with any color. I mean, I am developping one session that it must function in this way: in the form and if the item discount is 20% I want to show one frame with blue color, but if discount is 30% the frame´s color is red and finally is the discount is 40% then frame´s color is yellow. Another posibility is to show one word with the same colours.
Can anybody help me?
Best regards,
Arístides. :D
pconde
27th August 2004, 12:28
Hello,
a partial solution is to modify the variable attr.cf like this
field.xxxx:
before.field:
if something
attr.cf = 4
else
attr.cf = 0
endif
You can reverse (attr.cf =4 ) the display of the field
I tested this on display forms
Regards
Philippe
klixy23
27th August 2004, 16:21
Try this sample. There is only one form field "discount" on the form to demontrate the functionality.
|****************************** DECLARATION SECTION ***************************
declaration:
extern domain tcmcs.long discount
long frame.id, color
#include <bic_gc>
|****************************** PROGRAM SECTION ***************************
|****************************** ZOOM FROM SECTION ***************************
|****************************** FORM SECTION ***************************
form.1:
init.form:
discount = 0
color = 0
create.frame()
|****************************** CHOICE SECTION ***************************
|****************************** FIELD SECTION ***************************
field.discount:
after.input:
if discount < 20 then
color = RGB.GREEN
endif
if discount >= 20 then
color = RGB.BLUE
endif
if discount >= 30 then
color = RGB.YELLOW
endif
if discount >= 40 then
color = RGB.RED
endif
change.frame()
|****************************** MAIN TABLE SECTION ***************************
|****************************** FUNCTION SECTION ***************************
functions:
function create.frame()
{
frame.id = create.object(DsCgwindow, current.mwindow(),
DsNx, 150, DsNy, 44,
DsNwidth, 10, DsNheight, 10,
DsNbackground, color )
update.object(frame.id)
}
function change.frame()
{
change.object(frame.id,
DsNbackground, color )
update.object(frame.id)
}
It is difficult to draw a frame around a baan standard field, so I use a simple rectangle. You can also try other window objects.
SriksAdi
27th August 2004, 16:30
Nice One..!!!
Is it possible to make the coloured frame Multi Occurance ?
regards
Sriks
klixy23
27th August 2004, 16:36
Hmm.... All window objects overlay the standard form. But it is possible to use the variable fattr.occurnr (number of occ on form) to multiply and place the object (object id should be an array) and change the color depend on actual.occ.
baanfans
31st August 2004, 00:03
Hi!!! It works very well!!!
Thank you very much for your help!!! :D
klixy23
31st August 2004, 08:24
Can you post a screenshot?
baanfans
1st September 2004, 15:33
This is the screenshot :cool:
raj_mirani
24th July 2007, 14:43
can you send the screenshot of a colored occurence of a multi-occ session.
Also tell me is it possible for all the fields?
george7a
24th July 2007, 16:00
I don't have the screen shot but I know it is possible for all fields.
NPRao
24th July 2007, 20:58
From the latest Tools Programmer's Manual:
SSA ERP LN 6.1 Programmers Guide
WebTop Programming Rules
The following sections describe the deprecated API's:
Deprecated low-level UI drawing API's
Baan Automation is deprecated
Other deprecated predefined variables / functions
The following sections describe other attention points:
Focus events
Functions that should be used with caution
Some notes on the Generic Browser Framework (GBF)
SSA ERP LN 6.1 Programmers Guide
Deprecated low-level UI drawing API's
--------------------------------------------------------------------------------
The following API's will "draw" objects on the screen and are therefore deprecated. For some API's a new alternative is given.
Deprecated API Alternative API
User Interface Object Programmable Dialogs
Structure Chart Manager -
Chart Manager Programmable Dialogs (chart functions)
Plan Chart Manager Gantt And Schedule Charts
Character Based Windows -
Colors -
Timers -
Events -
SSA ERP LN 6.1 Programmers Guide
User interface objects overview
--------------------------------------------------------------------------------
Deprecated. This API is only supported for Baan Windows and its usage is therefore deprecated. The Programmable Dialogs API can be used as an alternative.
In the latest Webtop-8.4
Conditional formatting
WebTop supports conditional formatting of data. You can define conditions to apply special formatting effects to the data displayed in ERP LN sessions. For example, you can apply a foreground color, a background color, or a warning symbol.
You can define multiple conditions per session.
lakoon
27th July 2007, 13:30
Hello
I programmed it a 2 years ago.
You have to keep in track the resizing of the form and the changes of the number of displayed lines.
Dending on the header lines you have to set the startpoint. Also each new line you have to calculate as follows:
horizontal start position (first line) + number of occurances * 22
Remarks on the 27th of November 2008
I have done some rework on the script. It can now be used as an include. Also more dynamic options implemented. (Short documentation in the script)
Remarks on the 3rd. of December 2008
New corrected version uploaded.
/lakoon
PascalOrfila
3rd August 2007, 15:34
Hello,
By extension to this nice programming tip, would it be possible to insert a tiff image in the Baan frame?
george7a
3rd August 2007, 15:39
Hello,
By extension to this nice programming tip, would it be possible to insert a tiff image in the Baan frame?
Check this link:
http://www.baanboard.com/baanboard/showthread.php?t=12892
Juergen
3rd March 2010, 11:55
Hi lakoon,
thanks for the cool solution, works like a charm in our LN.
Juergen
lakoon
3rd March 2010, 21:20
Hello Juergen
I'm happy, that you can use it
Just place a printscreen, that we can have a look at the solution..
/lakoon