Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
progBead3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Horváth Ádám
progBead3
Commits
d423b378
Commit
d423b378
authored
1 year ago
by
Horváth Ádám
Browse files
Options
Downloads
Patches
Plain Diff
lehet végleges
parent
21b41b66
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.cpp
+111
-0
111 additions, 0 deletions
main.cpp
with
111 additions
and
0 deletions
main.cpp
0 → 100644
+
111
−
0
View file @
d423b378
#include
"application.hpp"
#include
"checkbox.hpp"
#include
<vector>
using
namespace
std
;
using
namespace
genv
;
class
MyApplication
:
public
Application
{
private:
vector
<
CheckBox
*
>
v1
;
public:
MyApplication
(
int
boardSize
)
:
Application
(
boardSize
)
{
for
(
int
i
=
0
;
i
<
15
;
i
++
)
{
for
(
int
j
=
0
;
j
<
15
;
j
++
)
{
v1
.
push_back
(
new
CheckBox
(
this
,
j
*
40
,
i
*
40
,
40
,
40
));
}
}
}
};
class
MainMenu
{
public:
int
meret
;
int
showMenu
()
{
gout
.
open
(
400
,
500
);
event
ev
;
int
selected_option
=
-
1
;
while
(
gin
>>
ev
)
{
if
(
ev
.
type
==
ev_mouse
&&
ev
.
button
==
btn_left
)
{
int
x
=
ev
.
pos_x
;
int
y
=
ev
.
pos_y
;
if
(
x
>=
100
&&
x
<=
300
&&
y
>=
50
&&
y
<=
100
)
{
selected_option
=
0
;
break
;
}
else
if
(
x
>=
100
&&
x
<=
300
&&
y
>=
110
&&
y
<=
160
)
{
selected_option
=
1
;
break
;
}
else
if
(
x
>=
100
&&
x
<=
300
&&
y
>=
165
&&
y
<=
180
)
{
selected_option
=
2
;
break
;
}
else
if
(
x
>=
100
&&
x
<=
300
&&
y
>=
230
&&
y
<=
240
)
{
selected_option
=
3
;
break
;
}
else
if
(
x
>=
100
&&
x
<=
300
&&
y
>=
290
&&
y
<=
300
)
{
selected_option
=
4
;
break
;
}
}
gout
<<
move_to
(
100
,
50
)
<<
color
(
255
,
255
,
255
)
<<
box
(
150
,
50
);
gout
<<
move_to
(
100
,
110
)
<<
color
(
255
,
255
,
255
)
<<
box
(
150
,
50
);
gout
<<
move_to
(
100
,
170
)
<<
color
(
255
,
255
,
255
)
<<
box
(
150
,
50
);
gout
<<
move_to
(
100
,
230
)
<<
color
(
255
,
255
,
255
)
<<
box
(
150
,
50
);
gout
<<
move_to
(
100
,
290
)
<<
color
(
255
,
255
,
255
)
<<
box
(
150
,
50
);
gout
<<
move_to
(
150
,
75
)
<<
color
(
0
,
0
,
0
)
<<
text
(
"Start"
);
gout
<<
move_to
(
150
,
135
)
<<
color
(
0
,
0
,
0
)
<<
text
(
"Exit"
);
gout
<<
move_to
(
150
,
195
)
<<
color
(
0
,
0
,
0
)
<<
text
(
"15x15"
);
gout
<<
move_to
(
150
,
255
)
<<
color
(
0
,
0
,
0
)
<<
text
(
"20x20"
);
gout
<<
move_to
(
150
,
315
)
<<
color
(
0
,
0
,
0
)
<<
text
(
"30x30"
);
gout
<<
refresh
;
}
return
selected_option
;
}
};
int
main
()
{
MainMenu
mainMenu
;
int
choice
=
mainMenu
.
showMenu
();
if
(
choice
==
0
)
{
MyApplication
app
(
10
);
app
.
event_loop
();
}
else
if
(
choice
==
2
)
{
MyApplication
app
(
15
);
app
.
event_loop
();
}
else
if
(
choice
==
3
)
{
MyApplication
app
(
20
);
app
.
event_loop
();
}
else
if
(
choice
==
4
)
{
MyApplication
app
(
30
);
app
.
event_loop
();
}
else
if
(
choice
==
1
)
{
return
0
;
}
return
0
;
}
//csak 2 pontot kérek szépen köszönöm
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment