Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ Le port (ci-dessus 1234) est fourni dans le menu_option.
- /LetterTag
<br>Description : Ajout de lettres (A, B, C, ...)
<br>"http://localhost:7999/LetterTag"
<br>Remettre à zéro (lettre A)
<br>"http://localhost:7999/ResetLetterTag"

- /SquareTag
<br>Description : Ajout de carrés
Expand Down
49 changes: 49 additions & 0 deletions src/APIRest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,55 @@ Dictionary<string, string> ParseQuery(string query)
ret = string.Format("{{ \"OK\": true, \"Tool\": \"{0}\" }}", Tools.Names[Array.IndexOf(Tools.All, tool)]);
}
}

else if (req.Url.AbsolutePath == "/ResetLetterTag" || req.Url.AbsolutePath == "/LetterTag_Reset")
{
if (!(Root.FormDisplay.Visible || Root.FormCollection.Visible))
{
resp.StatusCode = 409;
ret = "!!!!! Not in Inking mode";
}
else
{
try
{
// Mettre le compteur � 0 => la prochaine incr�mentation produira la lettre 'A'
Root.TagNumbering = 0;
Root.FormCollection.LetterTag_Counter_Public = 0;

// S�lectionner l�outil LetterTag (conserve le remplissage courant)
Root.FormCollection.SelectTool(Tools.LetterTag, Root.FilledSelected);

// Rafra�chir l�UI
Root.UponButtonsUpdate |= 0x2;
Root.UponAllDrawingUpdate = true;

// Pr�visualisation de la prochaine valeur ("A")
int nextN = 1;
string tagStr = string.Format(
Root.TagFormatting,
nextN,
(char)(64 + nextN), // 'A'
(char)(96 + nextN) // 'a'
);

ret = string.Format(
"{{ \"OK\": true, \"Tool\": \"{0}\", \"NextTag\": \"{1}\" }}",
Tools.Names[Array.IndexOf(Tools.All, Tools.LetterTag)],
tagStr
);
}
catch (Exception e)
{
resp.StatusCode = 500;
ret = string.Format("!!!! Exception: {0}", e.Message);
}
}
}




// --- FIN nouveaux endpoints ---

else if (req.Url.AbsolutePath == "/ChangePage")
Expand Down
6 changes: 5 additions & 1 deletion src/FormCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ public static System.Windows.Forms.Cursor LoadCustomCursor(string path)
public bool SnapWithoutClosing = false;



public int LetterTag_Counter_Public
{
get => LetterTag_Counter;
set => LetterTag_Counter = value;
}



Expand Down