Skip to content
Snippets Groups Projects
Commit fd00fe81 authored by Jolibois Simon's avatar Jolibois Simon
Browse files

nettoyage du code et ajout de commentaires

parent 4e61b225
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
No preview for this file type
No preview for this file type
......@@ -12,7 +12,12 @@ Window {
color : "#e6ecfa"
function check(){
/* appelle la fonction verif_matrice vérifie que la grille est correcte */
// appel de la fonction verif_matrice
vueObjetCpt.verif_matrice();
// signal de retour et affichage de la fenêtre Résultat
var verif = vueObjetCpt.verifier;
if(verif===1){
result.visible=true;
......@@ -26,7 +31,12 @@ Window {
}
function save_clicked(){
/* appelle la fonction save_grid et enregistre la partie actuelle */
// appel de la fonction save_grid
vueObjetCpt.save_grid();
// signal de retour et confirmation visuelle de la sauvegarde - pas fonctionnelle pour l'instant
var isSaved = vueObjetCpt.gameIsSaved();
if(isSaved===1){
saved_display.visible = true;
......@@ -38,13 +48,16 @@ Window {
}
function set_chiffre_actif(i){
/* appelle la fonction changer_valeur_bouton et change la valeur d'une case à partir de boutons */
// appel de la fonction changer_valeur_bouton
vueObjetCpt.changer_valeur_bouton(i);
// signal de retour
var chiffre_IsActif = vueObjetCpt.coloration
var values = vueObjetCpt.values;
var l
var c
for(l=0;l<9;l++){
for(c=0;c<9;c++){
for(var l=0;l<9;l++){
for(var c=0;c<9;c++){
var v = repeater.itemAt(l).rep.itemAt(c).input
v.text=values[l][c];
}
......@@ -53,8 +66,7 @@ Window {
Component.onCompleted:{
var values=vueObjetCpt.values;
var i;
for(i=0;i<9;i++){
for(var i=0;i<9;i++){
var t = repeater.itemAt(0).rep.itemAt(i).input
t.text=values[0][i]
if(values[0][i]!==''){
......@@ -136,15 +148,17 @@ Window {
}
}
}
property alias repeater : repeater
MenuBar {
id : menuBar
Menu { title : qsTr("File")
Action { text: qsTr("New File")}
Action { text : qsTr("Save current game")
onTriggered : save_clicked()}
Action { text : qsTr("Open game")}
}
delegate : MenuBarItem {
......@@ -170,26 +184,20 @@ Window {
}
background : Rectangle {
// rectangle du menu
id : menu_background
implicitWidth : 40
implicitHeight : 40
color : "#ffffff"
// border.width: 1
// border.color: "#000000"
Rectangle {
// la barre noire en dessous du menu
color: "#000000"
width: parent.width
height: 1
anchors.bottom: parent.bottom
height: 1
}
}
}
Rectangle{
id : background
x : 3
......@@ -201,7 +209,6 @@ Window {
width : childrenRect.width+6
height : childrenRect.height+6
Grid{
id : grid
x : 3
......@@ -209,6 +216,7 @@ Window {
rows : 3
columns : 3
spacing : 2
Repeater{
id : repeater
model : 9
......@@ -228,17 +236,15 @@ Window {
y : 660
width : 132
height : 40
text: qsTr("Vérifier la grille")
anchors.bottom: parent.bottom
highlighted: false
anchors.horizontalCenterOffset: -250
anchors.horizontalCenter : parent.horizontalCenter
anchors.horizontalCenterOffset : -250
anchors.bottom : parent.bottom
anchors.bottomMargin : 10
text : qsTr("Vérifier la grille")
highlighted : false
font.weight : Font.ExtraLight
font.pointSize : 12
onClicked:{ check();
button_check.highlighted = true
}
onClicked : { check(); button_check.highlighted = true}
}
Resultat{
......@@ -411,8 +417,8 @@ Window {
Rectangle{
id : saved_display
visible : false
width : child.width
height : child.height
width : childrenRect.width
height : childrenRect.height
anchors.bottom : parent.bottom
anchors.horizontalCenter : parent.left
anchors.bottomMargin : 40
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment