You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@royale.apache.org by Isabelle LOYER <i....@intersystemes.fr> on 2022/04/26 15:00:21 UTC
Custom windows with Apache Flex 4.16.1 and Air 33
Dear Flex users,
I need your help to update my Flex 4.6 air desktop application app.
Indeed, now, I work with Apache Flex 4.16.1 and Air 33 and I have some
problems with windows skin.
When I launch my application in debug mode an error appear who says :
CloseButtonSkinM is undifined !
<s:SparkSkin xmlns:fx =
["http://ns.adobe.com/mxml/2009"](http://ns.adobe.com/mxml/2009)
xmlns:s = "library://ns.adobe.com/flex/spark"
xmlns:fb =
["http://ns.adobe.com/flashbuilder/2009"](http://ns.adobe.com/flashbuilder/2009)
xmlns:Layout = "skin.Layout.*"
alpha.disabledGroup = "0.5" creationComplete =
"sparkskin1_creationCompleteHandler(event)">
<fx:Metadata>
[HostComponent("fr.mycompagny.ui.windowSkin.wCustomWindow")]
</fx:Metadata>
<fx:Script>
<![CDATA[
import fr.mycompagny.command.AddMenuImp;
import fr.mycompagny.util.WindowManager;
import mx.core.FlexGlobals;
import mx.events.FlexEvent;
import mx.events.StateChangeEvent;
//skin Mac
import assets.skin.components.MaximizeButtonSkinM;
import assets.skin.components.MinimizeButtonSkinM;
import assets.skin.components.CloseButtonSkinM;
import spark.components.Button;
private var btMaximize:Button;
private var btMinimize:Button;
private var closeButton:Button;
protected function sparkskin1_creationCompleteHandler( event:FlexEvent ):void
{
this.addEventListener( StateChangeEvent.CURRENT_STATE_CHANGE , onEnterState );
btMaximize=new Button();
btMaximize.buttonMode=true;
btMaximize.verticalCenter=0;
btMinimize=new Button();
btMinimize.buttonMode=true;
btMinimize.verticalCenter=0;
closeButton=new Button();
closeButton.buttonMode=true;
closeButton.verticalCenter=0;
btMinimize.addEventListener( MouseEvent.CLICK , minimizeW );
btMaximize.addEventListener( MouseEvent.CLICK , maximizeW );
closeButton.addEventListener( MouseEvent.CLICK , closeWindow );
this.addEventListener( StateChangeEvent.CURRENT_STATE_CHANGE , onEnterState );
if ( NativeApplication.supportsDockIcon )
{
buttonArea.addElement( closeButton );
buttonArea.addElement( btMinimize );
buttonArea.addElement( btMaximize );
closeButton.setStyle( "skinClass", CloseButtonSkinM);
btMaximize.setStyle( "skinClass" , MaximizeButtonSkinM );
btMinimize.setStyle( "skinClass" , MinimizeButtonSkinM );
buttonArea.left=12;
titleDisplay.left=this.width / 2;
icon.right=5;
}
else
{
buttonArea.addElement( btMinimize );
buttonArea.addElement( btMaximize );
buttonArea.addElement( closeButton );
closeButton.setStyle( "skinClass" , CloseButtonSkin );
btMaximize.setStyle( "skinClass" , skin.components.MaximizeButtonSkin );
btMinimize.setStyle( "skinClass" , skin.components.MinimizeButtonSkin );
buttonArea.right=12;
titleDisplay.left=60;
icon.left=5;
}
}
]]>
</fx:Script>
<s:states>
<s:State name = "disabledAndInactive" stateGroups = "disabledGroup,
inactiveGroup"/>
<s:State name = "maximizedGroup"/>
<s:State name = "normal"/>
<s:State name = "disabled" stateGroups = "disabledGroup"/>
<s:State name = "normalAndInactive" stateGroups = "inactiveGroup"/>
<s:State name = "supportsDockIcon"/>
<s:State name = "supportsSystemTray"/>
</s:states>
<s:Rect id = "backgroundRect" left = "0" right = "0" top = "0" bottom = "0"
alpha = "0">
<s:fill>
<s:SolidColor alpha = "0"/>
</s:fill>
</s:Rect>
<s:Group bottom = "0" left = "0" right = "0" top = "0">
<!--Fond de la fenetre-->
<s:Rect bottom = "0" left = "0" right = "0" top = "0" radiusX = "8" radiusY =
"8">
<s:fill>
<s:SolidColor color = "#656565" alpha = ".7"/>
</s:fill>
<s:stroke>
<s:SolidColorStroke color = "#666666"/>
</s:stroke>
</s:Rect>
<s:Group height = "38" id = "moveArea" left = "0" right = "0">
<!--Barre bleu avec filet-->
<s:Rect height = "25" left = "10" right = "10" top = "10">
<s:fill>
<s:SolidColor color = "#055a90"/>
</s:fill>
<s:stroke>
<s:SolidColorStroke color = "#666666"/>
</s:stroke>
</s:Rect>
<s:BitmapImage id = "icon" verticalCenter = "0"/>
<s:Label id = "titleDisplay" styleName = "swindowTitle" top = "18"
verticalAlign = "middle" horizontalCenter = "0"/>
<!--Zone de bouton-->
<s:HGroup id = "buttonArea" verticalCenter = "0">
<!--<s:Button id="btMinimize" buttonMode="true"
verticalCenter="0"/>
<s:Button id="btMaximize" buttonMode="true"
verticalCenter="0"/>
<s:Button id="closeButton" buttonMode="true"
verticalCenter="0"/>\-->
</s:HGroup>
</s:Group>
<!--Fond de la zone principale-->
<s:Rect id = "background" left = "10" top = "35" right = "10" bottom = "10">
<s:fill>
<s:LinearGradient rotation = "-90">
<s:GradientEntry color = "#edf0f7"/>
<s:GradientEntry color = "#fcfbfb"/>
</s:LinearGradient>
</s:fill>
<s:stroke>
<s:SolidColorStroke color = "#666666"/>
</s:stroke>
</s:Rect>
<!--Zone dans laquelle les elements vont se positionner-->
<s:Group id = "contentGroup" left = "15" right = "15" top = "43" bottom = "15"
minWidth = "0" minHeight = "0" width = "100%" height = "100%">
</s:Group>
</s:Group>
<s:Button height = "15" id = "btResize" width = "15" bottom = "0" right = "0"
skinClass = "spark.skins.spark.windowChrome.GripperSkin" mouseDown =
"btResize_mouseDownHandler(event)"
buttonMode = "true"/>
</s:SparkSkin>
\--
|
### Isabelle LOYER
|
|
|
|
---|---|---|---|---
Re: Custom windows with Apache Flex 4.16.1 and Air 33
Posted by Alex Harui <ah...@adobe.com>.
Hello,
Is there a stack trace along with the error? If so, please post it.
Try making a very simple test case with your custom Window and Skin and open a bug report with that test case. You can swap in different graphics if your skins are proprietary.
-Alex
From: Isabelle LOYER <i....@intersystemes.fr>
Reply-To: "users@royale.apache.org" <us...@royale.apache.org>
Date: Tuesday, April 26, 2022 at 8:00 AM
To: "users@royale.apache.org" <us...@royale.apache.org>
Subject: Custom windows with Apache Flex 4.16.1 and Air 33
Dear Flex users,
I need your help to update my Flex 4.6 air desktop application app.
Indeed, now, I work with Apache Flex 4.16.1 and Air 33 and I have some problems with windows skin.
When I launch my application in debug mode an error appear who says : CloseButtonSkinM is undifined !
<s:SparkSkin xmlns:fx = "http://ns.adobe.com/mxml/2009"<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=05%7C01%7Caharui%40adobe.com%7Cf014f7b4dc2d4ebf17fc08da279582ea%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637865820486163333%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=WoKrvwoFE%2FYcHiXNzUfuTlYNAIWUiyiffl7yEzBxe%2Bc%3D&reserved=0>
xmlns:s = "library://ns.adobe.com/flex/spark"
xmlns:fb = "http://ns.adobe.com/flashbuilder/2009"<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fflashbuilder%2F2009&data=05%7C01%7Caharui%40adobe.com%7Cf014f7b4dc2d4ebf17fc08da279582ea%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637865820486163333%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MqHmgXwn6Ry%2Bi02s0NeOCeXS42Ls3GuJBdwsndKQveY%3D&reserved=0> xmlns:Layout = "skin.Layout.*"
alpha.disabledGroup = "0.5" creationComplete = "sparkskin1_creationCompleteHandler(event)">
<fx:Metadata>
[HostComponent("fr.mycompagny.ui.windowSkin.wCustomWindow")]
</fx:Metadata>
<fx:Script>
<![CDATA[
import fr.mycompagny.command.AddMenuImp;
import fr.mycompagny.util.WindowManager;
import mx.core.FlexGlobals;
import mx.events.FlexEvent;
import mx.events.StateChangeEvent;
//skin Mac
import assets.skin.components.MaximizeButtonSkinM;
import assets.skin.components.MinimizeButtonSkinM;
import assets.skin.components.CloseButtonSkinM;
import spark.components.Button;
private var btMaximize:Button;
private var btMinimize:Button;
private var closeButton:Button;
protected function sparkskin1_creationCompleteHandler( event:FlexEvent ):void
{
this.addEventListener( StateChangeEvent.CURRENT_STATE_CHANGE , onEnterState );
btMaximize=new Button();
btMaximize.buttonMode=true;
btMaximize.verticalCenter=0;
btMinimize=new Button();
btMinimize.buttonMode=true;
btMinimize.verticalCenter=0;
closeButton=new Button();
closeButton.buttonMode=true;
closeButton.verticalCenter=0;
btMinimize.addEventListener( MouseEvent.CLICK , minimizeW );
btMaximize.addEventListener( MouseEvent.CLICK , maximizeW );
closeButton.addEventListener( MouseEvent.CLICK , closeWindow );
this.addEventListener( StateChangeEvent.CURRENT_STATE_CHANGE , onEnterState );
if ( NativeApplication.supportsDockIcon )
{
buttonArea.addElement( closeButton );
buttonArea.addElement( btMinimize );
buttonArea.addElement( btMaximize );
closeButton.setStyle( "skinClass", CloseButtonSkinM);
btMaximize.setStyle( "skinClass" , MaximizeButtonSkinM );
btMinimize.setStyle( "skinClass" , MinimizeButtonSkinM );
buttonArea.left=12;
titleDisplay.left=this.width / 2;
icon.right=5;
}
else
{
buttonArea.addElement( btMinimize );
buttonArea.addElement( btMaximize );
buttonArea.addElement( closeButton );
closeButton.setStyle( "skinClass" , CloseButtonSkin );
btMaximize.setStyle( "skinClass" , skin.components.MaximizeButtonSkin );
btMinimize.setStyle( "skinClass" , skin.components.MinimizeButtonSkin );
buttonArea.right=12;
titleDisplay.left=60;
icon.left=5;
}
}
]]>
</fx:Script>
<s:states>
<s:State name = "disabledAndInactive" stateGroups = "disabledGroup, inactiveGroup"/>
<s:State name = "maximizedGroup"/>
<s:State name = "normal"/>
<s:State name = "disabled" stateGroups = "disabledGroup"/>
<s:State name = "normalAndInactive" stateGroups = "inactiveGroup"/>
<s:State name = "supportsDockIcon"/>
<s:State name = "supportsSystemTray"/>
</s:states>
<s:Rect id = "backgroundRect" left = "0" right = "0" top = "0" bottom = "0" alpha = "0">
<s:fill>
<s:SolidColor alpha = "0"/>
</s:fill>
</s:Rect>
<s:Group bottom = "0" left = "0" right = "0" top = "0">
<!--Fond de la fenetre-->
<s:Rect bottom = "0" left = "0" right = "0" top = "0" radiusX = "8" radiusY = "8">
<s:fill>
<s:SolidColor color = "#656565" alpha = ".7"/>
</s:fill>
<s:stroke>
<s:SolidColorStroke color = "#666666"/>
</s:stroke>
</s:Rect>
<s:Group height = "38" id = "moveArea" left = "0" right = "0">
<!--Barre bleu avec filet-->
<s:Rect height = "25" left = "10" right = "10" top = "10">
<s:fill>
<s:SolidColor color = "#055a90"/>
</s:fill>
<s:stroke>
<s:SolidColorStroke color = "#666666"/>
</s:stroke>
</s:Rect>
<s:BitmapImage id = "icon" verticalCenter = "0"/>
<s:Label id = "titleDisplay" styleName = "swindowTitle" top = "18" verticalAlign = "middle" horizontalCenter = "0"/>
<!--Zone de bouton-->
<s:HGroup id = "buttonArea" verticalCenter = "0">
<!--<s:Button id="btMinimize" buttonMode="true"
verticalCenter="0"/>
<s:Button id="btMaximize" buttonMode="true"
verticalCenter="0"/>
<s:Button id="closeButton" buttonMode="true"
verticalCenter="0"/>-->
</s:HGroup>
</s:Group>
<!--Fond de la zone principale-->
<s:Rect id = "background" left = "10" top = "35" right = "10" bottom = "10">
<s:fill>
<s:LinearGradient rotation = "-90">
<s:GradientEntry color = "#edf0f7"/>
<s:GradientEntry color = "#fcfbfb"/>
</s:LinearGradient>
</s:fill>
<s:stroke>
<s:SolidColorStroke color = "#666666"/>
</s:stroke>
</s:Rect>
<!--Zone dans laquelle les elements vont se positionner-->
<s:Group id = "contentGroup" left = "15" right = "15" top = "43" bottom = "15" minWidth = "0" minHeight = "0" width = "100%" height = "100%">
</s:Group>
</s:Group>
<s:Button height = "15" id = "btResize" width = "15" bottom = "0" right = "0" skinClass = "spark.skins.spark.windowChrome.GripperSkin" mouseDown = "btResize_mouseDownHandler(event)"
buttonMode = "true"/>
</s:SparkSkin>
--
Isabelle LOYER