7 #ifndef _HATCHKEEPER_H__
8 #define _HATCHKEEPER_H__
10 #include <wx/statline.h>
15 #include <wx/toolbar.h>
16 #include <wx/calctrl.h>
17 #include <wx/spinctrl.h>
18 #include <wx/choice.h>
19 #include <wx/datectrl.h>
20 #include <wx/listctrl.h>
21 #include <wx/filepicker.h>
22 #include <wx/splash.h>
23 #include <wx/generic/calctrlg.h>
25 #include <wx/notebook.h>
26 #include <wx/printdlg.h>
27 #include <wx/html/htmprint.h>
28 #include <wx/textdlg.h>
29 #include <wx/notifmsg.h>
30 #include <wx/generic/notifmsg.h>
31 #include <wx/clipbrd.h>
34 #include "./.HatchKeeper_Data_90/Images/hatch.xpm"
122 void OnImport(wxCommandEvent&);
123 void OnNewBatch(wxCommandEvent& );
124 void OnSchedule(wxCommandEvent& );
125 void OnRemind(wxCommandEvent& );
126 void OnRefresh(wxCommandEvent& );
127 void OnPreference(wxCommandEvent& );
129 void OnGraph(wxCommandEvent&);
131 void OnAbout(wxCommandEvent& );
132 void OnQuit(wxCommandEvent& );
133 void OnSearch(wxCommandEvent& );
137 void OnListSelect(wxListEvent& );
138 void OnListDESelect(wxListEvent& evt);
139 void OnColumnClick(wxListEvent& evt);
140 void OnSort(wxCommandEvent&);
141 void SetupBatchStats(
int sel);
142 void UnsetBatchStats(
void);
143 void ShowBatches(
bool Scan);
148 void OnEggSpinner(wxSpinEvent&);
149 void OnFertileSpin(wxSpinEvent&);
150 void OnHatchedSpin(wxSpinEvent&);
151 void OnBatchName(wxCommandEvent&);
152 void OnBatchType(wxCommandEvent&);
153 void OnBatchBreed(wxCommandEvent&);
154 void OnBatchGroup(wxCommandEvent&);
155 void OnBatchIncubator(wxCommandEvent&);
156 void OnBatchDates(wxDateEvent&);
157 void OnBatchComments(wxCommandEvent&);
158 void OnUpdate(wxCommandEvent&);
159 void OnDelete(wxCommandEvent&);
160 void OnMoreActions(wxCommandEvent&);
164 void OnCalChange(wxCalendarEvent&);
165 void OnCalPrn(wxCommandEvent&);
166 void RemoveAttr(
void);
172 bool SetBatchAsAdvanced(
int sel);
174 void DeleteAdvanced(
int sel);
177 void OnSelectEgg(wxListEvent&);
178 void OnUnSelectEgg(wxListEvent&);
179 void ClearAdvPanel();
180 void OnAdvDaySelect(wxListEvent&);
181 void OnAdvDayUnSelect(wxListEvent&);
182 void ShowAdvWeight(
HK_Egg Egg,
int Select);
186 void OnEggCommentChange(wxCommandEvent&);
187 void OnTagsChange(wxCommandEvent&);
188 void OnAdvFertileChecked(wxCommandEvent&);
189 void OnAdvPippedChecked(wxCommandEvent&);
190 void OnAdvResultChoice(wxCommandEvent&);
191 void OnAdvResultDate(wxDateEvent&);
192 void OnWeightChange(wxSpinDoubleEvent&);
193 void OnDayCommentChange(wxCommandEvent&);
199 void AddGroup(
string Name,
string Comment);
200 void OnAddGroup(wxCommandEvent&);
201 void OnDelGroup(wxCommandEvent&);
202 void OnMoreGroupActions(wxCommandEvent&);
203 void OnGrComment(wxCommandEvent&);
204 void ShowGroups(
bool Scan);
205 void OnGroupSelect(wxListEvent&);
206 void OnGroupUnSelect(wxListEvent&);
210 void ShowMsg(
string Msg);
211 void OnTimer(wxTimerEvent&);
212 void ShowNotifications();
213 void OnCloseWindow(wxCloseEvent &evt);
214 void OnNotificationClicked(wxCommandEvent&);
215 void OnNotificationDismissed(wxCommandEvent&);
218 void ShowBatchGraph(
int sel);
222 void OnHideChange(wxCommandEvent&);
323 DECLARE_EVENT_TABLE()
330 void OnExitSession(wxCloseEvent& evt);
331 virtual void MacReopenApp();
332 virtual bool OnInit();
348 system(
"cp -r ./HatchKeeper.app/Contents/Resources/.HatchKeeper_Data* ~");
357 cout<<FileFolder<<endl;
358 if( ! wxFileExists(FileFolder.c_str()))
368 wxImage::AddHandler(
new wxPNGHandler);
374 if (bitmap.LoadFile(FileFolder.c_str(), wxBITMAP_TYPE_PNG)) {
375 wxSplashScreen* splash =
new wxSplashScreen(bitmap,
376 wxSPLASH_CENTRE_ON_PARENT|wxSPLASH_TIMEOUT,
377 3000, NULL, -1, wxDefaultPosition, wxDefaultSize,
378 wxBORDER_SIMPLE|wxSTAY_ON_TOP|wxHORIZONTAL|wxCENTER_ON_SCREEN);
383 wxTimer * timer1 =
new wxTimer(
this,
TIMER1);
386 timer1->Start(30000);
388 this->SetSizeHints( wxDefaultSize, wxDefaultSize );
394 this->SetBackgroundColour(wxColor(ColorRed[0],ColorGreen[0],ColorBlue[0],225) );
397 bSizer2 =
new wxBoxSizer( wxVERTICAL );
399 TheToolBar =
new wxToolBar(
this,
TOOLBAR, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL|wxTB_TEXT );
401 TheToolBar->AddTool(
ON_BATCH,
l(
"New Batch"), wxBitmap( FileFolder.c_str(), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString );
403 TheToolBar->AddTool(
ON_IMPORT,
l(
"Import Batch"), wxBitmap( FileFolder.c_str(), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString );
405 TheToolBar->AddTool(
ON_SCH,
l(
"Schedules"), wxBitmap(FileFolder.c_str(), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString );
407 TheToolBar->AddTool(
ON_REMIND,
l(
"Reminders"), wxBitmap( FileFolder.c_str(), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString );
409 TheToolBar->AddTool(
ON_PREF,
l(
"Settings"), wxBitmap( FileFolder.c_str(), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString );
411 TheToolBar->AddTool(
ON_REFR,
l(
"Refresh"), wxBitmap( FileFolder.c_str(), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString );
414 TheToolBar->AddTool(
ON_GRAPH,
l(
"Graphs"), wxBitmap(FileFolder.c_str(), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString );
417 TheToolBar->AddTool(
ON_ABOUT,
l(
"About"), wxBitmap(FileFolder.c_str(), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString );
420 TheToolBar->AddTool(
ON_SEARCH,
l(
"Search"), wxBitmap(FileFolder.c_str(), wxBITMAP_TYPE_PNG ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString );
423 TheToolBar->AddTool(
ON_QUIT,
l(
"Exit"), wxBitmap(FileFolder.c_str(), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString );
430 wxGridSizer* gSizer1;
431 gSizer1 =
new wxGridSizer( 0, 2, 0, 0 );
433 wxGridSizer* gSizer3;
434 gSizer3 =
new wxGridSizer( 2, 0, 0, 0 );
436 wxBoxSizer* bSizer11;
437 bSizer11 =
new wxBoxSizer( wxHORIZONTAL );
439 MainCalendar =
new wxGenericCalendarCtrl(
this,
CAL_CHANGE, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxCAL_SHOW_SURROUNDING_WEEKS|wxCAL_SEQUENTIAL_MONTH_SELECTION );
441 wxFont CalFont(
Settings.
GetInt(
"CalTextSize"), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,
true);
443 MainCalendar->SetBackgroundColour(wxColor(ColorRed[1],ColorGreen[1],ColorBlue[1],225));
444 MainCalendar->SetForegroundColour(wxColor(ColorRed[2],ColorGreen[2],ColorBlue[2],225));
445 MainCalendar->SetHeaderColours (wxColor(0,0,0,225), wxColor(211,211,211,225));
448 BatchGraphPanel =
new wxChartPanel(
this,wxID_ANY, NULL, wxDefaultPosition, wxSize(130,325));
449 BatchGraphPanel->SetToolTip(
l(
"Legend: Blue: % Were Fertile, Yellow: % Of Fertile Hatched, Red: % Of Total Hatched, Green: % Of Total Unhatched") );
453 gSizer3->Add( bSizer11, 1, wxEXPAND, 5 );
456 bSizer4 =
new wxBoxSizer( wxVERTICAL );
458 wxFlexGridSizer* gSizer11;
459 gSizer11 =
new wxFlexGridSizer( 1, 4, 0, 0 );
460 gSizer11->SetFlexibleDirection(wxHORIZONTAL);
462 printCalButton->SetToolTip(
l(
"Prints The Month Selected Above With All Its Batch Dates") );
463 gSizer11->Add(
printCalButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
465 SortBatchStat =
new wxStaticText(
this, wxID_ANY,
l(
"Sort Batches By") +
"..", wxDefaultPosition, wxDefaultSize, 0 );
467 gSizer11->Add(
SortBatchStat, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
469 wxArrayString SortBatchChoiceChoices;
470 SortBatchChoice =
new wxChoice(
this,
ON_SORT, wxDefaultPosition, wxDefaultSize, SortBatchChoiceChoices, 0 );
474 HideCheckBox->SetToolTip(
l(
"Hide Batches That Have Hatched Already, Works Best If Sorted By Hatch Date") );
475 gSizer11->Add(
HideCheckBox, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
477 bSizer4->Add( gSizer11, 0, wxEXPAND, 5 );
479 MainList =
new wxListView(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL );
480 bSizer4->Add(
MainList, 1, wxALL|wxEXPAND, 5 );
481 MainList->SetBackgroundColour(wxColor(ColorRed[3],ColorGreen[3],ColorBlue[3],225) );
482 MainList->SetForegroundColour(wxColor(ColorRed[4],ColorGreen[4],ColorBlue[4],225));
484 gSizer3->Add( bSizer4, 1, wxEXPAND, 5 );
486 gSizer1->Add( gSizer3, 1, wxEXPAND, 5 );
488 m_notebook2 =
new wxNotebook(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
489 m_notebook2->SetBackgroundColour(wxColor(ColorRed[5],ColorGreen[5],ColorBlue[5],225) );
490 BatchPanel =
new wxPanel(
m_notebook2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
491 BatchPanel->SetBackgroundColour( wxColor(ColorRed[5],ColorGreen[5],ColorBlue[5],225));
492 BatchPanel->SetForegroundColour( wxColor(ColorRed[6],ColorGreen[6],ColorBlue[6],225));
494 wxBoxSizer* BPBoxSizer;
495 BPBoxSizer =
new wxBoxSizer( wxVERTICAL );
497 wxGridSizer* BPGridSizer;
498 BPGridSizer =
new wxGridSizer( 0, 3, 0, 0 );
501 wxTextValidator textVal(wxFILTER_INCLUDE_CHAR_LIST,NULL);
504 BPNameCtrl =
new wxTextCtrl(
BatchPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ,textVal);
506 BPGridSizer->Add(
BPNameCtrl, 0, wxALL|wxEXPAND, 5 );
508 wxArrayString BPTypeChoiceChoices;
509 BPTypeChoice =
new wxChoice(
BatchPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, BPTypeChoiceChoices, 0 );
514 wxArrayString BPBreedChoiceChoices;
515 BPBreedChoice =
new wxChoice(
BatchPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, BPBreedChoiceChoices, 0 );
520 wxArrayString BPGroupChoiceChoices;
521 BPGroupChoice =
new wxChoice(
BatchPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, BPGroupChoiceChoices, 0 );
529 BPGridSizer->Add(
BPProgressGauge, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
531 wxArrayString BPIncubatorChoiceChoices;
537 wxBoxSizer* BPSizer5;
538 BPSizer5 =
new wxBoxSizer( wxHORIZONTAL);
540 BPEggSpin =
new wxSpinCtrl(
BatchPanel,
ON_EGG, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxSP_ARROW_KEYS, 0, 10000, 1 );
541 BPEggSpin->SetToolTip(
l(
"Enter Number Of Eggs In Batch") );
542 BPEggSpin->SetForegroundColour(wxColor(0,0,0,225));
543 BPSizer5->Add(
BPEggSpin, 0, wxALL|wxEXPAND, 5 );
546 BPSizer5->Add(
BPEggStat, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
549 BPGridSizer->Add( BPSizer5, 0, wxALL|wxEXPAND, 0 );
551 wxBoxSizer* BPSizer6;
552 BPSizer6 =
new wxBoxSizer( wxHORIZONTAL);
555 BPFertileSpin->SetToolTip(
l(
"Enter The Number Of Fertile Eggs") );
560 BPSizer6->Add(
BPFertileStat, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
563 BPGridSizer->Add( BPSizer6, 0, wxALL|wxEXPAND, 0 );
565 wxBoxSizer* BPSizer7;
566 BPSizer7 =
new wxBoxSizer( wxHORIZONTAL);
574 BPSizer7->Add(
BPChicksStat, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
577 BPGridSizer->Add( BPSizer7, 0, wxALL|wxEXPAND, 0 );
579 BPBoxSizer->Add( BPGridSizer, 0, wxEXPAND, 5 );
581 BPStatLine1 =
new wxStaticLine(
BatchPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
582 BPBoxSizer->Add(
BPStatLine1, 0, wxEXPAND | wxALL, 5 );
584 wxGridSizer* BPStaticGridSizer;
585 BPStaticGridSizer =
new wxGridSizer(3,2,0,0);
587 BPFerUnStat =
new wxStaticText(
BatchPanel, wxID_ANY,
l(
"Fertile Unhatched"), wxDefaultPosition, wxDefaultSize, 0 );
589 BPStaticGridSizer->Add(
BPFerUnStat, 0, wxALIGN_CENTER_VERTICAL, 5 );
593 BPStaticGridSizer->Add(
BPPerWerFerStat, 0, wxALIGN_CENTER_VERTICAL, 5 );
599 BPPerOfFerStat =
new wxStaticText(
BatchPanel, wxID_ANY,
"% " +
l(
"Of Fertile Hatched"), wxDefaultPosition, wxDefaultSize, 0 );
601 BPStaticGridSizer->Add(
BPPerOfFerStat, 0, wxALIGN_CENTER_VERTICAL, 5 );
607 BPBoxSizer->Add( BPStaticGridSizer, 1, wxEXPAND| wxALL, 5 );
609 BPStatLine2 =
new wxStaticLine(
BatchPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
610 BPBoxSizer->Add(
BPStatLine2, 0, wxEXPAND | wxALL, 5 );
612 wxGridSizer* BPGridSizer1;
613 BPGridSizer1 =
new wxGridSizer( 0, 2, 0, 0 );
615 wxGridSizer* BPGridSizer2;
616 BPGridSizer2 =
new wxGridSizer( 0, 2, 0, 0 );
618 BPStartDateCtrl =
new wxDatePickerCtrl(
BatchPanel, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DROPDOWN );
620 BPGridSizer2->Add(
BPStartDateCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
622 BPStartStat =
new wxStaticText(
BatchPanel, wxID_ANY,
l(
"Start Date"), wxDefaultPosition, wxDefaultSize, 0 );
624 BPStartStat->SetForegroundColour(wxColor(152,0,255));
625 BPGridSizer2->Add(
BPStartStat, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
627 BPCandleDateCtrl =
new wxDatePickerCtrl(
BatchPanel, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DROPDOWN );
631 BPCandleStat =
new wxStaticText(
BatchPanel, wxID_ANY,
l(
"Candle Date"), wxDefaultPosition, wxDefaultSize, 0 );
634 BPGridSizer2->Add(
BPCandleStat, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
636 BPLockDateCtrl =
new wxDatePickerCtrl(
BatchPanel, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DROPDOWN );
639 BPGridSizer2->Add(
BPLockDateCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
641 BPLockStat =
new wxStaticText(
BatchPanel, wxID_ANY,
l(
"Lockdown Date"), wxDefaultPosition, wxDefaultSize, 0 );
643 BPLockStat->SetForegroundColour(wxColor(0,128,0));
644 BPGridSizer2->Add(
BPLockStat, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
646 BPHatchDateCtrl =
new wxDatePickerCtrl(
BatchPanel, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DROPDOWN );
649 BPGridSizer2->Add(
BPHatchDateCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
651 BPHatchStat =
new wxStaticText(
BatchPanel, wxID_ANY,
l(
"Hatch Date"), wxDefaultPosition, wxDefaultSize, 0 );
653 BPHatchStat->SetForegroundColour(wxColor(255,0,0));
654 BPGridSizer2->Add(
BPHatchStat, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
656 BPGridSizer1->Add( BPGridSizer2, 1, wxEXPAND, 5 );
658 BPCommentCtrl =
new wxTextCtrl(
BatchPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE,textVal);
659 BPCommentCtrl->SetToolTip(
l(
"Edit Comments For Selected Batch") );
662 BPBoxSizer->Add( BPGridSizer1, 1, wxEXPAND, 5 );
664 BPStatLine3 =
new wxStaticLine(
BatchPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
665 BPBoxSizer->Add(
BPStatLine3, 0, wxEXPAND | wxALL, 5 );
667 wxGridSizer* BPGridSizer3;
668 BPGridSizer3 =
new wxGridSizer( 0, 3, 0, 0 );
671 BPUpdate->SetToolTip(
l(
"Save Changes To Database") );
673 BPGridSizer3->Add(
BPUpdate, 0, wxALL|wxEXPAND, 5 );
675 wxString MoreActionsChoiceChoices[] = {
l(
"More Actions"),
l(
"Print Report"),
l(
"Save Text Report"),
l(
"Export Batch"),
l(
"Export iCal"),
l(
"Copy To Clipboard") };
676 int MoreActionsChoiceNChoices =
sizeof( MoreActionsChoiceChoices ) /
sizeof( wxString );
683 BPDelete->SetToolTip(
l(
"Completely Delete Batch From Database") );
685 BPGridSizer3->Add(
BPDelete, 0, wxALL|wxEXPAND, 5 );
687 BPBoxSizer->Add( BPGridSizer3, 0, wxEXPAND, 5 );
697 EggPanel =
new wxPanel(
m_notebook2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
698 EggPanel->SetBackgroundColour( wxColor(ColorRed[5],ColorGreen[5],ColorBlue[5],225));
699 EggPanel->SetForegroundColour( wxColor(ColorRed[6],ColorGreen[6],ColorBlue[6],225));
700 wxBoxSizer* AdvBsizer1;
701 AdvBsizer1 =
new wxBoxSizer( wxVERTICAL );
703 wxGridSizer* AdvGsizer1;
704 AdvGsizer1 =
new wxGridSizer( 0, 3, 0, 0 );
706 AdvEggList =
new wxListView(
EggPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT );
707 AdvEggList->SetToolTip(
l(
"Select An Egg To Edit It") );
709 AdvGsizer1->Add(
AdvEggList, 0, wxALL|wxEXPAND, 5 );
711 wxBoxSizer* AdvBsizer2;
712 AdvBsizer2 =
new wxBoxSizer( wxVERTICAL );
714 wxString AdvTag1ChoiceChoices[] = { wxT(
"Tag 1") };
715 int AdvTag1ChoiceNChoices =
sizeof( AdvTag1ChoiceChoices ) /
sizeof( wxString );
722 wxString AdvTag2ChoiceChoices[] = { wxT(
"Tag 2") };
723 int AdvTag2ChoiceNChoices =
sizeof( AdvTag2ChoiceChoices ) /
sizeof( wxString );
730 wxString AdvTag3ChoiceChoices[] = { wxT(
"Tag 3") };
731 int AdvTag3ChoiceNChoices =
sizeof( AdvTag3ChoiceChoices ) /
sizeof( wxString );
738 m_staticline3 =
new wxStaticLine(
EggPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
741 wxGridSizer* AdvGsizer2;
742 AdvGsizer2 =
new wxGridSizer( 0, 2, 0, 0 );
752 AdvGsizer2->Add(
AdvPipCheckbox, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
755 AdvBsizer2->Add( AdvGsizer2, 0, wxEXPAND, 5 );
757 m_staticline4 =
new wxStaticLine(
EggPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
760 wxString AdvResultChoiceChoices[] = {
l(
"Result"),
l(
"Hatched"),
l(
"Quit") };
761 int AdvResultChoiceNChoices =
sizeof( AdvResultChoiceChoices ) /
sizeof( wxString );
774 AdvGsizer1->Add( AdvBsizer2, 1, wxEXPAND, 5 );
782 AdvBsizer1->Add( AdvGsizer1, 0, wxEXPAND, 5 );
784 AdvStatLine1 =
new wxStaticLine(
EggPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
785 AdvBsizer1->Add(
AdvStatLine1, 0, wxEXPAND | wxALL, 5 );
787 wxGridSizer* AdvGsizer3;
788 AdvGsizer3 =
new wxGridSizer( 0, 3, 0, 0 );
791 AdvWeightList->SetToolTip(
l(
"Select A Day To Edit Weight And Comments") );
795 wxGridSizer* AdvGsizer4;
796 AdvGsizer4 =
new wxGridSizer( 0, 1, 0, 0 );
800 AdvWeightCtrl->SetToolTip(
l(
"Select A Day Then Edit Weight With This Control") );
802 AdvGsizer4->Add(
AdvWeightCtrl, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );
804 AdvTotalLossStat =
new wxStaticText(
EggPanel, wxID_ANY,
"0% " +
l(
"Total Weight Loss"), wxDefaultPosition, wxDefaultSize, 0 );
806 AdvGsizer4->Add(
AdvTotalLossStat, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );
808 AdvDayLossStat =
new wxStaticText(
EggPanel, wxID_ANY,
"0% " +
l(
"Loss On Day"), wxDefaultPosition, wxDefaultSize, 0 );
810 AdvGsizer4->Add(
AdvDayLossStat, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );
812 AdvAvgBatchLossStat =
new wxStaticText(
EggPanel, wxID_ANY,
"0% " +
l(
"Avg Weight Loss For All Eggs In Batch"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL );
814 AdvGsizer4->Add(
AdvAvgBatchLossStat, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );
817 AdvGsizer3->Add( AdvGsizer4, 1, wxEXPAND, 5 );
825 AdvBsizer1->Add( AdvGsizer3, 1, wxEXPAND, 5 );
827 AdvStatLine2 =
new wxStaticLine(
EggPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
828 AdvBsizer1->Add(
AdvStatLine2, 0, wxEXPAND | wxALL, 5 );
830 wxGridSizer* AdvGsizer5;
831 AdvGsizer5 =
new wxGridSizer( 0, 3, 0, 0 );
834 AdvUpdate->SetToolTip(
l(
"Save Changes To Database") );
836 AdvGsizer5->Add(
AdvUpdate, 0, wxALL|wxEXPAND, 5 );
838 AdvMoreChoice =
new wxChoice(
EggPanel,
ON_MORE, wxDefaultPosition, wxDefaultSize, MoreActionsChoiceNChoices, MoreActionsChoiceChoices, 0 );
845 AdvDelete->SetToolTip(
l(
"Completely Delete Batch From Database") );
847 AdvGsizer5->Add(
AdvDelete, 0, wxALL|wxEXPAND, 5 );
850 AdvBsizer1->Add( AdvGsizer5, 0, wxEXPAND, 5 );
859 GroupPanel =
new wxPanel(
m_notebook2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
860 GroupPanel->SetBackgroundColour( wxColor(ColorRed[5],ColorGreen[5],ColorBlue[5],225));
861 GroupPanel->SetForegroundColour( wxColor(ColorRed[6],ColorGreen[6],ColorBlue[6],225));
862 wxBoxSizer* GrBSizer1;
863 GrBSizer1 =
new wxBoxSizer( wxVERTICAL );
865 wxGridSizer* GrGSizer1;
866 GrGSizer1 =
new wxGridSizer( 0, 2, 0, 0 );
868 GroupList =
new wxListView(
GroupPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL );
869 GrGSizer1->Add(
GroupList, 0, wxALL|wxEXPAND, 5 );
871 wxBoxSizer* GRBSizer2;
872 GRBSizer2 =
new wxBoxSizer( wxVERTICAL );
874 GrCommentCtrl =
new wxTextCtrl(
GroupPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
881 GrGSizer1->Add( GRBSizer2, 1, wxEXPAND, 5 );
886 GrGSizer1->Add(
GrBatchList, 0, wxALL|wxEXPAND, 5 );
888 wxBoxSizer* GrBSizer2;
889 GrBSizer2 =
new wxBoxSizer( wxVERTICAL );
891 wxGridSizer* GrGSizer;
892 GrGSizer =
new wxGridSizer( 0, 4, 0, 0 );
895 GrGSizer->Add(
GrEggBitmap, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
897 GrTEggCtrl =
new wxTextCtrl(
GroupPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 50,-1 ), wxTE_READONLY );
898 GrGSizer->Add(
GrTEggCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
901 GrGSizer->Add(
GrChickBitmap, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
903 GrTChickCtrl =
new wxTextCtrl(
GroupPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 50,-1 ), wxTE_READONLY );
904 GrGSizer->Add(
GrTChickCtrl, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
907 GrBSizer2->Add( GrGSizer, 0, wxEXPAND, 5 );
909 GrAWFerStat =
new wxStaticText(
GroupPanel, wxID_ANY,
l(
"Avg % Fertile"), wxDefaultPosition, wxDefaultSize, 0 );
913 GrAOFHatchStat =
new wxStaticText(
GroupPanel, wxID_ANY,
l(
"Avg % Of Fertile Hatched"), wxDefaultPosition, wxSize( -1,-1 ), 0 );
917 GrAOTHatchStat =
new wxStaticText(
GroupPanel, wxID_ANY,
l(
"Avg % of Total Hatched"), wxDefaultPosition, wxDefaultSize, 0 );
927 GrGSizer1->Add( GrBSizer2, 1, wxEXPAND, 5 );
930 GrBSizer1->Add( GrGSizer1, 1, wxEXPAND, 5 );
933 wxGridSizer* GRBSizer4;
934 GRBSizer4 =
new wxGridSizer( 0, 3, 0, 0 );
937 GRBSizer4->Add(
GrAddButton, 0, wxALL|wxEXPAND, 5 );
939 wxString GrMoreChoiceChoices[] = {
l(
"More Actions"),
l(
"Save Text Group Report"),
l(
"Print Group Report"),
l(
"Export Group"),
l(
"Export Group iCal") };
940 int GrMoreChoiceNChoices =
sizeof( GrMoreChoiceChoices ) /
sizeof( wxString );
949 GrBSizer1->Add( GRBSizer4, 0, wxEXPAND, 5 );
957 NotePanel =
new wxPanel(
m_notebook2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
958 NotePanel->SetBackgroundColour( wxColor(ColorRed[5],ColorGreen[5],ColorBlue[5],225));
959 NotePanel->SetForegroundColour( wxColor(ColorRed[6],ColorGreen[6],ColorBlue[6],225));
961 bSizer3 =
new wxBoxSizer( wxVERTICAL );
963 NoteList =
new wxListView(
NotePanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT );
964 bSizer3->Add(
NoteList, 1, wxALL|wxEXPAND, 5 );
965 NoteList->SetBackgroundColour(wxColor(ColorRed[9],ColorGreen[9],ColorBlue[9],225) );
966 NoteList->SetForegroundColour(wxColor(ColorRed[10],ColorGreen[10],ColorBlue[10],225));
968 ClearDayStat =
new wxStaticText(
NotePanel, wxID_ANY,
l(
"Notifications Automatically Clear After 3 Days."), wxDefaultPosition, wxDefaultSize, 0 );
977 gSizer1->Add(
m_notebook2, 1, wxEXPAND | wxALL, 5 );
979 bSizer2->Add( gSizer1, 1, wxEXPAND, 5 );
981 this->SetSizer( bSizer2 );
984 this->Centre( wxBOTH );
1041 if ( !
m_taskBarIcon->SetIcon(TaskBar_xpm,
"HatchKeeper.") ) {
1042 cout<<
"Log: Could Not Set Taskbar Icon."<<endl;
std::string HATCHKEEPER_DATA
HK_Database Database(HATCHKEEPER_DATA+"HatchKeeper.db")
std::string l(std::string Text)
A Helper Function For HK_Language.
Holds Classes Related Single Instance Features.
Holds stuff related to displaying a taskbar icon.
HK_Notifications ReadNotify()
Scans Notifications Into A HK_Storage Object.
HK_KeyValue ReadSettings()
Reads Settings Table Into HK_KeyValue Object.
HK_Storage ReadSchedules()
Reads Schedules Table Into HK_Storage Object.
HK_Storage ReadRemind()
Reads Reminders Table Into HK_Storage Object.
HK_Storage ReadTypes()
Reads Types Table Into HK_Storage Object.
bool CreateDB()
Populates Database With Defaults.
HK_Batches ReadBatches(int Sort)
Scans Batches Into HK_Batches Object.
HK_Storage ReadBreeds()
Scans Breeds Into A HK_Storage Object.
A Class For Storing And Retieving Data For One Egg.
std::string GetValidChars()
Returns Chars That Are Allowed In Text Controls.
vector< int > GetIntArray(int Selection)
Returns The Selected Value As An Array Of Integers.
int GetInt(int Selection)
Returns The Selected Setting Value As An Integer.
string GetValue(int Selection)
Returns The Selected Setting Value As A String.
void SetPath(std::string Path)
Sets/Loads Path Opens the xml language file and reads it into two arrays.
wxStaticText * AdvTotalLossStat
wxChoice * SortBatchChoice
wxCheckBox * AdvPipCheckbox
wxButton * printCalButton
wxCheckBox * AdvFertileCheckbox
wxStaticText * BPStartStat
void OnUnSelectEgg(wxListEvent &)
Resets Ctrls With Default Values.
wxGenericCalendarCtrl * MainCalendar
wxStaticText * BPPerWerFerStat
wxStaticText * BPPerOfFerStat
wxStaticText * GrAOFHatchStat
void ShowGroups(bool Scan)
Populates GroupList.
void ScanAdvanced(int sel)
wxStaticText * BPCandleStat
wxSpinCtrlDouble * AdvWeightCtrl
void OnBatchName(wxCommandEvent &)
Fired When BPNameCtrl Is Edited. Updates Batches With New Name.
wxTextCtrl * AdvCommentCtrl
void OnBatchGroup(wxCommandEvent &)
Fired When BPGroupChoice Is Changed. Updates Batches With New Group Name.
void ShowBatches(bool Scan)
Populates MainList With Data From Batches.
wxStaticText * AdvDayLossStat
wxStaticBitmap * BPEggStat
wxStaticText * BPFerUnStat
wxStaticBitmap * GrChickBitmap
wxStaticText * SortBatchStat
wxStaticText * BPHatchStat
wxDatePickerCtrl * AdvResultDate
wxChoice * AdvResultChoice
wxStaticBitmap * BPFertileStat
wxButton * GrDeleteButton
void OnAdvDayUnSelect(wxListEvent &)
Called When Day Is Unselected.
wxStaticLine * BPStatLine1
void OnGroupUnSelect(wxListEvent &)
Fired When A GroupList Item Gets Unselected.
wxStaticText * GrAOTHatchStat
wxStaticLine * BPStatLine3
wxChoice * BPIncubatorChoice
wxDatePickerCtrl * BPStartDateCtrl
wxStaticLine * AdvStatLine1
wxChartPanel * BatchGraphPanel
wxStaticText * BPLockStat
wxDatePickerCtrl * BPCandleDateCtrl
wxStaticText * BPPerOfTotalStat
void OnBatchComments(wxCommandEvent &)
Fired When Batch Comments Are Edited.
wxSpinCtrl * BPChicksHatchSpin
wxSpinCtrl * BPFertileSpin
void OnSelectEgg(wxListEvent &)
Fired When An Egg Is Selected.
wxChoice * MoreActionsChoice
wxStaticText * GrAWFerStat
void ShowMsg(string Msg)
Uses wxMessageDialog To Display Message.
wxStaticBitmap * GrEggBitmap
void OnAdvDaySelect(wxListEvent &)
Called When User Selects A Day.
void OnSaveAdvChanges(wxCommandEvent &)
void OnEnableAdv(wxCommandEvent &)
wxTextCtrl * GrCommentCtrl
wxTextCtrl * AdvDayCommentCtrl
wxStaticText * GrAOTUnHatchStat
wxStaticLine * m_staticline4
wxCheckBox * HideCheckBox
wxStaticLine * AdvStatLine2
wxStaticText * AdvAvgBatchLossStat
wxStaticLine * m_staticline3
void OnGroupSelect(wxListEvent &)
Fires When A GroupList Item Get Selected.
void OnColumnClick(wxListEvent &evt)
Switches Groups Column.
wxButton * ClearNoteButton
void OnBatchBreed(wxCommandEvent &)
Fired When BPBreedChoice Is Changed. Updates Batches With New Breed.
wxGauge * BPProgressGauge
wxTextCtrl * BPCommentCtrl
void OnBatchType(wxCommandEvent &)
Fired When BPTypeChoice Is Changed. Updates Batches With New Type And Sets Breed To Unknown.
wxTextCtrl * GrTChickCtrl
HatchFrame()
The Main Window Constructor.
wxStaticText * ClearDayStat
wxStaticBitmap * BPChicksStat
HatchTaskBarIcon * m_taskBarIcon
void OnListSelect(wxListEvent &)
Fired When A MainList Item Gets Selected.
void OnBatchDates(wxDateEvent &)
Fired When Any Of The Batch Dates Are Changed.
void OnBatchIncubator(wxCommandEvent &)
Fired When BPIncubatorChoice Is Changed. Updates Batches With New Incubator.
wxDatePickerCtrl * BPLockDateCtrl
wxStaticLine * BPStatLine2
wxStaticText * BPPerUnhatchStat
wxDatePickerCtrl * BPHatchDateCtrl
void OnListDESelect(wxListEvent &evt)
Fired When A MainList Item Gets Unselected.
wxListView * AdvWeightList
void ShowNotifications()
Shows Popup Notifications To User And Adds Them To NoteList.
wxSpinCtrl * ClearDaySpin
string ReadableDate(wxDateTime date)
A Taskbar Icon That Is Visable When HatchKeeper Is Running.