-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPersonne.cpp
More file actions
48 lines (38 loc) · 1.49 KB
/
Personne.cpp
File metadata and controls
48 lines (38 loc) · 1.49 KB
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
#include "Personne.hpp"
Personne::Personne(wxPanel* parent, Membre* membres, const string& nom, const string& prenom) : wxPanel(parent, -1), membre(membres), nom(nom), prenom(prenom)
{
testCheck = new wxCheckBox(this, -1, wxString(nom + " " + prenom));
wxBitmap sup_bitmap("icon/moin.jpg", wxBITMAP_TYPE_JPEG);
btn_sup_personne = new wxBitmapButton(this, -1, sup_bitmap);
btn_sup_personne->SetMinSize(btn_sup_personne->GetSize());
btn_sup_personne->SetMaxSize(btn_sup_personne->GetSize());
size_personne = new wxBoxSizer(wxHORIZONTAL);
testCheck->SetMinSize(wxSize(255, 0));
size_personne->Add(testCheck, 0, wxALL | wxEXPAND, 0);
size_personne->Add(btn_sup_personne, wxALIGN_RIGHT| wxEXPAND);
this->SetSizer(size_personne);
btn_sup_personne->Bind(wxEVT_BUTTON, &Personne::EventRetirePersonne, this);
testCheck->Bind(wxEVT_CHECKBOX, &Personne::EventActivierPersonne, this);
}
void Personne::EventRetirePersonne(wxCommandEvent& event){
membre->SupprimerPersonne(this);
desactiverPersonne(nom, prenom);
}
void Personne::MoodAdmin(){
btn_sup_personne->Enable(true);
}
void Personne::MoodUtilisateur(){
btn_sup_personne->Enable(false);
}
bool Personne::Check(){
return testCheck->GetValue();
}
pair<string, string> Personne::GetNom(){
return pair<string, string> (nom, prenom);
}
void Personne::EventActivierPersonne(wxCommandEvent& event){
membre->JustOnePersonne();
}
wxString Personne::Afiche(){
return wxString(nom+ " " + prenom);
}