Example #1
0
AboxDlgGen::~AboxDlgGen()
{
	// Disconnect Events
	this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( AboxDlgGen::onClose ) );
	m_bmpFind->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( AboxDlgGen::onBmpFind ), NULL, this );
	m_Find->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboxDlgGen::onFind ), NULL, this );
	m_FindText->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( AboxDlgGen::onFindTextEnter ), NULL, this );
	m_FromDate->Disconnect( wxEVT_DATE_CHANGED, wxDateEventHandler( AboxDlgGen::onFromDate ), NULL, this );
	m_ToDate->Disconnect( wxEVT_DATE_CHANGED, wxDateEventHandler( AboxDlgGen::onToDate ), NULL, this );
	m_SelectFile->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboxDlgGen::onSelectFile ), NULL, this );
	m_bmpUpload->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( AboxDlgGen::onBmpAdd ), NULL, this );
	m_Add->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboxDlgGen::onAdd ), NULL, this );
	m_Stubs->Disconnect( wxEVT_COMMAND_LIST_COL_CLICK, wxListEventHandler( AboxDlgGen::onStubCol ), NULL, this );
	m_Stubs->Disconnect( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler( AboxDlgGen::onStubActivated ), NULL, this );
	m_Stubs->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AboxDlgGen::onStubSelected ), NULL, this );
	m_ShowPath->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( AboxDlgGen::onShowPath ), NULL, this );
	m_Preview->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( AboxDlgGen::onOpenPreview ), NULL, this );
	m_bmpOpen->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( AboxDlgGen::onBmpOpen ), NULL, this );
	m_Open->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboxDlgGen::onOpen ), NULL, this );
	m_Modify->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboxDlgGen::onModify ), NULL, this );
	m_Delete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboxDlgGen::onDelete ), NULL, this );
	m_StdButtonsHelp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboxDlgGen::onHelp ), NULL, this );
	m_StdButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboxDlgGen::onOK ), NULL, this );
	
}
Example #2
0
MainFrameBase::~MainFrameBase()
{
	// Disconnect Events
	this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainFrameBase::Closed ) );
	CalendarCtrl->Disconnect( wxEVT_CALENDAR_SEL_CHANGED, wxCalendarEventHandler( MainFrameBase::CalendarCtrlChanged ), NULL, this );
	ShowChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainFrameBase::ShowChanged ), NULL, this );
	FromDatePicker->Disconnect( wxEVT_DATE_CHANGED, wxDateEventHandler( MainFrameBase::FromDateChanged ), NULL, this );
	ToDatePicker->Disconnect( wxEVT_DATE_CHANGED, wxDateEventHandler( MainFrameBase::ToDateChanged ), NULL, this );
	CategoriesText->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( MainFrameBase::QueryChanged ), NULL, this );
	SearchText->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( MainFrameBase::QueryChanged ), NULL, this );
	EventsList->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( MainFrameBase::ListDClick ), NULL, this );
	EventsList->Disconnect( wxEVT_COMMAND_LIST_COL_CLICK, wxListEventHandler( MainFrameBase::ColumnClicked ), NULL, this );
	EventsList->Disconnect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( MainFrameBase::EventsDeselected ), NULL, this );
	EventsList->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( MainFrameBase::EventsSelected ), NULL, this );
	EventsList->Disconnect( wxEVT_COMMAND_LIST_KEY_DOWN, wxListEventHandler( MainFrameBase::DeleteKeyDown ), NULL, this );
	this->Disconnect( wxID_NEW, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( MainFrameBase::NewClicked ) );
	this->Disconnect( wxID_DELETE, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( MainFrameBase::DeleteClicked ) );
	this->Disconnect( wxID_PROPERTIES, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( MainFrameBase::EditClicked ) );
	this->Disconnect( wxID_EXIT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( MainFrameBase::QuitClicked ) );
}
otcurrentUIDialogBase::~otcurrentUIDialogBase()
{
	// Disconnect Events
	this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( otcurrentUIDialogBase::OnClose ) );
	this->Disconnect( wxEVT_SIZE, wxSizeEventHandler( otcurrentUIDialogBase::OnSize ) );
	m_datePickerDate->Disconnect( wxEVT_DATE_CHANGED, wxDateEventHandler( otcurrentUIDialogBase::OnDateTimeChanged ), NULL, this );
	m_bpNow->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( otcurrentUIDialogBase::OnNow ), NULL, this );
	m_dirPicker1->Disconnect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( otcurrentUIDialogBase::OnFolderSelChanged ), NULL, this );
	m_button1->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( otcurrentUIDialogBase::About ), NULL, this );
	m_bpPrev->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( otcurrentUIDialogBase::OnPrev ), NULL, this );
	m_bpNext->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( otcurrentUIDialogBase::OnNext ), NULL, this );
	
}
Example #4
0
bool mmCustomData::FillCustomFields(wxBoxSizer* box_sizer)
{
    m_static_box = new wxStaticBox(m_dialog, wxID_ANY, _("Custom fields"));
    wxStaticBoxSizer* box_sizer_right = new wxStaticBoxSizer(m_static_box, wxVERTICAL);
    box_sizer->Add(box_sizer_right, g_flagsExpand);

    wxScrolledWindow* scrolled_window = new wxScrolledWindow(m_static_box, wxID_ANY);
    wxBoxSizer *custom_sizer = new wxBoxSizer(wxVERTICAL);
    scrolled_window->SetScrollbar(wxSB_VERTICAL, wxALIGN_RIGHT, 1, -1);
    scrolled_window->SetSizer(custom_sizer);

    wxFlexGridSizer* grid_sizer_custom = new wxFlexGridSizer(0, 2, 0, 0);
    grid_sizer_custom->AddGrowableCol(1, 1);
    custom_sizer->Add(grid_sizer_custom, g_flagsExpand);

    for (const auto &field : m_fields)
    {
        Model_CustomFieldData::Data* fieldData = Model_CustomFieldData::instance().get(field.FIELDID, m_ref_id);
        if (!fieldData)
        {
            fieldData = Model_CustomFieldData::instance().create();
            fieldData->FIELDID = field.FIELDID;
            fieldData->REFID = m_ref_id;
            fieldData->CONTENT = Model_CustomField::getDefault(field.PROPERTIES);
        }

        wxWindowID controlID = GetBaseID() + (wxWindowID)field.FIELDID;
        wxWindowID labelID = GetLabelID() + (wxWindowID)field.FIELDID;

        wxCheckBox* Description = new wxCheckBox(scrolled_window
            , labelID, field.DESCRIPTION
            , wxDefaultPosition, wxDefaultSize, wxCHK_2STATE
            , wxDefaultValidator, field.TYPE);
        Description->Connect(labelID, wxEVT_CHECKBOX
            , wxCommandEventHandler(mmCustomData::OnCheckBoxActivated), nullptr, this);

        grid_sizer_custom->Add(Description, g_flagsH);

        switch (Model_CustomField::type(field))
        {
        case Model_CustomField::STRING:
        {
            const auto& data = fieldData->CONTENT;
            wxTextCtrl* CustomString = new wxTextCtrl(scrolled_window, controlID, data, wxDefaultPosition, wxDefaultSize);
            CustomString->SetToolTip(Model_CustomField::getTooltip(field.PROPERTIES));
            if (Model_CustomField::getAutocomplete(field.PROPERTIES))
            {
                const wxArrayString& values = Model_CustomFieldData::instance().allValue(field.FIELDID);
                CustomString->AutoComplete(values);
            }
            grid_sizer_custom->Add(CustomString, g_flagsExpand);

            if (!data.empty())
            {
                Description->SetValue(true);
            }

            CustomString->Connect(controlID, wxEVT_TEXT, wxCommandEventHandler(mmCustomData::OnStringChanged), nullptr, this);
            break;
        }
        case Model_CustomField::INTEGER:
        {
            int value;
            double test;
            if (!fieldData->CONTENT.ToDouble(&test)) {
                value = 0;
            }
            else {
                value = (int)test;
                SetWidgetChanged(controlID, wxString::Format("%i", value));
                Description->SetValue(true);
            }

            wxSpinCtrl* CustomInteger = new wxSpinCtrl(scrolled_window, controlID,
                wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, -2147483647, 2147483647, value);
            CustomInteger->SetToolTip(Model_CustomField::getTooltip(field.PROPERTIES));
            grid_sizer_custom->Add(CustomInteger, g_flagsExpand);

            CustomInteger->Connect(controlID, wxEVT_SPINCTRL, wxCommandEventHandler(mmCustomData::OnIntegerChanged), nullptr, this);

            break;
        }
        case Model_CustomField::DECIMAL:
        {
            double value;
            if (!fieldData->CONTENT.ToDouble(&value)) {
                value = 0;
            }
            else {
                const auto& data = wxString::Format("%f", value);
                SetWidgetChanged(controlID, data);
                Description->SetValue(true);
            }

            int DigitScale = Model_CustomField::getDigitScale(field.PROPERTIES);
            wxSpinCtrlDouble* CustomDecimal = new wxSpinCtrlDouble(scrolled_window, controlID
                , wxEmptyString, wxDefaultPosition, wxDefaultSize
                , wxSP_ARROW_KEYS, -2147483647, 2147483647, value, 1 / pow(10, DigitScale));
            CustomDecimal->SetDigits(DigitScale);
            CustomDecimal->SetToolTip(Model_CustomField::getTooltip(field.PROPERTIES));
            grid_sizer_custom->Add(CustomDecimal, g_flagsExpand);

            CustomDecimal->Connect(controlID, wxEVT_SPINCTRLDOUBLE, wxCommandEventHandler(mmCustomData::OnDoubleChanged), nullptr, this);

            break;
        }
        case Model_CustomField::BOOLEAN:
        {
            wxCheckBox* CustomBoolean = new wxCheckBox(scrolled_window, controlID,
                wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT | wxCHK_2STATE);

            const auto& data = fieldData->CONTENT;
            if (!data.empty())
            {
                CustomBoolean->SetValue(data == "TRUE");
                SetWidgetChanged(controlID, data);
                Description->SetValue(true);
            }

            CustomBoolean->SetToolTip(Model_CustomField::getTooltip(field.PROPERTIES));
            grid_sizer_custom->Add(CustomBoolean, g_flagsExpand);

            CustomBoolean->Connect(controlID, wxEVT_CHECKBOX, wxCommandEventHandler(mmCustomData::OnCheckBoxChanged), nullptr, this);

            break;
        }
        case Model_CustomField::DATE:
        {
            wxDate value;
            if (!value.ParseDate(fieldData->CONTENT)) {
                value = wxDate::Today();
            }
            else {
                SetWidgetChanged(controlID, value.FormatISODate());
                Description->SetValue(true);
            }

            wxDatePickerCtrl* CustomDate = new wxDatePickerCtrl(scrolled_window, controlID
                , value, wxDefaultPosition, wxDefaultSize, wxDP_DROPDOWN | wxDP_SHOWCENTURY);
            CustomDate->SetToolTip(Model_CustomField::getTooltip(field.PROPERTIES));
            grid_sizer_custom->Add(CustomDate, g_flagsExpand);

            CustomDate->Connect(controlID, wxEVT_DATE_CHANGED, wxDateEventHandler(mmCustomData::OnDateChanged), nullptr, this);

            break;
        }
        case Model_CustomField::TIME:
        {
            wxDateTime value;
            if (!value.ParseTime(fieldData->CONTENT)) {
                value.ParseTime("00:00:00");
            }
            else {
                SetWidgetChanged(controlID, value.FormatISOTime());
                Description->SetValue(true);
            }

            wxTimePickerCtrl* CustomTime = new wxTimePickerCtrl(scrolled_window, controlID
                , value, wxDefaultPosition, wxDefaultSize, wxDP_DROPDOWN);
            CustomTime->SetToolTip(Model_CustomField::getTooltip(field.PROPERTIES));
            grid_sizer_custom->Add(CustomTime, g_flagsExpand);

            CustomTime->Connect(controlID, wxEVT_TIME_CHANGED, wxDateEventHandler(mmCustomData::OnTimeChanged), nullptr, this);

            break;
        }
        case Model_CustomField::SINGLECHOICE:
        {
            wxArrayString Choices = Model_CustomField::getChoices(field.PROPERTIES);
            Choices.Sort();

            wxChoice* CustomChoice = new wxChoice(scrolled_window, controlID
                , wxDefaultPosition, wxDefaultSize, Choices);
            CustomChoice->SetToolTip(Model_CustomField::getTooltip(field.PROPERTIES));
            grid_sizer_custom->Add(CustomChoice, g_flagsExpand);

            if (Choices.size() == 0) {
                CustomChoice->Enable(false);
            }

            const auto& data = fieldData->CONTENT;
            if (!data.empty())
            {
                CustomChoice->SetStringSelection(data);
                SetWidgetChanged(controlID, data);
                Description->SetValue(true);
            }

            CustomChoice->Connect(controlID, wxEVT_CHOICE, wxCommandEventHandler(mmCustomData::OnSingleChoice), nullptr, this);
            break;
        }
        case Model_CustomField::MULTICHOICE:
        {
            const auto& content = fieldData->CONTENT;
            const auto& name = field.DESCRIPTION;

            wxButton* multi_choice_button = new wxButton(scrolled_window, controlID, content
                , wxDefaultPosition, wxDefaultSize, 0L, wxDefaultValidator, name);
            multi_choice_button->SetToolTip(Model_CustomField::getTooltip(field.PROPERTIES));
            grid_sizer_custom->Add(multi_choice_button, g_flagsExpand);

            if (!content.empty()) {
                SetWidgetChanged(controlID, content);
                Description->SetValue(true);
            }

            multi_choice_button->Connect(controlID, wxEVT_COMMAND_BUTTON_CLICKED
                , wxCommandEventHandler(mmCustomData::OnMultiChoice), nullptr, this);

            break;
        }
        default: break;
        }
    }

    scrolled_window->FitInside();
    scrolled_window->SetScrollRate(5, 5);
    box_sizer_right->Add(scrolled_window, g_flagsExpand);
    m_static_box->Hide();

    return true;
}
Example #5
0
AboxDlgGen::AboxDlgGen( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* bSizer3;
	bSizer3 = new wxBoxSizer( wxVERTICAL );
	
	m_FindBox = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Find") ), wxHORIZONTAL );
	
	wxBoxSizer* bSizer7;
	bSizer7 = new wxBoxSizer( wxHORIZONTAL );
	
	m_bmpFind = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
	bSizer7->Add( m_bmpFind, 0, wxALL, 5 );
	
	m_Find = new wxButton( this, wxID_ANY, wxT("Find"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer7->Add( m_Find, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_FindBox->Add( bSizer7, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	wxBoxSizer* bSizer31;
	bSizer31 = new wxBoxSizer( wxVERTICAL );
	
	m_FindInText = new wxCheckBox( this, wxID_ANY, wxT("Text"), wxDefaultPosition, wxDefaultSize, 0 );
	m_FindInText->SetValue(true); 
	bSizer31->Add( m_FindInText, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
	
	m_FindInCategory = new wxCheckBox( this, wxID_ANY, wxT("Category"), wxDefaultPosition, wxDefaultSize, 0 );
	m_FindInCategory->SetValue(true); 
	bSizer31->Add( m_FindInCategory, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
	
	m_FindInFilename = new wxCheckBox( this, wxID_ANY, wxT("Filename"), wxDefaultPosition, wxDefaultSize, 0 );
	m_FindInFilename->SetValue(true); 
	bSizer31->Add( m_FindInFilename, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
	
	m_FindInDate = new wxCheckBox( this, wxID_ANY, wxT("Date"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer31->Add( m_FindInDate, 0, wxRIGHT|wxLEFT, 5 );
	
	m_FindBox->Add( bSizer31, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
	
	wxBoxSizer* bSizer4;
	bSizer4 = new wxBoxSizer( wxVERTICAL );
	
	m_FindText = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxTE_PROCESS_ENTER ); 
	bSizer4->Add( m_FindText, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
	
	wxFlexGridSizer* fgSizer41;
	fgSizer41 = new wxFlexGridSizer( 0, 4, 0, 0 );
	fgSizer41->AddGrowableCol( 1 );
	fgSizer41->AddGrowableCol( 3 );
	fgSizer41->SetFlexibleDirection( wxBOTH );
	fgSizer41->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_labFromDate = new wxStaticText( this, wxID_ANY, wxT("From"), wxDefaultPosition, wxDefaultSize, 0 );
	m_labFromDate->Wrap( -1 );
	fgSizer41->Add( m_labFromDate, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_FromDate = new wxDatePickerCtrl( this, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DEFAULT|wxDP_SHOWCENTURY );
	fgSizer41->Add( m_FromDate, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
	
	m_labToDate = new wxStaticText( this, wxID_ANY, wxT("To"), wxDefaultPosition, wxDefaultSize, 0 );
	m_labToDate->Wrap( -1 );
	fgSizer41->Add( m_labToDate, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_ToDate = new wxDatePickerCtrl( this, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DEFAULT|wxDP_SHOWCENTURY );
	fgSizer41->Add( m_ToDate, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
	
	bSizer4->Add( fgSizer41, 0, wxEXPAND, 5 );
	
	m_FindBox->Add( bSizer4, 1, wxALIGN_CENTER_VERTICAL, 5 );
	
	bSizer3->Add( m_FindBox, 0, wxEXPAND|wxALL, 5 );
	
	m_UploadBox = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Upload") ), wxVERTICAL );
	
	wxFlexGridSizer* fgSizer2;
	fgSizer2 = new wxFlexGridSizer( 0, 2, 0, 0 );
	fgSizer2->AddGrowableCol( 1 );
	fgSizer2->SetFlexibleDirection( wxBOTH );
	fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_labCategory = new wxStaticText( this, wxID_ANY, wxT("Category"), wxDefaultPosition, wxDefaultSize, 0 );
	m_labCategory->Wrap( -1 );
	fgSizer2->Add( m_labCategory, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
	
	m_Category = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); 
	fgSizer2->Add( m_Category, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	m_labText = new wxStaticText( this, wxID_ANY, wxT("Text"), wxDefaultPosition, wxDefaultSize, 0 );
	m_labText->Wrap( -1 );
	fgSizer2->Add( m_labText, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
	
	m_Text = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer2->Add( m_Text, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
	
	m_labFile = new wxStaticText( this, wxID_ANY, wxT("File"), wxDefaultPosition, wxDefaultSize, 0 );
	m_labFile->Wrap( -1 );
	fgSizer2->Add( m_labFile, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
	
	wxFlexGridSizer* fgSizer3;
	fgSizer3 = new wxFlexGridSizer( 0, 3, 0, 0 );
	fgSizer3->AddGrowableCol( 0 );
	fgSizer3->SetFlexibleDirection( wxBOTH );
	fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_Filename = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer3->Add( m_Filename, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
	
	m_SelectFile = new wxButton( this, wxID_ANY, wxT("..."), wxDefaultPosition, wxSize( 50,-1 ), 0 );
	fgSizer3->Add( m_SelectFile, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
	
	m_Link = new wxCheckBox( this, wxID_ANY, wxT("Link"), wxDefaultPosition, wxDefaultSize, 0 );
	m_Link->SetValue(true); 
	fgSizer3->Add( m_Link, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
	
	fgSizer2->Add( fgSizer3, 0, wxEXPAND, 5 );
	
	m_UploadBox->Add( fgSizer2, 0, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer6;
	bSizer6 = new wxBoxSizer( wxHORIZONTAL );
	
	m_bmpUpload = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
	bSizer6->Add( m_bmpUpload, 0, wxALL, 5 );
	
	m_Add = new wxButton( this, wxID_ANY, wxT("Add"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer6->Add( m_Add, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_labUploadState = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	m_labUploadState->Wrap( -1 );
	bSizer6->Add( m_labUploadState, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_UploadBox->Add( bSizer6, 0, wxEXPAND, 5 );
	
	bSizer3->Add( m_UploadBox, 0, wxEXPAND|wxALL, 5 );
	
	m_ResultBox = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Result") ), wxVERTICAL );
	
	m_Stubs = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL );
	m_Stubs->SetMinSize( wxSize( 600,200 ) );
	
	m_ResultBox->Add( m_Stubs, 1, wxEXPAND, 5 );
	
	m_ShowPath = new wxCheckBox( this, wxID_ANY, wxT("Show path"), wxDefaultPosition, wxDefaultSize, 0 );
	m_ResultBox->Add( m_ShowPath, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
	
	m_PreviewSizer = new wxBoxSizer( wxHORIZONTAL );
	
	wxFlexGridSizer* fgSizer4;
	fgSizer4 = new wxFlexGridSizer( 2, 2, 0, 0 );
	fgSizer4->AddGrowableCol( 1 );
	fgSizer4->AddGrowableRow( 1 );
	fgSizer4->SetFlexibleDirection( wxBOTH );
	fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_labResultText = new wxStaticText( this, wxID_ANY, wxT("Text"), wxDefaultPosition, wxDefaultSize, 0 );
	m_labResultText->Wrap( -1 );
	fgSizer4->Add( m_labResultText, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
	
	m_ResultText = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer4->Add( m_ResultText, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
	
	m_labResultNote = new wxStaticText( this, wxID_ANY, wxT("Note"), wxDefaultPosition, wxDefaultSize, 0 );
	m_labResultNote->Wrap( -1 );
	fgSizer4->Add( m_labResultNote, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
	
	m_ResultNote = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
	m_ResultNote->SetMinSize( wxSize( -1,50 ) );
	
	fgSizer4->Add( m_ResultNote, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_PreviewSizer->Add( fgSizer4, 1, wxEXPAND, 5 );
	
	m_Preview = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 );
	m_Preview->SetMinSize( wxSize( -1,100 ) );
	
	m_PreviewSizer->Add( m_Preview, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_ResultBox->Add( m_PreviewSizer, 0, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer2;
	bSizer2 = new wxBoxSizer( wxHORIZONTAL );
	
	m_bmpOpen = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
	bSizer2->Add( m_bmpOpen, 0, wxALL, 5 );
	
	m_Open = new wxButton( this, wxID_ANY, wxT("Open"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer2->Add( m_Open, 0, wxALL, 5 );
	
	m_Modify = new wxButton( this, wxID_ANY, wxT("Modify"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer2->Add( m_Modify, 0, wxALL, 5 );
	
	m_Delete = new wxButton( this, wxID_ANY, wxT("Delete"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer2->Add( m_Delete, 0, wxALL, 5 );
	
	m_labDownloadState = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	m_labDownloadState->Wrap( -1 );
	bSizer2->Add( m_labDownloadState, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_ResultBox->Add( bSizer2, 0, wxEXPAND, 5 );
	
	bSizer3->Add( m_ResultBox, 1, wxEXPAND|wxALL, 5 );
	
	m_StdButtons = new wxStdDialogButtonSizer();
	m_StdButtonsOK = new wxButton( this, wxID_OK );
	m_StdButtons->AddButton( m_StdButtonsOK );
	m_StdButtonsHelp = new wxButton( this, wxID_HELP );
	m_StdButtons->AddButton( m_StdButtonsHelp );
	m_StdButtons->Realize();
	bSizer3->Add( m_StdButtons, 0, wxEXPAND|wxALL|wxALIGN_RIGHT, 5 );
	
	this->SetSizer( bSizer3 );
	this->Layout();
	bSizer3->Fit( this );
	
	this->Centre( wxBOTH );
	
	// Connect Events
	this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( AboxDlgGen::onClose ) );
	m_bmpFind->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( AboxDlgGen::onBmpFind ), NULL, this );
	m_Find->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboxDlgGen::onFind ), NULL, this );
	m_FindText->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( AboxDlgGen::onFindTextEnter ), NULL, this );
	m_FromDate->Connect( wxEVT_DATE_CHANGED, wxDateEventHandler( AboxDlgGen::onFromDate ), NULL, this );
	m_ToDate->Connect( wxEVT_DATE_CHANGED, wxDateEventHandler( AboxDlgGen::onToDate ), NULL, this );
	m_SelectFile->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboxDlgGen::onSelectFile ), NULL, this );
	m_bmpUpload->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( AboxDlgGen::onBmpAdd ), NULL, this );
	m_Add->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboxDlgGen::onAdd ), NULL, this );
	m_Stubs->Connect( wxEVT_COMMAND_LIST_COL_CLICK, wxListEventHandler( AboxDlgGen::onStubCol ), NULL, this );
	m_Stubs->Connect( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler( AboxDlgGen::onStubActivated ), NULL, this );
	m_Stubs->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AboxDlgGen::onStubSelected ), NULL, this );
	m_ShowPath->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( AboxDlgGen::onShowPath ), NULL, this );
	m_Preview->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( AboxDlgGen::onOpenPreview ), NULL, this );
	m_bmpOpen->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( AboxDlgGen::onBmpOpen ), NULL, this );
	m_Open->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboxDlgGen::onOpen ), NULL, this );
	m_Modify->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboxDlgGen::onModify ), NULL, this );
	m_Delete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboxDlgGen::onDelete ), NULL, this );
	m_StdButtonsHelp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboxDlgGen::onHelp ), NULL, this );
	m_StdButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboxDlgGen::onOK ), NULL, this );
}
otcurrentUIDialogBase::otcurrentUIDialogBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
	
	wxBoxSizer* bSizerMain;
	bSizerMain = new wxBoxSizer( wxVERTICAL );
	
	wxStaticBoxSizer* sbSizerDateTime;
	sbSizerDateTime = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Date/Time") ), wxHORIZONTAL );
	
	m_staticTextDatetime = new wxStaticText( sbSizerDateTime->GetStaticBox(), wxID_ANY, _("Day"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticTextDatetime->Wrap( -1 );
	sbSizerDateTime->Add( m_staticTextDatetime, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	m_datePickerDate = new wxDatePickerCtrl( sbSizerDateTime->GetStaticBox(), wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DEFAULT );
	sbSizerDateTime->Add( m_datePickerDate, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	m_timePickerTime = new wxTimePickerCtrl( sbSizerDateTime->GetStaticBox(), wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, 0 );
	sbSizerDateTime->Add( m_timePickerTime, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	
	sbSizerDateTime->Add( 0, 0, 1, wxEXPAND, 5 );
	
	m_stTimeZone = new wxStaticText( sbSizerDateTime->GetStaticBox(), wxID_ANY, _("(UTC)"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
	m_stTimeZone->Wrap( -1 );
	m_stTimeZone->SetFont( wxFont( 12, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxT("Arial") ) );
	
	sbSizerDateTime->Add( m_stTimeZone, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
	
	m_bpNow = new wxBitmapButton( sbSizerDateTime->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
	m_bpNow->SetToolTip( _("Now") );
	m_bpNow->SetMinSize( wxSize( 45,45 ) );
	
	sbSizerDateTime->Add( m_bpNow, 0, wxALIGN_CENTER|wxALL|wxEXPAND, 5 );
	
	
	bSizerMain->Add( sbSizerDateTime, 0, wxEXPAND, 5 );
	
	wxStaticBoxSizer* sbSizerFolder;
	sbSizerFolder = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Tidal Data Folder") ), wxVERTICAL );
	
	m_dirPicker1 = new wxDirPickerCtrl( sbSizerFolder->GetStaticBox(), wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_CHANGE_DIR|wxDIRP_USE_TEXTCTRL );
	sbSizerFolder->Add( m_dirPicker1, 0, wxALL|wxEXPAND, 5 );
	
	
	bSizerMain->Add( sbSizerFolder, 0, wxEXPAND, 5 );
	
	wxStaticBoxSizer* sbSizerControls;
	sbSizerControls = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Step (Minutes)") ), wxHORIZONTAL );
	
	wxString m_choice1Choices[] = { _("60"), _("30"), _("15") };
	int m_choice1NChoices = sizeof( m_choice1Choices ) / sizeof( wxString );
	m_choice1 = new wxChoice( sbSizerControls->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choice1NChoices, m_choice1Choices, 0 );
	m_choice1->SetSelection( 0 );
	sbSizerControls->Add( m_choice1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	
	sbSizerControls->Add( 5, 0, 1, wxEXPAND, 5 );
	
	m_button1 = new wxButton( sbSizerControls->GetStaticBox(), wxID_ANY, _("Help"), wxDefaultPosition, wxDefaultSize, 0 );
	sbSizerControls->Add( m_button1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	m_bpPrev = new wxBitmapButton( sbSizerControls->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW );
	m_bpPrev->SetToolTip( _("Previous") );
	m_bpPrev->SetMinSize( wxSize( 40,40 ) );
	
	sbSizerControls->Add( m_bpPrev, 0, wxALL|wxEXPAND, 5 );
	
	m_bpNext = new wxBitmapButton( sbSizerControls->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW );
	m_bpNext->SetToolTip( _("Next") );
	m_bpNext->SetMinSize( wxSize( 40,40 ) );
	
	sbSizerControls->Add( m_bpNext, 0, wxALL|wxEXPAND, 5 );
	
	
	bSizerMain->Add( sbSizerControls, 0, wxEXPAND, 5 );
	
	
	this->SetSizer( bSizerMain );
	this->Layout();
	bSizerMain->Fit( this );
	
	this->Centre( wxBOTH );
	
	// Connect Events
	this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( otcurrentUIDialogBase::OnClose ) );
	this->Connect( wxEVT_SIZE, wxSizeEventHandler( otcurrentUIDialogBase::OnSize ) );
	m_datePickerDate->Connect( wxEVT_DATE_CHANGED, wxDateEventHandler( otcurrentUIDialogBase::OnDateTimeChanged ), NULL, this );
	m_bpNow->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( otcurrentUIDialogBase::OnNow ), NULL, this );
	m_dirPicker1->Connect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( otcurrentUIDialogBase::OnFolderSelChanged ), NULL, this );
	m_button1->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( otcurrentUIDialogBase::About ), NULL, this );
	m_bpPrev->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( otcurrentUIDialogBase::OnPrev ), NULL, this );
	m_bpNext->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( otcurrentUIDialogBase::OnNext ), NULL, this );
}
Example #7
0
MainFrameBase::MainFrameBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
	
	wxBoxSizer* MainSizer;
	MainSizer = new wxBoxSizer( wxHORIZONTAL );
	
	SidePanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxTAB_TRAVERSAL );
	wxBoxSizer* SidePanelSizer;
	SidePanelSizer = new wxBoxSizer( wxVERTICAL );
	
	CalendarCtrl = new wxCalendarCtrl( SidePanel, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxSize( -1,-1 ), 0|wxSTATIC_BORDER );
	SidePanelSizer->Add( CalendarCtrl, 0, wxEXPAND|wxALL, 10 );
	
	wxBoxSizer* ShowSizer;
	ShowSizer = new wxBoxSizer( wxHORIZONTAL );
	
	ShowLabel = new wxStaticText( SidePanel, wxID_ANY, _("Show:"), wxDefaultPosition, wxDefaultSize, 0 );
	ShowLabel->Wrap( -1 );
	ShowSizer->Add( ShowLabel, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	wxString ShowChoiceChoices[] = { _("All events"), _("Today's events"), _("Upcoming week"), _("Specific period") };
	int ShowChoiceNChoices = sizeof( ShowChoiceChoices ) / sizeof( wxString );
	ShowChoice = new wxChoice( SidePanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, ShowChoiceNChoices, ShowChoiceChoices, 0 );
	ShowChoice->SetSelection( 1 );
	ShowSizer->Add( ShowChoice, 1, wxEXPAND|wxLEFT, 8 );
	
	SidePanelSizer->Add( ShowSizer, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 );
	
	PeriodPanel = new wxPanel( SidePanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* PeriodPanelSizer;
	PeriodPanelSizer = new wxBoxSizer( wxVERTICAL );
	
	m_staticline1 = new wxStaticLine( PeriodPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
	PeriodPanelSizer->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxBOTTOM, 10 );
	
	wxFlexGridSizer* PeriodSizer;
	PeriodSizer = new wxFlexGridSizer( 2, 2, 10, 5 );
	PeriodSizer->AddGrowableCol( 1 );
	PeriodSizer->SetFlexibleDirection( wxBOTH );
	PeriodSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	FromLabel = new wxStaticText( PeriodPanel, wxID_ANY, _("From:"), wxDefaultPosition, wxDefaultSize, 0 );
	FromLabel->Wrap( -1 );
	PeriodSizer->Add( FromLabel, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	FromDatePicker = new wxDatePickerCtrl( PeriodPanel, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DROPDOWN );
	PeriodSizer->Add( FromDatePicker, 0, wxEXPAND, 5 );
	
	ToLabel = new wxStaticText( PeriodPanel, wxID_ANY, _("To:"), wxDefaultPosition, wxDefaultSize, 0 );
	ToLabel->Wrap( -1 );
	PeriodSizer->Add( ToLabel, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	ToDatePicker = new wxDatePickerCtrl( PeriodPanel, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DROPDOWN );
	PeriodSizer->Add( ToDatePicker, 0, wxEXPAND, 5 );
	
	PeriodPanelSizer->Add( PeriodSizer, 1, wxEXPAND, 5 );
	
	PeriodPanel->SetSizer( PeriodPanelSizer );
	PeriodPanel->Layout();
	PeriodPanelSizer->Fit( PeriodPanel );
	SidePanelSizer->Add( PeriodPanel, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 );
	
	
	SidePanelSizer->Add( 0, 0, 1, wxEXPAND, 5 );
	
	wxBoxSizer* QueryPanel;
	QueryPanel = new wxBoxSizer( wxVERTICAL );
	
	CategoriesLabel = new wxStaticText( SidePanel, wxID_ANY, _("Categories contain:"), wxDefaultPosition, wxDefaultSize, 0 );
	CategoriesLabel->Wrap( -1 );
	QueryPanel->Add( CategoriesLabel, 0, wxTOP|wxBOTTOM, 5 );
	
	CategoriesText = new wxTextCtrl( SidePanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	QueryPanel->Add( CategoriesText, 0, wxEXPAND, 5 );
	
	SummaryLabel = new wxStaticText( SidePanel, wxID_ANY, _("Summary contains:"), wxDefaultPosition, wxDefaultSize, 0 );
	SummaryLabel->Wrap( -1 );
	QueryPanel->Add( SummaryLabel, 0, wxTOP|wxBOTTOM, 5 );
	
	SearchText = new wxTextCtrl( SidePanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), 0 );
	QueryPanel->Add( SearchText, 0, wxEXPAND, 10 );
	
	SidePanelSizer->Add( QueryPanel, 0, wxEXPAND|wxALL, 10 );
	
	SidePanel->SetSizer( SidePanelSizer );
	SidePanel->Layout();
	SidePanelSizer->Fit( SidePanel );
	MainSizer->Add( SidePanel, 0, wxEXPAND, 5 );
	
	EventsList = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT );
	MainSizer->Add( EventsList, 1, wxEXPAND, 5 );
	
	this->SetSizer( MainSizer );
	this->Layout();
	ToolBar = this->CreateToolBar( wxTB_FLAT|wxTB_HORIZONTAL|wxTB_HORZ_TEXT, wxID_ANY );
	ToolBar->SetToolBitmapSize( wxSize( 16,16 ) );
	ToolBar->AddTool( wxID_NEW, _("Add"), wxBitmap( wxT("icons/add.png"), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_NORMAL, _("Add Event"), wxEmptyString );
	ToolBar->AddTool( wxID_DELETE, _("Delete"), wxBitmap( wxT("icons/delete.png"), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_NORMAL, _("Delete Event"), wxEmptyString );
	ToolBar->AddTool( wxID_PROPERTIES, _("Edit"), wxBitmap( wxT("icons/edit.png"), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_NORMAL, _("Edit Event"), wxEmptyString );
	ToolBar->AddSeparator();
	ToolBar->AddTool( wxID_EXIT, _("Quit"), wxBitmap( wxT("icons/quit.png"), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_NORMAL, _("Quit program"), wxEmptyString );
	ToolBar->Realize();
	
	
	// Connect Events
	this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainFrameBase::Closed ) );
	CalendarCtrl->Connect( wxEVT_CALENDAR_SEL_CHANGED, wxCalendarEventHandler( MainFrameBase::CalendarCtrlChanged ), NULL, this );
	ShowChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainFrameBase::ShowChanged ), NULL, this );
	FromDatePicker->Connect( wxEVT_DATE_CHANGED, wxDateEventHandler( MainFrameBase::FromDateChanged ), NULL, this );
	ToDatePicker->Connect( wxEVT_DATE_CHANGED, wxDateEventHandler( MainFrameBase::ToDateChanged ), NULL, this );
	CategoriesText->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( MainFrameBase::QueryChanged ), NULL, this );
	SearchText->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( MainFrameBase::QueryChanged ), NULL, this );
	EventsList->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( MainFrameBase::ListDClick ), NULL, this );
	EventsList->Connect( wxEVT_COMMAND_LIST_COL_CLICK, wxListEventHandler( MainFrameBase::ColumnClicked ), NULL, this );
	EventsList->Connect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( MainFrameBase::EventsDeselected ), NULL, this );
	EventsList->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( MainFrameBase::EventsSelected ), NULL, this );
	EventsList->Connect( wxEVT_COMMAND_LIST_KEY_DOWN, wxListEventHandler( MainFrameBase::DeleteKeyDown ), NULL, this );
	this->Connect( wxID_NEW, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( MainFrameBase::NewClicked ) );
	this->Connect( wxID_DELETE, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( MainFrameBase::DeleteClicked ) );
	this->Connect( wxID_PROPERTIES, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( MainFrameBase::EditClicked ) );
	this->Connect( wxID_EXIT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( MainFrameBase::QuitClicked ) );
}