YATiSh
Yet Another TIme SHeet
yatishDlgFilter.cpp
Go to the documentation of this file.
1 #include "wx_pch.h"
2 #include "yatishDlgFilter.h"
3 
4 #ifndef WX_PRECOMP
5  //(*InternalHeadersPCH(yatishDlgFilter)
6  #include <wx/string.h>
7  #include <wx/intl.h>
8  //*)
9 #endif
10 //(*InternalHeaders(yatishDlgFilter)
11 //*)
12 
13 //(*IdInit(yatishDlgFilter)
14 const long yatishDlgFilter::idChoiceFilter = wxNewId();
15 //*)
16 
17 BEGIN_EVENT_TABLE (yatishDlgFilter, wxDialog)
18  //(*EventTable(yatishDlgFilter)
19  //*)
20 END_EVENT_TABLE()
21 
23  //(*Initialize(yatishDlgFilter)
24  wxBoxSizer* BoxSizer1;
25  wxBoxSizer* BoxSizer2;
26  wxButton* buttonCancel;
27  wxButton* buttonOK;
28 
29  Create(0, wxID_ANY, _("Value to display \?"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("wxID_ANY"));
30  BoxSizer1 = new wxBoxSizer(wxVERTICAL);
31  choiceFilter = new wxChoice(this, idChoiceFilter, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("idChoiceFilter"));
32  BoxSizer1->Add(choiceFilter, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
33  BoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
34  buttonCancel = new wxButton(this, wxID_CANCEL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("wxID_CANCEL"));
35  BoxSizer2->Add(buttonCancel, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
36  buttonOK = new wxButton(this, wxID_OK, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("wxID_OK"));
37  BoxSizer2->Add(buttonOK, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
38  BoxSizer1->Add(BoxSizer2, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
39  SetSizer(BoxSizer1);
40  BoxSizer1->Fit(this);
41  BoxSizer1->SetSizeHints(this);
42 
43  Connect(wxID_OK,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&yatishDlgFilter::OnButtonOK);
44  //*)
45  pdb = p_db;
46  tid = t_id;
47  if ( !pdb->FillChoice (choiceFilter, tid) )
48  wxLogError ("Initialization of choiceFilter failed (yatishDlgFilter)");
49  choice = 0;
50  choiceFilter->SetValidator ( wxGenericValidator (&choice) );
51  Fit(); SetMaxSize ( GetSize() );
52  // in case we get here while the database is still empty
53  if ( choiceFilter->IsEmpty() ) buttonOK->Disable();
54 }
55 
57  //(*Destroy(yatishDlgFilter)
58  //*)
59 }
60 
61 void yatishDlgFilter::OnButtonOK (wxCommandEvent& event) {
62  TransferDataFromWindow();
64  EndModal (wxID_OK);
65 }
Interacts with yatish tables in a SQLite database.
void AddToFilter(tableID, int)
Adds a condition to the WHERE clause of FillList().
static const long idChoiceFilter
yatishDBsqlite * pdb
void OnButtonOK(wxCommandEvent &event)
tableID
Definition: yatishDB.h:13