Skip to content

Commit

Permalink
- added 'Apply' button to the 'Build Order' dialog to allow manually …
Browse files Browse the repository at this point in the history
…saving changes when switching configurations

git-svn-id: https://codelite.svn.sourceforge.net/svnroot/codelite/trunk@1890 9da81c78-c036-0410-9e1f-a2b0375e4b5a
  • Loading branch information
eranif committed Jul 25, 2008
1 parent 7b0f484 commit 1ea4449
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 9 deletions.
14 changes: 14 additions & 0 deletions LiteEditor/LiteEditor.project
Original file line number Diff line number Diff line change
Expand Up @@ -503,4 +503,18 @@ resources.cpp: resources.xrc
<Project Name="Copyright"/>
<Project Name="UnitTestPP"/>
</Dependencies>
<Dependencies Name="WinReleaseUnicode">
<Project Name="wxscintilla"/>
<Project Name="sqlite3"/>
<Project Name="wxsqlite3"/>
<Project Name="CodeLite"/>
<Project Name="plugin_sdk"/>
<Project Name="CodeFormatter"/>
<Project Name="DebuggerGDB"/>
<Project Name="Subversion"/>
<Project Name="Gizmos"/>
<Project Name="Cscope"/>
<Project Name="Copyright"/>
<Project Name="UnitTestPP"/>
</Dependencies>
</CodeLite_Project>
27 changes: 22 additions & 5 deletions LiteEditor/buildorderbasepage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,24 @@ DependenciesPageBase::DependenciesPageBase( wxWindow* parent, wxWindowID id, con
wxBoxSizer* bSizer6;
bSizer6 = new wxBoxSizer( wxVERTICAL );

m_buttonUp = new wxButton( this, wxID_ANY, wxT("Up"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer6->Add( m_buttonUp, 0, wxALL, 5 );
wxBoxSizer* bSizer8;
bSizer8 = new wxBoxSizer( wxVERTICAL );

m_buttonDown = new wxButton( this, wxID_ANY, wxT("Down"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer6->Add( m_buttonDown, 0, wxALL, 5 );
bSizer8->Add( m_buttonDown, 0, wxALL, 5 );

m_buttonUp = new wxButton( this, wxID_ANY, wxT("Up"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer8->Add( m_buttonUp, 0, wxALL, 5 );

bSizer6->Add( bSizer8, 1, wxEXPAND, 5 );

wxBoxSizer* bSizer7;
bSizer7 = new wxBoxSizer( wxVERTICAL );

m_buttonApply = new wxButton( this, wxID_ANY, wxT("Apply"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer7->Add( m_buttonApply, 0, wxALL, 5 );

bSizer6->Add( bSizer7, 0, 0, 5 );

bSizer11->Add( bSizer6, 0, wxEXPAND, 5 );

Expand All @@ -92,15 +105,19 @@ DependenciesPageBase::DependenciesPageBase( wxWindow* parent, wxWindowID id, con
// Connect Events
m_choiceProjectConfig->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DependenciesPageBase::OnConfigChanged ), NULL, this );
m_checkListProjectList->Connect( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEventHandler( DependenciesPageBase::OnCheckListItemToggled ), NULL, this );
m_buttonUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DependenciesPageBase::OnMoveUp ), NULL, this );
m_buttonDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DependenciesPageBase::OnMoveDown ), NULL, this );
m_buttonUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DependenciesPageBase::OnMoveUp ), NULL, this );
m_buttonApply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DependenciesPageBase::OnApplyButton ), NULL, this );
m_buttonApply->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DependenciesPageBase::OnApplyButtonUI ), NULL, this );
}

DependenciesPageBase::~DependenciesPageBase()
{
// Disconnect Events
m_choiceProjectConfig->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DependenciesPageBase::OnConfigChanged ), NULL, this );
m_checkListProjectList->Disconnect( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEventHandler( DependenciesPageBase::OnCheckListItemToggled ), NULL, this );
m_buttonUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DependenciesPageBase::OnMoveUp ), NULL, this );
m_buttonDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DependenciesPageBase::OnMoveDown ), NULL, this );
m_buttonUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DependenciesPageBase::OnMoveUp ), NULL, this );
m_buttonApply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DependenciesPageBase::OnApplyButton ), NULL, this );
m_buttonApply->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DependenciesPageBase::OnApplyButtonUI ), NULL, this );
}
7 changes: 5 additions & 2 deletions LiteEditor/buildorderbasepage.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,17 @@ class DependenciesPageBase : public wxPanel
wxCheckListBox* m_checkListProjectList;
wxStaticText* m_staticText2;
wxListBox* m_listBoxBuildOrder;
wxButton* m_buttonUp;
wxButton* m_buttonDown;
wxButton* m_buttonUp;
wxButton* m_buttonApply;

// Virtual event handlers, overide them in your derived class
virtual void OnConfigChanged( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCheckListItemToggled( wxCommandEvent& event ){ event.Skip(); }
virtual void OnMoveUp( wxCommandEvent& event ){ event.Skip(); }
virtual void OnMoveDown( wxCommandEvent& event ){ event.Skip(); }
virtual void OnMoveUp( wxCommandEvent& event ){ event.Skip(); }
virtual void OnApplyButton( wxCommandEvent& event ){ event.Skip(); }
virtual void OnApplyButtonUI( wxUpdateUIEvent& event ){ event.Skip(); }


public:
Expand Down
14 changes: 13 additions & 1 deletion LiteEditor/depend_dlg_page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,16 @@ void DependenciesPage::DoPopulateControl(const wxString& configuration)
}
}

}
}

void DependenciesPage::OnApplyButton(wxCommandEvent& event)
{
wxUnusedVar(event);
Save();
}

void DependenciesPage::OnApplyButtonUI(wxUpdateUIEvent& event)
{
event.Enable(m_dirty);
}

4 changes: 3 additions & 1 deletion LiteEditor/depend_dlg_page.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ class DependenciesPage : public DependenciesPageBase
void OnCheckListItemToggled( wxCommandEvent& event );
void OnMoveUp( wxCommandEvent& event );
void OnMoveDown( wxCommandEvent& event );

void OnApplyButton(wxCommandEvent &event);
void OnApplyButtonUI(wxUpdateUIEvent &event);

protected:
void Init();
void OnUpCommand(wxListBox *list);
Expand Down

0 comments on commit 1ea4449

Please sign in to comment.