mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-15 15:49:36 +02:00
Bug2244: need a distinct cursor for adjustment of split views...
... Adapted from the bandwidth adjustment cursor for spectral selection, with reversal of white and black, so the new ones are white around black
This commit is contained in:
parent
28e19e3e03
commit
0c44d0f7d3
@ -32,6 +32,7 @@
|
||||
#include "Cursors32/StretchLeftCursor.xpm"
|
||||
#include "Cursors32/StretchRightCursor.xpm"
|
||||
#endif
|
||||
#include "Cursors32/SubViewsCursor.xpm"
|
||||
|
||||
#else
|
||||
|
||||
@ -52,6 +53,7 @@
|
||||
#include "Cursors16/StretchLeftCursor.xpm"
|
||||
#include "Cursors16/StretchRightCursor.xpm"
|
||||
#endif
|
||||
#include "Cursors16/SubViewsCursor.xpm"
|
||||
|
||||
#endif
|
||||
|
||||
|
23
images/Cursors16/SubViewsCursor.xpm
Normal file
23
images/Cursors16/SubViewsCursor.xpm
Normal file
@ -0,0 +1,23 @@
|
||||
/* XPM */
|
||||
//Image of a pencil.
|
||||
static const char * const SubViewsCursorXpm[] = {
|
||||
"16 16 3 1",
|
||||
". c #FF0000", // mask color = RGB:255,0,0
|
||||
"# c #000000",
|
||||
"+ c #FFFFFF",
|
||||
"........+.......",
|
||||
".......+#+......",
|
||||
"......+###+.....",
|
||||
"......+++++.....",
|
||||
"................",
|
||||
"................",
|
||||
"................",
|
||||
"................",
|
||||
"................",
|
||||
"................",
|
||||
"................",
|
||||
"................",
|
||||
"......+++++.....",
|
||||
"......+###+.....",
|
||||
".......+#+......",
|
||||
"........+.......",};
|
38
images/Cursors32/SubViewsCursor.xpm
Normal file
38
images/Cursors32/SubViewsCursor.xpm
Normal file
@ -0,0 +1,38 @@
|
||||
/* XPM */
|
||||
static const char * const SubViewsCursorXpm[] = {
|
||||
"32 32 3 1",
|
||||
". c #FF0000", // mask color = RGB:255,0,0
|
||||
"# c #000000",
|
||||
"+ c #FFFFFF",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
"................+...............",
|
||||
"...............+#+..............",
|
||||
"..............+###+.............",
|
||||
".............+#####+............",
|
||||
"............+#######+...........",
|
||||
"............+++++++++...........",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
"............+++++++++...........",
|
||||
"............+#######+...........",
|
||||
".............+#####+............",
|
||||
"..............+###+.............",
|
||||
"...............+#+..............",
|
||||
"................+...............",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................"};
|
@ -228,7 +228,8 @@ from there. Audacity will look for a file called "Pause.png".
|
||||
DEFINE_IMAGE( bmpBottomFrequencyCursor, wxImage( 32, 32 ), wxT("BottomFrequencyCursor"));
|
||||
DEFINE_IMAGE( bmpTopFrequencyCursor, wxImage( 32, 32 ), wxT("TopFrequencyCursor"));
|
||||
DEFINE_IMAGE( bmpBandWidthCursor, wxImage(32, 32), wxT("BandWidthCursor"));
|
||||
|
||||
DEFINE_IMAGE( bmpSubViewsCursor, wxImage(32, 32), wxT("SubViewsCursor"));
|
||||
|
||||
//SET_THEME_FLAGS( resFlagNewLine );
|
||||
|
||||
// DA: The logo with name xpm has a different width.
|
||||
|
@ -18,6 +18,9 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "../../../../WaveClip.h"
|
||||
#include "../../../../WaveTrack.h"
|
||||
|
||||
#include "../../../../../images/Cursors.h"
|
||||
#include "../../../../AllThemeResources.h"
|
||||
|
||||
#include "../../../../HitTestResult.h"
|
||||
#include "../../../../ProjectHistory.h"
|
||||
#include "../../../../RefreshCode.h"
|
||||
@ -33,6 +36,25 @@ Paul Licameli split from TrackPanel.cpp
|
||||
|
||||
namespace {
|
||||
|
||||
/// Makes a cursor from an XPM, uses CursorId as a fallback.
|
||||
/// TODO: Move this function to some other source file for reuse elsewhere.
|
||||
std::unique_ptr<wxCursor> MakeCursor( int WXUNUSED(CursorId), const char * const pXpm[36], int HotX, int HotY )
|
||||
{
|
||||
#ifdef CURSORS_SIZE32
|
||||
const int HotAdjust =0;
|
||||
#else
|
||||
const int HotAdjust =8;
|
||||
#endif
|
||||
|
||||
wxImage Image = wxImage(wxBitmap(pXpm).ConvertToImage());
|
||||
Image.SetMaskColour(255,0,0);
|
||||
Image.SetMask();// Enable mask.
|
||||
|
||||
Image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_X, HotX-HotAdjust );
|
||||
Image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_Y, HotY-HotAdjust );
|
||||
return std::make_unique<wxCursor>( Image );
|
||||
}
|
||||
|
||||
using WaveTrackSubViewPtrs = std::vector< std::shared_ptr< WaveTrackSubView > >;
|
||||
|
||||
// Structure that collects and modifies information on sub-view positions
|
||||
@ -321,10 +343,11 @@ public:
|
||||
HitTestPreview Preview(
|
||||
const TrackPanelMouseState &state, const AudacityProject * ) override
|
||||
{
|
||||
static wxCursor resizeCursor{ wxCURSOR_SIZENS };
|
||||
static auto resizeCursor =
|
||||
::MakeCursor(wxCURSOR_ARROW, SubViewsCursorXpm, 16, 16);
|
||||
return {
|
||||
XO("Click and drag to adjust sizes of sub-views."),
|
||||
&resizeCursor
|
||||
&*resizeCursor
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user