-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
61 lines (53 loc) · 2.75 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
$$\ $$\ $$$$$$\ $$$$$$$\ $$$$$$\
$$$\ $$ |$$ __$$\ $$ __$$\ $$ __$$\
$$$$\ $$ |$$ / \__|$$ | $$ |$$ / \__|
$$ $$\$$ |\$$$$$$\ $$ | $$ |$$ |$$$$\
$$ \$$$$ | \____$$\ $$ | $$ |$$ |\_$$ |
$$ |\$$$ |$$\ $$ |$$ | $$ |$$ | $$ |
$$ | \$$ |\$$$$$$ |$$$$$$$ |\$$$$$$ |
\__| \__| \______/ \_______/ \______/
Nassi - Shneiderman
Diagram Generator
Balan Calin --- Rotariu George-Flavian
No. of Code Lines: 1254 (17.12.2022)
*/
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <graphics.h>
#include <winbgim.h>
#include <windows.h>
#include <cstring>
using namespace std;
bool mainLoop=true; ///Controleaza functionarea programului
bool mainMenu=true; ///Ma aflu pe fereastra de meniu sau nu
char filePath[512]; ///Calea catre fisierul din care citesc pseudocod
#include "frontEnd.h"
#include "backEnd.h"
int main()
{
initwindow(screen_width, screen_height, "Nassi-Shneiderman Diag Gen"); ///Am pus linia in afara functiei de mai jos ca sa pot apela functia de mai jos cand ies din fereastra pentru convert
initialisation(); ///Initializez fereastra de desen grafic
while (mainLoop) {
if (mainMenu){ ///Daca sunt in meniul principal desenez butoanele
if (convertButton(mainMenuBWidth1, mainMenuCenter-mainMenuBHeight, mainMenuBWidth2, mainMenuCenter+mainMenuBHeight)) ///Daca apas pe convert nu mai desenez meniul principal
fileProcessing(); ///Incep procesarea pseudocodului && desenez fereastra diagramei
if (mainMenu){ ///Daca si dupa evaluarea statusului butonului CONVERT sunt in meniul principal, desenez restul butoanelor
if (loadButton(mainMenuBWidth1, mainMenuCenter+mainMenuBHeight*2, mainMenuBWidth2, mainMenuCenter+mainMenuBHeight*4)){
openDialogue(filePath); ///Deschid ferestra de dialog
pathProcessing(filePath); ///Procesez calea catre fisier
loadStatus(mainMenuBWidth2+10, mainMenuCenter+mainMenuBHeight*2, mainMenuBWidth2+10+mainMenuBHeight*2, mainMenuCenter+mainMenuBHeight*4); ///Redesenez indicatorul de status pentru load
}
if (exitButton(mainMenuBWidth1, mainMenuCenter+mainMenuBHeight*5, mainMenuBWidth2, mainMenuCenter+mainMenuBHeight*7))
mainLoop = false; ///Opresc functionarea programului
}
}
else {
if (backButton(0.02*screen_height, 0.02*screen_height, 0.08*screen_width, 0.08*screen_height)) ///Desenez butonul back doar in fereastra diagramei
mainMenu = true; ///Revin in meniul principal
}
}
return 0;
}