void CToolBar::MakeTool(char const* id, std::wstring const& art, wxString const& tooltip, wxString const& help, wxItemKind type) { if (help.empty() && !tooltip.empty()) { MakeTool(id, art, tooltip, tooltip, type); return; } wxBitmap bmp = CThemeProvider::Get()->CreateBitmap(art, wxART_TOOLBAR, GetToolBitmapSize()); wxToolBar::AddTool(XRCID(id), wxString(), bmp, wxBitmap(), type, tooltip, help); }
void ToolsToolBar::Populate() { MakeButtonBackgroundsSmall(); Add(mToolSizer = safenew wxGridSizer(2, 3, 1, 1)); /* Tools */ mTool[ selectTool ] = MakeTool( bmpIBeam, selectTool, _("Selection Tool") ); mTool[ envelopeTool ] = MakeTool( bmpEnvelope, envelopeTool, _("Envelope Tool") ); mTool[ drawTool ] = MakeTool( bmpDraw, drawTool, _("Draw Tool") ); mTool[ zoomTool ] = MakeTool( bmpZoom, zoomTool, _("Zoom Tool") ); mTool[ slideTool ] = MakeTool( bmpTimeShift, slideTool, _("Slide Tool") ); mTool[ multiTool ] = MakeTool( bmpMulti, multiTool, _("Multi Tool") ); mTool[mCurrentTool]->PushDown(); RegenerateTooltips(); }
void CToolBar::MakeTools() { #ifdef __WXMSW__ MakeTool("ID_TOOLBAR_SITEMANAGER", L"ART_SITEMANAGER", _("Open the Site Manager."), _("Open the Site Manager"), wxITEM_DROPDOWN); #else MakeTool("ID_TOOLBAR_SITEMANAGER", L"ART_SITEMANAGER", _("Open the Site Manager. Right-click for a list of sites."), _("Open the Site Manager"), wxITEM_DROPDOWN); #endif AddSeparator(); MakeTool("ID_TOOLBAR_LOGVIEW", L"ART_LOGVIEW", _("Toggles the display of the message log"), wxString(), wxITEM_CHECK); MakeTool("ID_TOOLBAR_LOCALTREEVIEW", L"ART_LOCALTREEVIEW", _("Toggles the display of the local directory tree"), wxString(), wxITEM_CHECK); MakeTool("ID_TOOLBAR_REMOTETREEVIEW", L"ART_REMOTETREEVIEW", _("Toggles the display of the remote directory tree"), wxString(), wxITEM_CHECK); MakeTool("ID_TOOLBAR_QUEUEVIEW", L"ART_QUEUEVIEW", _("Toggles the display of the transfer queue"), wxString(), wxITEM_CHECK); AddSeparator(); MakeTool("ID_TOOLBAR_REFRESH", L"ART_REFRESH", _("Refresh the file and folder lists")); MakeTool("ID_TOOLBAR_PROCESSQUEUE", L"ART_PROCESSQUEUE", _("Toggles processing of the transfer queue"), wxString(), wxITEM_CHECK); MakeTool("ID_TOOLBAR_CANCEL", L"ART_CANCEL", _("Cancels the current operation"), _("Cancel current operation")); MakeTool("ID_TOOLBAR_DISCONNECT", L"ART_DISCONNECT", _("Disconnects from the currently visible server"), _("Disconnect from server")); MakeTool("ID_TOOLBAR_RECONNECT", L"ART_RECONNECT", _("Reconnects to the last used server")); AddSeparator(); MakeTool("ID_TOOLBAR_FILTER", L"ART_FILTER", _("Opens the directory listing filter dialog. Right-click to toggle filters."), _("Filter the directory listings"), wxITEM_CHECK); MakeTool("ID_TOOLBAR_COMPARISON", L"ART_COMPARE", _("Toggle directory comparison. Right-click to change comparison mode.\n\nColors:\nYellow: File only exists on one side\nGreen: File is newer than the unmarked file on other side\nRed: File sizes different"), _("Directory comparison"), wxITEM_CHECK); MakeTool("ID_TOOLBAR_SYNCHRONIZED_BROWSING", L"ART_SYNCHRONIZE", _("Toggle synchronized browsing.\nIf enabled, navigating the local directory hierarchy will also change the directory on the server accordingly and vice versa."), _("Synchronized browsing"), wxITEM_CHECK); MakeTool("ID_TOOLBAR_FIND", L"ART_FIND", _("Search for files recursively."), _("File search")); }
void ControlToolBar::MakeButtons() { wxImage *upOriginal = new wxImage(wxBitmap(UpButton).ConvertToImage()); wxImage *downOriginal = new wxImage(wxBitmap(DownButton).ConvertToImage()); wxImage *hiliteOriginal = new wxImage(wxBitmap(HiliteButton).ConvertToImage()); wxColour newColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE); #ifdef __WXMAC__ upPattern = upOriginal; downPattern = downOriginal; hilitePattern = hiliteOriginal; #else upPattern = ChangeImageColour(upOriginal, newColour); downPattern = ChangeImageColour(downOriginal, newColour); hilitePattern = ChangeImageColour(hiliteOriginal, newColour); #endif /* Buttons */ #if (AUDACITY_BRANDING == BRAND_THINKLABS) // || (AUDACITY_BRANDING == BRAND_AUDIOTOUCH) #define kNumButtons 7 #else #define kNumButtons 6 #endif int buttonOrder[kNumButtons]; mButtonPos = kButtonsXOffset; #if (AUDACITY_BRANDING != BRAND_THINKLABS) // no tools for Thinklabs if (mShowTools) mButtonPos += kToolsClusterWidth; #endif gPrefs->Read("/GUI/ErgonomicTransportButtons", &mErgonomicTransportButtons, false); if (mErgonomicTransportButtons) { #if (AUDACITY_BRANDING == BRAND_THINKLABS) buttonOrder[0] = ID_PAUSE_BUTTON; buttonOrder[1] = ID_PLAY_BUTTON; buttonOrder[2] = ID_LOOP_PLAY_BUTTON; buttonOrder[3] = ID_STOP_BUTTON; buttonOrder[4] = ID_REW_BUTTON; buttonOrder[5] = ID_FF_BUTTON; buttonOrder[6] = ID_RECORD_BUTTON; #elif (AUDACITY_BRANDING == BRAND_AUDIOTOUCH) //buttonOrder[0] = ID_LOCK_BUTTON; //buttonOrder[1] = ID_RECORD_BUTTON; //buttonOrder[2] = ID_REW_BUTTON; //buttonOrder[3] = ID_PLAY_BUTTON; //buttonOrder[4] = ID_PAUSE_BUTTON; // actually, on top of Play btn, and alternately hidden //buttonOrder[5] = ID_STOP_BUTTON; //buttonOrder[6] = ID_FF_BUTTON; buttonOrder[0] = ID_RECORD_BUTTON; buttonOrder[1] = ID_REW_BUTTON; buttonOrder[2] = ID_PLAY_BUTTON; buttonOrder[3] = ID_PAUSE_BUTTON; // actually, on top of Play btn, and alternately hidden buttonOrder[4] = ID_STOP_BUTTON; buttonOrder[5] = ID_FF_BUTTON; #else buttonOrder[0] = ID_PAUSE_BUTTON; buttonOrder[1] = ID_PLAY_BUTTON; buttonOrder[2] = ID_STOP_BUTTON; buttonOrder[3] = ID_REW_BUTTON; buttonOrder[4] = ID_FF_BUTTON; buttonOrder[5] = ID_RECORD_BUTTON; #endif } else { #if (AUDACITY_BRANDING == BRAND_THINKLABS) buttonOrder[0] = ID_REW_BUTTON; buttonOrder[1] = ID_PLAY_BUTTON; buttonOrder[2] = ID_LOOP_PLAY_BUTTON; buttonOrder[3] = ID_RECORD_BUTTON; buttonOrder[4] = ID_PAUSE_BUTTON; buttonOrder[5] = ID_STOP_BUTTON; buttonOrder[6] = ID_FF_BUTTON; #elif (AUDACITY_BRANDING == BRAND_AUDIOTOUCH) // ignores mErgonomicTransportButtons //buttonOrder[0] = ID_LOCK_BUTTON; //buttonOrder[1] = ID_RECORD_BUTTON; //buttonOrder[2] = ID_REW_BUTTON; //buttonOrder[3] = ID_PLAY_BUTTON; //buttonOrder[4] = ID_PAUSE_BUTTON; // actually, on top of Play btn, and alternately hidden //buttonOrder[5] = ID_STOP_BUTTON; //buttonOrder[6] = ID_FF_BUTTON; buttonOrder[0] = ID_RECORD_BUTTON; buttonOrder[1] = ID_REW_BUTTON; buttonOrder[2] = ID_PLAY_BUTTON; buttonOrder[3] = ID_PAUSE_BUTTON; // actually, on top of Play btn, and alternately hidden buttonOrder[4] = ID_STOP_BUTTON; buttonOrder[5] = ID_FF_BUTTON; #else buttonOrder[0] = ID_REW_BUTTON; buttonOrder[1] = ID_PLAY_BUTTON; buttonOrder[2] = ID_RECORD_BUTTON; buttonOrder[3] = ID_PAUSE_BUTTON; buttonOrder[4] = ID_STOP_BUTTON; buttonOrder[5] = ID_FF_BUTTON; #endif } for (int iButton = 0; iButton < kNumButtons; iButton++) { switch (buttonOrder[iButton]) { case ID_REW_BUTTON: mRewind = MakeButton((char const **) Rewind, (char const **) RewindDisabled, (char const **) RewindAlpha, ID_REW_BUTTON, false); break; case ID_PLAY_BUTTON: mPlay = MakeButton((char const **) Play, (char const **) PlayDisabled, (char const **) PlayAlpha, ID_PLAY_BUTTON, false); MakeLoopImage(); break; #if (AUDACITY_BRANDING == BRAND_THINKLABS) case ID_LOOP_PLAY_BUTTON: mLoopPlay = MakeButton((char const **) Loop, (char const **) LoopDisabled, (char const **) LoopAlpha, ID_LOOP_PLAY_BUTTON, false); break; //#elif (AUDACITY_BRANDING == BRAND_AUDIOTOUCH) // case ID_LOCK_BUTTON: // mLock = MakeButton((char const **) Lock, // (char const **) LockDisabled, // (char const **) LockAlpha, ID_LOCK_BUTTON, // true); // processDownEvents // //v alt images for unlocked? Currently just making it toggle up/down with processDownEvents. // break; #endif case ID_RECORD_BUTTON: if (mErgonomicTransportButtons) mButtonPos += 10; // space before record button mRecord = MakeButton((char const **) Record, (char const **) RecordDisabled, (char const **) RecordAlpha, ID_RECORD_BUTTON, false); break; #if (AUDACITY_BRANDING == BRAND_AUDIOTOUCH) // Audacity_Audiotouch swaps colors for Pause and Stop. case ID_PAUSE_BUTTON: mPause = MakeButton((char const **)Pause_yellow, (char const **) PauseDisabled_yellow, (char const **) PauseAlpha, ID_PAUSE_BUTTON, true); break; case ID_STOP_BUTTON: mStop = MakeButton((char const **) Stop_blue, (char const **) StopDisabled_blue, (char const **) StopAlpha, ID_STOP_BUTTON, false); break; #else case ID_PAUSE_BUTTON: mPause = MakeButton((char const **)Pause, (char const **) PauseDisabled, (char const **) PauseAlpha, ID_PAUSE_BUTTON, true); break; case ID_STOP_BUTTON: mStop = MakeButton((char const **) Stop, (char const **) StopDisabled, (char const **) StopAlpha, ID_STOP_BUTTON, false); break; #endif case ID_FF_BUTTON: mFF = MakeButton((char const **) FFwd, (char const **) FFwdDisabled, (char const **) FFwdAlpha, ID_FF_BUTTON, false); break; default: wxASSERT(false); // unknown button id } } #if wxUSE_TOOLTIPS mRewind->SetToolTip(_("Skip to Start")); mPlay->SetToolTip(_("Play (Shift for loop-play)")); #if (AUDACITY_BRANDING == BRAND_THINKLABS) mLoopPlay->SetToolTip(_("Loop Play")); //#elif (AUDACITY_BRANDING == BRAND_AUDIOTOUCH) // mLock->SetToolTip(_("Lock/Unlock Recording")); #endif mRecord->SetToolTip(_("Record")); mPause->SetToolTip(_("Pause")); mStop->SetToolTip(_("Stop")); mFF->SetToolTip(_("Skip to End")); #endif #ifndef __WXMAC__ delete upPattern; delete downPattern; delete hilitePattern; #endif delete upOriginal; delete downOriginal; delete hiliteOriginal; /* Tools */ #if (AUDACITY_BRANDING == BRAND_THINKLABS) // no tools for Thinklabs for (unsigned int i = 0; i < numTools; i++) mTool[i] = NULL; #else #ifdef __WXMAC__ // different positioning mTool[selectTool] = MakeTool(IBeam, IBeamAlpha, ID_SELECT, 0, 0); mTool[zoomTool] = MakeTool(Zoom, ZoomAlpha, ID_ZOOM, 0, 26); mTool[envelopeTool] = MakeTool(Envelope, EnvelopeAlpha, ID_ENVELOPE, 26, 0); mTool[slideTool] = MakeTool(TimeShift, TimeShiftAlpha, ID_SLIDE, 26, 26); mTool[drawTool] = MakeTool(Draw, DrawAlpha, ID_DRAW, 52, 0); mTool[multiTool] = MakeTool(Multi, MultiAlpha, ID_MULTI, 52, 26); #else mTool[selectTool] = MakeTool(IBeam, IBeamAlpha, ID_SELECT, 0, 0); mTool[zoomTool] = MakeTool(Zoom, ZoomAlpha, ID_ZOOM, 0, 28); mTool[envelopeTool] = MakeTool(Envelope, EnvelopeAlpha, ID_ENVELOPE, 27, 0); mTool[slideTool] = MakeTool(TimeShift, TimeShiftAlpha, ID_SLIDE, 27, 28); mTool[drawTool] = MakeTool(Draw, DrawAlpha, ID_DRAW, 54, 0); mTool[multiTool] = MakeTool(Multi, MultiAlpha, ID_MULTI, 54, 28); #endif #endif #if wxUSE_TOOLTIPS #ifdef __WXMAC__ wxToolTip::Enable(false); // DM: tooltips are broken in wxMac #else // MB: Should make this a pref wxToolTip::Enable(true); wxToolTip::SetDelay(1000); #endif #endif RegenerateToolsTooltips(); }