Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
XCCalendarManipulator: Set button background colours to the main panel background...
[xestiacalendar/.git] / source / widgets / XCCalendarManipulator.cpp
index f8971ca..95d2045 100644 (file)
 
 #include "XCCalendarManipulator.h"
 
-BEGIN_EVENT_TABLE(XCCalendarManipulator, wxPanel)
-END_EVENT_TABLE()
+wxDEFINE_EVENT(XCCALENDARMANIPULATOR_CHANGEGRID, wxCommandEvent);
 
 using namespace std;
 
 XCCalendarManipulator::XCCalendarManipulator(wxWindow* parent, const wxString& title, 
        const wxPoint& pos, const wxSize& size, CalendarDataStorage *dataStorage)
         : wxPanel(parent, wxID_ANY, pos, size, wxTAB_TRAVERSAL, title){
-       
        szrMain = new wxBoxSizer( wxVERTICAL );
        pnlMain = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(500, 50), wxTAB_TRAVERSAL);
        pnlMain->SetBackgroundColour(wxColour(40,40,40));
@@ -60,6 +58,9 @@ XCCalendarManipulator::XCCalendarManipulator(wxWindow* parent, const wxString& t
        previousButton->SetBitmap(previousIconBitmap);
        nextButton->SetBitmap(nextIconBitmap);
        calendarsButton->SetBitmap(calendarsIconBitmap);
+       previousButton->SetBackgroundColour(pnlMain->GetBackgroundColour());
+       nextButton->SetBackgroundColour(pnlMain->GetBackgroundColour());
+       calendarsButton->SetBackgroundColour(pnlMain->GetBackgroundColour());
                
        // Setup the static text.
                
@@ -72,15 +73,7 @@ XCCalendarManipulator::XCCalendarManipulator(wxWindow* parent, const wxString& t
                
        dateButton->SetFont(test);
        dateButton->SetForegroundColour(wxColour(255,255,255));
-       
-       // Setup the event controls.
-
-       dateButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(XCCalendarManipulator::DateTextClick), NULL, this);
-       nextButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(XCCalendarManipulator::NextMonth), NULL, this);
-       calendarsButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(XCCalendarManipulator::ShowCalendarsList), NULL, this);
-       previousButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(XCCalendarManipulator::PreviousMonth), NULL, this);
-       
-       Connect(ID_CHANGEGRID, XCCALENDARMANIPULATOR_CHANGEGRID, wxCommandEventHandler(XCCalendarManipulator::ChangeGrid));
+       dateButton->SetBackgroundColour(pnlMain->GetBackgroundColour());
        
        // Setup the manipulator control.
 
@@ -110,6 +103,14 @@ XCCalendarManipulator::XCCalendarManipulator(wxWindow* parent, const wxString& t
        
        this->dataStorage = dataStorage;
                
+       // Setup the event controls.
+
+       dateButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(XCCalendarManipulator::DateTextClick), NULL, this);
+       nextButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(XCCalendarManipulator::NextMonth), NULL, this);
+       calendarsButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(XCCalendarManipulator::ShowCalendarsList), NULL, this);
+       previousButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(XCCalendarManipulator::PreviousMonth), NULL, this);
+       
+       Bind(XCCALENDARMANIPULATOR_CHANGEGRID, &XCCalendarManipulator::ChangeGrid, this, ID_CHANGEGRID);
 }
 
 XCCalendarManipulator::~XCCalendarManipulator(){
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy