//----------------------------------------------------------------------------// void Scrollbar::onThumbTrackEnded(WindowEventArgs& e) { fireEvent(EventThumbTrackEnded, e, EventNamespace); }
void ScrollablePane::onContentPaneScrolled(WindowEventArgs& e) { updateContainerPosition(); fireEvent(EventContentPaneScrolled, e, EventNamespace); }
/************************************************************************ Handle multiselect mode changed ************************************************************************/ void ItemListbox::onMultiSelectModeChanged(WindowEventArgs& e) { fireEvent(EventMultiSelectModeChanged, e); }
// CMeteringMode message handler void CMeteringMode::OnSelChange() { DWORD_PTR data = GetItemData(GetCurSel()); fireEvent(&data); }
void ScrollablePane::onHorzScrollbarModeChanged(WindowEventArgs& e) { fireEvent(EventHorzScrollbarModeChanged, e, EventNamespace); }
/************************************************************************* Handler called internally when the currently selected item or items changes. *************************************************************************/ void Listbox::onSelectionChanged(WindowEventArgs& e) { invalidate(); fireEvent(EventSelectionChanged, e, EventNamespace); }
/************************************************************************* Handler called internally when the multi-select mode setting changes. *************************************************************************/ void Listbox::onMultiselectModeChanged(WindowEventArgs& e) { fireEvent(EventMultiselectModeChanged, e, EventNamespace); }
//----------------------------------------------------------------------------// void Editbox::onMaskedRenderingModeChanged(WindowEventArgs& e) { invalidate(); fireEvent(EventMaskedRenderingModeChanged , e, EventNamespace); }
//----------------------------------------------------------------------------// void Editbox::onValidationStringChanged(WindowEventArgs& e) { fireEvent(EventValidationStringChanged , e, EventNamespace); }
//----------------------------------------------------------------------------// void Editbox::onKeyDown(KeyEventArgs& e) { // fire event. fireEvent(EventKeyDown, e, Window::EventNamespace); if (e.handled == 0 && hasInputFocus()) { if (isReadOnly()) { Window::onKeyDown(e); return; } WindowEventArgs args(this); switch (e.scancode) { case Key::LeftShift: case Key::RightShift: if (getSelectionLength() == 0) d_dragAnchorIdx = d_caretPos; break; case Key::Backspace: handleBackspace(); break; case Key::Delete: handleDelete(); break; case Key::Tab: case Key::Return: case Key::NumpadEnter: // Fire 'input accepted' event onTextAcceptedEvent(args); break; case Key::ArrowLeft: if (e.sysKeys & Control) handleWordLeft(e.sysKeys); else handleCharLeft(e.sysKeys); break; case Key::ArrowRight: if (e.sysKeys & Control) handleWordRight(e.sysKeys); else handleCharRight(e.sysKeys); break; case Key::Home: handleHome(e.sysKeys); break; case Key::End: handleEnd(e.sysKeys); break; default: Window::onKeyDown(e); return; } ++e.handled; } }
//----------------------------------------------------------------------------// void Editbox::onReadOnlyChanged(WindowEventArgs& e) { invalidate(); fireEvent(EventReadOnlyModeChanged, e, EventNamespace); }
void RootEventPlugin::shutdown() { fireEvent(Shutdown, RootEventArgs()); }
void RootEventPlugin::initialise() { fireEvent(Initialized, RootEventArgs()); }
//----------------------------------------------------------------------------// void Scrollbar::onScrollConfigChanged(WindowEventArgs& e) { performChildWindowLayout(); fireEvent(EventScrollConfigChanged, e, EventNamespace); }
void LLSpeakerMgr::update(BOOL resort_ok) { if (!gVoiceClient) { return; } LLColor4 speaking_color = gSavedSettings.getColor4("SpeakingColor"); LLColor4 overdriven_color = gSavedSettings.getColor4("OverdrivenColor"); if(resort_ok) // only allow list changes when user is not interacting with it { updateSpeakerList(); } // update status of all current speakers BOOL voice_channel_active = (!mVoiceChannel && gVoiceClient->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive()); for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end();) { LLUUID speaker_id = speaker_it->first; LLSpeaker* speakerp = speaker_it->second; speaker_map_t::iterator cur_speaker_it = speaker_it++; if (voice_channel_active && gVoiceClient->getVoiceEnabled(speaker_id)) { speakerp->mSpeechVolume = gVoiceClient->getCurrentPower(speaker_id); BOOL moderator_muted_voice = gVoiceClient->getIsModeratorMuted(speaker_id); if (moderator_muted_voice != speakerp->mModeratorMutedVoice) { speakerp->mModeratorMutedVoice = moderator_muted_voice; speakerp->fireEvent(new LLSpeakerVoiceModerationEvent(speakerp)); } if (gVoiceClient->getOnMuteList(speaker_id) || speakerp->mModeratorMutedVoice) { speakerp->mStatus = LLSpeaker::STATUS_MUTED; } else if (gVoiceClient->getIsSpeaking(speaker_id)) { // reset inactivity expiration if (speakerp->mStatus != LLSpeaker::STATUS_SPEAKING) { speakerp->mLastSpokeTime = mSpeechTimer.getElapsedTimeF32(); speakerp->mHasSpoken = TRUE; } speakerp->mStatus = LLSpeaker::STATUS_SPEAKING; // interpolate between active color and full speaking color based on power of speech output speakerp->mDotColor = speaking_color; if (speakerp->mSpeechVolume > LLVoiceClient::OVERDRIVEN_POWER_LEVEL) { speakerp->mDotColor = overdriven_color; } } else { speakerp->mSpeechVolume = 0.f; speakerp->mDotColor = ACTIVE_COLOR; if (speakerp->mHasSpoken) { // have spoken once, not currently speaking speakerp->mStatus = LLSpeaker::STATUS_HAS_SPOKEN; } else { // default state for being in voice channel speakerp->mStatus = LLSpeaker::STATUS_VOICE_ACTIVE; } } } // speaker no longer registered in voice channel, demote to text only else if (speakerp->mStatus != LLSpeaker::STATUS_NOT_IN_CHANNEL) { if(speakerp->mType == LLSpeaker::SPEAKER_EXTERNAL) { // external speakers should be timed out when they leave the voice channel (since they only exist via SLVoice) speakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL; } else { speakerp->mStatus = LLSpeaker::STATUS_TEXT_ONLY; speakerp->mSpeechVolume = 0.f; speakerp->mDotColor = ACTIVE_COLOR; } } } if(resort_ok) // only allow list changes when user is not interacting with it { // sort by status then time last spoken std::sort(mSpeakersSorted.begin(), mSpeakersSorted.end(), LLSortRecentSpeakers()); } // for recent speakers who are not currently speaking, show "recent" color dot for most recent // fading to "active" color S32 recent_speaker_count = 0; S32 sort_index = 0; speaker_list_t::iterator sorted_speaker_it; for(sorted_speaker_it = mSpeakersSorted.begin(); sorted_speaker_it != mSpeakersSorted.end(); ) { LLPointer<LLSpeaker> speakerp = *sorted_speaker_it; // color code recent speakers who are not currently speaking if (speakerp->mStatus == LLSpeaker::STATUS_HAS_SPOKEN) { speakerp->mDotColor = lerp(speaking_color, ACTIVE_COLOR, clamp_rescale((F32)recent_speaker_count, -2.f, 3.f, 0.f, 1.f)); recent_speaker_count++; } // stuff sort ordinal into speaker so the ui can sort by this value speakerp->mSortIndex = sort_index++; // remove speakers that have been gone too long if (speakerp->mStatus == LLSpeaker::STATUS_NOT_IN_CHANNEL && speakerp->mActivityTimer.hasExpired()) { fireEvent(new LLSpeakerListChangeEvent(this, speakerp->mID), "remove"); mSpeakers.erase(speakerp->mID); sorted_speaker_it = mSpeakersSorted.erase(sorted_speaker_it); } else { ++sorted_speaker_it; } } }
//----------------------------------------------------------------------------// void Editbox::onMaximumTextLengthChanged(WindowEventArgs& e) { fireEvent(EventMaximumTextLengthChanged , e, EventNamespace); }
/************************************************************************* Handler called internally when the list contents are changed *************************************************************************/ void Listbox::onListContentsChanged(WindowEventArgs& e) { configureScrollbars(); invalidate(); fireEvent(EventListContentsChanged, e, EventNamespace); }
//----------------------------------------------------------------------------// void Editbox::onTextValidityChanged(RegexMatchStateEventArgs& e) { fireEvent(EventTextValidityChanged, e, EventNamespace); }
/************************************************************************* Handler called internally when the sort mode setting changes. *************************************************************************/ void Listbox::onSortModeChanged(WindowEventArgs& e) { invalidate(); fireEvent(EventSortModeChanged, e, EventNamespace); }
//----------------------------------------------------------------------------// void Editbox::onCaretMoved(WindowEventArgs& e) { invalidate(); fireEvent(EventCaretMoved , e, EventNamespace); }
/************************************************************************* Handler called internally when the forced display of the horizontal scroll bar setting changes. *************************************************************************/ void Listbox::onHorzScrollbarModeChanged(WindowEventArgs& e) { invalidate(); fireEvent(EventHorzScrollbarModeChanged, e, EventNamespace); }
//----------------------------------------------------------------------------// void Editbox::onEditboxFullEvent(WindowEventArgs& e) { fireEvent(EventEditboxFull, e, EventNamespace); }
void ScrollablePane::onContentPaneChanged(WindowEventArgs& e) { fireEvent(EventContentPaneChanged, e, EventNamespace); }
//----------------------------------------------------------------------------// void Editbox::onTextAcceptedEvent(WindowEventArgs& e) { fireEvent(EventTextAccepted, e, EventNamespace); }
void ScrollablePane::onAutoSizeSettingChanged(WindowEventArgs& e) { fireEvent(EventAutoSizeSettingChanged, e, EventNamespace); }
LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { static UINT s_uTaskBarCreated = 0; switch(uMsg) { case WM_CREATE: { g_hwndMain = hwnd; // Register task bar (re)creation in order to reload systray icons after explorer crashes s_uTaskBarCreated = RegisterWindowMessage(REGISTER_MESSAGE); // Set Icons SendMessage(hwnd, WM_SETICON, ICON_BIG, (LONG)(LONG_PTR)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_MAIN_ICON), IMAGE_ICON, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR)); SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LONG)(LONG_PTR)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_MAIN_ICON), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR)); ShowWindow(hwnd, SW_HIDE); // Clear the list g_IconTray.clear(); installHookKeyboard(); // Open the configuration if (openConfig() == FALSE) { uninstallHookKeyboard(); clearMenuSkin(); MessageBox(g_hwndMain, L"Configuration file not found or invalid", ERR_MSGBOX_TITLE, NULL); PostQuitMessage(0); return 0; } // Retreive the version of Windows (in order to know if it is a win200 or superior) windowsVersion = GetWindowsVersion(); // Initialisation of variables for menus InitMenuVars(); // Add the system tray icons (depends of the configuration) ShowTrayIcons(); // Show loading error messages if (g_loadingmessage != NULL) { ShowBalloon(ERR_MSGBOX_TITLE, g_loadingmessage, 0, NIIF_ERROR); free(g_loadingmessage); g_loadingmessage = NULL; } // Launch application in "autorun" mode fireEvent(PROG_EVENT_START); FlushMemory(); } break; case WM_HOTKEY: if( (wParam >= IDH_HOTKEY_MENU) && (wParam <= (IDH_HOTKEY_MENU + g_portal->hotkeys.size()) ) ) { // Detect application item or menu item in order to open a menu or launch the application PortalProg* l_sp = g_portal->hotkeys[ wParam - IDH_HOTKEY_MENU ]; while( l_sp ) { if( l_sp->progs.size() > 0 ) { ShowTrayMenu(l_sp, PORTAL_MENU_HOTKEY); } else { l_sp->run(false); // Some commands could call quitPortal. In this case g_portal is set to NULL. if(g_portal == NULL) return 0; } l_sp = l_sp->nextSameHotkey; } } FlushMemory(); break; case WM_DESTROY: { quitPortal(); } break; case WM_MYTRAYMSG: if ((wParam >= IDI_MAIN_ICON) && g_portal && (wParam <= (IDI_MAIN_ICON + g_portal->menus.size()))) { // Find the clicked systray int pos = (int)wParam - IDI_MAIN_ICON; if( ((UINT)lParam == WM_RBUTTONUP) || ((UINT)lParam == WM_LBUTTONUP) || ((UINT)lParam == WM_MOUSEMOVE) ) { // Left click : minimalist menu // Right click : Complete menu (with About/Reload/Quit) // Auto Open : Complete menu (like right click) with a automatic dismiss int param = PORTAL_MENU_SYSTRAY; if((UINT)lParam == WM_RBUTTONUP) { param = PORTAL_MENU_SYSTRAY_CMD; } if( ((UINT)lParam == WM_MOUSEMOVE) ) { if( (g_portal->menus[pos] != NULL) && (g_portal->menus[pos]->options & PROG_OPTION_AUTOOPEN) ) { param = PORTAL_MENU_SYSTRAY_AUTO; } else { return 0; } } // Detect if the icon is for a menu or a application if( (g_portal->menus[pos] != NULL) && ( g_portal->menus[pos]->progs.size() > 0 ) ) { ShowTrayMenu(g_portal->menus[pos], param); g_currentMenu = pos; } else if( (g_portal->menus[pos] != NULL) && (g_portal->menus[pos]->progExe != NULL )) { if((UINT)lParam == WM_LBUTTONUP) { g_portal->menus[pos]->run(true); g_currentMenu = pos; } else { ShowTrayMenu(g_portal->menus[pos], param); g_currentMenu = pos; } } else { ShowTrayMenu(NULL, param); g_currentMenu = 0; } FlushMemory(); } else if( (UINT)lParam == NIN_BALLOONUSERCLICK ) { if(g_aboutbaloon) checkGuiproVersion(); FlushMemory(); return 0; } } break; case WM_INITMENUPOPUP : OnInitMenuPopup(hwnd, wParam, lParam); break; case WM_UNINITMENUPOPUP: OnUninitMenuPopup(hwnd, wParam, lParam); break; case WM_MEASUREITEM : OnMeasureItem(hwnd, wParam, lParam); break; case WM_DRAWITEM : OnDrawItem(hwnd, wParam, lParam); break; case WM_MENUCHAR: return OnMenuCharItem(hwnd, wParam, lParam); case WM_COMMAND: // Retreive a menu command if( wParam == IDM_EXIT ) { quitPortal(); } else if( wParam == IDM_RELOAD ) { reloadPortalConfig(); } else if( wParam == IDM_ABOUT ) { ShowAbout(g_currentMenu); FlushMemory(); } else if( ((UINT)wParam >= (PORTAL_HK_ID)) && ( (UINT)wParam <= (UINT)(PORTAL_HK_ID + menuGetNbElem()) ) ) { PortalProg* l_sp = menuGetElem( (int)(wParam - 1 - PORTAL_HK_ID) ); l_sp->run(true); FlushMemory(); } else if( ((UINT)wParam >= (PORTAL_FILE_ID)) && ( (UINT)wParam < (UINT)(PORTAL_FILE_ID + menuGetNbFiles()) ) ) { PortalProg* l_sp = menuGetFile( (int)(wParam - PORTAL_FILE_ID) ); l_sp->run(true); FlushMemory(); for(PortalProgVector::iterator i = g_portal_files.begin(); i != g_portal_files.end(); i++) { delete (*i); } g_portal_files.clear(); } break; default: if( uMsg == s_uTaskBarCreated ) { // Traskbar (re)creation, we have to reset systray icons ReloadTrayIcons(); FlushMemory(); } else { return(DefWindowProc(hwnd, uMsg, wParam, lParam)); } break; } return 0; }
/************************************************************************ Handle selection changed ************************************************************************/ void ItemListbox::onSelectionChanged(WindowEventArgs& e) { fireEvent(EventSelectionChanged, e); }
//---------------------------------------------------------------------- Spaceship::~Spaceship() { NamedProperties params; params.set( "spaceship", this ); fireEvent( "SpaceshipDied", params ); }
/************************************************************************* handler invoked internally when the button is clicked. *************************************************************************/ void PushButton::onClicked(WindowEventArgs& e) { fireEvent(EventClicked, e, EventNamespace); }
//----------------------------------------------------------------------------// void Scrollbar::onScrollPositionChanged(WindowEventArgs& e) { fireEvent(EventScrollPositionChanged, e, EventNamespace); }