Déplacement de la modification des booléens de résultats à la fenêtre de résultats (plus depuis la grille principale) Modification de la fenêtre de résultats pour cocher directement publi_chu et cs_associé Contrôles au clavier ajoutés dans la fenêtre de résultatsmaster
@@ -145,7 +145,55 @@ void class_bdd::importer(const wxString& filename) | |||
void class_bdd::exporter(const wxString& filename) | |||
{ | |||
/*#ifdef __WXMSW__ | |||
importfile->ReadAll(&fichier, wxConvAuto(wxFONTENCODING_SYSTEM)); | |||
#elif defined(__WXGTK__) | |||
importfile->ReadAll(&fichier); | |||
#endif*/ | |||
wxProgressDialog progress_dialog("Export", "Export de la base...", grid->GetNumberRows(), NULL, wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_SMOOTH | wxPD_ELAPSED_TIME | wxPD_REMAINING_TIME); | |||
wxFFile* exportfile = new wxFFile(filename, "w"); | |||
wxString ligne; | |||
ligne = "Travail numéro;Dossier numéro;Nom demandeur;Prénom demandeur;Service libellé;Etablissement libellé;Type travail libellé;Thème;Nom responsable;Consultant responsable;Date dernier RDV eff;Publi;Publi CHU;Consultant associé;Date de publication 1;Lien 1;Date de publication 2;Lien 2\n"; | |||
exportfile->Write(ligne); | |||
for (int i=0; i < grid->GetNumberRows(); i++) | |||
{ | |||
wxString id = grid->GetCellValue(i,13); | |||
ligne=""; | |||
wxString requete = "SELECT service FROM Consult WHERE id=" + id + ";"; | |||
sqlite3_prepare_v2(db, requete, -1, &stmt, NULL); | |||
sqlite3_step(stmt); | |||
wxString service = sqlite3_column_text(stmt,0); | |||
ligne << grid->GetCellValue(i,13) << ";" | |||
<< grid->GetCellValue(i,4) << ";" | |||
<< "\"" << grid->GetCellValue(i,5) << "\";" | |||
<< "\"" << grid->GetCellValue(i,6) << "\";" | |||
<< "\"" << service << "\";" | |||
<< "\"" << grid->GetCellValue(i,10) << "\";" | |||
<< "\"" << grid->GetCellValue(i,11) << "\";" | |||
<< "\"" << grid->GetCellValue(i,9) << "\";" | |||
<< "\"" << grid->GetCellValue(i,7) << "\";" | |||
<< "\"" << grid->GetCellValue(i,8) << "\";" | |||
<< grid->GetCellValue(i,12) << ";" | |||
<< grid->GetCellValue(i,1) << ";" | |||
<< grid->GetCellValue(i,2) << ";" | |||
<< grid->GetCellValue(i,3) << ";"; | |||
wxArrayString list_publi = getidresult(id); | |||
for (unsigned int j=0; j < list_publi.GetCount(); j++) | |||
{ | |||
if (list_publi[j].Left(1) == '@') | |||
{ | |||
requete = "SELECT date_publi,lien FROM Publi WHERE id=" + list_publi[j].AfterLast('@') + ";"; | |||
sqlite3_prepare_v2(db, requete, -1, &stmt, NULL); | |||
sqlite3_step(stmt); | |||
ligne << sqlite3_column_text(stmt,0) << ";" << sqlite3_column_text(stmt,1) << ";"; | |||
} | |||
} | |||
ligne << "\n"; | |||
exportfile->Write(ligne); | |||
progress_dialog.Update(i); | |||
} | |||
exportfile->Close(); | |||
} | |||
void class_bdd::updategrid() | |||
@@ -230,17 +278,45 @@ void class_bdd::updategrid() | |||
wxEndBusyCursor(); | |||
} | |||
void class_bdd::modresultbool(const wxString& id, int col, const wxString& val) | |||
void class_bdd::modresultpubli(int row, unsigned int bitfield) | |||
{ | |||
rc = 0; | |||
wxString requete = "UPDATE Result SET "; | |||
switch (col) | |||
wxString id = grid->GetCellValue(row,13); | |||
wxString val[3] = {"0","0","0"}; | |||
//Actualisation de la grille | |||
for (int i=1; i<= 3; i++) | |||
grid->SetCellValue(row,i,"0"); | |||
if (bitfield & 1<<1) | |||
{ | |||
grid->SetCellValue(row,1,"1"); | |||
val[0] = "1"; | |||
} | |||
if (bitfield & 1<<2) | |||
{ | |||
grid->SetCellValue(row,2,"1"); | |||
val[1] = "1"; | |||
} | |||
if (bitfield & 1<<3) | |||
{ | |||
case 1: requete << "publi"; break; | |||
case 2: requete << "publi_CHU"; break; | |||
case 3: requete << "cs_associe"; break; | |||
grid->SetCellValue(row,3,"1"); | |||
val[2] = "1"; | |||
} | |||
requete << "=" << val | |||
for (int i=0; i<13; i++) | |||
{ | |||
if (bitfield & 1<<1) | |||
grid->SetCellBackgroundColour(row, i, *wxGREEN); | |||
else | |||
grid->SetCellBackgroundColour(row, i, grid->GetDefaultCellBackgroundColour()); | |||
} | |||
grid->ForceRefresh(); | |||
rc = 0; | |||
wxString requete = "UPDATE Result SET"; | |||
requete << " publi=" << val[0] | |||
<< ", publi_CHU=" << val[1] | |||
<< ", cs_associe=" << val[2] | |||
<< " WHERE id=" | |||
<< id << ";"; | |||
rc = sqlite3_exec(db, requete, NULL, NULL, NULL); | |||
@@ -33,7 +33,7 @@ class class_bdd | |||
void updategrid(); | |||
// modification des booléens de publi | |||
void modresultbool(const wxString& id, int col, const wxString& val); | |||
void modresultpubli(int row, unsigned int bitfield); //modifie le statut de publi dans la bdd et la grille (publi(1<<1)/publichu(1<<2)/cs_associe(1<<3) | |||
// gestion des corrections | |||
int nbcorrections(); | |||
@@ -37,7 +37,14 @@ void cosmos::OnImport( wxCommandEvent& event ) | |||
void cosmos::OnExport( wxCommandEvent& event ) | |||
{ | |||
// TODO: Implement OnExport | |||
wxFileDialog * savedialog = new wxFileDialog(this, "Exporter", "", "", "*.csv", wxFD_SAVE); | |||
if (savedialog->ShowModal() == wxID_CANCEL) | |||
return; | |||
else | |||
bdd->exporter(savedialog->GetPath()); | |||
delete savedialog; | |||
} | |||
void cosmos::OnQuit( wxCommandEvent& event ) | |||
@@ -92,45 +99,7 @@ void cosmos::OnCellChange( wxGridEvent& event ) | |||
{ | |||
int row = event.GetRow(); | |||
int col = event.GetCol(); | |||
if (col < 4) //checkboxes | |||
{ | |||
bdd->modresultbool(grid_Consults->GetCellValue(row,13), col, grid_Consults->GetCellValue(row, col)); | |||
// modification automatique des checkbox | |||
// si pas de publi, pas de publi_chu ni cs_associe | |||
if ((col == 1) && (grid_Consults->GetCellValue(row, 1) == "0")) | |||
{ | |||
grid_Consults->SetCellValue(row, 2, "0"); | |||
grid_Consults->SetCellValue(row, 3, "0"); | |||
bdd->modresultbool(grid_Consults->GetCellValue(row, 13), 2, "0"); | |||
bdd->modresultbool(grid_Consults->GetCellValue(row, 13), 3, "0"); | |||
} | |||
// si une publi_chu ou cs_associe, publi | |||
if ((col > 1) && (grid_Consults->GetCellValue(row, col) == "1")) | |||
{ | |||
grid_Consults->SetCellValue(row, 1, "1"); | |||
bdd->modresultbool(grid_Consults->GetCellValue(row, 13), 1, "1"); | |||
} | |||
//Actualisation de la grille | |||
bool publie = false; | |||
for (int i=1; i<4; i++) | |||
if (grid_Consults->GetCellValue(row, i) == "1") | |||
publie=true; | |||
for (int i=0; i<13; i++) | |||
{ | |||
if (publie) | |||
grid_Consults->SetCellBackgroundColour(row, i, *wxGREEN); | |||
else | |||
grid_Consults->SetCellBackgroundColour(row, i, grid_Consults->GetDefaultCellBackgroundColour()); | |||
} | |||
grid_Consults->ForceRefresh(); | |||
} | |||
else //corrections | |||
{ | |||
bdd->addcorrection(grid_Consults->GetCellValue(row, 13), col, grid_Consults->GetCellValue(row, col)); | |||
} | |||
bdd->addcorrection(grid_Consults->GetCellValue(row, 13), col, grid_Consults->GetCellValue(row, col)); | |||
} | |||
void cosmos::OnCellDbClick( wxGridEvent& event ) | |||
@@ -130,6 +130,7 @@ cosmosGUI::cosmosGUI( wxWindow* parent, wxWindowID id, const wxString& title, co | |||
col_bool = new wxGridCellAttr(); | |||
col_bool->SetAlignment(wxALIGN_CENTER, wxALIGN_CENTER); | |||
col_bool->SetEditor(bool_editor); | |||
col_bool->SetReadOnly(); | |||
col_bool->SetRenderer(bool_renderer); | |||
// Attributs pour les colonnes en lecture seule (0,4,11,13) | |||
@@ -6,11 +6,10 @@ | |||
#ifdef __WXGTK__ | |||
#define slash "/" | |||
#define _C(string) (const char*) string.c_str() // wxString -> char* | |||
#elif defined( __WXMSW__ ) | |||
#define slash "\\" | |||
#define _C(string) (const char*) string.c_str() // wxString -> char* | |||
#endif | |||
#define _C(string) (const char*) string.c_str() // wxString -> char* | |||
#define _itoW(integer) wxString::Format("%i",integer) // int -> wxString | |||
enum | |||
@@ -12,36 +12,55 @@ dialog_resultats( parent ) | |||
void resultats::OnCellClick( wxGridEvent& event ) | |||
{ | |||
currentpubli = event.GetRow(); | |||
grid_publis->GoToCell(currentpubli,0); | |||
grid_publis->SetGridCursor(currentpubli,0); | |||
grid_publis->SelectRow(currentpubli); | |||
update_detail(); | |||
} | |||
void resultats::OnCheckPubli( wxCommandEvent& event ) | |||
{ | |||
//TODO: actualiser la grille principale | |||
list_publi[currentpubli] = list_publi[currentpubli].AfterLast('!').AfterLast('@'); | |||
switch (checkbox_publi->Get3StateValue()) | |||
if (event.GetId() == CHK_PUBLI) | |||
{ | |||
case wxCHK_CHECKED: list_publi[currentpubli] = "@" + list_publi[currentpubli]; | |||
grid_publis->SetCellBackgroundColour(currentpubli, 0, *wxGREEN); | |||
break; | |||
case wxCHK_UNDETERMINED: list_publi[currentpubli] = "!" + list_publi[currentpubli]; | |||
grid_publis->SetCellBackgroundColour(currentpubli, 0, *wxLIGHT_GREY); | |||
break; | |||
default: grid_publis->SetCellBackgroundColour(currentpubli, 0, grid_publis->GetDefaultCellBackgroundColour()); | |||
break; | |||
int prev_state; | |||
if (list_publi[currentpubli].Left(1) == '@') | |||
prev_state=1; | |||
else | |||
prev_state=0; | |||
list_publi[currentpubli] = list_publi[currentpubli].AfterLast('!').AfterLast('@'); | |||
switch (checkbox_publi->Get3StateValue()) | |||
{ | |||
case wxCHK_CHECKED: | |||
list_publi[currentpubli] = "@" + list_publi[currentpubli]; | |||
grid_publis->SetCellBackgroundColour(currentpubli, 0, *wxGREEN); | |||
if (prev_state == 0) | |||
publi++; | |||
break; | |||
case wxCHK_UNDETERMINED: | |||
list_publi[currentpubli] = "!" + list_publi[currentpubli]; | |||
grid_publis->SetCellBackgroundColour(currentpubli, 0, *wxLIGHT_GREY); | |||
if (prev_state == 1) | |||
publi--; | |||
break; | |||
case wxCHK_UNCHECKED: | |||
grid_publis->SetCellBackgroundColour(currentpubli, 0, grid_publis->GetDefaultCellBackgroundColour()); | |||
if (prev_state == 1) | |||
publi--; | |||
break; | |||
default:break; | |||
} | |||
} | |||
changed = true; | |||
update_checkpubli(); | |||
} | |||
void resultats::OnPrev( wxCommandEvent& event ) | |||
{ | |||
if (changed) | |||
{ | |||
wxString id = grid->GetCellValue(currentrow, 13); | |||
bdd->setidresult(id, list_publi); | |||
grid->SetCellValue(currentrow, 0, _itoW(bdd->nbresult(id))); | |||
} | |||
commit_changes(); | |||
changed = false; | |||
currentrow--; | |||
update(); | |||
@@ -50,10 +69,7 @@ void resultats::OnPrev( wxCommandEvent& event ) | |||
void resultats::OnNext( wxCommandEvent& event ) | |||
{ | |||
if (changed) | |||
{ | |||
bdd->setidresult(grid->GetCellValue(currentrow, 13), list_publi); | |||
grid->SetCellValue(currentrow, 0, _itoW(bdd->nbresult(grid->GetCellValue(currentrow, 13)))); | |||
} | |||
commit_changes(); | |||
changed = false; | |||
currentrow++; | |||
update(); | |||
@@ -62,22 +78,21 @@ void resultats::OnNext( wxCommandEvent& event ) | |||
void resultats::OnOk( wxCommandEvent& event ) | |||
{ | |||
if (changed) | |||
{ | |||
bdd->setidresult(grid->GetCellValue(currentrow, 13), list_publi); | |||
grid->SetCellValue(currentrow, 0, _itoW(bdd->nbresult(grid->GetCellValue(currentrow, 13)))); | |||
} | |||
commit_changes(); | |||
changed = false; | |||
Close(); | |||
} | |||
void resultats::update() | |||
{ | |||
publi=0; | |||
currentid = grid->GetCellValue(currentrow, 13); | |||
list_publi.Clear(); | |||
list_publi = bdd->getidresult(grid->GetCellValue(currentrow, 13)); | |||
list_publi = bdd->getidresult(currentid); | |||
if (grid_publis->GetNumberRows() != 0) | |||
{ | |||
grid_publis->DeleteRows(0, grid_publis->GetNumberRows()); //reset de la grille | |||
} | |||
if (list_publi.GetCount() > 0) | |||
{ | |||
grid_publis->AppendRows(list_publi.GetCount()); | |||
@@ -91,6 +106,7 @@ void resultats::update() | |||
} | |||
else if (publi_id.Left(1) == "@") | |||
{ | |||
publi++; | |||
publi_id = publi_id.AfterFirst('@'); | |||
grid_publis->SetCellBackgroundColour(i, 0, *wxGREEN); | |||
} | |||
@@ -102,6 +118,15 @@ void resultats::update() | |||
currentpubli = 0; | |||
grid_publis->SelectRow(currentpubli); | |||
grid_publis->SetFocus(); | |||
if (grid->GetCellValue(currentrow,2) == "1") | |||
checkbox_publichu->SetValue(true); | |||
else | |||
checkbox_publichu->SetValue(false); | |||
if (grid->GetCellValue(currentrow,3) == "1") | |||
checkbox_cs->SetValue(true); | |||
else | |||
checkbox_cs->SetValue(false); | |||
update_detail(); | |||
} | |||
else | |||
@@ -115,16 +140,19 @@ void resultats::update() | |||
hyperlink_lien->Disable(); | |||
checkbox_publi->Set3StateValue(wxCHK_UNCHECKED); | |||
checkbox_publi->Disable(); | |||
checkbox_publichu->Hide(); | |||
checkbox_cs->Hide(); | |||
} | |||
if (currentrow == 0) | |||
bouton_prec->Disable(); | |||
else | |||
bouton_prec->Enable(); | |||
if (currentrow == (grid->GetNumberRows() - 1)) | |||
bouton_suiv->Disable(); | |||
else | |||
bouton_suiv->Enable(); | |||
bouton_prec->Disable(); | |||
else | |||
bouton_prec->Enable(); | |||
if (currentrow == (grid->GetNumberRows() - 1)) | |||
bouton_suiv->Disable(); | |||
else | |||
bouton_suiv->Enable(); | |||
grid->SelectRow(currentrow); | |||
grid->GoToCell(currentrow,0); | |||
} | |||
void resultats::update_detail() | |||
@@ -146,4 +174,92 @@ void resultats::update_detail() | |||
else | |||
etat = wxCHK_UNCHECKED; | |||
checkbox_publi->Set3StateValue(etat); | |||
update_checkpubli(); | |||
} | |||
void resultats::update_checkpubli() | |||
{ | |||
if (publi > 0) | |||
{ | |||
checkbox_publichu->Show(); | |||
checkbox_cs->Show(); | |||
this->Refresh(); | |||
} | |||
else | |||
{ | |||
checkbox_publichu->SetValue(false); | |||
checkbox_cs->SetValue(false); | |||
checkbox_publichu->Hide(); | |||
checkbox_cs->Hide(); | |||
} | |||
} | |||
void resultats::commit_changes() | |||
{ | |||
unsigned int bitfield = 0; | |||
if (publi > 0) | |||
bitfield |= 1<<1; | |||
if (checkbox_publichu->GetValue()) | |||
bitfield |= 1<<2; | |||
if (checkbox_cs->GetValue()) | |||
bitfield |= 1<<3; | |||
bdd->modresultpubli(currentrow, bitfield); | |||
bdd->setidresult(currentid, list_publi); | |||
grid->SetCellValue(currentrow, 0, _itoW(bdd->nbresult(currentid))); | |||
} | |||
void resultats::OnKey( wxKeyEvent& event ) | |||
{ | |||
if ((event.GetKeyCode() != WXK_SPACE) && (checkbox_publi->Get3StateValue() == wxCHK_UNCHECKED) && (list_publi.GetCount() > 0)) | |||
{ | |||
list_publi[currentpubli] = "!" + list_publi[currentpubli]; | |||
grid_publis->SetCellBackgroundColour(currentpubli, 0, *wxLIGHT_GREY); | |||
checkbox_publi->Set3StateValue(wxCHK_UNDETERMINED); | |||
changed = true; | |||
} | |||
if ((event.GetKeyCode() == WXK_UP) && (currentpubli>0)) | |||
{ | |||
currentpubli--; | |||
grid_publis->MoveCursorUp(false); | |||
grid_publis->SelectRow(currentpubli); | |||
update_detail(); | |||
} | |||
if ((event.GetKeyCode() == WXK_DOWN) && (currentpubli < grid_publis->GetNumberRows() - 1)) | |||
{ | |||
currentpubli++; | |||
grid_publis->MoveCursorDown(false); | |||
grid_publis->SelectRow(currentpubli); | |||
update_detail(); | |||
} | |||
wxCommandEvent e; | |||
if ((event.GetKeyCode() == WXK_LEFT) && (currentrow>0)) | |||
OnPrev(e); | |||
if ((event.GetKeyCode() == WXK_RIGHT) && (currentrow < grid->GetNumberRows() - 1)) | |||
OnNext(e); | |||
if ((event.GetKeyCode() == WXK_SPACE) && (list_publi.GetCount() > 0)) | |||
{ | |||
if (checkbox_publi->Get3StateValue() != wxCHK_CHECKED) | |||
{ | |||
list_publi[currentpubli] = list_publi[currentpubli].AfterLast('!'); | |||
list_publi[currentpubli] = "@" + list_publi[currentpubli]; | |||
grid_publis->SetCellBackgroundColour(currentpubli, 0, *wxGREEN); | |||
checkbox_publi->Set3StateValue(wxCHK_CHECKED); | |||
publi++; | |||
} | |||
else | |||
{ | |||
list_publi[currentpubli] = list_publi[currentpubli].AfterLast('@'); | |||
grid_publis->SetCellBackgroundColour(currentpubli, 0, grid_publis->GetDefaultCellBackgroundColour()); | |||
checkbox_publi->Set3StateValue(wxCHK_UNCHECKED); | |||
publi--; | |||
} | |||
changed = true; | |||
update_checkpubli(); | |||
} | |||
} |
@@ -52,7 +52,7 @@ | |||
<event name="OnActivate"></event> | |||
<event name="OnActivateApp"></event> | |||
<event name="OnChar"></event> | |||
<event name="OnClose"></event> | |||
<event name="OnClose">OnClose</event> | |||
<event name="OnEnterWindow"></event> | |||
<event name="OnEraseBackground"></event> | |||
<event name="OnHibernate"></event> | |||
@@ -180,14 +180,14 @@ | |||
<event name="OnGridEditorCreated"></event> | |||
<event name="OnGridEditorHidden"></event> | |||
<event name="OnGridEditorShown"></event> | |||
<event name="OnGridLabelLeftClick">OnLabelClick</event> | |||
<event name="OnGridLabelLeftClick"></event> | |||
<event name="OnGridLabelLeftDClick"></event> | |||
<event name="OnGridLabelRightClick"></event> | |||
<event name="OnGridLabelRightDClick"></event> | |||
<event name="OnGridRangeSelect"></event> | |||
<event name="OnGridRowSize"></event> | |||
<event name="OnGridSelectCell"></event> | |||
<event name="OnKeyDown"></event> | |||
<event name="OnKeyDown">OnKey</event> | |||
<event name="OnKeyUp"></event> | |||
<event name="OnKillFocus"></event> | |||
<event name="OnLeaveWindow"></event> | |||
@@ -800,59 +800,184 @@ | |||
</object> | |||
<object class="sizeritem" expanded="1"> | |||
<property name="border">5</property> | |||
<property name="flag">wxALL</property> | |||
<property name="flag">wxEXPAND</property> | |||
<property name="proportion">0</property> | |||
<object class="wxCheckBox" expanded="1"> | |||
<property name="bg"></property> | |||
<property name="checked">0</property> | |||
<property name="context_help"></property> | |||
<property name="context_menu">1</property> | |||
<property name="enabled">1</property> | |||
<property name="fg"></property> | |||
<property name="font"></property> | |||
<property name="hidden">0</property> | |||
<property name="id">wxID_ANY</property> | |||
<property name="label">Publication ?</property> | |||
<property name="maximum_size"></property> | |||
<object class="wxBoxSizer" expanded="1"> | |||
<property name="minimum_size"></property> | |||
<property name="name">checkbox_publi</property> | |||
<property name="permission">protected</property> | |||
<property name="pos"></property> | |||
<property name="size"></property> | |||
<property name="style">wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER</property> | |||
<property name="subclass"></property> | |||
<property name="tooltip"></property> | |||
<property name="validator_data_type"></property> | |||
<property name="validator_style">wxFILTER_NONE</property> | |||
<property name="validator_type">wxDefaultValidator</property> | |||
<property name="validator_variable"></property> | |||
<property name="window_extra_style"></property> | |||
<property name="window_name"></property> | |||
<property name="window_style"></property> | |||
<event name="OnChar"></event> | |||
<event name="OnCheckBox">OnCheckPubli</event> | |||
<event name="OnEnterWindow"></event> | |||
<event name="OnEraseBackground"></event> | |||
<event name="OnKeyDown"></event> | |||
<event name="OnKeyUp"></event> | |||
<event name="OnKillFocus"></event> | |||
<event name="OnLeaveWindow"></event> | |||
<event name="OnLeftDClick"></event> | |||
<event name="OnLeftDown"></event> | |||
<event name="OnLeftUp"></event> | |||
<event name="OnMiddleDClick"></event> | |||
<event name="OnMiddleDown"></event> | |||
<event name="OnMiddleUp"></event> | |||
<event name="OnMotion"></event> | |||
<event name="OnMouseEvents"></event> | |||
<event name="OnMouseWheel"></event> | |||
<event name="OnPaint"></event> | |||
<event name="OnRightDClick"></event> | |||
<event name="OnRightDown"></event> | |||
<event name="OnRightUp"></event> | |||
<event name="OnSetFocus"></event> | |||
<event name="OnSize"></event> | |||
<event name="OnUpdateUI"></event> | |||
<property name="name">sizer_publi</property> | |||
<property name="orient">wxHORIZONTAL</property> | |||
<property name="permission">none</property> | |||
<object class="sizeritem" expanded="1"> | |||
<property name="border">5</property> | |||
<property name="flag">wxALL|wxEXPAND</property> | |||
<property name="proportion">1</property> | |||
<object class="wxCheckBox" expanded="1"> | |||
<property name="bg"></property> | |||
<property name="checked">0</property> | |||
<property name="context_help"></property> | |||
<property name="context_menu">1</property> | |||
<property name="enabled">1</property> | |||
<property name="fg"></property> | |||
<property name="font"></property> | |||
<property name="hidden">0</property> | |||
<property name="id">CHK_PUBLI</property> | |||
<property name="label">Publi</property> | |||
<property name="maximum_size"></property> | |||
<property name="minimum_size"></property> | |||
<property name="name">checkbox_publi</property> | |||
<property name="permission">protected</property> | |||
<property name="pos"></property> | |||
<property name="size"></property> | |||
<property name="style">wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER</property> | |||
<property name="subclass"></property> | |||
<property name="tooltip"></property> | |||
<property name="validator_data_type"></property> | |||
<property name="validator_style">wxFILTER_NONE</property> | |||
<property name="validator_type">wxDefaultValidator</property> | |||
<property name="validator_variable"></property> | |||
<property name="window_extra_style"></property> | |||
<property name="window_name"></property> | |||
<property name="window_style"></property> | |||
<event name="OnChar"></event> | |||
<event name="OnCheckBox">OnCheckPubli</event> | |||
<event name="OnEnterWindow"></event> | |||
<event name="OnEraseBackground"></event> | |||
<event name="OnKeyDown"></event> | |||
<event name="OnKeyUp"></event> | |||
<event name="OnKillFocus"></event> | |||
<event name="OnLeaveWindow"></event> | |||
<event name="OnLeftDClick"></event> | |||
<event name="OnLeftDown"></event> | |||
<event name="OnLeftUp"></event> | |||
<event name="OnMiddleDClick"></event> | |||
<event name="OnMiddleDown"></event> | |||
<event name="OnMiddleUp"></event> | |||
<event name="OnMotion"></event> | |||
<event name="OnMouseEvents"></event> | |||
<event name="OnMouseWheel"></event> | |||
<event name="OnPaint"></event> | |||
<event name="OnRightDClick"></event> | |||
<event name="OnRightDown"></event> | |||
<event name="OnRightUp"></event> | |||
<event name="OnSetFocus"></event> | |||
<event name="OnSize"></event> | |||
<event name="OnUpdateUI"></event> | |||
</object> | |||
</object> | |||
<object class="sizeritem" expanded="1"> | |||
<property name="border">5</property> | |||
<property name="flag">wxALL|wxEXPAND</property> | |||
<property name="proportion">1</property> | |||
<object class="wxCheckBox" expanded="1"> | |||
<property name="bg"></property> | |||
<property name="checked">0</property> | |||
<property name="context_help"></property> | |||
<property name="context_menu">1</property> | |||
<property name="enabled">1</property> | |||
<property name="fg"></property> | |||
<property name="font"></property> | |||
<property name="hidden">1</property> | |||
<property name="id">CHK_PUBLICHU</property> | |||
<property name="label">Publi CHU</property> | |||
<property name="maximum_size"></property> | |||
<property name="minimum_size"></property> | |||
<property name="name">checkbox_publichu</property> | |||
<property name="permission">protected</property> | |||
<property name="pos"></property> | |||
<property name="size"></property> | |||
<property name="style"></property> | |||
<property name="subclass"></property> | |||
<property name="tooltip"></property> | |||
<property name="validator_data_type"></property> | |||
<property name="validator_style">wxFILTER_NONE</property> | |||
<property name="validator_type">wxDefaultValidator</property> | |||
<property name="validator_variable"></property> | |||
<property name="window_extra_style"></property> | |||
<property name="window_name"></property> | |||
<property name="window_style"></property> | |||
<event name="OnChar"></event> | |||
<event name="OnCheckBox">OnCheckPubli</event> | |||
<event name="OnEnterWindow"></event> | |||
<event name="OnEraseBackground"></event> | |||
<event name="OnKeyDown"></event> | |||
<event name="OnKeyUp"></event> | |||
<event name="OnKillFocus"></event> | |||
<event name="OnLeaveWindow"></event> | |||
<event name="OnLeftDClick"></event> | |||
<event name="OnLeftDown"></event> | |||
<event name="OnLeftUp"></event> | |||
<event name="OnMiddleDClick"></event> | |||
<event name="OnMiddleDown"></event> | |||
<event name="OnMiddleUp"></event> | |||
<event name="OnMotion"></event> | |||
<event name="OnMouseEvents"></event> | |||
<event name="OnMouseWheel"></event> | |||
<event name="OnPaint"></event> | |||
<event name="OnRightDClick"></event> | |||
<event name="OnRightDown"></event> | |||
<event name="OnRightUp"></event> | |||
<event name="OnSetFocus"></event> | |||
<event name="OnSize"></event> | |||
<event name="OnUpdateUI"></event> | |||
</object> | |||
</object> | |||
<object class="sizeritem" expanded="1"> | |||
<property name="border">5</property> | |||
<property name="flag">wxALL|wxEXPAND</property> | |||
<property name="proportion">1</property> | |||
<object class="wxCheckBox" expanded="1"> | |||
<property name="bg"></property> | |||
<property name="checked">0</property> | |||
<property name="context_help"></property> | |||
<property name="context_menu">1</property> | |||
<property name="enabled">1</property> | |||
<property name="fg"></property> | |||
<property name="font"></property> | |||
<property name="hidden">1</property> | |||
<property name="id">CHK_CS</property> | |||
<property name="label">Consultant associé</property> | |||
<property name="maximum_size"></property> | |||
<property name="minimum_size"></property> | |||
<property name="name">checkbox_cs</property> | |||
<property name="permission">protected</property> | |||
<property name="pos"></property> | |||
<property name="size"></property> | |||
<property name="style"></property> | |||
<property name="subclass"></property> | |||
<property name="tooltip"></property> | |||
<property name="validator_data_type"></property> | |||
<property name="validator_style">wxFILTER_NONE</property> | |||
<property name="validator_type">wxDefaultValidator</property> | |||
<property name="validator_variable"></property> | |||
<property name="window_extra_style"></property> | |||
<property name="window_name"></property> | |||
<property name="window_style"></property> | |||
<event name="OnChar"></event> | |||
<event name="OnCheckBox">OnCheckPubli</event> | |||
<event name="OnEnterWindow"></event> | |||
<event name="OnEraseBackground"></event> | |||
<event name="OnKeyDown"></event> | |||
<event name="OnKeyUp"></event> | |||
<event name="OnKillFocus"></event> | |||
<event name="OnLeaveWindow"></event> | |||
<event name="OnLeftDClick"></event> | |||
<event name="OnLeftDown"></event> | |||
<event name="OnLeftUp"></event> | |||
<event name="OnMiddleDClick"></event> | |||
<event name="OnMiddleDown"></event> | |||
<event name="OnMiddleUp"></event> | |||
<event name="OnMotion"></event> | |||
<event name="OnMouseEvents"></event> | |||
<event name="OnMouseWheel"></event> | |||
<event name="OnPaint"></event> | |||
<event name="OnRightDClick"></event> | |||
<event name="OnRightDown"></event> | |||
<event name="OnRightUp"></event> | |||
<event name="OnSetFocus"></event> | |||
<event name="OnSize"></event> | |||
<event name="OnUpdateUI"></event> | |||
</object> | |||
</object> | |||
</object> | |||
</object> | |||
</object> | |||
@@ -15,23 +15,28 @@ Subclass of dialog_resultats, which is generated by wxFormBuilder. | |||
class resultats : public dialog_resultats | |||
{ | |||
protected: | |||
class_bdd* bdd; | |||
wxGrid* grid; | |||
int currentrow; | |||
int currentpubli; | |||
wxArrayString list_publi; | |||
bool changed; | |||
class_bdd* bdd; //pointeur vers la bdd | |||
wxGrid* grid; //pointeur vers la grille de consults | |||
int currentrow; //index consult courante | |||
wxString currentid; //id de la consult courante | |||
int currentpubli; //index de la publi courante dans la liste pour cette consult | |||
int publi; //compteur de publications | |||
wxArrayString list_publi; //liste des publis trouvées par la recherche | |||
bool changed; //indicateur de modifications | |||
// Handlers for dialog_resultats events. | |||
void OnCellClick( wxGridEvent& event ); | |||
void OnKey( wxKeyEvent& event ); | |||
void OnCheckPubli( wxCommandEvent& event ); | |||
void OnPrev( wxCommandEvent& event ); | |||
void OnNext( wxCommandEvent& event ); | |||
void OnOk( wxCommandEvent& event ); | |||
void update_detail(); | |||
void update_detail(); //met à jour les détails pour une publication | |||
void update_checkpubli(); //met à jour les checkboxes | |||
void commit_changes(); //enregistre les modifs dans la bdd | |||
public: | |||
/** Constructor */ | |||
resultats( wxWindow* parent, class_bdd* bdd, wxGrid* grid ); | |||
void update(); | |||
void update(); //met à jour la fenêtre pour une consult | |||
void SetCurrentrow(int currentrow) {this->currentrow = currentrow;} | |||
int GetCurrentrow() const {return currentrow;} | |||
@@ -1,5 +1,5 @@ | |||
/////////////////////////////////////////////////////////////////////////// | |||
// C++ code generated with wxFormBuilder (version Sep 8 2010) | |||
// C++ code generated with wxFormBuilder (version Sep 15 2010) | |||
// http://www.wxformbuilder.org/ | |||
// | |||
// PLEASE DO "NOT" EDIT THIS FILE! | |||
@@ -83,8 +83,23 @@ dialog_resultats::dialog_resultats( wxWindow* parent, wxWindowID id, const wxStr | |||
hyperlink_lien = new wxHyperlinkCtrl( this, wxID_ANY, wxT("Lien vers la page PubMed"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); | |||
sizer_detail->Add( hyperlink_lien, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); | |||
checkbox_publi = new wxCheckBox( this, wxID_ANY, wxT("Publication ?"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER ); | |||
sizer_detail->Add( checkbox_publi, 0, wxALL, 5 ); | |||
wxBoxSizer* sizer_publi; | |||
sizer_publi = new wxBoxSizer( wxHORIZONTAL ); | |||
checkbox_publi = new wxCheckBox( this, CHK_PUBLI, wxT("Publi"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER ); | |||
sizer_publi->Add( checkbox_publi, 1, wxALL|wxEXPAND, 5 ); | |||
checkbox_publichu = new wxCheckBox( this, CHK_PUBLICHU, wxT("Publi CHU"), wxDefaultPosition, wxDefaultSize, 0 ); | |||
checkbox_publichu->Hide(); | |||
sizer_publi->Add( checkbox_publichu, 1, wxALL|wxEXPAND, 5 ); | |||
checkbox_cs = new wxCheckBox( this, CHK_CS, wxT("Consultant associé"), wxDefaultPosition, wxDefaultSize, 0 ); | |||
checkbox_cs->Hide(); | |||
sizer_publi->Add( checkbox_cs, 1, wxALL|wxEXPAND, 5 ); | |||
sizer_detail->Add( sizer_publi, 0, wxEXPAND, 5 ); | |||
horizontalsizer->Add( sizer_detail, 1, wxEXPAND, 5 ); | |||
@@ -115,8 +130,10 @@ dialog_resultats::dialog_resultats( wxWindow* parent, wxWindowID id, const wxStr | |||
// Connect Events | |||
grid_publis->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( dialog_resultats::OnCellClick ), NULL, this ); | |||
grid_publis->Connect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( dialog_resultats::OnLabelClick ), NULL, this ); | |||
grid_publis->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( dialog_resultats::OnKey ), NULL, this ); | |||
checkbox_publi->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( dialog_resultats::OnCheckPubli ), NULL, this ); | |||
checkbox_publichu->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( dialog_resultats::OnCheckPubli ), NULL, this ); | |||
checkbox_cs->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( dialog_resultats::OnCheckPubli ), NULL, this ); | |||
bouton_prec->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_resultats::OnPrev ), NULL, this ); | |||
bouton_suiv->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_resultats::OnNext ), NULL, this ); | |||
bouton_ok->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_resultats::OnOk ), NULL, this ); | |||
@@ -126,8 +143,10 @@ dialog_resultats::~dialog_resultats() | |||
{ | |||
// Disconnect Events | |||
grid_publis->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( dialog_resultats::OnCellClick ), NULL, this ); | |||
grid_publis->Disconnect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( dialog_resultats::OnLabelClick ), NULL, this ); | |||
grid_publis->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( dialog_resultats::OnKey ), NULL, this ); | |||
checkbox_publi->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( dialog_resultats::OnCheckPubli ), NULL, this ); | |||
checkbox_publichu->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( dialog_resultats::OnCheckPubli ), NULL, this ); | |||
checkbox_cs->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( dialog_resultats::OnCheckPubli ), NULL, this ); | |||
bouton_prec->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_resultats::OnPrev ), NULL, this ); | |||
bouton_suiv->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_resultats::OnNext ), NULL, this ); | |||
bouton_ok->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_resultats::OnOk ), NULL, this ); | |||
@@ -1,5 +1,5 @@ | |||
/////////////////////////////////////////////////////////////////////////// | |||
// C++ code generated with wxFormBuilder (version Sep 8 2010) | |||
// C++ code generated with wxFormBuilder (version Sep 15 2010) | |||
// http://www.wxformbuilder.org/ | |||
// | |||
// PLEASE DO "NOT" EDIT THIS FILE! | |||
@@ -24,6 +24,9 @@ | |||
/////////////////////////////////////////////////////////////////////////// | |||
#define CHK_PUBLI 1000 | |||
#define CHK_PUBLICHU 1001 | |||
#define CHK_CS 1002 | |||
/////////////////////////////////////////////////////////////////////////////// | |||
/// Class dialog_resultats | |||
@@ -45,6 +48,8 @@ class dialog_resultats : public wxDialog | |||
wxStaticText* statictext_date; | |||
wxHyperlinkCtrl* hyperlink_lien; | |||
wxCheckBox* checkbox_publi; | |||
wxCheckBox* checkbox_publichu; | |||
wxCheckBox* checkbox_cs; | |||
wxButton* bouton_prec; | |||
wxButton* bouton_suiv; | |||
@@ -52,7 +57,7 @@ class dialog_resultats : public wxDialog | |||
// Virtual event handlers, overide them in your derived class | |||
virtual void OnCellClick( wxGridEvent& event ) { event.Skip(); } | |||
virtual void OnLabelClick( wxGridEvent& event ) { event.Skip(); } | |||
virtual void OnKey( wxKeyEvent& event ) { event.Skip(); } | |||
virtual void OnCheckPubli( wxCommandEvent& event ) { event.Skip(); } | |||
virtual void OnPrev( wxCommandEvent& event ) { event.Skip(); } | |||
virtual void OnNext( wxCommandEvent& event ) { event.Skip(); } | |||