void FilterGraph::mouseMove (const MouseEvent &event) { Point <int> mousePos = getMouseXYRelative(); int xPos = mousePos.getX(); float freq = xToFreq (xPos); if (traceType == Magnitude) { float magnitude = (float) (filterVector [0].getResponse (freq).magnitudeValue); for (int i = 1; i < numFilters; i++) { magnitude *= (float) (filterVector [i].getResponse (freq).magnitudeValue); } magnitude = 20 * log10 (magnitude); setTooltip (String (freq, 1) + "Hz, " + String (magnitude, 1) + "dB"); } if (traceType == Phase) { float phase = (float) (filterVector [0].getResponse (freq).phaseValue); for (int i = 1; i < numFilters; i++) { phase += (float) (filterVector [i].getResponse (freq).phaseValue); } phase /= float_Pi; setTooltip (String (freq, 1) + "Hz, " + String (phase, 2) + String (CharPointer_UTF8 ("\xcf\x80")) + "rad"); } }
SelectorButton::SelectorButton(const String& name_) : Button(name_) { setClickingTogglesState(true); setTooltip("Toggle a state."); }
PlayButton::PlayButton() : DrawableButton("PlayButton", DrawableButton::ImageFitted) { DrawablePath normal, over, down; Path p; p.addTriangle(0.0f, 0.0f, 0.0f, 20.0f, 18.0f, 10.0f); normal.setPath(p); normal.setFill(Colours::lightgrey); normal.setStrokeThickness(0.0f); over.setPath(p); over.setFill(Colours::black); over.setStrokeFill(Colours::black); over.setStrokeThickness(5.0f); down.setPath(p); down.setFill(Colours::pink); down.setStrokeFill(Colours::pink); down.setStrokeThickness(5.0f); setImages(&normal, &over, &over); // setBackgroundColours(Colours::darkgrey, Colours::yellow); setClickingTogglesState(true); setTooltip("Start/stop acquisition"); }
PinComponent::PinComponent (PMixAudioEngine& audioEngine, const uint32 nodeId_, const int index_, const bool isInput_) : nodeId (nodeId_) , index (index_) , isInput (isInput_) , mouseOver(false) , audioEngine(audioEngine) { if (const AudioProcessorGraph::Node::Ptr node = audioEngine.getDoc().getNodeForId (nodeId_)) { String tip; if (index_ == PMixDocument::midiChannelNumber) { tip = isInput ? "MIDI Input" : "MIDI Output"; } else { if (isInput) tip = node->getProcessor()->getInputChannelName (index_); else tip = node->getProcessor()->getOutputChannelName (index_); if (tip.isEmpty()) tip = (isInput ? "Input " : "Output ") + String (index_ + 1); } setTooltip (tip); } setSize (16, 16); }
PinComponent (FilterGraph& graph_, const uint32 filterID_, const int index_, const bool isInput_) : filterID (filterID_), index (index_), isInput (isInput_), graph (graph_) { const AudioProcessorGraph::Node::Ptr node (graph.getNodeForId (filterID_)); if (node != nullptr) { String tip; if (isInput) tip = node->getProcessor()->getInputChannelName (index_); else tip = node->getProcessor()->getOutputChannelName (index_); if (tip.isEmpty()) { if (index_ == FilterGraph::midiChannelNumber) tip = isInput ? "Midi Input" : "Midi Output"; else tip = (isInput ? "Input " : "Output ") + String (index_ + 1); } setTooltip (tip); } setSize (16, 16); }
//-------------------------------------------------------------- void Parameter::readFromXml(ofxXmlSettings &xml, bool bFullSchema) { ofLogVerbose("ofxMSAControlFreak") << "msa::controlfreak::Parameter::readFromXml: " << getPath(); if(_paramValue) _paramValue->readFromXml(xml, bFullSchema); if(bFullSchema) { setTooltip(xml.getAttribute(_xmlTag, "tooltip", "", _xmlTagId)); } }
void setStatus(const String& ttStr, bool startWarning) { EventLogger::getInstance()->logMessage(m_nickname + " : " + ttStr); setTooltip(getTooltip() + "\n" + Time::getCurrentTime().toString (false, true) + " : " + ttStr); if (startWarning) { m_countdown = 40; startTimer(200); } }
void timerCallback () { // use delay on the warning indicator if (m_countdown-- <= 0) { setTooltip(m_selected ? "Shift+Click to see event log." : String::empty); stopTimer(); }; repaint(); }
HyperlinkButton::HyperlinkButton (const String& linkText, const URL& linkURL) : Button (linkText), url (linkURL), font (14.0f, Font::underlined), resizeFont (true), justification (Justification::centred) { setMouseCursor (MouseCursor::PointingHandCursor); setTooltip (linkURL.toString (false)); }
CPUMeter::CPUMeter() : Label("CPU Meter","0.0"), cpu(0.0f), lastCpu(0.0f) { font = Font("Small Text", 12, Font::plain); // MemoryInputStream mis(BinaryData::silkscreenserialized, BinaryData::silkscreenserializedSize, false); // Typeface::Ptr typeface = new CustomTypeface(mis); // font = Font(typeface); // font.setHeight(12); setTooltip("CPU usage"); }
//============================================================================== ChangeKeyButton::ChangeKeyButton(ChangeKeyListener *_listener, KeyPress keyPress, const int keyIndex) : Button(keyPress.getTextDescription()), listener(_listener), keyNum(keyIndex) { this->keyPress = keyPress; setWantsKeyboardFocus(false); setTriggeredOnMouseDown(keyNum >= 0); setTooltip(keyNum >= 0 ? TRANS("Adds a new key-mapping") : TRANS("Click to change this key-mapping")); }
AudioWindowButton::AudioWindowButton() : Button("AudioWindowButton") { setClickingTogglesState(true); //MemoryInputStream mis(BinaryData::silkscreenserialized, BinaryData::silkscreenserializedSize, false); //Typeface::Ptr typeface = new CustomTypeface(mis); font = Font("Small Text", 12, Font::plain); //Font(typeface); //font.setHeight(12); textString = "AUDIO"; setTooltip("Change the buffer size"); }
//============================================================================== HomeMenu::HomeMenu() { addAndMakeVisible(labItem = new MenuItem("lab")); addAndMakeVisible(bankItem = new MenuItem("bank")); addAndMakeVisible(stageItem = new MenuItem("stage")); labItem->addActionListener(this); bankItem->addActionListener(this); stageItem->addActionListener(this); setTooltip("Home menu: Navigate between the Lab, Bank, and Stage with ease."); }
void ContainerGrid::refresh() { renderer.setDrawColor(Color::BLACK); for (size_t i = 0; i != _linked.size(); ++i) { const px_t x = i % _cols, y = i / _cols; const auto slotRect = ScreenRect{x * (Client::ICON_SIZE + _gap + 2), y * (Client::ICON_SIZE + _gap + 2) + 1, Client::ICON_SIZE + 2, Client::ICON_SIZE + 2}; if (_solidBackground) { static const auto SLOT_BACKGROUND_OFFSET = ScreenRect{1, 1, -2, -2}; renderer.fillRect(slotRect + SLOT_BACKGROUND_OFFSET); } if (dragSlot != i || dragGrid != this) { // Don't draw an item being moved by the mouse. const std::pair<const ClientItem *, size_t> &slot = _linked[i]; if (slot.first != nullptr) { slot.first->icon().draw(slotRect.x + 1, slotRect.y + 1); if (slot.second > 1) { Texture label(font(), makeArgs(slot.second), FONT_COLOR), labelOutline(font(), toString(slot.second), Color::UI_OUTLINE); px_t x = slotRect.x + slotRect.w - label.width() - 1, y = slotRect.y + slotRect.h - label.height() + textOffset; labelOutline.draw(x - 1, y); labelOutline.draw(x + 1, y); labelOutline.draw(x, y - 1); labelOutline.draw(x, y + 1); label.draw(x, y); } } } // Highlight moused-over slot if (_mouseOverSlot == i) { _highlight.draw(slotRect.x + 1, slotRect.y + 1); // Indicate matching gear slot if an item is being dragged } else if (_serial == Client::GEAR && dragGrid != nullptr) { size_t itemSlot = dragGrid->_linked[dragSlot].first->gearSlot(); (i == itemSlot ? _highlightGood : _highlightBad) .draw(slotRect.x + 1, slotRect.y + 1); } } // Item tooltip if (_mouseOverSlot != NO_SLOT) { const ClientItem *item = _linked[_mouseOverSlot].first; if (item == nullptr) clearTooltip(); else setTooltip(item->tooltip()); } }
DiskSpaceMeter::DiskSpaceMeter() { font = Font("Small Text", 12, Font::plain); // MemoryInputStream mis(BinaryData::silkscreenserialized, BinaryData::silkscreenserializedSize, false); // Typeface::Ptr typeface = new CustomTypeface(mis); // font = Font(typeface); // font.setHeight(12); setTooltip("Disk space available"); }
ChangeKeyButton (KeyMappingEditorComponent& kec, const CommandID command, const String& keyName, const int keyIndex) : Button (keyName), owner (kec), commandID (command), keyNum (keyIndex) { setWantsKeyboardFocus (false); setTriggeredOnMouseDown (keyNum >= 0); setTooltip (keyIndex < 0 ? TRANS("Adds a new key-mapping") : TRANS("Click to change this key-mapping")); }
ChangeKeyButton (KeyMappingEditorComponent& owner_, const CommandID commandID_, const String& keyName, const int keyNum_) : Button (keyName), owner (owner_), commandID (commandID_), keyNum (keyNum_) { setWantsKeyboardFocus (false); setTriggeredOnMouseDown (keyNum >= 0); setTooltip (keyNum_ < 0 ? TRANS("adds a new key-mapping") : TRANS("click to change this key-mapping")); }
bool StatusWnd::create(HWND imeUIWnd) { HIMC hIMC = (HIMC)GetWindowLong( imeUIWnd, IMMGWL_IMC ); if ( g_isWinLogon ) return false; IMCLock imc(hIMC); hwnd = CreateWindowEx(0, g_statusWndClass, NULL, WS_POPUP|WS_CLIPCHILDREN, 0, 0, 0, 0, imeUIWnd, NULL, g_dllInst, NULL); if( !hwnd ) return false; TCHAR bmppath[MAX_PATH]; GetSystemDirectory( bmppath, MAX_PATH ); _tcscat( bmppath, _T("\\IME\\Chewing\\statuswnd.bmp") ); HBITMAP tbbmp = (HBITMAP)LoadImage( NULL, bmppath, IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR|LR_LOADFROMFILE); this->setTheme(tbbmp); iconChi = (HICON)LoadImage( g_dllInst, LPCTSTR (IDI_CHI), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR ); iconEng = (HICON)LoadImage( g_dllInst, LPCTSTR (IDI_ENG), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR ); iconFull = (HICON)LoadImage( g_dllInst, LPCTSTR (IDI_FULL), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR ); iconHalf = (HICON)LoadImage( g_dllInst, LPCTSTR (IDI_HALF), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR ); iconConfig = (HICON)LoadImage( g_dllInst, LPCTSTR (IDI_CONFIG), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR ); TCHAR tip[128]; LoadString(g_dllInst, ID_CHI_ENG, tip, sizeof(tip) ); addBtn( ID_CHI_ENG, imc.isChinese() ? iconChi : iconEng, tip ); LoadString(g_dllInst, ID_FULL_HALF, tip, sizeof(tip) ); addBtn( ID_FULL_HALF, imc.isFullShape() ? iconFull : iconHalf, tip ); // This should be disabled in WinLogon for security reason. if( ! g_isWinLogon ) { LoadString(g_dllInst, ID_MENU, tip, sizeof(tip) ); addBtn( ID_MENU, iconConfig, tip ); } IMEUILock ui(GetParent(hwnd)); setTooltip( &ui.getIMEUI()->tooltip ); setCmdTarget(hwnd); int w, h; XPToolbar::getSize(&w, &h); SetWindowPos( hwnd, NULL, 0, 0, w, h, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER ); return true; }
void BCMLabel::applyProperties(LabelProperties& props) { applyWidgetProperties(props); maxTextLines = props.maxTextLines; String labelText = getText(); String tooltip = getText(); mapsToParameter = false; if (getName().equalsIgnoreCase("configurationfilepath")) labelText = scopeSyncGUI.getScopeSync().getConfigurationFile().getFullPathName(); else if (getName().equalsIgnoreCase("configurationname")) labelText = scopeSyncGUI.getScopeSync().getConfigurationName(true); else { setupMapping(Ids::label, getName(), props.mappingParentType, props.mappingParent); if (mapsToParameter) { String shortDescription; String fullDescription; parameter->getDescriptions(shortDescription, fullDescription); tooltip = fullDescription; if (props.parameterTextDisplay == LabelProperties::parameterName) labelText = parameter->getName(); else if (props.parameterTextDisplay == LabelProperties::shortDescription) labelText = shortDescription; else if (props.parameterTextDisplay == LabelProperties::fullDescription) labelText = fullDescription; else if (props.parameterTextDisplay == LabelProperties::scopeCode) labelText = parameter->getScopeCode(); } } // Only relevant if label is editable. Not currently supported setEditable(false, false, false); setText(labelText, dontSendNotification); setTooltip(tooltip); setFont(Font(props.fontHeight, props.fontStyleFlags)); setJustificationType(Justification(props.justificationFlags)); }
MuteButton::MuteButton() : ImageButton("MuteButton") { Image offimage = ImageCache::getFromMemory(BinaryData::muteoff_png, BinaryData::muteoff_pngSize); Image onimage = ImageCache::getFromMemory(BinaryData::muteon_png, BinaryData::muteon_pngSize); setImages(false, true, true, offimage, 1.0f, Colours::white.withAlpha(0.0f), offimage, 1.0f, Colours::black.withAlpha(0.0f), onimage, 1.0f, Colours::white.withAlpha(0.0f)); setClickingTogglesState(true); setTooltip("Mute audio"); }
RecordButton::RecordButton() : DrawableButton("RecordButton", DrawableButton::ImageFitted) { DrawablePath normal, over, down; Path p; p.addEllipse(0.0,0.0,20.0,20.0); normal.setPath(p); normal.setFill(Colours::lightgrey); normal.setStrokeThickness(0.0f); over.setPath(p); over.setFill(Colours::black); over.setStrokeFill(Colours::black); over.setStrokeThickness(5.0f); setImages(&normal, &over, &over); //setBackgroundColours(Colours::darkgrey, Colours::red); setClickingTogglesState(true); setTooltip("Start/stop writing to disk"); }
SelectorButton::SelectorButton() : DrawableButton (T("Selector"), DrawableButton::ImageFitted) { DrawablePath normal, over, down; Path p; p.addEllipse (0.0,0.0,20.0,20.0); normal.setPath (p); normal.setFill (Colours::lightgrey); normal.setStrokeThickness (0.0f); over.setPath (p); over.setFill (Colours::black); over.setStrokeFill (Colours::black); over.setStrokeThickness (5.0f); setImages (&normal, &over, &over); setBackgroundColours(Colours::darkgrey, Colours::green); setClickingTogglesState (true); setTooltip ("Toggle a state."); }
void cUObject::sendTooltip( cUOSocket* mSock ) { if( tooltip_ == 0xFFFFFFFF ) { tooltip_ = World::instance()->getUnusedTooltip(); setTooltip( tooltip_ ); } cUOTxAttachTooltip* tooltip = new cUOTxAttachTooltip; tooltip->setId( tooltip_ ); tooltip->setSerial( serial() ); if( tooltip_ >= mSock->toolTips()->size() || !mSock->haveTooltip( tooltip_ ) ) { mSock->addTooltip( tooltip_ ); mSock->send( tooltip ); } delete( tooltip ); }
PinComponent::PinComponent (PMixAudioEngine& audioEngine, const uint32 nodeID_, const int index_, const bool isInput_) : nodeID (nodeID_) , index (index_) , isInput (isInput_) , mouseOver(false) , busIdx(0) , audioEngine(audioEngine) { if (const AudioProcessorGraph::Node::Ptr node = audioEngine.getDoc().getNodeForId (nodeID_)) { String tip; if (index_ == PMixDocument::midiChannelNumber) { tip = isInput ? "MIDI Input" : "MIDI Output"; } else { const AudioProcessor& processor = *node->getProcessor(); int channel; channel = processor.getOffsetInBusBufferForAbsoluteChannelIndex (isInput, index, busIdx); if (const AudioProcessor::Bus* bus = processor.getBus (isInput, busIdx)) tip = bus->getName() + String (": ") + AudioChannelSet::getAbbreviatedChannelTypeName (bus->getCurrentLayout().getTypeOfChannel (channel)); else tip = (isInput ? "Main Input: " : "Main Output: ") + String (index + 1); } setTooltip (tip); } setSize (16, 16); }
void setSelected(bool isSelected) { m_selected = isSelected; setTooltip(m_selected ? "Shift+Click to see event log." : String::empty); }
void HyperlinkButton::setURL (const URL& newURL) noexcept { url = newURL; setTooltip (newURL.toString (false)); }
TextButton::TextButton (const String& name, const String& toolTip) : Button (name) { setTooltip (toolTip); }
ControlPanelButton::ControlPanelButton(ControlPanel* cp_) : cp(cp_) { open = false; setTooltip("Show/hide recording options"); }
LRESULT ZLWin32ApplicationWindow::mainLoopCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case MY_WM_FULLSCREEN: setFullscreen(true); return 0; case WM_MEASUREITEM: if (!myPopupMenu.isNull()) { myPopupMenu->measureItem(*(MEASUREITEMSTRUCT*)lParam); } return 1; case WM_DRAWITEM: if (!myPopupMenu.isNull()) { myPopupMenu->drawItem(*(DRAWITEMSTRUCT*)lParam); } return 1; case WM_MOUSEWHEEL: if (!mouseEventsAreBlocked()) { application().doActionByKey( ((short)HIWORD(wParam) > 0) ? ZLApplication::MouseScrollUpKey : ZLApplication::MouseScrollDownKey ); } return 0; case WM_PAINT: { LRESULT code = DefWindowProc(hWnd, uMsg, wParam, lParam); updateWindowToolbarInfo(); updateFullscreenToolbarSize(); return code; } case WM_TIMER: ((ZLWin32TimeManager&)ZLTimeManager::instance()).execute(wParam); return 0; case WM_CREATE: myMainWindow = hWnd; ZLApplicationWindow::init(); return DefWindowProc(hWnd, uMsg, wParam, lParam); case WM_KEYDOWN: case WM_SYSKEYDOWN: if (wParam == 0x10) { myKeyboardModifierMask |= 0x1; } else if (wParam == 0x11) { myKeyboardModifierMask |= 0x2; } else if (wParam == 0x12) { myKeyboardModifierMask |= 0x4; } else { application().doActionByKey(ZLKeyUtil::keyName(wParam, wParam, myKeyboardModifierMask)); myKeyboardModifierMask = 0; } return 0; case WM_KEYUP: case WM_SYSKEYUP: if (wParam == 0x10) { myKeyboardModifierMask &= ~0x1; } else if (wParam == 0x11) { myKeyboardModifierMask &= ~0x2; } else if (wParam == 0x12) { myKeyboardModifierMask &= ~0x4; } return 0; case WM_SIZE: { RECT rebarRect; GetWindowRect(myRebar, &rebarRect); int offset = rebarRect.bottom - rebarRect.top - 1; MoveWindow(myRebar, 0, 0, LOWORD(lParam), rebarRect.bottom - rebarRect.top, true); if (myFullScreen) { offset = 0; } MoveWindow(myWin32ViewWidget->handle(), 0, offset, LOWORD(lParam), HIWORD(lParam) - offset, true); return DefWindowProc(hWnd, uMsg, wParam, lParam); } case WM_CLOSE: if (myFullScreen) { myWindowStateOption.setValue(FULLSCREEN); } else if (IsMaximized(myMainWindow)) { myWindowStateOption.setValue(MAXIMIZED); } else { myWindowStateOption.setValue(NORMAL); RECT rectangle; GetWindowRect(myMainWindow, &rectangle); myXOption.setValue(rectangle.left); myYOption.setValue(rectangle.top); myWidthOption.setValue(rectangle.right - rectangle.left + 1); myHeightOption.setValue(rectangle.bottom - rectangle.top + 1); } application().closeView(); return 0; case WM_DESTROY: PostQuitMessage(0); return 0; case WM_COMMAND: onToolbarButtonRelease(LOWORD(wParam)); return 0; case WM_NOTIFY: { const NMHDR *notificationHeader = (const NMHDR*)lParam; switch (notificationHeader->code) { case TTN_NEEDTEXT: setTooltip(*(TOOLTIPTEXT*)lParam); break; case NM_CUSTOMDRAW: updateParameters(); break; case TBN_DROPDOWN: runPopup(*(const NMTOOLBAR*)lParam); break; case RBN_CHEVRONPUSHED: processChevron(*(const NMREBARCHEVRON*)lParam); break; } return 0; } default: return DefWindowProc(hWnd, uMsg, wParam, lParam); } }