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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361
| #include "wx/wx.h"
#include <wx/toolbar.h>
#include <wx/tbarbase.h>
#include "wx/listctrl.h"
#include "wx/mdi.h"
int pom =0;
class MyApp: public wxApp
{
virtual bool OnInit();
};
class MyFrame: public wxMDIParentFrame
{
public:
MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style = wxDEFAULT_FRAME_STYLE);
void OnQuit(wxCommandEvent& event);
void OnBloki(wxCommandEvent& event);
void OnUrzadzenia(wxCommandEvent& event);
void OnStany(wxCommandEvent& event);
void OnDane(wxCommandEvent& event);
void OnPrzegladanie(wxCommandEvent& event);
void OnCzaspracy(wxCommandEvent& event);
void OnCzaspost(wxCommandEvent& event);
void OnStannadzien(wxCommandEvent& event);
void OnRapmies(wxCommandEvent& event);
void OnRapszcz(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
};
class BlokiDialog :public wxMDIChildFrame
{
public:
BlokiDialog (wxMDIParentFrame *parent, wxWindowID id, const wxString &title, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE);
~BlokiDialog ();
wxListCtrl * dialogList;
void OnClick_AddNowy(wxCommandEvent & event);
void OnClick_Popraw(wxCommandEvent & event);
void OnClick_Anuluj(wxCommandEvent & event);
void OnClick_Usun(wxCommandEvent & event);
void OnClick_Wyjscie(wxCommandEvent & event);
DECLARE_EVENT_TABLE()
};
class UrzadzeniaDialog :public wxMDIChildFrame
{
public:
UrzadzeniaDialog(wxMDIParentFrame *parent, wxWindowID id, const wxString &title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE);
wxListCtrl * dialogList;
void OnClick_AddNowy(wxCommandEvent & event);
void OnClick_Popraw(wxCommandEvent & event);
void OnClick_Anuluj(wxCommandEvent & event);
void OnClick_Usun(wxCommandEvent & event);
void OnClick_Wyjscie(wxCommandEvent & event);
DECLARE_EVENT_TABLE()
};
class StanyDialog :public wxMDIChildFrame
{
public:
StanyDialog(wxMDIParentFrame *parent, wxWindowID id, const wxString &title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE);
wxListCtrl * dialogList;
void OnClick_AddNowy(wxCommandEvent & event);
void OnClick_Popraw(wxCommandEvent & event);
void OnClick_Usun(wxCommandEvent & event);
void OnClick_Anuluj(wxCommandEvent & event);
void OnClick_Wyjscie(wxCommandEvent & event);
DECLARE_EVENT_TABLE()
};
enum
{
ID_Quit = 1,
ID_Bloki,
ID_BLOKI_DIALOG,
ID_Urzadzenia,
ID_Stany,
ID_DANE,
ID_Przegladanie,
ID_czas_pr_urz,
ID_czas_post,
ID_stan_urz_nadzien,
ID_rap_mies,
ID_rap_szcz,
ID_id,
ID_nazwa_bloku,
ID_BUTTON_ADD,
ID_BUTTON_RENAME,
ID_BUTTON_ANULUJ,
ID_BUTTON_USUN,
ID_BUTTON_WYJSCIE
};
BEGIN_EVENT_TABLE(MyFrame, wxMDIParentFrame)
EVT_MENU(ID_Quit, MyFrame::OnQuit)
EVT_MENU(ID_Bloki,MyFrame ::OnBloki)
EVT_MENU(ID_Urzadzenia, MyFrame::OnUrzadzenia)
EVT_MENU(ID_Stany, MyFrame::OnStany)
EVT_MENU(ID_DANE, MyFrame::OnDane)
EVT_MENU(ID_Przegladanie, MyFrame::OnPrzegladanie)
EVT_MENU(ID_czas_pr_urz, MyFrame::OnCzaspracy)
EVT_MENU(ID_czas_post, MyFrame::OnCzaspost)
EVT_MENU(ID_stan_urz_nadzien, MyFrame::OnStannadzien)
EVT_MENU(ID_rap_mies, MyFrame::OnRapmies)
EVT_MENU(ID_rap_szcz, MyFrame::OnRapszcz)
END_EVENT_TABLE()
BEGIN_EVENT_TABLE(BlokiDialog,wxMDIParentFrame)
EVT_BUTTON(ID_BUTTON_ADD, BlokiDialog::OnClick_AddNowy)
EVT_BUTTON(ID_BUTTON_RENAME, BlokiDialog::OnClick_Popraw)
EVT_BUTTON(ID_BUTTON_ANULUJ, BlokiDialog::OnClick_Anuluj)
EVT_BUTTON(ID_BUTTON_USUN, BlokiDialog::OnClick_Usun)
EVT_BUTTON(ID_BUTTON_WYJSCIE, BlokiDialog::OnClick_Wyjscie)
END_EVENT_TABLE()
BEGIN_EVENT_TABLE(UrzadzeniaDialog,wxMDIParentFrame)
EVT_BUTTON(ID_BUTTON_ADD, UrzadzeniaDialog::OnClick_AddNowy)
EVT_BUTTON(ID_BUTTON_RENAME, UrzadzeniaDialog::OnClick_Popraw)
EVT_BUTTON(ID_BUTTON_ANULUJ, UrzadzeniaDialog::OnClick_Anuluj)
EVT_BUTTON(ID_BUTTON_USUN, UrzadzeniaDialog::OnClick_Usun)
EVT_BUTTON(ID_BUTTON_WYJSCIE, UrzadzeniaDialog::OnClick_Wyjscie)
END_EVENT_TABLE()
BEGIN_EVENT_TABLE(StanyDialog,wxMDIParentFrame)
EVT_BUTTON(ID_BUTTON_ADD, StanyDialog::OnClick_AddNowy)
EVT_BUTTON(ID_BUTTON_RENAME, StanyDialog::OnClick_Popraw)
EVT_BUTTON(ID_BUTTON_USUN, StanyDialog::OnClick_Usun)
EVT_BUTTON(ID_BUTTON_ANULUJ, StanyDialog::OnClick_Anuluj)
EVT_BUTTON(ID_BUTTON_WYJSCIE, StanyDialog::OnClick_Wyjscie)
END_EVENT_TABLE()
//DECLARE_APP(MyApp)
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
MyFrame *frame = new MyFrame( _("EH"), wxPoint(50,50), wxSize(950,740) );
//frame->SetIcon(wxIcon(mondrian));
frame->Show(TRUE);
//SetIcon(wxICON(monicone));
SetTopWindow(frame);
return TRUE;
}
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style)
: wxMDIParentFrame((wxMDIParentFrame *)NULL, -1, title, pos, size)
{
wxMenu *menuObiekty = new wxMenu;
wxMenu *menuEwidencja= new wxMenu;
wxMenu *menuInformacje= new wxMenu;
wxMenu *menuRaporty= new wxMenu;
menuObiekty->Append( ID_Bloki, _("&Bloki\tF2") );
menuObiekty->AppendSeparator();
menuObiekty->Append(ID_Urzadzenia, _("&UrzÄ
dzenia\tF3"));
menuObiekty->AppendSeparator();
menuObiekty->Append(ID_Stany, _("&Stany\tF4"));
menuObiekty->AppendSeparator();
menuObiekty->Append( ID_Quit, _("&WyjĹcie\tAlt+F4"));
menuEwidencja->Append( ID_DANE, _("Wprowadzanie danych"));
menuEwidencja->AppendSeparator();
menuEwidencja->Append( ID_Przegladanie, _("PrzeglÄ
danie i edycja"));
menuInformacje->Append( ID_czas_pr_urz, _("Czas pracy urzÄ
dzeĹ"));
menuInformacje->AppendSeparator();
menuInformacje->Append( ID_czas_post, _("Czas postojĂłw"));
menuInformacje->AppendSeparator();
menuInformacje->Append( ID_stan_urz_nadzien, _("Czas urzÄ
dzeĹ w dniu"));
menuRaporty->Append( ID_rap_mies, _("Raport miesiÄczny"));
menuInformacje->AppendSeparator();
menuInformacje->Append( ID_rap_szcz, _("Raport szczegĂłĹowy"));
wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append( menuObiekty, _("&Obiekty"));
menuBar->Append( menuEwidencja, _("&Ewidencja"));
menuBar->Append( menuInformacje, _("&Informacje"));
menuBar->Append( menuRaporty, _("&Raporty"));
SetMenuBar( menuBar );
CreateStatusBar();
SetStatusText( _("Czas pracy"));
}
//***************************MENU*******OBIEKTY**********************************************************
BlokiDialog::BlokiDialog (
wxMDIParentFrame *parent,
wxWindowID id,
const wxString &title,
const wxPoint &position,
const wxSize& size,
long style)
:wxMDIChildFrame(parent, -1,_("Bloki"))//, wxPoint(50,50), wxSize(420,380), style)
{
pom++;
dialogList = new wxListCtrl(this, ID_id, wxPoint(12,20), wxSize(420,380), wxLC_REPORT);
dialogList->InsertColumn(0, _("Blok"), wxLIST_FORMAT_CENTER,120);
dialogList->InsertColumn(1, _("Nazwa bloku"),wxLIST_FORMAT_CENTER,300);
wxButton* buttonAddNowy = new wxButton(this, ID_BUTTON_ADD, _("&Dodaj"), wxPoint(10, 450), wxSize(80,30), 0);
wxButton* buttonPopraw = new wxButton(this, ID_BUTTON_RENAME, _("&Popraw"), wxPoint(98, 450), wxSize(80,30),0);
wxButton* buttonAnuluj = new wxButton(this, ID_BUTTON_ANULUJ, _("&Anuluj"), wxPoint(185, 450), wxSize(80,30),0);
wxButton* buttonUsun = new wxButton(this, ID_BUTTON_USUN, _("&UsuĹ"), wxPoint(272, 450), wxSize(80,30),0);
wxButton* buttonWyjscie = new wxButton(this, ID_BUTTON_WYJSCIE, _("&WyjĹcie"), wxPoint(360, 450), wxSize(80,30),0);
}
BlokiDialog::~BlokiDialog ()
{
pom--;
}
UrzadzeniaDialog::UrzadzeniaDialog ( wxMDIParentFrame *parent,
wxWindowID id,
const wxString &title,
const wxPoint &position,
const wxSize& size,
long style)
:wxMDIChildFrame(parent, -1,_("Wykaz urzÄ
dzeĹ"))// wxPoint(50,50), wxSize(800,580), style)
{
dialogList = new wxListCtrl(this, ID_id, wxPoint(12, 20), wxSize(880,500), wxLC_REPORT);
dialogList->InsertColumn(0, _("Blok"), wxLIST_FORMAT_CENTER,60);
dialogList->InsertColumn(1, _("Kod"),wxLIST_FORMAT_CENTER,130);
dialogList->InsertColumn(2, _("Nazwa urzÄ
dzenia"),wxLIST_FORMAT_CENTER,400);
dialogList->InsertColumn(3, _("Data stanu"),wxLIST_FORMAT_CENTER,100);
dialogList->InsertColumn(4, _("Godzina"),wxLIST_FORMAT_CENTER,95);
dialogList->InsertColumn(5, _("Stan"),wxLIST_FORMAT_CENTER,95);
wxButton* buttonAddNowy = new wxButton(this, ID_BUTTON_ADD, _("&Dodaj"), wxPoint(50,550), wxSize(140, 30), 0);
wxButton* buttonPopraw = new wxButton(this, ID_BUTTON_RENAME, _("&Popraw"), wxPoint(200, 550), wxSize(140, 30), 0);
wxButton* buttonUsun = new wxButton(this, ID_BUTTON_USUN, _("&UsuĹ"), wxPoint(500, 550), wxSize(140, 30), 0);
wxButton* buttonWyjscie = new wxButton(this, ID_BUTTON_WYJSCIE, _("&WyjĹcie"), wxPoint(650, 550), wxSize(140, 30), 0);
}
StanyDialog::StanyDialog ( wxMDIParentFrame *parent,
wxWindowID id,
const wxString &title,
const wxPoint &position,
const wxSize& size,
long style)
:wxMDIChildFrame( parent, id,_("Stan urzÄ
dzeĹ"))// , wxPoint(50,50), size, style)
{
dialogList = new wxListCtrl(this, ID_id, wxPoint(12, 20), wxSize(527, 500), wxLC_REPORT);
dialogList->InsertColumn(0, _("Kod stanu"), wxLIST_FORMAT_CENTER,120);
dialogList->InsertColumn(1, _("Stan urzÄ
dzeĹ"),wxLIST_FORMAT_CENTER,407);
wxButton* buttonAddNowy = new wxButton(this, ID_BUTTON_ADD, _("&Dodaj"), wxPoint(27, 550), wxSize(80, 30), 0);
wxButton* buttonPopraw = new wxButton(this, ID_BUTTON_RENAME, _("&Popraw"), wxPoint(132, 550), wxSize(80, 30), 0);
wxButton* buttonAnuluj = new wxButton(this, ID_BUTTON_ANULUJ, _("&Anuluj"), wxPoint(237, 550), wxSize(80, 30), 0);
wxButton* buttonUsun = new wxButton(this, ID_BUTTON_USUN, _("&UsuĹ"), wxPoint(342, 550), wxSize(80, 30), 0);
wxButton* buttonWyjscie = new wxButton(this, ID_BUTTON_WYJSCIE, _("&WyjĹcie"), wxPoint(442, 550), wxSize(80, 30), 0);
}
//*******************************MENU********EWIDENCJA*************************************************************
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
Close(TRUE);
}
void MyFrame::OnBloki(wxCommandEvent& WXUNUSED(event))
{
if (!pom)
{
BlokiDialog *aboutDialog = new BlokiDialog(this, ID_BLOKI_DIALOG, _("Lista blokĂłw"));
aboutDialog->Show(TRUE);
}
else
{
wxWindow *aD = wxWindow::FindWindow(ID_BLOKI_DIALOG);
BlokiDialog *aboutDialog = wxDynamicCast(aD, BlokiDialog);
aboutDialog->Show(TRUE);
}
}
void MyFrame::OnUrzadzenia(wxCommandEvent& WXUNUSED(event))
{
UrzadzeniaDialog *aboutDialog = new UrzadzeniaDialog(this, -1, _("Lista urzÄ
dzeĹ"));
aboutDialog->Show(TRUE);
}
void MyFrame::OnStany(wxCommandEvent& WXUNUSED(event))
{
StanyDialog *aboutDialog = new StanyDialog(this, -1, _("Stany urzÄ
dzeĹ"));
aboutDialog->Show(TRUE);
}
void MyFrame::OnDane(wxCommandEvent& WXUNUSED(event))
{
wxMessageBox(_("tu bÄdzie wprowadzana ewidencja"),_("coĹ tu bÄdzie"), wxOK | wxICON_INFORMATION, this);
}
void MyFrame::OnPrzegladanie(wxCommandEvent& WXUNUSED(event))
{
wxMessageBox(_("tu bÄdzie wprowadzana ewidencja"),_("coĹ tu bÄdzie"), wxOK | wxICON_INFORMATION, this);
}
void MyFrame::OnCzaspracy(wxCommandEvent& WXUNUSED(event))
{
wxMessageBox(_("tu bÄdzie wprowadzany czas pracy"),_("coĹ tu bÄdzie"), wxOK | wxICON_INFORMATION, this);
}
void MyFrame::OnCzaspost(wxCommandEvent& WXUNUSED(event))
{}
void MyFrame::OnStannadzien(wxCommandEvent& WXUNUSED(event))
{}
void MyFrame::OnRapmies(wxCommandEvent& WXUNUSED(event))
{}
void MyFrame::OnRapszcz(wxCommandEvent& WXUNUSED(event))
{}
void BlokiDialog::OnClick_AddNowy(wxCommandEvent& WXUNUSED(event))
{}
void BlokiDialog::OnClick_Popraw(wxCommandEvent& WXUNUSED(event))
{}
void BlokiDialog::OnClick_Anuluj(wxCommandEvent& WXUNUSED(event))
{}
void BlokiDialog::OnClick_Usun(wxCommandEvent& WXUNUSED(event))
{}
void BlokiDialog::OnClick_Wyjscie(wxCommandEvent& WXUNUSED(event))
{
Show(FALSE);
}
void UrzadzeniaDialog::OnClick_AddNowy(wxCommandEvent& WXUNUSED(event))
{}
void UrzadzeniaDialog::OnClick_Popraw(wxCommandEvent& WXUNUSED(event))
{}
void UrzadzeniaDialog::OnClick_Anuluj(wxCommandEvent& WXUNUSED(event))
{}
void UrzadzeniaDialog::OnClick_Usun(wxCommandEvent& WXUNUSED(event))
{}
void UrzadzeniaDialog::OnClick_Wyjscie(wxCommandEvent& WXUNUSED(event))
{
Close(TRUE);
}
void StanyDialog::OnClick_AddNowy(wxCommandEvent& WXUNUSED(event))
{}
void StanyDialog::OnClick_Popraw(wxCommandEvent& WXUNUSED(event))
{}
void StanyDialog::OnClick_Usun(wxCommandEvent& WXUNUSED(event))
{}
void StanyDialog::OnClick_Anuluj(wxCommandEvent& WXUNUSED(event))
{}
void StanyDialog::OnClick_Wyjscie(wxCommandEvent& WXUNUSED(event))
{
Close(TRUE);
} |
Partager