From a9c86ca6f6b650d441be82a338c860f2f5633966 Mon Sep 17 00:00:00 2001 From: Aleksey Lobanov Date: Tue, 16 Jun 2015 23:12:10 +0300 Subject: [PATCH] Changed GUI from wxGlade-generated to wxFormBuilder-generated wxGlade project deleted. Added wxFormBuilder project. Sources also changed --- CrossGen.wxg | 101 ------- wxCrossGen/FormBuilderGUI.fbp | 531 ++++++++++++++++++++++++++++++++++ wxCrossGen/fbgui/fbgui.cpp | 100 +++++++ wxCrossGen/fbgui/fbgui.h | 64 ++++ wxCrossGen/main.cpp | 63 +--- wxCrossGen/wxCrossGen.mk | 10 +- wxCrossGen/wxCrossGen.project | 4 + wxCrossGen/wxCrossGen.txt | 2 +- wxCrossGen/wxgui.hpp | 48 ++- 9 files changed, 736 insertions(+), 187 deletions(-) delete mode 100644 CrossGen.wxg create mode 100644 wxCrossGen/FormBuilderGUI.fbp create mode 100644 wxCrossGen/fbgui/fbgui.cpp create mode 100644 wxCrossGen/fbgui/fbgui.h diff --git a/CrossGen.wxg b/CrossGen.wxg deleted file mode 100644 index 935586f..0000000 --- a/CrossGen.wxg +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - Генератор кроссвордов - - wxSize(220,180) - - 433, 401 - - wxVERTICAL - - wxEXPAND - 0 - - - wxHORIZONTAL - - wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL - 0 - - - 1 - - - - - 0 - - - - - - 0 - - - - - wxID_PATH - - OnbtnPathClick - - - - - - - wxEXPAND - 0 - - - wxHORIZONTAL - - wxEXPAND - 0 - - - - - - - 0 - - - 0 - - - - - - wxEXPAND - 0 - - - wxHORIZONTAL - - 0 - - - 0 - 0 - - - - 0 - - - - wxID_GENERATE - - OnbtnGenerateClick - - - - - - - - diff --git a/wxCrossGen/FormBuilderGUI.fbp b/wxCrossGen/FormBuilderGUI.fbp new file mode 100644 index 0000000..174bf4f --- /dev/null +++ b/wxCrossGen/FormBuilderGUI.fbp @@ -0,0 +1,531 @@ + + + + + + C++ + 1 + UTF-8 + connect + impl_virtual + fbgui + 1000 + none + 1 + wxCrossGen + + fbgui + + 1 + 0 + 0 + + + + + 1 + + + + 0 + wxID_ANY + + 600,340 + VMainFrame + + 700,500 + wxDEFAULT_FRAME_STYLE + + CrossGen + + + wxFILTER_NONE + wxDefaultValidator + + + + wxTAB_TRAVERSAL + 1 + + + + onExitClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + 0 + wxID_ANY + MyMenuBar + + + mMenu + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + File + miFile + protected + + + 0 + 1 + + wxID_OPEN + wxITEM_NORMAL + &Open grid + miOpenGrid + none + Ctrl+O + + onOpenGridClick + + + + + 0 + 1 + + wxID_ANY + wxITEM_NORMAL + &Generate + miGenerate + none + + + onGenerateClick + + + + + 0 + 1 + + wxID_EXIT + wxITEM_NORMAL + E&xit + miExit + none + Ctrl+Q + + onExitClick + + + + + Help + miHelp + protected + + + 0 + 1 + + wxID_ABOUT + wxITEM_NORMAL + &About + miAbout + none + + + onAboutClick + + + + + + + bSizer2 + wxVERTICAL + none + + 5 + wxEXPAND + 0 + + + bSizer4 + wxHORIZONTAL + none + + 5 + wxEXPAND|wxLEFT|wxTOP + 1 + + + + 1 + + + 0 + wxID_ANY + + 0 + + tPath + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 0 + 1 + + + 0 + wxID_ANY + ... + + + bPath + protected + + + wxBU_EXACTFIT + + + + wxFILTER_NONE + wxDefaultValidator + + + + + onOpenGridClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + + bSizer3 + wxHORIZONTAL + none + + 5 + wxALL|wxEXPAND + 1 + + + + 1 + + + 0 + wxID_ANY + + 0 + + tOutput + protected + + + wxTE_MULTILINE|wxTE_READONLY|wxTE_WORDWRAP + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + + 1 + + + 0 + wxID_ANY + + + bPreview + protected + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + + bSizer5 + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxBOTTOM|wxRIGHT + 0 + + + + 0 + 1 + + + 0 + wxID_ANY + Generate + + + bGenerate + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + onGenerateClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wxCrossGen/fbgui/fbgui.cpp b/wxCrossGen/fbgui/fbgui.cpp new file mode 100644 index 0000000..f074469 --- /dev/null +++ b/wxCrossGen/fbgui/fbgui.cpp @@ -0,0 +1,100 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Jan 29 2014) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "fbgui.h" + +/////////////////////////////////////////////////////////////////////////// + +VMainFrame::VMainFrame( 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( 600,340 ), wxDefaultSize ); + + mMenu = new wxMenuBar( 0 ); + miFile = new wxMenu(); + wxMenuItem* miOpenGrid; + miOpenGrid = new wxMenuItem( miFile, wxID_OPEN, wxString( _("&Open grid") ) + wxT('\t') + wxT("Ctrl+O"), wxEmptyString, wxITEM_NORMAL ); + miFile->Append( miOpenGrid ); + + wxMenuItem* miGenerate; + miGenerate = new wxMenuItem( miFile, wxID_ANY, wxString( _("&Generate") ) , wxEmptyString, wxITEM_NORMAL ); + miFile->Append( miGenerate ); + + wxMenuItem* miExit; + miExit = new wxMenuItem( miFile, wxID_EXIT, wxString( _("E&xit") ) + wxT('\t') + wxT("Ctrl+Q"), wxEmptyString, wxITEM_NORMAL ); + miFile->Append( miExit ); + + mMenu->Append( miFile, _("File") ); + + miHelp = new wxMenu(); + wxMenuItem* miAbout; + miAbout = new wxMenuItem( miHelp, wxID_ABOUT, wxString( _("&About") ) , wxEmptyString, wxITEM_NORMAL ); + miHelp->Append( miAbout ); + + mMenu->Append( miHelp, _("Help") ); + + this->SetMenuBar( mMenu ); + + wxBoxSizer* bSizer2; + bSizer2 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer4; + bSizer4 = new wxBoxSizer( wxHORIZONTAL ); + + tPath = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer4->Add( tPath, 1, wxEXPAND|wxLEFT|wxTOP, 5 ); + + bPath = new wxButton( this, wxID_ANY, _("..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT ); + bSizer4->Add( bPath, 0, wxALL, 5 ); + + bSizer2->Add( bSizer4, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer3; + bSizer3 = new wxBoxSizer( wxHORIZONTAL ); + + tOutput = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_WORDWRAP ); + bSizer3->Add( tOutput, 1, wxALL|wxEXPAND, 5 ); + + bPreview = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer3->Add( bPreview, 0, wxALL, 5 ); + + bSizer2->Add( bSizer3, 1, wxEXPAND, 5 ); + + wxBoxSizer* bSizer5; + bSizer5 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer5->Add( 0, 0, 1, wxEXPAND, 5 ); + + bGenerate = new wxButton( this, wxID_ANY, _("Generate"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer5->Add( bGenerate, 0, wxBOTTOM|wxRIGHT, 5 ); + + bSizer2->Add( bSizer5, 0, wxEXPAND, 5 ); + + this->SetSizer( bSizer2 ); + this->Layout(); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( VMainFrame::onExitClick ) ); + this->Connect( miOpenGrid->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onOpenGridClick ) ); + this->Connect( miGenerate->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onGenerateClick ) ); + this->Connect( miExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onExitClick ) ); + this->Connect( miAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onAboutClick ) ); + bPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( VMainFrame::onOpenGridClick ), NULL, this ); + bGenerate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( VMainFrame::onGenerateClick ), NULL, this ); +} + +VMainFrame::~VMainFrame() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( VMainFrame::onExitClick ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onOpenGridClick ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onGenerateClick ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onExitClick ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onAboutClick ) ); + bPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( VMainFrame::onOpenGridClick ), NULL, this ); + bGenerate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( VMainFrame::onGenerateClick ), NULL, this ); +} diff --git a/wxCrossGen/fbgui/fbgui.h b/wxCrossGen/fbgui/fbgui.h new file mode 100644 index 0000000..6bcb6ee --- /dev/null +++ b/wxCrossGen/fbgui/fbgui.h @@ -0,0 +1,64 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Jan 29 2014) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __fbgui__ +#define __fbgui__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +/// Class VMainFrame +/////////////////////////////////////////////////////////////////////////////// +class VMainFrame : public wxFrame +{ + private: + + protected: + wxMenuBar* mMenu; + wxMenu* miFile; + wxMenu* miHelp; + wxTextCtrl* tPath; + wxButton* bPath; + wxTextCtrl* tOutput; + wxStaticBitmap* bPreview; + + wxButton* bGenerate; + + // Virtual event handlers, overide them in your derived class + virtual void onExitClick( wxCloseEvent& event ) { event.Skip(); } + virtual void onOpenGridClick( wxCommandEvent& event ) { event.Skip(); } + virtual void onGenerateClick( wxCommandEvent& event ) { event.Skip(); } + virtual void onExitClick( wxCommandEvent& event ) { event.Skip(); } + virtual void onAboutClick( wxCommandEvent& event ) { event.Skip(); } + + + public: + + VMainFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("CrossGen"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 700,500 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); + ~VMainFrame(); + +}; + +#endif //__fbgui__ diff --git a/wxCrossGen/main.cpp b/wxCrossGen/main.cpp index 174c00b..171e61a 100644 --- a/wxCrossGen/main.cpp +++ b/wxCrossGen/main.cpp @@ -12,63 +12,10 @@ #include "crossgen.hpp" #include "crossexport.hpp" -#define wxID_PATH 1079 -#define wxID_GENERATE 1080 -MainFrame::MainFrame(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): - wxFrame(parent, id, title, pos, size, wxDEFAULT_FRAME_STYLE) -{ - // begin wxGlade: MainFrame::MainFrame - label_1 = new wxStaticText(this, wxID_ANY, _("Путь к сетке:")); - tPath = new wxTextCtrl(this, wxID_ANY, wxEmptyString); - btnPath = new wxButton(this, wxID_PATH, _("..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); - tOutput = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_WORDWRAP); - btnGenerate = new wxButton(this, wxID_GENERATE, _("Генерировать кроссворд")); - - set_properties(); - do_layout(); - - _isDictLoaded = false; - srand(time(NULL)); -} - - -void MainFrame::set_properties() { - SetTitle(_("Генератор кроссвордов")); - SetSize(wxSize(700, 500)); - SetMinSize(wxSize(600,340)); -} - - -void MainFrame::do_layout() { - wxBoxSizer* sizer_1 = new wxBoxSizer(wxVERTICAL); - wxBoxSizer* sizer_4 = new wxBoxSizer(wxHORIZONTAL); - wxBoxSizer* sizer_3 = new wxBoxSizer(wxHORIZONTAL); - wxBoxSizer* sizer_2 = new wxBoxSizer(wxHORIZONTAL); - sizer_2->Add(label_1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0); - sizer_2->Add(tPath, 1, 0, 0); - sizer_2->Add(btnPath, 0, 0, 0); - sizer_1->Add(sizer_2, 0, wxEXPAND, 0); - sizer_3->Add(tOutput, 1, wxEXPAND, 0); - bPreview = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap); - sizer_3->Add(bPreview, 0, 0, 0); - sizer_1->Add(sizer_3, 1, wxEXPAND, 0); - sizer_4->Add(0, 0, 1, 0, 0); - sizer_4->Add(btnGenerate, 0, 0, 0); - sizer_1->Add(sizer_4, 0, wxEXPAND, 0); - SetSizer(sizer_1); - Layout(); -} - - -BEGIN_EVENT_TABLE(MainFrame, wxFrame) - EVT_BUTTON(wxID_PATH, MainFrame::OnbtnPathClick) - EVT_BUTTON(wxID_GENERATE, MainFrame::OnbtnGenerateClick) -END_EVENT_TABLE(); - -void MainFrame::OnbtnPathClick(wxCommandEvent &event) { - wxFileDialog dlgOpen(this, wxT("Открыть файл кроссворда"), wxEmptyString, wxEmptyString, - wxT("Файлы кроссворда (*.cross)|*.cross"), wxFD_OPEN|wxFD_FILE_MUST_EXIST); +void MainFrame::onOpenGridClick(wxCommandEvent &event) { + wxFileDialog dlgOpen(this, _("Open crossword file"), wxEmptyString, wxEmptyString, + wxT("Files of crossword (*.cross)|*.cross"), wxFD_OPEN|wxFD_FILE_MUST_EXIST); if ( dlgOpen.ShowModal() == wxID_CANCEL ) return; @@ -156,7 +103,7 @@ void MainFrame::SetGridImage(GridType &grid, size_t w) { this->Refresh(); } -void MainFrame::OnbtnGenerateClick(wxCommandEvent &event) { +void MainFrame::onGenerateClick(wxCommandEvent &event) { if ( !_isDictLoaded ) { readDict(wxT("big_cross_ru.txt"), _dict); generateAllWords(_dict, _allWords, _transType); @@ -227,7 +174,7 @@ bool MyApp::OnInit() m_locale.AddCatalog(wxT(APP_CATALOG)); wxInitAllImageHandlers(); - MainFrame* fMain = new MainFrame(NULL, wxID_ANY, wxEmptyString); + MainFrame* fMain = new MainFrame(NULL); SetTopWindow(fMain); fMain->Show(); return true; diff --git a/wxCrossGen/wxCrossGen.mk b/wxCrossGen/wxCrossGen.mk index d984fe9..ce190f5 100644 --- a/wxCrossGen/wxCrossGen.mk +++ b/wxCrossGen/wxCrossGen.mk @@ -60,7 +60,7 @@ AS := /usr/bin/as ## User defined environment variables ## CodeLiteDir:=/usr/share/codelite -Objects0=$(IntermediateDirectory)/main.cpp$(ObjectSuffix) +Objects0=$(IntermediateDirectory)/main.cpp$(ObjectSuffix) $(IntermediateDirectory)/fbgui_fbgui.cpp$(ObjectSuffix) @@ -95,6 +95,14 @@ $(IntermediateDirectory)/main.cpp$(DependSuffix): main.cpp $(IntermediateDirectory)/main.cpp$(PreprocessSuffix): main.cpp @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/main.cpp$(PreprocessSuffix) "main.cpp" +$(IntermediateDirectory)/fbgui_fbgui.cpp$(ObjectSuffix): fbgui/fbgui.cpp $(IntermediateDirectory)/fbgui_fbgui.cpp$(DependSuffix) + $(CXX) $(IncludePCH) $(SourceSwitch) "/data/Sync/SyncProjects/CrossGen/wxCrossGen/fbgui/fbgui.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/fbgui_fbgui.cpp$(ObjectSuffix) $(IncludePath) +$(IntermediateDirectory)/fbgui_fbgui.cpp$(DependSuffix): fbgui/fbgui.cpp + @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/fbgui_fbgui.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/fbgui_fbgui.cpp$(DependSuffix) -MM "fbgui/fbgui.cpp" + +$(IntermediateDirectory)/fbgui_fbgui.cpp$(PreprocessSuffix): fbgui/fbgui.cpp + @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/fbgui_fbgui.cpp$(PreprocessSuffix) "fbgui/fbgui.cpp" + -include $(IntermediateDirectory)/*$(DependSuffix) ## diff --git a/wxCrossGen/wxCrossGen.project b/wxCrossGen/wxCrossGen.project index cc23c68..924e985 100644 --- a/wxCrossGen/wxCrossGen.project +++ b/wxCrossGen/wxCrossGen.project @@ -120,4 +120,8 @@ + + + + diff --git a/wxCrossGen/wxCrossGen.txt b/wxCrossGen/wxCrossGen.txt index b7e8d8a..a51634d 100644 --- a/wxCrossGen/wxCrossGen.txt +++ b/wxCrossGen/wxCrossGen.txt @@ -1 +1 @@ -../Release/main.cpp.o +../Release/main.cpp.o ../Release/fbgui_fbgui.cpp.o diff --git a/wxCrossGen/wxgui.hpp b/wxCrossGen/wxgui.hpp index e76de51..2b03203 100644 --- a/wxCrossGen/wxgui.hpp +++ b/wxCrossGen/wxgui.hpp @@ -3,6 +3,7 @@ #ifndef WXGUI_HPP #define WXGUI_HPP +#include #include #include #include @@ -10,46 +11,41 @@ #include "crossgen.hpp" +#include "fbgui/fbgui.h" + #ifndef APP_CATALOG #define APP_CATALOG "app" // replace with the appropriate catalog name #endif -class MainFrame: public wxFrame { -public: - // begin wxGlade: MainFrame::ids - // end wxGlade - - MainFrame(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE); - -private: - // begin wxGlade: MainFrame::methods - void set_properties(); - void do_layout(); - // end wxGlade - +class MainFrame: public VMainFrame { protected: std::vector _words; DictType _dict; bool _isDictLoaded; AllWordsType _allWords; CharsTransType _transType; - // begin wxGlade: MainFrame::attributes - wxStaticText* label_1; - wxTextCtrl* tPath; - wxButton* btnPath; - wxTextCtrl* tOutput; - wxButton* btnGenerate; - wxStaticBitmap* bPreview; - // end wxGlade - - DECLARE_EVENT_TABLE(); public: - virtual void OnbtnPathClick(wxCommandEvent &event); - virtual void OnbtnGenerateClick(wxCommandEvent &event); void SetGridImage(GridType &grid, size_t w=400); -}; // wxGlade: end class + MainFrame( + wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxString& title = _("CrossGen"), + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxSize( 700,500 ), + long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ) + : VMainFrame(parent){ + + _isDictLoaded = false; + srand(time(NULL)); + } + virtual void onExitClick( wxCloseEvent& event ) { event.Skip(); } + virtual void onOpenGridClick( wxCommandEvent& event ); + virtual void onGenerateClick( wxCommandEvent& event ); + virtual void onExitClick( wxCommandEvent& event ) { event.Skip(); } + virtual void onAboutClick( wxCommandEvent& event ) { event.Skip(); } +}; #endif // WXGUI_HPP