<%@ page language="C#" autoeventwireup="true" inherits="PartConfig_Style, App_Web_-gk5xqfx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>部件属性 - 样式</title>
    <base target="_self"/>
    <link rel="stylesheet" href="../Style/Common.css" />
    <link rel="stylesheet" href="../Style/Dialog.css" />
    <link rel="stylesheet" href="../style/TiledView.css" />
    <style type="text/css">
.ColorBlock{width:45px; height:13px; border: 1px solid #7f9db9; }
div.ThumbCase { border: 1px solid #7f9db9; margin-bottom:4px; }
div.ThumbCase div.Text{ display:none; }
#BdTempCase div.ThumbNail, #BdTempCase div.ThumbNail_Active {  width: 98px; height:98px; margin: 2px 1px; }
#BdTempCase .Image { width: 92px; height: 92px; }
#BdTempCase{ width:98.8%; height:230px; }
#SyTempCase{ width:98%; height:230px; margin-top:6px; }
#SyTempCase div.ThumbNail, #SyTempCase div.ThumbNail_Active { width: 160px; margin: 2px; }
#SyTempCase .Image { width: 154px; height: 74px; }
</style>

    <script type="text/javascript" src="../Script/Common.js"></script>
    <script type="text/javascript" src="../Script/Controls.js"></script>
    <script type="text/javascript">
var lstMoreLinkMode, tbMoreLinkShowText, tbMoreLinkUrl, chkMoreNewOpen;
var sltBdColor, hfBdColor, hfBdTemp, hfSyTemp, hfPartName;
function Page_Init()
    {
	lstMoreLinkMode = $('lstMoreLinkMode');
	tbMoreLinkShowText = $('tbMoreLinkShowText');
	tbMoreLinkUrl = $('tbMoreLinkUrl');
	chkMoreNewOpen = $('chkMoreNewOpen');
	sltBdColor = $('sltBdColor');
	sltBdColor.ondblclick = sltBdColor_DblClick;
	sltBdColor.onblur = sltBdColor_Blur;
	
	hfBdColor = $('hfBdColor');
	hfBdTemp = $('hfBdTemp');
	hfSyTemp = $('hfSyTemp');
	hfPartName = $('hfPartName');
//	lstMoreLinkMode.onchange = lstMoreLinkMode_Change;
    }
var colorRg = /#?([0-9a-f]{6})/i;

var SiteName, BdTempView, SyTempView;
function Page_Load()
    {
	SiteName = Common.GetQueryString('sitename');

	var ConfigTab = $('ConfigTab');
	var BindTab = $('BindTab');
	var query = location.search;
	ConfigTab.href = 'Setting.aspx' + query;
	BindTab.href = 'BindColumn.aspx' + query;
	
	BdTempView = new ThumbView.Case( $('BdTempCase'), '../TempManage/TempOp.aspx', {allowUnselect:false, onSelFunc:BdTempSelect, onLoaded:BdTempLoaded } );
	var c = hfBdColor.value;//alert(c);
	if( c && colorRg.test(c) ){
	    c = '#'+RegExp.$1;
	    BdTempView.LoadByRequest( 'optype=listbordertemp&color='+ c );
	}

	SyTempView = new ThumbView.Case( $('SyTempCase'), '../TempManage/TempOp.aspx', {allowUnselect:false, onSelFunc:SyTempSelect, onLoaded:SyTempLoaded } );
	var partName = hfPartName.value;
	if( partName){
	    SyTempView.LoadByRequest( 'optype=liststyletemp&partname='+ partName );
	}
    }
function BdTempLoaded()
    {
	var tempName = hfBdTemp.value;
	BdTempView.Activate( tempName );
    }
function BdTempSelect( tempName )
    {
	hfBdTemp.value = tempName;
    }

function SyTempLoaded()
    {
	var tempName = hfSyTemp.value;
	SyTempView.Activate( tempName );
    }
function SyTempSelect( tempName )
    {
	hfSyTemp.value = tempName;
    }


//function lstMoreLinkMode_Change()
//    {
//	var lst = event.srcElement;
//	var value = ListUtil.GetSelectedValue( lst );
//	if( value=='0' ){
//	    tbMoreLinkShowText.disabled = true;
//	    tbMoreLinkUrl.disabled = true;
//	    chkMoreNewOpen.disabled = true;
//	} else{
//	    tbMoreLinkShowText.disabled = false;
//	    tbMoreLinkUrl.disabled = false;
//	    chkMoreNewOpen.disabled = false;
//	}	
//    }
function btnAdvanced_Click()
    {
	var sea = location.search;	
	var sMsg = Common.ShowDialog( 1, 'StyleAdv.aspx'+sea, null, {width:760, height:500, offset:true} );
//	if( /^ok/i.test(sMsg) )
//	    partOp.Fresh( part );
    }
function btnSelect_Click()
    {
	var url = new UrlText( '../CommonUI/SelectFile.aspx', ['SiteName', SiteName], 'uni' );
	var ret = Common.ShowDialog( 1, url.Text, null, {width:420, height:480} );
	if( ret ){
	    var obj = event.srcElement.previousSibling.previousSibling;
	    if( obj ) obj.value = ret;
	}
    }
function sltBdColor_DblClick()
    {
	var ret = Common.ShowDialog( 1, '../CommonUI/SelectColor.htm', null, {width:500, height:400} );
	setColor( ret )
    }
function sltBdColor_Blur( obj )
    {
	setColor( sltBdColor.value );
    }
function setColor( c )
    {
	if( c && colorRg.test(c) ){
	    cn = RegExp.$1;
	    c = '#'+cn;
	    sltBdColor.value = c;
	    if( c != hfBdColor.value ){
	        try{ sltBdColor.style.backgroundColor = c; } catch(e){;}
	        hfBdColor.value = c;
	        BdTempView.LoadByRequest( 'optype=listbordertemp&color='+ cn );
	    }
	} else{
	    sltBdColor.value = hfBdColor.value;
	}
    }
    </script>
</head>
<body><form id="form1" runat="server">

    <div class="TopArea">
        <h1>部件属性
            <asp:Label ID="lbPartName" runat="server" Text="[]" CssClass="Notes" />
        </h1>
        <div class="HeadLogo"></div>
    </div>

    <div class="TitleBar">
        <table style="width:98%; margin:3px auto;"><tr>
            <td style="width:60px;">标题文本</td>
            <td>
                <asp:TextBox ID="tbTitleText" runat="server" Width="96%"></asp:TextBox>
            </td>
            <td style="width:260px; text-align:right;">
                <input id="btnAdvanced" type="button" value="高级..." class="Button" onclick="btnAdvanced_Click();" />
            </td>
        </tr></table>
    </div>
    
    <div class="ContentArea">
        <table class="Content" width="100%"><tr>
            <td style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="width:100%;">
                <tr>
                    <td style="">边框式样：</td>
                    <td style="width:8px;"></td>
                    <td style="text-align:right;">
                        选择颜色：
                        <input id="sltBdColor" runat="server" class="ColorBlock" type="text" />
                        <%--<div id="sltBdColor" runat="server" class="ColorBlock" onclick="SelectColor(this);">#ffffff</div>--%>
                        <asp:HiddenField ID="hfBdColor" runat="server" />
                    </td>
                </tr>
                <tr><td colspan="3">
                    <div id="BdTempCase"></div>
                    <asp:HiddenField ID="hfBdTemp" runat="server" />
                </td></tr>
                <tr>
                    <td>
                        <fieldset style="width: 280px;">
                            <legend>
                                "更多"链接 <asp:DropDownList ID="lstMoreLinkMode" runat="server">
                                    <asp:ListItem Value="0">不显示"更多"链接</asp:ListItem>
                                    <asp:ListItem Value="1">将标题作为"更多"链接</asp:ListItem>
                                    <asp:ListItem Value="2">将"更多"显示在标题右侧</asp:ListItem>
                                    <asp:ListItem Value="3">将"更多"显示在底栏左侧</asp:ListItem>
                                    <asp:ListItem Value="4">将"更多"显示在底栏右侧</asp:ListItem>
                                </asp:DropDownList>
                            </legend>
                            "更多"文本：<asp:TextBox ID="tbMoreLinkShowText" runat="server" Width="180" /><br />
                            "更多"路径：<asp:TextBox ID="tbMoreLinkUrl" runat="server" Width="154" />
                            <input id="btnSelect" type="button" value=".." onclick="btnSelect_Click();" /><br />
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<asp:CheckBox ID="chkMoreNewOpen" runat="server" Text="在新窗口打开更多页" />
                        </fieldset>
                    </td>
                    <td style="width:8px;"></td>
                    <td>
                        <fieldset style="width:210px;">
                            <legend>边距</legend>
                            <table><tr><td style="text-align:center; vertical-align:middle;">
                                上边距:<asp:TextBox ID="tbMarginTop" runat="server" Width="45" /><br />
                                左边距:<asp:TextBox ID="tbMarginLeft" runat="server" Width="45" />&nbsp;&nbsp;
                                右边距:<asp:TextBox ID="tbMarginRight" runat="server" Width="45" /><br />
                                下边距:<asp:TextBox ID="tbMarginBottom" runat="server" Width="45" />
                            </td></tr></table>
                        </fieldset>
                    </td>
                </tr>
            </table></td>
            <td style="width:4px;"></td>
            <td style="width:186px; vertical-align:top;">
                <span style="float:left;" >部件内式样：</span>
                <div id="SyTempCase"></div>
                <asp:HiddenField ID="hfSyTemp" runat="server" />
                
                <fieldset>
                    <legend>部件大小</legend>
                    <table cellpadding="0" cellspacing="1">
                        <tr>
                            <td style="vertical-align:middle;">指定宽度:</td>
                            <td><asp:TextBox ID="tbWidth" runat="server" Width="60" /></td>
                        </tr>
                        <tr>
                            <td style="vertical-align: middle;">指定高度:</td>
                            <td><asp:TextBox ID="tbHeight" runat="server" Width="60" /></td>
                        </tr>
                        <tr>
                            <td style="vertical-align: middle;">内容超出:</td>
                            <td><asp:DropDownList ID="lstOverflow" runat="server" Width="116" Enabled="false">
                                    <asp:ListItem Value="0" Text="自动调整显示区" />
                                    <asp:ListItem Value="1" Text="显示滚动条" />
                                    <asp:ListItem Value="2" Text="隐藏超出部分内容" />
                            </asp:DropDownList></td>
                        </tr>
                    </table>
                </fieldset>
            </td>
        </tr></table>
    
    
    </div>
    
    <div class="BottomArea">
        <span class="LeftBlock">
            <asp:Label ID="lbResult" runat="server" ForeColor="Red"></asp:Label>
        </span>
        <span class="RightBlock">
            <asp:Button ID="btnConfirm" runat="server" CssClass="Button" Text="确定" OnClick="btnConfirm_Click" />
            <input id="btnCancel" type="button" class="Button" value="取消" onclick="window.close();" />
        </span>
    </div>
    
    <%-- 顶部选项卡  放到后面，防止开始时获得焦点 --%>
    <div class="TabArea" style="left:221px; width:270px;">
        <a id="ConfigTab" class="NormalTab"><span>设置</span></a>
        <div id="StyleTab" class="ActiveTab"><span>样式</span></div>
        <a id="BindTab" class="NormalTab"><span>内容绑定</span></a>
    </div>
    
    <asp:HiddenField ID="hfPartName" runat="server" />

</form>
<script type="text/javascript" language="javascript">
try{ Page_Init(); }catch(ex){;}
try{ Page_Resize(); window.onresize=Page_Resize; }catch(ex){;}
try{ Page_Load(); }catch(ex){;}
</script>
</body>
</html>


<%--<asp:CheckBox ID="cnkInheritPage" runat="server" Text="保持和页面风格一致" Enabled="false" /><br />--%>
<%--选择颜色：<asp:DropDownList ID="lstColorSuit" runat="server" Width="86%"></asp:DropDownList><br /><br />--%>
<%--已应用的部件内式样：<br />
<asp:Label ID="lbCurPartTemplate" runat="server" /><br />--%>
