How to show canvas on tapping on the image - windows-phone-8

I have defined datatemplate in app.xaml
I have there an image
And in my custom page I have a canvas
How can I show this canvas on tapping on the image?
Here is my datatemplate in app.xaml
<DataTemplate x:Key="FlightInfoDataTemplate">
<Grid HorizontalAlignment="Stretch" Width="420">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<!-- here are controls, which are not necessary now-->
<Image Tag="{Binding ID}" Source="/Images/bel_icon_2.png" Width="20" Height="20" Visibility="{Binding Path=Status, Converter={StaticResource StatusToVisibilityConverter}}" />
<!--***********-->
</Grid>
</DataTemplate>
Here is my canvas which is defined in MainPage.xaml
<Canvas x:Name="AddReminderDialog" HorizontalAlignment="Center" Height="280" Width="260"
VerticalAlignment="Center" Background="Transparent" Margin="110,178,110,238" Visibility="Collapsed">
<TextBlock Foreground="Yellow" Text="Напомнить" HorizontalAlignment="Center" Canvas.Left="78" Canvas.Top="28" />
<Button Name="btn1HourBef" BorderThickness="0" Background="Black" Content="За час" Width="260" FontSize="15" Height="60" Margin="0,70,0,0"/>
<Button Name="btn30MinBef" BorderThickness="0" Background="Black" Content="За 30 минут" Width="260" FontSize="15" Height="60" Margin="0,130,0,0"/>
<Button Name="btn10MinBef" BorderThickness="0" Background="Black" Content="По прилету/вылету" Width="260" FontSize="15" Height="60" Margin="0,190,0,0"/>
</Canvas>
How can I make it visible on tapping on the image?

Edit - canvas was meant to be used as a notification, and preferably reusable on several pages:
Per comments, it became clear the intention of the canvas was to provide a notification message. Something suitable for the concept of a dismissible popup. There already is a System.Windows.Controls.Primitives.Popup class in the framework.
Example:
In App.xaml:
<DataTemplate x:Key="FlightInfoDataTemplate">
...
<Image Tag="{Binding ID}" Source="/Images/bel_icon_2.png" Width="20" Height="20" Visibility="{Binding Path=Status, Converter={StaticResource StatusToVisibilityConverter}}" Tap="Image_Tap"/>
...
</DataTemplate>
<ControlTemplate x:Key="AddReminderDialog">
<Canvas HorizontalAlignment="Center" Height="280" Width="260" VerticalAlignment="Center" Background="WhiteSmoke" Margin="110,178,110,238">
<TextBlock Foreground="Black" Text="Hello" HorizontalAlignment="Center" Canvas.Left="78" Canvas.Top="28" />
<Button Name="btn1HourBef" BorderThickness="0" Background="Black" Content="За час" Width="260" FontSize="15" Height="60" Margin="0,70,0,0"/>
<Button Name="btn30MinBef" BorderThickness="0" Background="Black" Content="За 30 минут" Width="260" FontSize="15" Height="60" Margin="0,130,0,0"/>
<Button Name="btn10MinBef" BorderThickness="0" Background="Black" Content="По прилету/вылету" Width="260" FontSize="15" Height="60" Margin="0,190,0,0"/>
</Canvas>
</ControlTemplate>
In App.xaml.cs:
public partial class App : Application
{
private Popup popup = new Popup();
...
private void Image_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
var image = sender as Image;
var modelItem = image.DataContext;
const double width = 200;
const double height = 100;
var content = new ContentControl(){Width = width, Height = height, Background = new SolidColorBrush(Colors.Purple)};
content.Template = (ControlTemplate) Resources["AddReminderDialog"];
content.DataContext = modelItem; // you should define bindings in the ControlTemplate.
popup.Child = content;
popup.Height = height;
popup.Width = width;
popup.VerticalOffset = Application.Current.RootVisual.RenderSize.Height / 2 - height / 2;
popup.HorizontalOffset = Application.Current.RootVisual.RenderSize.Width / 2 - width / 2;
popup.IsOpen = true;
}

Related

SVG mask used in SVG embedded in HTML document not working

I am making an HTML document version of a griefer list for Dredark.io because the ship I made that had the list was ruined. An idiot I thought was my friend went promoting everyone who joined to captain rank and they all messed EVERYTHING up. However, I am having issues with the portion that shows the last seen appearance of each griefer: the SVG mask="url(#face/body/legs/hand)" attribute is not working.
<!DOCTYPE html>
<html>
<head>
<title>Dredark.io Griefers</title>
<script>
var list = {
"clown": {
warning: 15,
hair: "none",
skin: "#ff8800",
shirt: "#111111",
pants: "#000000",
proof: "Many people know him as a griefer"
},
"SMARTLABRAT": {
warning: 1,
hair: "none",
skin: "#ffeeaa",
shirt: "#11aa11",
pants: "#1122aa",
proof: "none"
}
};
function load(){
var max = 0;
var sorted = [];
for(var prop in list){
if(list[prop].warning >= max){
max = list[prop].warning;
}
}
var cur = max;
for(var i = max; i > 0; i--){
for(var prop in list){
if(list[prop].warning == i){
sorted.push(prop);
}
}
}
var html = "";
var warningColors = ["#00ff00","#44ff00","#88ff00","#aaff00","#ffff00","#ffaa00","#ff8800","#ff4400","#ff0000"];
for(var i = 0; i < sorted.length; i++){
var color = "";
for(var j = 0; j < warningColors.length; j++){
if(list[sorted[i]].warning >= (j * 10)){
color = warningColors[j];
}
}
html = "<tr><td>" + (i + 1) + "</td><td>" + sorted[i] + "</td><td style='background: " + color + ";'>" + list[sorted[i]].warning + "</td><td>" + list[sorted[i]].proof + "</td><td>" + document.getElementById("skin").outerHTML.replace(/!----/g,"#00ff00").replace("!_---","#222222").replace("!-_--","#111111") + "</td></tr>";
document.getElementById("list").innerHTML += html;
}
}
window.onload = function(){
load();
};
</script>
<style>
#list{
border: 1px solid #004400;
}
#prototypes{
display: none;
}
</style>
</head>
<body>
<details>
<summary>Because the previous one was ruined</summary>
<p>by <b>La Danse Macabre</b>, someone I trusted.</p>
<details>
<summary>Note to <b>La Danse Macabre</b>:</summary>
<p>Do not promote random people to <u>Captain</u> on <b>MY</b> ships!</p>
</details>
</details>
<p>The warning level of a griefer depends on how many ships they griefed and how much hard work is lost to them per ship. Griefers with a level below <code>20</code> are not really that bad and can still be trusted. Griefers with a level of less than <code>5</code> mean that they are possible but not proven.</p>
<div id="prototypes">
<svg id='skin' xmlns='http://www.w3.org/2000/svg' width='50px' height='80px' viewbox='0 0 50 80'>
<defs>
<mask maskContentUnits="userSpaceOnUse" id="face" width="50" height="80" viewbox="0 0 50 80"><image href="https://test.drednot.io/img/player_head.png" x="0" y="0"/></mask>
<mask maskContentUnits="userSpaceOnUse" id="body"><image href="https://test.drednot.io/img/player.png" x="17" y="7"/>
<image href="https://test.drednot.io/img/player_arm.png" x="20" y="-5"/></mask>
<mask maskContentUnits="userSpaceOnUse" id="legs"><image href="https://test.drednot.io/img/player_leg.png" x="17" y="8"/>
<image href="https://test.drednot.io/img/player_leg.png" x="20" y="8"/></mask>
<mask maskContentUnits="userSpaceOnUse" id="hand"><image href="https://test.drednot.io/img/player_hand.png" x="19" y="-5"/></mask>
</defs>
<rect x="0" y="0" width="100" height="100" fill="!----" mask="url(#face)"/>
<rect x="0" y="0" width="100" height="100" fill="!_---" mask="url(#body)"/>
<rect x="0" y="0" width="100" height="100" fill="!-_--" mask="url(#legs)"/>
<rect x="0" y="0" width="100" height="100" fill="!----" mask="url(#hand)"/>
<image href="https://test.drednot.io/img/player_face.png" x="0" y="0"/>
<image href="https://test.drednot.io/img/player_foot.png" x="17" y="8"/>
<image href="https://test.drednot.io/img/player_foot.png" x="20" y="8"/>
</svg>
</div>
<table id="list" border="1" cellSpacing="0px">
<tr>
<th>#</th>
<th>Name</th>
<th>Warning level</th>
<th>Proof</th>
<th>Last seen appearance</th>
</tr>
</table>
</body>
</html>
As its own file, the SVG image DOES support it, but for some reason when I embed it within the HTML document it just stops working. The best I can do is make the whole thing disappear. I have tried everything and I have been searching the whole web for a fix but I have lost all hope other than you kind people. What am I doing wrong and how do I fix this?
Svg <mask> won't be applied, if your svg containing it is hidden via display: none.
But you can hide it like so
#prototypes {
position: absolute;
width.0;
height: 0;
overflow: hidden;
}
This also applies to other svg elements like <clipPath> or filters.
So It's actually a better practice to hide your svg containing all assets and definitions this way.
Workin example
var list = {
"clown": {
warning: 15,
hair: "none",
skin: "#ff8800",
shirt: "#111111",
pants: "#000000",
proof: "Many people know him as a griefer"
},
"SMARTLABRAT": {
warning: 1,
hair: "none",
skin: "#ffeeaa",
shirt: "#11aa11",
pants: "#1122aa",
proof: "none"
}
};
function load() {
var max = 0;
var sorted = [];
for (var prop in list) {
if (list[prop].warning >= max) {
max = list[prop].warning;
}
}
var cur = max;
for (var i = max; i > 0; i--) {
for (var prop in list) {
if (list[prop].warning == i) {
sorted.push(prop);
}
}
}
var html = "";
var warningColors = ["#00ff00", "#44ff00", "#88ff00", "#aaff00", "#ffff00", "#ffaa00", "#ff8800", "#ff4400", "#ff0000"];
for (var i = 0; i < sorted.length; i++) {
var color = "";
for (var j = 0; j < warningColors.length; j++) {
if (list[sorted[i]].warning >= (j * 10)) {
color = warningColors[j];
}
}
html = "<tr><td>" + (i + 1) + "</td><td>" + sorted[i] + "</td><td style='background: " + color + ";'>" + list[sorted[i]].warning + "</td><td>" + list[sorted[i]].proof + "</td><td>" + document.getElementById("skin").outerHTML.replace(/!----/g, "#00ff00").replace("!_---", "#222222").replace("!-_--", "#111111") + "</td></tr>";
document.getElementById("list").innerHTML += html;
}
}
window.onload = function() {
load();
};
#list {
border: 1px solid #004400;
}
#prototypes {
position: absolute;
width.0;
height: 0;
overflow: hidden;
}
<details>
<summary>Because the previous one was ruined</summary>
<p>by <b>La Danse Macabre</b>, someone I trusted.</p>
<details>
<summary>Note to <b>La Danse Macabre</b>:</summary>
<p>Do not promote random people to <u>Captain</u> on <b>MY</b> ships!</p>
</details>
</details>
<p>The warning level of a griefer depends on how many ships they griefed and how much hard work is lost to them per ship. Griefers with a level below <code>20</code> are not really that bad and can still be trusted. Griefers with a level of less than <code>5</code> mean that they are possible but not proven.</p>
<div id="prototypes">
<svg aria-hidden="true" id='skin' xmlns='http://www.w3.org/2000/svg' width='50px' height='80px' viewbox='0 0 50 80'>
<defs>
<mask maskContentUnits="userSpaceOnUse" id="face" width="50" height="80" viewbox="0 0 50 80"><image href="https://test.drednot.io/img/player_head.png" x="0" y="0"/></mask>
<mask maskContentUnits="userSpaceOnUse" id="body"><image href="https://test.drednot.io/img/player.png" x="17" y="7"/>
<image href="https://test.drednot.io/img/player_arm.png" x="20" y="-5"/></mask>
<mask maskContentUnits="userSpaceOnUse" id="legs"><image href="https://test.drednot.io/img/player_leg.png" x="17" y="8"/>
<image href="https://test.drednot.io/img/player_leg.png" x="20" y="8"/></mask>
<mask maskContentUnits="userSpaceOnUse" id="hand"><image href="https://test.drednot.io/img/player_hand.png" x="19" y="-5"/></mask>
</defs>
<rect x="0" y="0" width="100" height="100" fill="!----" mask="url(#face)"/>
<rect x="0" y="0" width="100" height="100" fill="!_---" mask="url(#body)"/>
<rect x="0" y="0" width="100" height="100" fill="!-_--" mask="url(#legs)"/>
<rect x="0" y="0" width="100" height="100" fill="!----" mask="url(#hand)"/>
<image href="https://test.drednot.io/img/player_face.png" x="0" y="0"/>
<image href="https://test.drednot.io/img/player_foot.png" x="17" y="8"/>
<image href="https://test.drednot.io/img/player_foot.png" x="20" y="8"/>
</svg>
</div>
<table id="list" border="1" cellSpacing="0px">
<tr>
<th>#</th>
<th>Name</th>
<th>Warning level</th>
<th>Proof</th>
<th>Last seen appearance</th>
</tr>
</table>

How to make responsive content with React and Material UI?

I'm designing a product detail page with React and Material UI. I tried to make the page responsive. But the description section keeps overlapping over the image until the screen is reduced to the mobile size. The content gets stacked at that point, but the images and text are not adjusting to the screen size.
I feel like it's something wrong with the image styling. How do I get the images to be responsive?
Here's my code
styling section
const useStyles = makeStyles((theme) => ({
content: {
flexGrow: 1,
padding: theme.spacing(3),
},
toolbar: {
display: "flex",
alignItems: "center",
justifyContent: "flex-end",
padding: theme.spacing(0, 1),
// necessary for content to be below app bar
...theme.mixins.toolbar,
},
}));
function
export default function ProductDetails() {
const classes = useStyles();
return (
<main className={classes.content}>
<div className={classes.toolbar} />
<Grid container spacing={3}> {/* image and description container */}
<Grid item xs={12} sm={6}> {/* image container */}
<Grid> {/* preview image */}
<img src="luxury-watch.jpg" width="600" id="preview" alt="" />
</Grid>
<Grid> {/* sub images */}
<img src="luxury-watch.jpg" width="140" id="img1" alt="" />
<img src="luxury-watch.jpg" width="140" id="img2" alt="" />
<img src="luxury-watch.jpg" width="140" id="img3" alt="" />
<img src="luxury-watch.jpg" width="140" id="img4" alt="" />
</Grid>
</Grid>
<Grid item xs={12} sm={6}> {/* description container */}
<div>
<h1>ROLEX</h1>
<p> .... </p>
<h2><span><sup>$</sup></span>1250</h2>
<Button variant="contained" color="secondary">ADD TO CART</Button>
</div>
</Grid>
</Grid>
</main>
);
}
I think you've missed a few props on your Grid elements. Try this:
export default function ProductDetails() {
const classes = useStyles();
return (
<main className={classes.content}>
<div className={classes.toolbar} />
<Grid container spacing={3}> {/* image and description container */}
<Grid item container xs={12} sm={6}> {/* image container */}
<Grid item> {/* preview image */}
<img src="luxury-watch.jpg" width="600" id="preview" alt="" />
</Grid>
<Grid item> {/* sub images */}
<img src="luxury-watch.jpg" width="140" id="img1" alt="" />
<img src="luxury-watch.jpg" width="140" id="img2" alt="" />
<img src="luxury-watch.jpg" width="140" id="img3" alt="" />
<img src="luxury-watch.jpg" width="140" id="img4" alt="" />
</Grid>
</Grid>
<Grid item container xs={12} sm={6}> {/* description container */}
<div>
<h1>ROLEX</h1>
<p> .... </p>
<h2><span><sup>$</sup></span>1250</h2>
<Button variant="contained" color="secondary">ADD TO CART</Button>
</div>
</Grid>
</Grid>
</main>
);
}
You can't apply xs attribute if your Grid items isn't a container and you console should be warning you about that too
You can use material ui breakpoints for responsiveness
const useStyles = makeStyles((theme) => ({
content: {
flexGrow: 1,
padding: theme.spacing(3),
},
toolbar: {
display: "flex",
alignItems: "center",
justifyContent: "flex-end",
padding: theme.spacing(0, 1),
// necessary for content to be below app bar
...theme.mixins.toolbar,
[theme.breakpoints.down('lg')]:{
width:'60%',
},
[theme.breakpoints.up('lg')]:{
width:'60%',
}
}
}));

Ionic net::ERR_FILE_NOT_FOUND in directive template

I have a problem with my directive template. When execute ionic run android and go to inspect the device (chrome://inspect), it throws Failed to load resource: net::ERR_FILE_NOT_FOUND. But if I write ionic serve, it works correctly. Also works fine if I write the directive code directly in the main html (recetas.html).
The code:
The directive (recetasCardDirective.js):
.directive('recetasCard', function(){
return {
restrict: 'E',
templateUrl: "/templates/recetas-card.html",
scope: {
titulo: '#',
img: '#'
}
}
});
The directive code (recetas-card.html):
<a class="list card estiloCard" href="#/tabs/recetas/{{titulo}}">
<!-- title card -->
<ion-item>{{titulo}}</ion-item>
<!-- img card -->
<div class="item item-image">
<img ng-src="data:image/png;base64,{{img}}" class="imgResponsive">
</div>
<ion-item class="item-icon-left">
<i class="icon ion-fork"></i>Ver Receta
</ion-item>
</a>
And where I call directive html (recetas.html):
<ion-view title="Recetas Xpress" id="pag-recetas">
<ion-content padding="true" class="has-header">
<div ng-repeat="port in portada">
<recetas-card titulo={{port.titulo}} img={{port.img}} ></recetas-card>
</div>
</ion-content>
</ion-view>
Finally, the config.xml file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.ionicframework.recetasxpress299189" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>recetasXpress</name>
<description>
An Ionic Framework and Cordova project.
</description>
<author email="you#example.com" href="http://example.com.com/">
Your Name Here
</author>
<content src="index.html"/>
<access origin="*"/>
<access origin="tel:*" launch-external="yes"/>
<allow-navigation href="*"/>
<allow-navigation href="http://*/*"/>
<allow-navigation href="https://*/*"/>
<allow-navigation href="data:*"/>
<allow-intent href="*"/>
<access origin="*"/>
<preference name="phonegap-version" value="3.7.0" />
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="SplashScreenDelay" value="2000"/>
<preference name="FadeSplashScreenDuration" value="2000"/>
<preference name="android-minSdkVersion" value="16"/>
<preference name="BackupWebStorage" value="none"/>
<preference name="SplashScreen" value="screen"/>
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true"/>
</feature>
<platform name="ios">
<splash src="resources\ios\splash\Default-568h#2x~iphone.png" width="640" height="1136"/>
<splash src="resources\ios\splash\Default-667h.png" width="750" height="1334"/>
<splash src="resources\ios\splash\Default-736h.png" width="1242" height="2208"/>
<splash src="resources\ios\splash\Default-Landscape-736h.png" width="2208" height="1242"/>
<splash src="resources\ios\splash\Default-Landscape#2x~ipad.png" width="2048" height="1536"/>
<splash src="resources\ios\splash\Default-Landscape~ipad.png" width="1024" height="768"/>
<splash src="resources\ios\splash\Default-Portrait#2x~ipad.png" width="1536" height="2048"/>
<splash src="resources\ios\splash\Default-Portrait~ipad.png" width="768" height="1024"/>
<splash src="resources\ios\splash\Default#2x~iphone.png" width="640" height="960"/>
<splash src="resources\ios\splash\Default~iphone.png" width="320" height="480"/>
<icon src="resources\ios\icon\icon.png" width="57" height="57"/>
<icon src="resources\ios\icon\icon#2x.png" width="114" height="114"/>
<icon src="resources\ios\icon\icon-40.png" width="40" height="40"/>
<icon src="resources\ios\icon\icon-40#2x.png" width="80" height="80"/>
<icon src="resources\ios\icon\icon-40#3x.png" width="120" height="120"/>
<icon src="resources\ios\icon\icon-50.png" width="50" height="50"/>
<icon src="resources\ios\icon\icon-50#2x.png" width="100" height="100"/>
<icon src="resources\ios\icon\icon-60.png" width="60" height="60"/>
<icon src="resources\ios\icon\icon-60#2x.png" width="120" height="120"/>
<icon src="resources\ios\icon\icon-60#3x.png" width="180" height="180"/>
<icon src="resources\ios\icon\icon-72.png" width="72" height="72"/>
<icon src="resources\ios\icon\icon-72#2x.png" width="144" height="144"/>
<icon src="resources\ios\icon\icon-76.png" width="76" height="76"/>
<icon src="resources\ios\icon\icon-76#2x.png" width="152" height="152"/>
<icon src="resources\ios\icon\icon-83.5#2x.png" width="167" height="167"/>
<icon src="resources\ios\icon\icon-small.png" width="29" height="29"/>
<icon src="resources\ios\icon\icon-small#2x.png" width="58" height="58"/>
<icon src="resources\ios\icon\icon-small#3x.png" width="87" height="87"/>
</platform>
<platform name="android">
<splash src="resources\android\splash\drawable-land-ldpi-screen.png" density="land-ldpi"/>
<splash src="resources\android\splash\drawable-land-mdpi-screen.png" density="land-mdpi"/>
<splash src="resources\android\splash\drawable-land-hdpi-screen.png" density="land-hdpi"/>
<splash src="resources\android\splash\drawable-land-xhdpi-screen.png" density="land-xhdpi"/>
<splash src="resources\android\splash\drawable-land-xxhdpi-screen.png" density="land-xxhdpi"/>
<splash src="resources\android\splash\drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi"/>
<splash src="resources\android\splash\drawable-port-ldpi-screen.png" density="port-ldpi"/>
<splash src="resources\android\splash\drawable-port-mdpi-screen.png" density="port-mdpi"/>
<splash src="resources\android\splash\drawable-port-hdpi-screen.png" density="port-hdpi"/>
<splash src="resources\android\splash\drawable-port-xhdpi-screen.png" density="port-xhdpi"/>
<splash src="resources\android\splash\drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/>
<splash src="resources\android\splash\drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/>
<icon src="resources\android\icon\drawable-ldpi-icon.png" density="ldpi"/>
<icon src="resources\android\icon\drawable-mdpi-icon.png" density="mdpi"/>
<icon src="resources\android\icon\drawable-hdpi-icon.png" density="hdpi"/>
<icon src="resources\android\icon\drawable-xhdpi-icon.png" density="xhdpi"/>
<icon src="resources\android\icon\drawable-xxhdpi-icon.png" density="xxhdpi"/>
<icon src="resources\android\icon\drawable-xxxhdpi-icon.png" density="xxxhdpi"/>
</platform>
<icon src="resources\android\icon\drawable-xhdpi-icon.png"/>
<allow-navigation href="http://192.168.1.42:8100"/>
</widget>
Don't know what can I do... Thanks in advance and Sorry for my bad english
Sorry for bothers... The problem was a simply bar in directive.js
The correction (templateUrl):
.directive('recetasCard', function(){
return {
restrict: 'E',
templateUrl: "templates/recetas-card.html",
scope: {
titulo: '#',
img: '#'
}
}
});
So stupid... Thanks.

How to align the container to the right?

My current code renders like Picture 1, how can I get the output to render like Picture 2?
I tried to search the web but most of the results I have found show how to do this in css
Pic one,
Pic two,
<ext:Container id="Container1" runat="server" layout="HBoxLayout" width="2000" marginSpec="0 0 10 0" >
<Items>
<ext:Panel ID="panel_cms004_view" Title="Document Control Profile" runat="server" AutoScroll="true" Region="East" Height="180" Width="700" Split="true">
<Loader ID="cms004_view" runat="server" Url="../CMS/cms004_view.aspx" Mode="Frame" AutoLoad="true" >
<LoadMask ShowMask="true"></LoadMask>
</Loader>
</ext:Panel>
<ext:Panel ID="panel_cms004d_audit" Title="Document Control Number - Audit" runat="server" AutoScroll="true" Region="East" Height="180" Width="428" Split="true">
<Loader ID="cms004d_audit" runat="server" Url="../CMS/cms004d_audit.aspx" Mode="Frame" AutoLoad="true" >
<LoadMask ShowMask="true"></LoadMask>
</Loader>
</ext:Panel>
</Items>
</ext:Container>
<ext:Container id="Container8" runat="server" layout="HBoxLayout" width="2000" marginSpec="0 0 0 0">
<Items>
<ext:Panel ID="docControlNum" Title="Document Control Number" runat="server" AutoScroll="true" Region="East" Height="265" Width="700" Split="true">
<Loader ID="cms004d_view" runat="server" Url="../CMS/cms004d_view.aspx" Mode="Frame" AutoLoad="true" >
<LoadMask ShowMask="true"></LoadMask>
</Loader>
</ext:Panel>
</Items>
</ext:Container>
<ext:Container id="Container1" runat="server" Height="700" marginSpec="0 0 0 0" Layout="VBoxLayout" >
<Items>
<ext:Panel ID="panel_cms004_view" Title="Document Control Profile" runat="server" AutoScroll="true" Height="180" Width="700" Layout="VBoxLayout">
<Loader ID="cms004_view" runat="server" Url="../CMS/cms004_view.aspx" Mode="Frame" AutoLoad="true" Height="200">
<LoadMask ShowMask="true"></LoadMask>
</Loader>
</ext:Panel>
<ext:Panel ID="docControlNum" Title="Document Control Number" runat="server" AutoScroll="true" Height="248" Width="700" Layout="VBoxLayout">
<Loader ID="cms004d_view" runat="server" Url="../CMS/cms004d_view.aspx" Mode="Frame" AutoLoad="true" Height="700">
<LoadMask ShowMask="true"></LoadMask>
</Loader>
</ext:Panel>
</Items>
</ext:Container>
<ext:Container id="Container8" runat="server" marginSpec="0 0 0 700" Layout="VBoxLayout" Height="700" Width="430">
<Items>
<ext:Panel ID="panel_cms004d_audit" Title="Document Control Number - Audit" runat="server" AutoScroll="true" Height="425" Width="433" Layout="VBoxLayout">
<Loader ID="cms004d_audit" runat="server" Url="../CMS/cms004d_audit.aspx" Mode="Frame" AutoLoad="true" Height="700" Width="430" >
<LoadMask ShowMask="true"></LoadMask>
</Loader>
</ext:Panel>
</Items>
</ext:Container>
Did some editing. Found out that need to add in the layout for the panel and the container.
whats the problem with CSS?
do something like this :
.right {
position: absolute;
right: 0px;
}
and then :
<div class="right">
// your html
</div>
instead of creating a .css I would recommend you to use preexisting css like twitter bootstrap css or even a frontend framework which they have function and features that works very well.
With Bootstrap it comes a Grid System where you can place your elements like you want.

Defining custom css properties in Flex 4

I'm creating a Flex theme and I'm defining the default component appearance. All buttons should have a default skin. A special style can be applied to the buttons using styleName, which defines a set of colors to the button skin.
I have created a Spark Button skin as follows:
<!-- ButtonSkin.mxml -->
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:fb="http://ns.adobe.com/flashbuilder/2009" minWidth="21" minHeight="24" alpha.disabled="0.5">
<fx:Metadata>
<![CDATA[
[HostComponent("spark.components.Button")]
[Style(name="backgroundGradient", states="up, over, down", format="Array", inherit="yes")]
]]>
</fx:Metadata>
<fx:Script>
<![CDATA[
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
var backgroundGradient:Array = getStyle("backgroundGradient");
topGradientEntry.color = backgroundGradient[0];
bottomGradientEntry.color = backgroundGradient[1];
super.updateDisplayList(unscaledWidth, unscaledHeight);
}
]]>
</fx:Script>
<s:states>
<s:State name="up" />
<s:State name="over" />
<s:State name="down" />
<s:State name="disabled" />
</s:states>
<!-- shapes using topGradientEntry.color and bottomGradientEntry.color -->
</s:Skin>
set the main css file like this:
/** default.css **/
s|Button {
skinClass: ClassReference('mytheme.skins.ButtonSkin');
fontWeight: bold;
}
skins|ButtonSkin {
backgroundGradient: 0x000000, 0xFFFFFF;
}
s|Button.btn-primary:up {
backgroundGradient: 0x000000, 0xFFFFFF;
}
s|Button.btn-primary:over {
backgroundGradient: 0x000000, 0xFFFFFF;
}
s|Button.btn-primary:down {
backgroundGradient: 0x000000, 0xFFFFFF;
}
s|Button.btn-inverted:up {
backgroundGradient: 0xFFFFFF, 0x000000;
}
s|Button.btn-inverted:over {
backgroundGradient: 0xFFFFFF, 0x000000;
}
s|Button.btn-inverted:down {
backgroundGradient: 0xFFFFFF, 0x000000;
}
The application would style the buttons like this:
<!-- Main.mxml -->
<s:Button label="Default" x="10" y="10" width="75" height="26"/>
<s:Button label="Button" x="110" y="10" width="75" height="26" styleName="btn-success"/>
<s:Button label="Primary" x="210" y="10" width="75" height="26" styleName="btn-primary"/>
But I'm getting the error "CSS Value for 'backgroundGradient' not supported" on all occurrences.
I can't believe how much time I spent on this issue. The problem is that values in CSS should use the HEX with # format i.e. #FFFFFF and not 0xFFFFFF. Actionscript uses the 0x format, MXML uses both, and CSS uses the HEX with # format.