CaptainCasa undecorated popup cant be sizeable - popup

I am trying to make undecorated popup sizeable.
The method setSizeableIfUndecorated(true) seems to not working.
Tested with ModalPopup and ModelessPopup

Just tested with...
...
final H70_pdfUI ui = new H70_pdfUI();
ModelessPopup mp = openModelessPopup(ui,"",300,300,new DefaultModelessPopupListener(this,ui));
mp.setUndecorated(true);
mp.setSizeableIfUndecorated(true);
...
...and saw: the decoartion side areas are available and you can resize - but the cursor is not indicating this by updating its shape. The style is missing in the .css since update 20220314 (due to a generalization of the decoration-style...).
We now added it to the style again, so it will be properly styled with 20220328 (next Monday).
If you want to add the style classes as part of your individual style, then this can be done by adding the style class definitions:
<class n="riscdialognodecoration_edgesizer">
<style n="background" v="transparent"/>
<style n="cursor" v="nw-resize"/>
</class>
<class n="riscdialognodecoration_sizer_left">
<style n="background" v="transparent"/>
<style n="cursor" v="w-resize"/>
</class>
<class n="riscdialognodecoration_sizer_right">
<style n="background" v="transparent"/>
<style n="cursor" v="e-resize"/>
</class>
<class n="riscdialognodecoration_sizer_top">
<style n="background" v="transparent"/>
<style n="cursor" v="n-resize"/>
</class>
<class n="riscdialognodecoration_sizer_bottom">
<style n="background" v="transparent"/>
<style n="cursor" v="s-resize"/>
</class>
Please pay attention: the name of the style classes contain a "no"! And also pleasy pay attention: you should take out these extra-definitions when applying next week's version.

Related

Add unicode character to Cognos Analytics expression data

I've got a simple expression like this: ReportDate()
which will print out the timestamp when the report was executed.
I want to add an unicode character like the SUM SIGN (https://www.fileformat.info/info/unicode/char/2211/index.htm) to that data in that expression. It is not a text field, it needs to be a concatination to a data expression.
Any idea? A simple || ... (any HTML or text) doesn't work.
Version Cognos Analytics 11
Database is DB2 LUW
Edit: The expression looks like this:
case when
[Datasource].[D_FINRP_D_KONTRAHENT_K].[SL_KONTRAHENTENGRUPPE] like 'D%' then concat('D (Summe)';' ∑')
else [Datasource].[D_FINRP_D_KONTRAHENT_K].[SL_KONTRAHENTENGRUPPE]
end
The HTML in the Cognos report looks like this: D (Summe)
and then the SUM sign doesn't show up.
Provided you using a Report Expression aka a Layout calculation from the Insertable objects pane, you should be able to use the following expression:
timestamp2string (ReportDate ())+ '∑'
Rather than a Query calculation, try an HTML item using a Data item value. Your expression should look like:
[Sales (query)].[Branch].[City] + 'Σ'
Here's an example using the sample data.
<report xmlns="http://developer.cognos.com/schemas/report/14.3/" useStyleVersion="11.4" expressionLocale="en-us">
<drillBehavior/>
<layouts>
<layout>
<reportPages>
<page name="Page1">
<style>
<defaultStyles>
<defaultStyle refStyle="pg"/>
</defaultStyles>
</style>
<pageBody>
<style>
<defaultStyles>
<defaultStyle refStyle="pb"/>
</defaultStyles>
</style>
<contents>
<list horizontalPagination="true" name="List1" refQuery="Query1">
<noDataHandler>
<contents>
<block>
<contents>
<textItem>
<dataSource>
<staticValue>No Data Available</staticValue>
</dataSource>
<style>
<CSS value="padding:10px 18px;"/>
</style>
</textItem>
</contents>
</block>
</contents>
</noDataHandler>
<style>
<CSS value="border-collapse:collapse"/>
<defaultStyles>
<defaultStyle refStyle="ls"/>
</defaultStyles>
</style>
<listColumns>
<listColumn>
<listColumnTitle>
<style>
<defaultStyles>
<defaultStyle refStyle="lt"/>
</defaultStyles>
</style>
<contents>
<textItem>
<dataSource>
<staticValue>HTML item</staticValue>
</dataSource>
</textItem>
</contents>
</listColumnTitle>
<listColumnBody>
<style>
<defaultStyles>
<defaultStyle refStyle="lc"/>
</defaultStyles>
</style>
<contents>
<HTMLItem>
<dataSource>
<dataItemValue refDataItem="City"/>
</dataSource>
</HTMLItem>
</contents>
</listColumnBody>
</listColumn>
</listColumns>
</list>
</contents>
</pageBody>
</page>
</reportPages>
</layout>
</layouts>
<XMLAttributes>
<XMLAttribute output="no" name="RS_CreateExtendedDataItems" value="true"/>
<XMLAttribute output="no" name="RS_modelModificationTime" value="2015-11-25T21:38:24.820Z"/>
<XMLAttribute output="no" name="listSeparator" value=","/>
</XMLAttributes>
<modelPath>/content/folder[#name=&apos;Samples&apos;]/folder[#name=&apos;Models&apos;]/package[#name=&apos;GO sales (query)&apos;]/model[#name=&apos;model&apos;]</modelPath>
<queries>
<query name="Query1">
<source>
<model/>
</source>
<selection>
<dataItem aggregate="none" rollupAggregate="none" name="City">
<expression>[Sales (query)].[Branch].[City] + &apos;&Sigma;&apos;</expression>
<XMLAttributes>
<XMLAttribute output="no" name="RS_dataType" value="3"/>
<XMLAttribute output="no" name="RS_dataUsage" value="0"/>
</XMLAttributes>
</dataItem>
</selection>
</query>
</queries>
</report>

Accessing DataGridColumn property from DataTrigger in CellTemplate

I created own custom attached property on DataGridColumn - utilities:ADPs.IsCellSelected to indicate whether any cell is selected in the column. I did similar for rows and it works fine.
Now I want to use this property to change the whole column e.g. background property like:
<DataGridTemplateColumn x:Name="MyColumn" Header="Test">
<DataGridTemplateColumn.CellStyle>
<Style TargetType="DataGridCell" BasedOn="{StaticResource BaseCell}">
<Setter Property="Background" Value="Black"/>
</Style>
</DataGridTemplateColumn.CellStyle>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate x:Uid="DataTemplate_3">
<TextBlock x:Name="trg" Text="some text" />
<DataTemplate.Triggers>
<Trigger SourceName="MyColumn" Property="utilities:ADPs.IsCellSelectedColumn" Value="True">
<Setter TargetName="trg" Property="Background" Value="Red"/>
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
But VS shows an error "The name MyColumn is not recognized.". Any idea how I can access to my new attached DataGridColumn property from "cells"?.
EDIT:
Probably i ti sno t possible what I intend because:
"DataTemplate has its own NameScope, therefore you cannot refer to an element outside DataTemplate using ElementName. Moreover, DataGridTemplateColumn is not an UIElement and is not in VisualTree, therefore DataGridTemplateColumn is not parent of your elements defined in DataTemplate. DataGridTemplateColumn is used just to define columns. DataGrid then generate headers, rows and cells based on the definitions, but the DataGridColumns never gets rendered."
link
Instead to change Background property of whole column with selected cell, I change only column header Background property. I use my custom attached property on DataGridColumnHeader - utilities:ADPs.IsCellSelected and then highligth the header
<DataGridTemplateColumn.HeaderStyle>
<Style TargetType="DataGridColumnHeader">
<Style.Triggers>
<Trigger Property="utilities:ADPs.IsCellSelected" Value="True">
<Setter Property="Background" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGridTemplateColumn.HeaderStyle>

Set background color in textfield from condition using iReport

I have a problem with conditionalStyle in iReport. I have the following textFields (${nameField} = field value):
${field1}=30 ${field2}=40 ${field3}=50
${field4}=23 ${field5}=1 ${field6}=45
${field7}=34 ${field8}=20 ${field9}=0
I need set difference background in every textField depend of the value of the field. I create a new Style and set the conditions:
<style name="ColoredField">
<conditionalStyle>
<conditionExpression><![CDATA[$F{field1} == 300]]></conditionExpression>
<style mode="Opaque" backcolor="#FCFF00"/>
</conditionalStyle>
</style>
As you can see, the Style use only $F{field1}, and I need make a dynamic style (or something), that apply to every textField.
Your question is not clear, can you be more explicit ?
From my understanding , each value will mean a specific background for a textfield, in that case your conditional style value should depend on variable. Maybe using Variables in your style can suit your need.
Add multiple conditional style under each style as below:
each textField can now have different background :
<style name="ColoredField">
<conditionalStyle>
<conditionExpression><![CDATA[$F{field1} == 100]]></conditionExpression>
<style mode="Opaque" backcolor="#FCFFFF"/>
</conditionalStyle>
<conditionalStyle>
<conditionExpression><![CDATA[$F{fiCeld1} == 200]]></conditionExpression>
<style mode="Opaque" backcolor="#00FF00"/>
</conditionalStyle>
<conditionalStyle>
<conditionExpression><![CDATA[$F{field1} == 300]]></conditionExpression>
<style mode="Opaque" backcolor="#FCFF00"/>
</conditionalStyle>
</style>
I could not find a direct way to accomplish this task - you have to create a separate style for each field.
Considering this you can concentrate your effort on creating a small script that replicate the XML with the same stile for the fields you have. Then you can just copy/paste the XML into the report source file. Each time you need to change the style you will have to go back to your XML generator.
Try ths one :
<style name="myStyle" fontName="Arial">
<conditionalStyle>
<conditionExpression><![CDATA[new Boolean($V{SANCTION_AMOUNT_MEASURE}.intValue() == 100)]]></conditionExpression>
<style forecolor="#FF0000" isBold="true"/>
</conditionalStyle>
<conditionalStyle>
<conditionExpression><![CDATA[new Boolean($V{SANCTION_AMOUNT_MEASURE}.intValue() == 200)]]></conditionExpression>
<style forecolor="#00FF00" isBold="true"/>
</conditionalStyle>
<conditionalStyle>
<conditionExpression><![CDATA[new Boolean($V{SANCTION_AMOUNT_MEASURE}.intValue() == 300)]]></conditionExpression>
<style forecolor="#0000FF" isBold="true"/>
</conditionalStyle>
</style>

Hide DataPoints in chart control from WinRT XAML Toolkit

Is it possible to hide the data points in the chart control from the WinRT XAML Toolkit from CodePlex? I'm using a LineSeries and only want a line without the dots.
This seems to work. Though I am not yet sure why it makes my lines orange...
<charting:Chart
x:Name="LineChart2"
Title="Line Chart Without Data Points"
Margin="70,0">
<charting:LineSeries
Title="Population"
IndependentValueBinding="{Binding Name}"
DependentValueBinding="{Binding Value}"
IsSelectionEnabled="True">
<charting:LineSeries.DataPointStyle>
<Style
TargetType="charting:LineDataPoint">
<Setter
Property="BorderThickness"
Value="0" />
<Setter
Property="IsTabStop"
Value="False" />
<Setter
Property="Width"
Value="0" />
<Setter
Property="Height"
Value="0" />
<Setter
Property="Template">
<Setter.Value>
<ControlTemplate
TargetType="charting:LineDataPoint">
<Grid
x:Name="Root"
Opacity="0" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</charting:LineSeries.DataPointStyle>
</charting:LineSeries>
</charting:Chart>
#Filip Skakun thanks for the very accurate answer, and about your issue regarding Orange Lines try adding this property and change the color to whatever color you want.
<Charting:LineSeries.DataPointStyle>
<Style TargetType="Charting:LineDataPoint">
<Setter Property="Background" Value="Red" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Charting:LineDataPoint">
<Grid x:Name="Root" Opacity="0" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Charting:LineSeries.DataPointStyle>
it happens mainly because Chart's are capable of displaying multiple data series on single chart. and for Series[0] the default color is set to Orange.

Styling button in MVVM

I am writing a small WPF application using MVVM pattern.
I set some style resources for buttons into my main window and I would like them to apply to the buttons into the views. The problem is that some of the buttons are having a style with trigger. So I would like to inherit this style from the generic one
here is my main window code:
<Window.Resources>
<DataTemplate DataType="{x:Type vm:HomeViewModel}">
<views:HomeView/>
</DataTemplate>
<DataTemplate DataType="{x:Type vm:DetailReportViewModel}">
<views:DetailReportView/>
</DataTemplate>
<DataTemplate DataType="{x:Type vm:TransferViewModel}">
<views:TransferView/>
</DataTemplate>
<Style TargetType="{x:Type Button}">
<Setter Property="Margin" Value="5"/>
<Setter Property="MinWidth" Value="30"/>
<Setter Property="Foreground" Value="Red"/>
</Style>
<Style TargetType="{x:Type ComboBox}">
<Setter Property="Margin" Value="5"/>
</Style>
</Window.Resources>
here is the button XAML into my view/usercontrol
<Button Content="Delete" Command="{Binding DeleteReportCommand}">
<Button.Style>
<Style TargetType="{x:Type Button}">
<Style.Triggers>
<DataTrigger Binding="{Binding Mode}">
<DataTrigger.Value>
<vm:Mode>Add</vm:Mode>
</DataTrigger.Value>
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
<DataTrigger Binding="{Binding Mode}">
<DataTrigger.Value>
<vm:Mode>Edit</vm:Mode>
</DataTrigger.Value>
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
I tried to used BasedOn="{StaticResource {x:Type Button} to inherit but it doesn't seems to work (see img)
I tried with a key name but static resource won't find the key name as it's not on the same view. And BasedOn is not accepting Dynamic resource.
Anything I am missing?
Thank you
You can put all the custom styles in a separate resource dictionary file and you can add it in usercontrol.resources.
Refer this: http://www.codeproject.com/Articles/35346/Using-a-Resource-Dictionary-in-WPF
Or you can put all those in app.xaml (Application.Resources).
Refer this: http://msdn.microsoft.com/en-us/library/system.windows.resourcedictionary.aspx