Difference between revisions of "CellIcon"

(Created page with "category:Cell format functions ''This function is not officially supported or exposed on menus yet and may be subject to change in a future release. It was first introduc...")
 
Line 15: Line 15:
 
The above screenshot uses [[CellIcon]] in two ways. First, an icon appears to the right of '''Staff development''', indicating that the projects are sorted in decreasing order by the values in that column, and second, in the ''Net revenues'' column to show the the sign of the value. These were implemented using the following code in the [[Cell Format Expression]] attribute:
 
The above screenshot uses [[CellIcon]] in two ways. First, an icon appears to the right of '''Staff development''', indicating that the projects are sorted in decreasing order by the values in that column, and second, in the ''Net revenues'' column to show the the sign of the value. These were implemented using the following code in the [[Cell Format Expression]] attribute:
  
 
+
<code>
[[CellFormats]](
+
: [[CellFormats]](
[[CellSpan]](Attributes_for_score,  
+
:: [[CellSpan]](Attributes_for_score,  
[[CellFormats]](
+
::: [[CellFormats]](
[[If]] Attributes_for_score=sort_col [[Then]] [[CellIcon]]( vis_icon,'Right' ),
+
:::: [[If]] Attributes_for_score=sort_col [[Then]] [[CellIcon]]( vis_icon,'Right' ),
[[CellOnClick]]( New_sort_crit(self, ViewMode) )
+
:::: [[CellOnClick]]( New_sort_crit(self, ViewMode) )
),
+
::: ),
header:true
+
::: header:true
),
+
:: ),
[[If]] Attributes_for_score='Net revenues' [[Then]]  
+
:: [[If]] Attributes_for_score='Net revenues' [[Then]]  
[[CellIcon]]([[If]] self>0 [[Then]] up_icon [[Else]] if self<0 [[Then]] down_icon, 'Left')
+
::: [[CellIcon]]([[If]] self>0 [[Then]] up_icon [[Else]] if self<0 [[Then]] down_icon, 'Left')
)
+
: )
 +
</code>

Revision as of 16:16, 11 May 2018


This function is not officially supported or exposed on menus yet and may be subject to change in a future release. It was first introduced in Analytica 5.0..

CellIcon( icon, side )

Displays an image (icon) in a cell, next to a cell value. «icon» is an image. «side» can be 'Right', 'Left' or 'IconOnly'.

This can be used from the Cell Format Expression attribute.

Examples

CellIcon example up-down icons.png

The above screenshot uses CellIcon in two ways. First, an icon appears to the right of Staff development, indicating that the projects are sorted in decreasing order by the values in that column, and second, in the Net revenues column to show the the sign of the value. These were implemented using the following code in the Cell Format Expression attribute:

CellFormats(
CellSpan(Attributes_for_score,
CellFormats(
If Attributes_for_score=sort_col Then CellIcon( vis_icon,'Right' ),
CellOnClick( New_sort_crit(self, ViewMode) )
),
header:true
),
If Attributes_for_score='Net revenues' Then
CellIcon(If self>0 Then up_icon Else if self<0 Then down_icon, 'Left')
)

Comments


You are not allowed to post comments.