1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-02 08:59:28 +02:00

Update Sync-Lock icons on toolbar, TrackInfo; add the ability to have

a different foreground icon when a toolbar button is pressed (which
will likely be used soon for the Sync-Lock icon).
This commit is contained in:
BusinessmanProgrammerSteve 2010-10-27 04:36:26 +00:00
parent 1fbf7136cb
commit 2499082baa
10 changed files with 4101 additions and 4082 deletions

View File

@ -141,7 +141,8 @@ from there. Audacity will look for a file called "Pause.png".
DEFINE_IMAGE( bmpRedo, wxImage( 26, 24 ), wxT("Redo")); DEFINE_IMAGE( bmpRedo, wxImage( 26, 24 ), wxT("Redo"));
DEFINE_IMAGE( bmpRedoDisabled, wxImage( 26, 24 ), wxT("RedoDisabled")); DEFINE_IMAGE( bmpRedoDisabled, wxImage( 26, 24 ), wxT("RedoDisabled"));
DEFINE_IMAGE( bmpSyncLockTracks, wxImage( 20, 20 ), wxT("SyncLockTracks")); DEFINE_IMAGE( bmpSyncLockTracksDown, wxImage( 20, 20 ), wxT("SyncLockTracksDown"));
DEFINE_IMAGE( bmpSyncLockTracksUp, wxImage( 20, 20 ), wxT("SyncLockTracksUp"));
DEFINE_IMAGE( bmpSyncLockTracksDisabled, wxImage( 20, 20 ), wxT("SyncLockTracksDisabled")); DEFINE_IMAGE( bmpSyncLockTracksDisabled, wxImage( 20, 20 ), wxT("SyncLockTracksDisabled"));

File diff suppressed because it is too large Load Diff

View File

@ -122,14 +122,14 @@ void ControlToolBar::Create(wxWindow * parent)
// This is a convenience function that allows for button creation in // This is a convenience function that allows for button creation in
// MakeButtons() with fewer arguments // MakeButtons() with fewer arguments
AButton *ControlToolBar::MakeButton(teBmps eFore, teBmps eDisabled, AButton *ControlToolBar::MakeButton(teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled,
int id, int id,
bool processdownevents, bool processdownevents,
const wxChar *label) const wxChar *label)
{ {
AButton *r = ToolBar::MakeButton( AButton *r = ToolBar::MakeButton(
bmpRecoloredUpLarge, bmpRecoloredDownLarge, bmpRecoloredHiliteLarge, bmpRecoloredUpLarge, bmpRecoloredDownLarge, bmpRecoloredHiliteLarge,
eFore, eDisabled, eEnabledUp, eEnabledDown, eDisabled,
wxWindowID(id), wxWindowID(id),
wxDefaultPosition, processdownevents, wxDefaultPosition, processdownevents,
theTheme.ImageSize( bmpRecoloredUpLarge )); theTheme.ImageSize( bmpRecoloredUpLarge ));
@ -166,27 +166,27 @@ void ControlToolBar::Populate()
{ {
MakeButtonBackgroundsLarge(); MakeButtonBackgroundsLarge();
mPause = MakeButton(bmpPause,bmpPauseDisabled, mPause = MakeButton(bmpPause, bmpPause, bmpPauseDisabled,
ID_PAUSE_BUTTON, true, _("Pause")); ID_PAUSE_BUTTON, true, _("Pause"));
mPlay = MakeButton( bmpPlay, bmpPlayDisabled, mPlay = MakeButton( bmpPlay, bmpPlay, bmpPlayDisabled,
ID_PLAY_BUTTON, true, _("Play")); ID_PLAY_BUTTON, true, _("Play"));
MakeLoopImage(); MakeLoopImage();
mStop = MakeButton( bmpStop, bmpStopDisabled , mStop = MakeButton( bmpStop, bmpStop, bmpStopDisabled ,
ID_STOP_BUTTON, false, _("Stop")); ID_STOP_BUTTON, false, _("Stop"));
mRewind = MakeButton(bmpRewind, bmpRewindDisabled, mRewind = MakeButton(bmpRewind, bmpRewind, bmpRewindDisabled,
ID_REW_BUTTON, false, _("Start")); ID_REW_BUTTON, false, _("Start"));
mFF = MakeButton(bmpFFwd, bmpFFwdDisabled, mFF = MakeButton(bmpFFwd, bmpFFwd, bmpFFwdDisabled,
ID_FF_BUTTON, false, _("End")); ID_FF_BUTTON, false, _("End"));
mRecord = MakeButton(bmpRecord, bmpRecordDisabled, mRecord = MakeButton(bmpRecord, bmpRecord, bmpRecordDisabled,
ID_RECORD_BUTTON, true, _("Record")); ID_RECORD_BUTTON, true, _("Record"));
mBatch = MakeButton(bmpCleanSpeech,bmpCleanSpeechDisabled, mBatch = MakeButton(bmpCleanSpeech, bmpCleanSpeech, bmpCleanSpeechDisabled,
ID_BATCH_BUTTON, false, _("Clean Speech")); ID_BATCH_BUTTON, false, _("Clean Speech"));
#if wxUSE_TOOLTIPS #if wxUSE_TOOLTIPS

View File

@ -83,7 +83,7 @@ class ControlToolBar:public ToolBar {
private: private:
AButton *MakeButton(teBmps eFore, teBmps eDisabled, AButton *MakeButton(teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled,
int id, int id,
bool processdownevents, bool processdownevents,
const wxChar *label); const wxChar *label);

View File

@ -98,7 +98,7 @@ void EditToolBar::AddSeparator()
/// MakeButtons() with fewer arguments /// MakeButtons() with fewer arguments
/// Very similar to code in ControlToolBar... /// Very similar to code in ControlToolBar...
AButton *EditToolBar::AddButton( AButton *EditToolBar::AddButton(
teBmps eFore, teBmps eDisabled, teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled,
int id, int id,
const wxChar *label, const wxChar *label,
bool toggle) bool toggle)
@ -107,7 +107,7 @@ AButton *EditToolBar::AddButton(
r = ToolBar::MakeButton( r = ToolBar::MakeButton(
bmpRecoloredUpSmall, bmpRecoloredDownSmall, bmpRecoloredHiliteSmall, bmpRecoloredUpSmall, bmpRecoloredDownSmall, bmpRecoloredHiliteSmall,
eFore, eDisabled, eEnabledUp, eEnabledDown, eDisabled,
wxWindowID(id), wxWindowID(id),
wxDefaultPosition, wxDefaultPosition,
toggle, toggle,
@ -127,41 +127,41 @@ void EditToolBar::Populate()
MakeButtonBackgroundsSmall(); MakeButtonBackgroundsSmall();
/* Buttons */ /* Buttons */
AddButton(bmpCut, bmpCutDisabled, ETBCutID, AddButton(bmpCut, bmpCut, bmpCutDisabled, ETBCutID,
_("Cut")); _("Cut"));
AddButton(bmpCopy, bmpCopyDisabled, ETBCopyID, AddButton(bmpCopy, bmpCopy, bmpCopyDisabled, ETBCopyID,
_("Copy")); _("Copy"));
AddButton(bmpPaste, bmpPasteDisabled, ETBPasteID, AddButton(bmpPaste, bmpPaste, bmpPasteDisabled, ETBPasteID,
_("Paste")); _("Paste"));
AddButton(bmpTrim, bmpTrimDisabled, ETBTrimID, AddButton(bmpTrim, bmpTrim, bmpTrimDisabled, ETBTrimID,
_("Trim outside selection")); _("Trim outside selection"));
AddButton(bmpSilence, bmpSilenceDisabled, ETBSilenceID, AddButton(bmpSilence, bmpSilence, bmpSilenceDisabled, ETBSilenceID,
_("Silence selection")); _("Silence selection"));
AddSeparator(); AddSeparator();
AddButton(bmpUndo, bmpUndoDisabled, ETBUndoID, AddButton(bmpUndo, bmpUndo, bmpUndoDisabled, ETBUndoID,
_("Undo")); _("Undo"));
AddButton(bmpRedo, bmpRedoDisabled, ETBRedoID, AddButton(bmpRedo, bmpRedo, bmpRedoDisabled, ETBRedoID,
_("Redo")); _("Redo"));
AddSeparator(); AddSeparator();
#ifdef EXPERIMENTAL_SYNC_LOCK #ifdef EXPERIMENTAL_SYNC_LOCK
AddButton(bmpSyncLockTracks, bmpSyncLockTracksDisabled, ETBSyncLockID, AddButton(bmpSyncLockTracksUp, bmpSyncLockTracksDown, bmpSyncLockTracksDisabled, ETBSyncLockID,
_("Sync-Lock Tracks"), true); _("Sync-Lock Tracks"), true);
AddSeparator(); AddSeparator();
#endif #endif
AddButton(bmpZoomIn, bmpZoomInDisabled, ETBZoomInID, AddButton(bmpZoomIn, bmpZoomIn, bmpZoomInDisabled, ETBZoomInID,
_("Zoom In")); _("Zoom In"));
AddButton(bmpZoomOut, bmpZoomOutDisabled, ETBZoomOutID, AddButton(bmpZoomOut, bmpZoomOut, bmpZoomOutDisabled, ETBZoomOutID,
_("Zoom Out")); _("Zoom Out"));
AddButton(bmpZoomSel, bmpZoomSelDisabled, ETBZoomSelID, AddButton(bmpZoomSel, bmpZoomSel, bmpZoomSelDisabled, ETBZoomSelID,
_("Fit selection in window")); _("Fit selection in window"));
AddButton(bmpZoomFit, bmpZoomFitDisabled, ETBZoomFitID, AddButton(bmpZoomFit, bmpZoomFit, bmpZoomFitDisabled, ETBZoomFitID,
_("Fit project in window")); _("Fit project in window"));
mButtons[ETBZoomInID]->SetEnabled(false); mButtons[ETBZoomInID]->SetEnabled(false);

View File

@ -72,7 +72,7 @@ class EditToolBar:public ToolBar {
private: private:
AButton *AddButton(teBmps eFore, teBmps eDisabled, AButton *AddButton(teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled,
int id, const wxChar *label, bool toggle = false); int id, const wxChar *label, bool toggle = false);
void AddSeparator(); void AddSeparator();

View File

@ -458,31 +458,33 @@ void ToolBar::MakeButtonBackgroundsSmall()
} }
/// Makes a button and its four different state bitmaps /// Makes a button and its four different state bitmaps
/// @param eUp Background for when button is Up. /// @param eUp Background for when button is Up.
/// @param eDown Background for when button is Down. /// @param eDown Background for when button is Down.
/// @param eHilite Background for when button is Hilit. /// @param eHilite Background for when button is Hilit.
/// @param eStandard Foreground when enabled. /// @param eStandardUp Foreground when enabled, up.
/// @param eDisabled Foreground when disabled. /// @param eStandardDown Foregrounde when enabled, down.
/// @param id Windows Id. /// @param eDisabled Foreground when disabled.
/// @param placement Placement position /// @param id Windows Id.
/// @param placement Placement position
/// @param processdownevents true iff button handles down events. /// @param processdownevents true iff button handles down events.
/// @param size Size of the background. /// @param size Size of the background.
AButton * ToolBar::MakeButton(teBmps eUp, AButton * ToolBar::MakeButton(teBmps eUp,
teBmps eDown, teBmps eDown,
teBmps eHilite, teBmps eHilite,
teBmps eStandard, teBmps eStandardUp,
teBmps eStandardDown,
teBmps eDisabled, teBmps eDisabled,
wxWindowID id, wxWindowID id,
wxPoint placement, wxPoint placement,
bool processdownevents, bool processdownevents,
wxSize size) wxSize size)
{ {
int xoff = (size.GetWidth() - theTheme.Image(eStandard).GetWidth())/2; int xoff = (size.GetWidth() - theTheme.Image(eStandardUp).GetWidth())/2;
int yoff = (size.GetHeight() - theTheme.Image(eStandard).GetHeight())/2; int yoff = (size.GetHeight() - theTheme.Image(eStandardUp).GetHeight())/2;
wxImage * up2 = OverlayImage(eUp, eStandard, xoff, yoff); wxImage * up2 = OverlayImage(eUp, eStandardUp, xoff, yoff);
wxImage * hilite2 = OverlayImage(eHilite, eStandard, xoff, yoff); wxImage * hilite2 = OverlayImage(eHilite, eStandardUp, xoff, yoff);
wxImage * down2 = OverlayImage(eDown, eStandard, xoff + 1, yoff + 1); wxImage * down2 = OverlayImage(eDown, eStandardDown, xoff + 1, yoff + 1);
wxImage * disable2 = OverlayImage(eUp, eDisabled, xoff, yoff); wxImage * disable2 = OverlayImage(eUp, eDisabled, xoff, yoff);
AButton * button = AButton * button =
@ -553,7 +555,7 @@ void ToolBar::OnPaint( wxPaintEvent & event )
int y; int y;
for(y=0;y<sz.y;y++) for(y=0;y<sz.y;y++)
{ {
int yPix = ((float)y * imSz.y - 0.0001f)/(sz.y-1); int yPix = ((float)y * imSz.y - 1.0f)/(sz.y-1);
wxColour col( wxColour col(
mpBackGradient->GetRed( 0, yPix), mpBackGradient->GetRed( 0, yPix),
mpBackGradient->GetGreen( 0, yPix), mpBackGradient->GetGreen( 0, yPix),

View File

@ -105,7 +105,8 @@ class ToolBar:public wxPanel
AButton *MakeButton(teBmps eUp, AButton *MakeButton(teBmps eUp,
teBmps eDown, teBmps eDown,
teBmps eHilite, teBmps eHilite,
teBmps eStandard, teBmps eStandardUp,
teBmps eStandardDown,
teBmps eDisabled, teBmps eDisabled,
wxWindowID id, wxWindowID id,
wxPoint placement, wxPoint placement,

View File

@ -166,7 +166,7 @@ AButton * ToolsToolBar::MakeTool( teBmps eTool,
{ {
AButton *button = ToolBar::MakeButton( AButton *button = ToolBar::MakeButton(
bmpRecoloredUpSmall, bmpRecoloredDownSmall, bmpRecoloredHiliteSmall, bmpRecoloredUpSmall, bmpRecoloredDownSmall, bmpRecoloredHiliteSmall,
eTool, eTool, eTool, eTool, eTool,
wxWindowID(id), wxWindowID(id),
wxDefaultPosition, true, wxDefaultPosition, true,
theTheme.ImageSize( bmpRecoloredUpSmall )); theTheme.ImageSize( bmpRecoloredUpSmall ));

View File

@ -145,7 +145,7 @@ AButton *TranscriptionToolBar::AddButton(
r = ToolBar::MakeButton( r = ToolBar::MakeButton(
bmpRecoloredUpSmall, bmpRecoloredDownSmall, bmpRecoloredHiliteSmall, bmpRecoloredUpSmall, bmpRecoloredDownSmall, bmpRecoloredHiliteSmall,
eFore, eDisabled, eFore, eFore, eDisabled,
wxWindowID(id), wxWindowID(id),
wxDefaultPosition, wxDefaultPosition,
false, false,