<?xml version="1.0"?>
<!DOCTYPE window PUBLIC "-//MOZILLA//DTD XUL V1.0//EN" "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="styles.css" type="text/css"?>

<?xul-overlay href="overlays/menu.xul"?>
<?xul-overlay href="overlays/navigation.xul"?>
<?xul-overlay href="overlays/adresses.xul"?>
<?xul-overlay href="overlays/communications.xul"?>
<?xul-overlay href="overlays/submit.xul"?>
<?xul-overlay href="overlays/bottom.xul"?>

<window id="YourApplication_window"
        windowtype="YourApplication"
        title="XuloContacts"
        xmlns:html="http://www.w3.org/1999/xhtml"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        width="1024"
        height="768"
        screenX="20"
        screenY="20"
        persist="screenX screenY width height"
				onload="Record.Init()"
				onclose="return Quitter()"
				onDOMMouseScroll="navMouse(event)"
        >

<script type="application/x-javascript" src="js/global.js" />
<script type="application/x-javascript" src="js/index.js" />
<script type="application/x-javascript" src="js/fonctions_editor.js" />

<script type="application/x-javascript">
	var a = "D:\\Loisirs\\yes.jpg";
	var b = imgPath;
	var c = "yes.jpg";
		
	function testDelete()
	{
		fileDelete(b+c);
	}
	
	function testCopy()
	{
		if (fileCopy(a, b, c))
			alert("Ok");
		else
			alert("Ko");
	}
</script>

<commandset>
	<command id="cmd_ajouter" 			oncommand="Record.Init(); $('type').focus();" />
	<command id="cmd_reload" 				oncommand="reload_fiche(Record, true, G_id);" />
	<command id="cmd_delete_fiche" 	oncommand="Record.Delete(G_id);" />
</commandset>

<toolbox id="tbx1" />
  <vbox id="ovl_navigation" />
	

<deck id="deck">

<vbox align="center">
	<!--<button label="Test Copy" oncommand="testCopy()" />-->
	<!--<button label="Test Delete" oncommand="testDelete()" />-->
	<hbox>
		<vbox flex="1">
			<label value="Appellation" control="type" />
			<menulist id="type" editable="true" oncommand="typeModif()">
				<menupopup>
					<menuitem value="" label="" />
					<menuitem value="Madame" label="Madame" />
					<menuitem value="Mademoiselle" label="Mademoiselle" />
					<menuitem value="Monsieur" label="Monsieur" />
					<menuseparator />
					<menuitem value="Fondation" label="Fondation" />
					<menuitem value="ASBL" label="ASBL" />
					<menuitem value="SA" label="SA" />
					<menuitem value="SPRL" label="SPRL" />
				</menupopup>
			</menulist>
			
			<separator class="thin" />
	
			<label value="Titre" control="titre" />
			<textbox id="titre" />
			
			<separator class="thin" />
			
			<label value="Nom" control="nom" />
			<textbox id="nom" />
			
			<separator class="thin" />
			
			<hbox>
				<vbox>
					<label value="Prénom" control="prenom" />
					<textbox id="prenom" />
				</vbox>
				<vbox width="150">
					<vbox id="zNom2">
						<label value="Nom de jeune fille" control="nom2" />
						<textbox id="nom2" />
					</vbox>
				</vbox>
			</hbox>
			
			<separator class="thin" />
			
			<hbox>
				<vbox>
					<label value="Date de naissance, de création" control="ddn" />
					<hbox align="center">
						<toolbarbutton image="img/date_delete.png" tooltiptext="Efface la date" oncommand="_datepikerReset($('ddn'))" />
						<datepicker id="ddn" type="popup" firstdayofweek="1" style="margin-left:0" />
			
						<textbox id="age" width="42" readonly="true" tabindex="-1" class="plain" style="margin-left:0;margin-right:0" />
					</hbox>
				</vbox>
				
				<spacer flex="1" />
				
				<vbox>
					<label value="Prendre en compte" control="ddn2" />
					<menulist id="ddn2">
						<menupopup>
							<menuitem value="0" label="Non" />
							<menuitem value="1" label="Oui" />
						</menupopup>
					</menulist>
					
				</vbox>
			</hbox>
			
		</vbox>
	
		<separator width="30" />
	
		<vbox width="300">
	
			<vbox id="zCategories">
				<groupbox><caption label="Catégories" />
				<hbox>
					<menulist id="fk_categories" flex="1"	oncommand="categoriesAdd()">
						<menupopup
										id="fk_categories_datas"
										datasources="datas/datas.sqlite"
										querytype="storage"
										ref="*">
						<menuitem value="0" label="-" />
					
						<template>
							<query>
								SELECT cat_id, cat_libelle
								FROM tbl_categories
								ORDER BY 2
							</query>
				
							<action>
								<menuitem uri="?" value="?cat_id" label="?cat_libelle" />
							</action>
				
						</template>
					
						</menupopup>
					</menulist>
		
					<toolbarbutton image="img/application_form_edit.png" tooltiptext="Ouvre la gestion des catégories" oncommand="openCategories()" />
				</hbox>
				<listbox id="fk_categories_liste" height="60" />
				<hbox>
					<toolbarbutton image="img/cross.png" tooltiptext="Effacer..." oncommand="categoriesDelete()" />
					<spacer flex="1" />
					<description id="Tfk_categories_liste" />
				</hbox>
				</groupbox>
			</vbox>
			
			<separator class="thin" />

			<vbox>
				<hbox align="end">
					<popupset>
						<panel id="popupColor">
							<colorpicker onselect="doColor('remarqueEditor', 'foreColor', this.color)" />
						</panel>
						<panel id="popupColor2">
							<colorpicker onselect="doColor('remarqueEditor', 'hilitecolor', this.color)" />
						</panel>
					</popupset>
					
					<label value="Remarque" />
		
					<toolbarbutton image="img/editor/text_bold.png" 				oncommand="doRichEditCommand('remarqueEditor', 'bold')" tooltiptext="Gras" />
					<toolbarbutton image="img/editor/text_italic.png" 			oncommand="doRichEditCommand('remarqueEditor', 'italic')" tooltiptext="Italique" />
					<toolbarbutton image="img/editor/text_underline.png" 		oncommand="doRichEditCommand('remarqueEditor', 'underline')" tooltiptext="Soulignage" />
					<toolbarbutton image="img/editor/text_strikethrough.png" oncommand="doRichEditCommand('remarqueEditor', 'strikeThrough')" tooltiptext="Barré" />
					<toolbarbutton image="img/editor/text_superscript.png" 		oncommand="doRichEditCommand('remarqueEditor', 'superscript')" tooltiptext="Exposant" />
					<toolbarbutton image="img/editor/text_subscript.png" 			oncommand="doRichEditCommand('remarqueEditor', 'subscript')" tooltiptext="Indice" />
					<!--<toolbarbutton image="img/editor/link_add.png"  					oncommand="doInsertLink('remarqueEditor')" tooltiptext="Ajouter un lien"  />-->
					<!--<toolbarbutton image="img/editor/link_delete.png" 				oncommand="doRichEditCommand('remarqueEditor', 'unlink')" tooltiptext="Supprimer un lien"  />-->
					<toolbarbutton image="img/editor/color_swatch.png" popup="popupColor" tooltiptext="Couleur de texte"  />				
					<toolbarbutton image="img/editor/color_swatch.png" popup="popupColor2" tooltiptext="Couleur de fond"  />				
					
					<spacer flex="1" />
					<toolbarbutton image="img/editor/font_delete.png" oncommand="doRichEditCommand('remarqueEditor', 'removeFormat')" tooltiptext="Efface le format"  />
				</hbox>
		
				<iframe
					id="remarqueEditor"
					src="about:blank"
					height="100"
					style="background-color:white;border:1px solid grey" />
				<textbox id="remarque" multiline="true" hidden="true" />
			</vbox>

	</vbox>
	</hbox>
	
	<tabbox id="onglets">
	<tabs>
		<tab accesskey="d" label="Adresses" />
		<tab accesskey="c" label="Communications" />
		<tab accesskey="u" label="Suivis" />
		<tab accesskey="h" label="Photos" />
		<tab accesskey="i" label="Informations" />
	</tabs>
	
	<tabpanels>
		<tabpanel id="ovl_adresses" />
		<tabpanel id="ovl_communications" />
		<tabpanel>
			<vbox flex="1">
				
				<tree id="liste_suivis" hidecolumnpicker="true" seltype="single" flex="1"
							ondblclick="Record.SuivisModif()">
				<treecols>
					<treecol flex="1" label="Date" />
					<treecol flex="4" label="Titre" />
					<treecol flex="0" label="" />
				</treecols>
				<treechildren id="liste_suivis2" />
				</tree>
				
				<hbox>
					<toolbarbutton image="img/add.png" tooltiptext="Ajouter un suivis" oncommand="Record.SuivisAdd()" />
					<toolbarbutton image="img/pencil.png" tooltiptext="Modifier le suivi" oncommand="Record.SuivisModif()" />
					<toolbarbutton image="img/cross.png" tooltiptext="Supprimer le suivi..." oncommand="Record.SuivisDelete()" />
					<spacer flex="1" />
					<description id="TlignesSuivis" />
				</hbox>
				
			</vbox>
			<spacer flex="1" />
		</tabpanel>
		<tabpanel>
			<vbox>
				<image id="img1" width="150" height="150"	style="border:2px dashed #000" />
				<hbox pack="end">
					<toolbarbutton image="img/picture_add.png" 	oncommand="Record.ImageAdd(1)" />
					<toolbarbutton image="img/cross.png" 				oncommand="Record.ImageDelete(1)" />
					<!--<toolbarbutton image="img/zoom_in.png" 			oncommand="Record.ImageZoom(1)" />-->
					<!--<toolbarbutton image="img/picture_save.png"	oncommand="Record.ImageSave(1)" />-->
					<!--<toolbarbutton image="img/information.png" 	oncommand="Record.ImageInfos(1)" />-->
				</hbox>
			</vbox>
			
			<separator width="20" />
			
			<vbox>
				<image id="img2" width="150" height="150"	style="border:2px dashed #000" />
				<hbox pack="end">
					<toolbarbutton image="img/picture_add.png"	oncommand="Record.ImageAdd(2)" />
					<toolbarbutton image="img/cross.png" 				oncommand="Record.ImageDelete(2)" />
					<!--<toolbarbutton image="img/zoom_in.png" 			oncommand="Record.ImageZoom(2)" />-->
					<!--<toolbarbutton image="img/picture_save.png" oncommand="ImageSave(2)" />-->
					<!--<toolbarbutton image="img/information.png" oncommand="ImageInfos(2)" />-->
				</hbox>
			</vbox>
			
			<separator width="20" />
			
			<vbox>
				<image id="img3" width="150" height="150"	style="border:2px dashed #000" />
				<hbox pack="end">
					<toolbarbutton image="img/picture_add.png" 	oncommand="Record.ImageAdd(3)" />
					<toolbarbutton image="img/cross.png" 				oncommand="Record.ImageDelete(3)" />
					<!--<toolbarbutton image="img/zoom_in.png" 			oncommand="Record.ImageZoom(3)" />-->
					<!--<toolbarbutton image="img/picture_save.png" oncommand="Record.ImageSave(3)" />-->
					<!--<toolbarbutton image="img/information.png" oncommand="Record.0ImageInfos(3)" />-->
				</hbox>
			</vbox>
		</tabpanel>
		<tabpanel>
			<grid flex="1">
				<columns>
					<column />
					<column width="180" />
				</columns>
				
				<rows>
					<row>
						<description value="Créé le :" />
						<textbox readonly="true" class="plain" tabindex="-1" id="inf_creation" />
					</row>
					
					<row>
						<description value="Modifié le :" />
						<textbox readonly="true" class="plain" tabindex="-1" id="inf_modification" />
					</row>
					
					<row>
						<description value="Num. Révision :" />
						<textbox readonly="true" class="plain" tabindex="-1" id="inf_revisions" />
					</row>
					
					<separator class="groove" />      
				</rows>
			</grid>
		</tabpanel>
	</tabpanels>
	</tabbox>
</vbox>
<!-- zone 2 -->
<hbox onkeypress="
  if (event.keyCode==13)
  {
    G_action='rechercher2';
  }">
  <vbox align="left">
    <groupbox width="200" maxheight="300" align="left"><caption label="Tris" />
    <menulist id="order1">
      <menupopup>
        <menuitem value="adr_nom" label="Nom" selected="true" />
        <menuitem value="adr_nom DESC" label="Nom desc" />
        <menuitem value="adr_prenom" label="Prénom" />
        <menuitem value="adr_prenom DESC" label="Prénom desc" />
        <menuitem value="adr_dt_creation" label="Création" />
        <menuitem value="adr_dt_creation DESC" label="Création desc" />
        <menuitem value="adr_ts_modification" label="Modification" />
        <menuitem value="adr_ts_modification DESC" label="Modification desc" />
      </menupopup>
    </menulist>
    <separator class="thin" />
    <menulist id="order2">
      <menupopup>
        <menuitem value="adr_nom" label="Nom" />
        <menuitem value="adr_nom DESC" label="Nom desc" />
        <menuitem value="adr_prenom" label="Prénom" selected="true" />
        <menuitem value="adr_prenom DESC" label="Prénom desc" />
        <menuitem value="adr_dt_creation" label="Création" />
        <menuitem value="adr_dt_creation DESC" label="Création desc" />
        <menuitem value="adr_ts_modification" label="Modification" />
        <menuitem value="adr_ts_modification DESC" label="Modification desc" />
      </menupopup>
  </menulist>
    
    </groupbox>

  <groupbox height="200" width="200"><caption label="Options" />
		<label value="Appellation" control="f_type" />
		<menulist id="f_type">
			<menupopup>
				<menuitem value="-1" label="Tous" />
				<menuitem value="" label="" />
				<menuitem value="Madame" label="Madame" />
				<menuitem value="Mademoiselle" label="Mademoiselle" />
				<menuitem value="Monsieur" label="Monsieur" />
				<menuseparator />
				<menuitem value="Fondation" label="Fondation" />
				<menuitem value="ASBL" label="ASBL" />
				<menuitem value="SA" label="SA" />
				<menuitem value="SPRL" label="SPRL" />
			</menupopup>
		</menulist>
		
    <separator class="thin" />
<!--		
		<label value="Catégories" control="f_fk_categories" />
		<menulist id="f_fk_categories">
			<menupopup
							id="f_fk_categories_datas"
							datasources="datas/datas.sqlite"
							querytype="storage"
							ref="*">
			<menuitem value="0" label="-" />
		
			<template>
				<query>
					SELECT cat_id, cat_libelle
					FROM tbl_categories
					ORDER BY 2
				</query>
	
				<action>
					<menuitem uri="?" value="?cat_id" label="?cat_libelle" />
				</action>
	
			</template>
		
			</menupopup>
		</menulist>
-->		
    <separator class="thin" />
  </groupbox>
    <separator class="thin" />
          
    <button label="Exécuter" command="cmd_find" />
  </vbox>

  <vbox flex="1">
    <tree id="liste" hidecolumnpicker="false" seltype="single" flex="1"
    ondblclick="reload_fiche(Record, false, TreeValue(this));">
    <treecols>
      <treecol flex="2" label="Appellation" />
        <splitter class="tree-splitter" />
      <treecol flex="2" label="Titre" />
        <splitter class="tree-splitter" />
      <treecol flex="2" label="Nom" />
        <splitter class="tree-splitter" />
      <treecol flex="2" label="Prénom" />
        <splitter class="tree-splitter" />
      <treecol flex="1" label="Création" style="text-align:right;" hidden="true" />
        <splitter class="tree-splitter" />
      <treecol flex="1" label="Modification" style="text-align:right;" hidden="true" />
		</treecols>
		<treechildren id="liste2" />
		</tree>
	<description id="Tlignes" />
</vbox>
</hbox>
</deck>

  <vbox id="ovl_bottom" />

</window>
