forked from GrandOrgue/grandorgue
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed displaying long file paths in the Paths and Reverb tabs of the …
…settings dialog GrandOrgue#1663
- Loading branch information
Showing
7 changed files
with
137 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright 2006 Milan Digital Audio LLC | ||
* Copyright 2009-2024 GrandOrgue contributors (see AUTHORS) | ||
* License GPL-2.0 or later | ||
* (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html). | ||
*/ | ||
|
||
#ifndef GODIRPICKERCTRL_H | ||
#define GODIRPICKERCTRL_H | ||
|
||
#include <wx/filepicker.h> | ||
|
||
#include "GORightVisiblePicker.h" | ||
|
||
class GODirPickerCtrl : public wxDirPickerCtrl, private GORightVisiblePicker { | ||
public: | ||
GODirPickerCtrl( | ||
wxWindow *parent, | ||
wxWindowID id, | ||
const wxString &title, | ||
const wxPoint &pos = wxDefaultPosition, | ||
const wxSize &size = wxDefaultSize, | ||
long style = 0) | ||
: wxDirPickerCtrl(parent, id, wxEmptyString, title, pos, size, style), | ||
GORightVisiblePicker(this) {} | ||
|
||
OVERRIDE_UPDATE_TEXTCTRL(wxDirPickerCtrl) | ||
}; | ||
|
||
#endif /* GODIRPICKERCTRL_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright 2006 Milan Digital Audio LLC | ||
* Copyright 2009-2024 GrandOrgue contributors (see AUTHORS) | ||
* License GPL-2.0 or later | ||
* (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html). | ||
*/ | ||
|
||
#ifndef GOFILEPICKERCTRL_H | ||
#define GOFILEPICKERCTRL_H | ||
|
||
#include <wx/filepicker.h> | ||
|
||
#include "GORightVisiblePicker.h" | ||
|
||
class GOFilePickerCtrl : public wxFilePickerCtrl, private GORightVisiblePicker { | ||
public: | ||
GOFilePickerCtrl( | ||
wxWindow *parent, | ||
wxWindowID id, | ||
const wxString &title, | ||
const wxString &wildcard, | ||
const wxPoint &pos = wxDefaultPosition, | ||
const wxSize &size = wxDefaultSize, | ||
long style = 0) | ||
: wxFilePickerCtrl( | ||
parent, id, wxEmptyString, title, wildcard, pos, size, style), | ||
GORightVisiblePicker(this) {} | ||
|
||
OVERRIDE_UPDATE_TEXTCTRL(wxFilePickerCtrl) | ||
}; | ||
|
||
#endif /* GOFILEPICKERCTRL_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright 2006 Milan Digital Audio LLC | ||
* Copyright 2009-2024 GrandOrgue contributors (see AUTHORS) | ||
* License GPL-2.0 or later | ||
* (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html). | ||
*/ | ||
|
||
#include "GORightVisiblePicker.h" | ||
|
||
#include <wx/pickerbase.h> | ||
#include <wx/textctrl.h> | ||
|
||
void GORightVisiblePicker::EnsureRigtIsVisible() { | ||
wxTextCtrl *pTxt = p_picker->GetTextCtrl(); | ||
|
||
if (pTxt) { | ||
pTxt->ShowPosition(pTxt->GetValue().length()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright 2006 Milan Digital Audio LLC | ||
* Copyright 2009-2024 GrandOrgue contributors (see AUTHORS) | ||
* License GPL-2.0 or later | ||
* (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html). | ||
*/ | ||
|
||
#ifndef GORIGHTVISIBLEPICKER_H | ||
#define GORIGHTVISIBLEPICKER_H | ||
|
||
class wxPickerBase; | ||
|
||
/** | ||
* This class is designed for enchancing the standard wx*PickerCtrl classes | ||
* If the file name is too long to fit in the text control, it makes visible | ||
* the rightmost part of the filename | ||
* | ||
* Usage: | ||
* 1. make a subclass of wx*PickerCtrl and GORightVisiblePicker | ||
* 2. use the OVERRIDE_UPDATE_TEXTCTRL macro | ||
*/ | ||
|
||
class GORightVisiblePicker { | ||
private: | ||
wxPickerBase *p_picker; | ||
|
||
protected: | ||
GORightVisiblePicker(wxPickerBase *pPicker) : p_picker(pPicker) {} | ||
|
||
// Scrolls the text in the text control of the p_picker to right | ||
void EnsureRigtIsVisible(); | ||
}; | ||
|
||
// This macro must be used in the class declaration for overriding the standard | ||
// UpdatePickerFromTextCtrl() method | ||
#define OVERRIDE_UPDATE_TEXTCTRL(baseClass) \ | ||
void UpdateTextCtrlFromPicker() override { \ | ||
baseClass::UpdateTextCtrlFromPicker(); \ | ||
EnsureRigtIsVisible(); \ | ||
} | ||
|
||
#endif /* GORIGHTVISIBLEPICKER_H */ |