<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="fieldsConfig.ascx.vb" Inherits="WF.Ninki.UI.fieldsConfig" %>
<%@ Register Assembly="WebFoundations.ServerControls" Namespace="WebFoundations.ServerControls" TagPrefix="WFF" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<h3>
    <asp:Literal runat="server" ID="ltitle" Text="Propriedades" /></h3>
<asp:UpdatePanel ID="pnlFields" UpdateMode="Conditional" runat="server" class="fields">
    <ContentTemplate>
        <asp:Label ID="noselection" runat="server" CssClass="no-selection" Text="selecione um controle para ver suas propriedades" />
        <style>
            .rslTrack {
                top: -7px !important;
            }

            .rcpPalette {
                font-size: 14px;
            }
        </style>
        <script>
            function OnClientDropDownOpenedHandler(sender, eventArgs) {
                if (sender.get_items().get_count() == 0) {
                    return;
                }
                else {
                    sender.requestItems(sender.get_text(), true);
                }
            }

            function showPopup(picker, args) {
                var paletteContainer = picker.getPaletteContainer();
                paletteContainer.style.left = "-10px";
                paletteContainer.style.width = "270px";
            }
        </script>
        <asp:Panel ID="pnlTitle" CssClass="formfield" runat="server" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblTitle" />
            <asp:TextBox CssClass="fieldvalue" runat="server" ID="txtTitle" AutoPostBack="true" OnTextChanged="txt_TextChanged" />
        </asp:Panel>
        <asp:Panel ID="pnlColumnName" CssClass="formfield" runat="server" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblColumnName" />
            <asp:TextBox CssClass="fieldvalue" runat="server" ID="txtColumnName" AutoPostBack="true" OnTextChanged="txt_ColumnNameChanged" />
        </asp:Panel>
        <asp:Panel ID="pnlGroupName" CssClass="formfield" runat="server" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblGroupName" />
            <asp:TextBox CssClass="fieldvalue" runat="server" ID="txtGroupName" AutoPostBack="true" OnTextChanged="txt_TextChanged" />
        </asp:Panel>
        <asp:PlaceHolder runat="server" ID="phAttachementFields" Visible="false">
            <div class="formfield">
                <p><asp:Literal runat="server" ID="litKeepNameDisclaimer" /></p>
                <asp:CheckBox CssClass="fieldvalue" ID="chkKeepOriginalName" OnCheckedChanged="chk_CheckedChanged" runat="server" AutoPostBack="True" Text="Keep Original Name" />
            </div>
            <div class="formfield">
                <p><asp:Literal runat="server" ID="litNewNameDisclaimer" /></p>
                <asp:Label CssClass="fieldtitle" runat="server" ID="lblNewFileName" Text="File Name" />
                <asp:TextBox CssClass="fieldvalue" runat="server" ID="txtNewFileName" AutoPostBack="true" OnTextChanged="txt_TextChanged" />
            </div>
        </asp:PlaceHolder>
        <asp:Panel ID="pnlIsReadOnly" CssClass="formfield" runat="server" Visible="false">
            <asp:CheckBox CssClass="fieldvalue" ID="chkIsReadOnly" OnCheckedChanged="chk_CheckedChanged" runat="server" AutoPostBack="True" />
        </asp:Panel>
        <asp:Panel ID="pnlIsRequired" CssClass="formfield" runat="server" Visible="false">
            <asp:CheckBox CssClass="fieldvalue" ID="chkIsRequired" OnCheckedChanged="chk_CheckedChanged" runat="server" AutoPostBack="True" />
        </asp:Panel>
        <asp:Panel ID="pnlDefaultValue" CssClass="formfield" runat="server" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblDefaultValue" />
            <telerik:RadComboBox ID="ddlDefaultValue" runat="server" OnItemsRequested="LoadContextItems"
                OnClientDropDownOpened="OnClientDropDownOpenedHandler" MarkFirstMatch="false" EnableLoadOnDemand="true" AutoPostBack="true" OnSelectedIndexChanged="ddl_DefaultIndexChanged" />
            <asp:TextBox runat="server" ID="txtDefaultValue" AutoPostBack="true" OnTextChanged="txt_TextChanged" Rows="5" Visible="false" TextMode="MultiLine" />
        </asp:Panel>
        <asp:Panel ID="pnlColor" CssClass="formfield" runat="server" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblColor" />
            <WFF:ColorPicker ID="itemColor" runat="server" PaletteModes="HSV"
                ShowIcon="true" Preset="None" AutoPostBack="true" OnColorChanged="colorPK_ColorChanged" OnClientPopUpShow="showPopup" />
        </asp:Panel>
        <asp:Panel ID="pnlEndDefaultValue" CssClass="formfield" runat="server" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblEndDefaultValue" />
            <telerik:RadComboBox ID="ddlEndDefaultValue" runat="server" OnItemsRequested="LoadContextItems"
                MarkFirstMatch="false" EnableLoadOnDemand="true" AutoPostBack="true" OnSelectedIndexChanged="ddl_DefaultIndexChanged" />
        </asp:Panel>
        <asp:Panel ID="pnlCheckInDefaultValue" CssClass="formfield" runat="server" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblCheckInDefaultValue" />
            <telerik:RadComboBox ID="ddlCheckInDefaultValue" runat="server" OnItemsRequested="LoadContextItems"
                MarkFirstMatch="false" EnableLoadOnDemand="true" AutoPostBack="true" OnSelectedIndexChanged="ddl_DefaultIndexChanged" />
        </asp:Panel>
        <asp:Panel ID="pnlCheckOutDefaultValue" CssClass="formfield" runat="server" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblCheckOutDefaultValue" />
            <telerik:RadComboBox ID="ddlCheckOutDefaultValue" runat="server" OnItemsRequested="LoadContextItems"
                MarkFirstMatch="false" EnableLoadOnDemand="true" AutoPostBack="true" OnSelectedIndexChanged="ddl_DefaultIndexChanged" />
        </asp:Panel>
        <asp:Panel ID="pnlLatitudeDefaultValue" CssClass="formfield" runat="server" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblLatitudeDefaultValue" />
            <telerik:RadComboBox ID="ddlLatitudeDefaultValue" runat="server" OnItemsRequested="LoadContextItems"
                MarkFirstMatch="false" EnableLoadOnDemand="true" AutoPostBack="true" OnSelectedIndexChanged="ddl_DefaultIndexChanged" />
        </asp:Panel>
        <asp:Panel ID="pnlLongitudeDefaultValue" CssClass="formfield" runat="server" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblLongitudeDefaultValue" />
            <telerik:RadComboBox ID="ddlLongitudeDefaultValue" runat="server" OnItemsRequested="LoadContextItems"
                MarkFirstMatch="false" EnableLoadOnDemand="true" AutoPostBack="true" OnSelectedIndexChanged="ddl_DefaultIndexChanged" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlValidationGroup" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblValidationGroup" />
            <asp:TextBox CssClass="fieldvalue" runat="server" ID="txtValidationGroup" AutoPostBack="true" OnTextChanged="txt_TextChanged" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlValidationExpression" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblValidationExpression" />
            <asp:TextBox CssClass="fieldvalue" runat="server" ID="txtValidationExpression" AutoPostBack="true" OnTextChanged="txt_TextChanged" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlTextMode" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblTextMode" />
            <asp:DropDownList runat="server" ID="ddlTextMode" DataTextField="Text" DataValueField="Value" AutoPostBack="true" OnTextChanged="ddl_SelectedIndexChanged" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlDateMode" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblDateMode" />
            <asp:DropDownList runat="server" ID="ddlDateMode" DataTextField="Text" DataValueField="Value" AutoPostBack="true" OnTextChanged="ddl_SelectedIndexChanged" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlLineCount" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblLineCount" />
            <asp:TextBox CssClass="fieldvalue" runat="server" ID="txtLineCount" AutoPostBack="true" OnTextChanged="txt_TextChanged" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlMask" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblMask" />
            <asp:TextBox CssClass="fieldvalue" runat="server" ID="txtMask" AutoPostBack="true" OnTextChanged="txt_TextChanged" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlWatermark" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblWatermark" />
            <asp:TextBox CssClass="fieldvalue" runat="server" ID="txtWatermark" AutoPostBack="true" OnTextChanged="txt_TextChanged" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlSaveTextToDB" Visible="false">
            <asp:CheckBox CssClass="fieldvalue" ID="chkSaveTextToDB" OnCheckedChanged="chk_CheckedChanged" runat="server" AutoPostBack="True" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlLocationName" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblLocationName" />
            <telerik:RadComboBox ID="ddlLocationName" runat="server" OnItemsRequested="LoadContextItems"
                MarkFirstMatch="false" EnableLoadOnDemand="true" AutoPostBack="true" OnSelectedIndexChanged="ddl_DefaultIndexChanged" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlLocationDescription" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblLocationDescription" />
            <telerik:RadComboBox ID="ddlLocationDescription" runat="server" OnItemsRequested="LoadContextItems"
                MarkFirstMatch="false" EnableLoadOnDemand="true" AutoPostBack="true" OnSelectedIndexChanged="ddl_DefaultIndexChanged" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlSorted" Visible="false">
            <asp:CheckBox CssClass="fieldvalue" ID="chkSorted" OnCheckedChanged="chk_CheckedChanged" runat="server" AutoPostBack="True" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlSelectByText" Visible="false">
            <asp:CheckBox CssClass="fieldvalue" ID="chkSelectByText" OnCheckedChanged="chk_CheckedChanged" runat="server" AutoPostBack="True" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlListType" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblListType" />
            <asp:DropDownList runat="server" ID="ddlListType" AutoPostBack="true" DataTextField="Text" DataValueField="Value" OnTextChanged="ddl_SelectedIndexChanged" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlType" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblType" />
            <asp:DropDownList runat="server" ID="ddlType" DataTextField="Text" DataValueField="Value" AutoPostBack="true" OnTextChanged="ddl_SelectedIndexChanged" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlLowValue" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblLowValue" />
            <asp:TextBox CssClass="fieldvalue" runat="server" ID="txtLowValue" AutoPostBack="true" OnTextChanged="txt_TextChanged" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlHighValue" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblHighValue" />
            <asp:TextBox CssClass="fieldvalue" runat="server" ID="txtHighValue" AutoPostBack="true" OnTextChanged="txt_TextChanged" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlMoveAwayDistance" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblMoveAwayDistance" />
            <asp:TextBox CssClass="fieldvalue" runat="server" ID="txtMoveAwayDistance" AutoPostBack="true" OnTextChanged="txt_TextChanged" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlShowMap" Visible="false">
            <asp:CheckBox CssClass="fieldvalue" ID="chkShowMap" OnCheckedChanged="chk_CheckedChanged" runat="server" AutoPostBack="True" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlShowAsAlert" Visible="false">
            <asp:CheckBox CssClass="fieldvalue" ID="chkShowAsAlert" OnCheckedChanged="chk_CheckedChanged" runat="server" AutoPostBack="True" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlTraceRoute" Visible="false">
            <asp:CheckBox CssClass="fieldvalue" ID="chkTraceRoute" OnCheckedChanged="chk_CheckedChanged" runat="server" AutoPostBack="True" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlisMainAction" Visible="false">
            <asp:CheckBox CssClass="fieldvalue" ID="chkIsMainAction" OnCheckedChanged="chk_CheckedChanged" runat="server" AutoPostBack="True" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlFieldType" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblFieldType" />
            <asp:DropDownList runat="server" ID="ddlFieldType" DataTextField="Text" DataValueField="Value" AutoPostBack="true" OnTextChanged="ddl_SelectedIndexChanged" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlFieldSize" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblFieldSize" />
            <asp:TextBox CssClass="fieldvalue" runat="server" ID="txtFieldSize" AutoPostBack="true" OnTextChanged="txt_TextChanged" />
        </asp:Panel>
        <asp:Panel CssClass="formfield" runat="server" ID="pnlTextFieldSize" Visible="false">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblTextFieldSize" />
            <asp:TextBox CssClass="fieldvalue" runat="server" ID="txtTextFieldSize" AutoPostBack="true" OnTextChanged="txt_TextChanged" />
        </asp:Panel>
        <asp:Panel ID="divItems" Visible="false" runat="server">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblItems" />
            <asp:Repeater runat="server" ID="rptItems">
                <HeaderTemplate>
                    <table>
                        <tr>
                            <td>
                                <asp:Label class="detailstitle" runat="server" ID="lblTexto" /></td>
                            <td>
                                <asp:Label class="detailstitle" runat="server" ID="lblValor" /></td>
                        </tr>
                </HeaderTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
                <ItemTemplate>
                    <tr>
                        <td>
                            <asp:Label class="detailsvalue" runat="server" ID="lblTexto" /></td>
                        <td>
                            <asp:Label class="detailsvalue" runat="server" ID="lblValor" /></td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
            <div class="formfield">
                <asp:Button CssClass="fieldsbutton" runat="server" ID="btnItems" />
            </div>
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblDataSources" />
            <asp:Panel CssClass="formfield" runat="server" ID="pnlNameDataSource">
                <asp:Label CssClass="fieldtitle" runat="server" ID="lblNameDataSource" />
                <telerik:RadComboBox ID="ddlNameDataSource" runat="server" OnItemsRequested="LoadDataTextItems"
                    EnableLoadOnDemand="true" AutoPostBack="true" OnSelectedIndexChanged="ddl_DefaultIndexChanged" />
            </asp:Panel>
            <asp:Panel CssClass="formfield" runat="server" ID="pnlValueDataSource">
                <asp:Label CssClass="fieldtitle" runat="server" ID="lblValueDataSource" />
                <telerik:RadComboBox ID="ddlValueDataSource" runat="server" OnItemsRequested="LoadDataValueItems"
                    EnableLoadOnDemand="true" AutoPostBack="true" OnSelectedIndexChanged="ddl_DefaultIndexChanged" />
            </asp:Panel>
        </asp:Panel>
        <div style="visibility: hidden; width: 1px; height: 1px;">
            <asp:HiddenField ID="hidFieldId" runat="server" />
            <asp:LinkButton ID="lnkFieldConfig" runat="server" />
        </div>
        <asp:Panel runat="server" ID="pnContext">
            <asp:Label CssClass="fieldtitle" runat="server" ID="lblContextTitle" />
            <telerik:RadComboBox ID="ddlContext" runat="server" OnItemsRequested="LoadContextItems"
                OnClientDropDownOpened="OnClientDropDownOpenedHandler" MarkFirstMatch="false" EnableLoadOnDemand="true" AutoPostBack="true" OnSelectedIndexChanged="ddl_DefaultIndexChanged" />
            <asp:Label CssClass="formfield" runat="server" ID="lblContextValue" />
        </asp:Panel>
    </ContentTemplate>
</asp:UpdatePanel>
