// Initialize void EmAddInit(HWND hWnd, EM_ADD *p) { // Validate arguments if (hWnd == NULL || p == NULL) { return; } // Initialize controls CbAddStr(hWnd, C_PACKET_SWITCH, _UU("SM_LOG_SWITCH_0"), 0); CbAddStr(hWnd, C_PACKET_SWITCH, _UU("SM_LOG_SWITCH_1"), 1); CbAddStr(hWnd, C_PACKET_SWITCH, _UU("SM_LOG_SWITCH_2"), 2); CbAddStr(hWnd, C_PACKET_SWITCH, _UU("SM_LOG_SWITCH_3"), 3); CbAddStr(hWnd, C_PACKET_SWITCH, _UU("SM_LOG_SWITCH_4"), 4); CbAddStr(hWnd, C_PACKET_SWITCH, _UU("SM_LOG_SWITCH_5"), 5); if (p->NewMode) { // Newly creation mode RPC_ENUM_DEVICE t; HUB_LOG g; Zero(&g, sizeof(g)); g.PacketLogSwitchType = LOG_SWITCH_DAY; g.PacketLogConfig[PACKET_LOG_TCP_CONN] = g.PacketLogConfig[PACKET_LOG_DHCP] = 1; EmHubLogToDlg(hWnd, &g); Zero(&t, sizeof(t)); if (CALL(hWnd, EcEnumAllDevice(p->Rpc, &t))) { UINT i; CbSetHeight(hWnd, C_DEVICE, 18); for (i = 0;i < t.NumItem;i++) { RPC_ENUM_DEVICE_ITEM *dev = &t.Items[i]; wchar_t tmp[MAX_SIZE]; StrToUni(tmp, sizeof(tmp), dev->DeviceName); CbAddStr(hWnd, C_DEVICE, tmp, 0); } FreeRpcEnumDevice(&t); } SetText(hWnd, 0, _UU("EM_ADD_NEW")); } else { // Edit mode (to obtain a configuration) wchar_t tmp[MAX_PATH]; RPC_ADD_DEVICE t; Hide(hWnd, R_PROMISCUS); Zero(&t, sizeof(t)); StrCpy(t.DeviceName, sizeof(t.DeviceName), p->DeviceName); if (CALL(hWnd, EcGetDevice(p->Rpc, &t))) { EmHubLogToDlg(hWnd, &t.LogSetting); } else { Close(hWnd); } StrToUni(tmp, sizeof(tmp), p->DeviceName); CbAddStr(hWnd, C_DEVICE, tmp, 0); Disable(hWnd, C_DEVICE); SetText(hWnd, 0, _UU("EM_ADD_EDIT")); } EmAddUpdate(hWnd, p); }
// -------------------------------------------------------------------------- void CToolTipWnd::RelayEvent( LPMSG lpMsg ) { switch( lpMsg->message ) { case WM_KEYDOWN: Hide(); break; case WM_LBUTTONDOWN: case WM_RBUTTONDOWN: case WM_NCLBUTTONDOWN: case WM_NCRBUTTONDOWN: Hide(); break; case WM_MOUSEMOVE: case WM_NCMOUSEMOVE: { // This is a fix to allow for messages to be made visible when not // using the mouse. if ( m_bSkipNextMove ) { // TRACE0("Move skipped\n"); m_bSkipNextMove = false; return; } else { // TRACE0("Move\n"); } HWND wndPt = lpMsg->hwnd; CPoint pt; pt.x = lpMsg->pt.x; pt.y = lpMsg->pt.y; // Don't show the tooltips if the application does not have the input focus CWnd *pFocusWnd = AfxGetApp()->m_pMainWnd->GetFocus(); if ( pFocusWnd == NULL ) break; // There are 3 possible states regarding tooltip controls: // a) moving outside any ctrl // b) going from outside a ctrl to inside // c) moving inside the control // d) going from inside a ctrl to outside BTOOLINFO *stToolInfo = NULL; BOOL found = m_toolPtr.Lookup( wndPt, (void *&)stToolInfo ); if ( m_pCurrwnd == NULL ) // was not in a control { if ( found ) // enters a control (now in a control) { // TRACE0("OUT -> IN\n"); m_clrTextColor = stToolInfo->clrToolTextClr; m_strText = stToolInfo->strToolText; Show( pt.x, pt.y, stToolInfo->iTimerDelay, stToolInfo->iTimerDelayShow ); m_pCurrwnd = wndPt; } else // still not in a control { // TRACE0("OUT -> OUT\n"); } } else // was in a control { ASSERT( m_pCurrwnd != NULL ); CRect rect; ::GetWindowRect( m_pCurrwnd, &rect ); if ( rect.PtInRect( lpMsg->pt ) ) // still in the same control { // TRACE0("IN -> IN (same)\n"); if ( m_bStuck ) if ( IsWindowVisible() ) { // may be over a tooltip, so look for previous control if ( ! found ) found = m_toolPtr.Lookup( m_pCurrwnd, (void *&)stToolInfo ); ASSERT( found ); Show( pt.x, pt.y, stToolInfo->iTimerDelay, stToolInfo->iTimerDelayShow ); } } else // gone outside the control { Hide(); m_pCurrwnd = NULL; if ( found ) // to another control { // TRACE0("IN -> IN (other)\n"); m_clrTextColor = stToolInfo->clrToolTextClr; m_strText = stToolInfo->strToolText; Show( pt.x, pt.y, stToolInfo->iTimerDelay, stToolInfo->iTimerDelayShow ); m_pCurrwnd = wndPt; } else { // TRACE0("IN -> OUT\n"); } } } } break; //WM_MOUSEMOVE } }
bool wxProgressDialog::Update(int value, const wxString& newmsg, bool *skip) { wxASSERT_MSG( value == -1 || m_gauge, wxT("cannot update non existent dialog") ); #ifdef __WXMSW__ value /= m_factor; #endif // __WXMSW__ wxASSERT_MSG( value <= m_maximum, wxT("invalid progress value") ); if ( m_gauge ) m_gauge->SetValue(value); UpdateMessage(newmsg); if ( (m_elapsed || m_remaining || m_estimated) && (value != 0) ) { unsigned long elapsed = wxGetCurrentTime() - m_timeStart; if ( m_last_timeupdate < elapsed || value == m_maximum ) { m_last_timeupdate = elapsed; unsigned long estimated = m_break + (unsigned long)(( (double) (elapsed-m_break) * m_maximum ) / ((double)value)) ; if ( estimated > m_display_estimated && m_ctdelay >= 0 ) { ++m_ctdelay; } else if ( estimated < m_display_estimated && m_ctdelay <= 0 ) { --m_ctdelay; } else { m_ctdelay = 0; } if ( m_ctdelay >= m_delay // enough confirmations for a higher value || m_ctdelay <= (m_delay*-1) // enough confirmations for a lower value || value == m_maximum // to stay consistent || elapsed > m_display_estimated // to stay consistent || ( elapsed > 0 && elapsed < 4 ) // additional updates in the beginning ) { m_display_estimated = estimated; m_ctdelay = 0; } } long display_remaining = m_display_estimated - elapsed; if ( display_remaining < 0 ) { display_remaining = 0; } SetTimeLabel(elapsed, m_elapsed); SetTimeLabel(m_display_estimated, m_estimated); SetTimeLabel(display_remaining, m_remaining); } if ( value == m_maximum ) { if ( m_state == Finished ) { // ignore multiple calls to Update(m_maximum): it may sometimes be // troublesome to ensure that Update() is not called twice with the // same value (e.g. because of the rounding errors) and if we don't // return now we're going to generate asserts below return true; } // so that we return true below and that out [Cancel] handler knew what // to do m_state = Finished; if( !HasFlag(wxPD_AUTO_HIDE) ) { EnableClose(); DisableSkip(); #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) EnableCloseButton(); #endif // __WXMSW__ if ( newmsg.empty() ) { // also provide the finishing message if the application didn't m_msg->SetLabel(_("Done.")); } wxCHECK_MSG(wxEventLoopBase::GetActive(), false, "wxProgressDialog::Update needs a running event loop"); // allow the window to repaint: // NOTE: since we yield only for UI events with this call, there // should be no side-effects wxEventLoopBase::GetActive()->YieldFor(wxEVT_CATEGORY_UI); // NOTE: this call results in a new event loop being created // and to a call to ProcessPendingEvents() (which may generate // unwanted re-entrancies). (void)ShowModal(); } else // auto hide { // reenable other windows before hiding this one because otherwise // Windows wouldn't give the focus back to the window which had // been previously focused because it would still be disabled ReenableOtherWindows(); Hide(); } } else // not at maximum yet { return DoAfterUpdate(skip); } // update the display in case yielding above didn't do it Update(); return m_state != Canceled; }
void CompaniesFrame::OnTryClose(wxCloseEvent& event) { event.Veto(); wxCloseEvent new_event(wxEVT_COMMAND_BUTTON_CLICKED); button_cancel_->ProcessWindowEvent(new_event); Hide(); }
void NMNotificationWindow::update() { Hide(); }
void AI_Control( WorldStuff *world_stuff, int vehicle_number ) { Player *player; team_type team, enemy_team; short frames_till_traitor_deactivate; short frames_till_unscramble; short scramble_life; short traitor_life; /* Alias pointer to this player */ player = world_stuff->player_array; frames_till_traitor_deactivate = player[vehicle_number].tank.frames_till_traitor_deactivate; frames_till_unscramble = player[vehicle_number].tank.frames_till_unscramble; scramble_life = player[vehicle_number].tank.scramble_life; traitor_life = player[vehicle_number].tank.traitor_life; if( player[vehicle_number].tank.team == RED_TEAM ) { team = RED_TEAM; enemy_team = BLUE_TEAM; } else { team = BLUE_TEAM; enemy_team = RED_TEAM; } if( player[vehicle_number].character.skill_level > 2 && player[vehicle_number].controller != USER_CONTROL ) { if( player[vehicle_number].tank.traitor_active ) if( frames_till_traitor_deactivate < (traitor_life - 40) ) player[vehicle_number].tank.traitor_active = FALSE; /* if( player[vehicle_number].tank.controls_scrambled ) if( frames_till_unscramble < (scramble_life - 40) ) player[vehicle_number].tank.controls_scrambled = FALSE; */ } if( player[vehicle_number].tank.traitor_active ) { player[vehicle_number].tank.team = enemy_team; player[vehicle_number].team = enemy_team; } /* Clear this players input table */ Clear_Input_Table( player[vehicle_number].table ); /* Fill up this players events data structure */ Update_Player_Events( world_stuff, vehicle_number ); /* Figure out what state we are in now */ world_stuff->player_array[vehicle_number].character.state = Find_State( world_stuff, vehicle_number ); if( player[vehicle_number].tank.traitor_active ) { world_stuff->player_array[vehicle_number].character.state = ATTACK; } /* Based on the state of the ai call appropriate control function */ switch( world_stuff->player_array[vehicle_number].character.state ) { case ATTACK: Attack( world_stuff, vehicle_number ); break; case GET_ENERGY: Get_Energy( world_stuff, vehicle_number ); break; case PANIC: Panic( world_stuff, vehicle_number ); break; case BEZERK: Bezerk( world_stuff, vehicle_number ); break; case HIDE: Hide( world_stuff, vehicle_number ); break; case GROUPUP: Group( world_stuff, vehicle_number ); break; case GET_PYLONS: Get_Pylons( world_stuff, vehicle_number ); break; case PROTECT: Protect( world_stuff, vehicle_number ); break; case KILL_RADAR_BASE: Kill_Radar_Base( world_stuff, vehicle_number ); break; case PROTECT_RADAR_BASE: Protect_Radar_Base( world_stuff, vehicle_number ); break; case EVADE: Evade( world_stuff, vehicle_number ); default: break; } /* End case */ if( player[vehicle_number].tank.traitor_active ) { player[vehicle_number].tank.team = team; player[vehicle_number].team = team; } if( player[vehicle_number].tank.vtype == Dragonfly ) Cloak_Override( world_stuff, vehicle_number ); if( player[vehicle_number].tank.vtype == Roach ) Mines( world_stuff, vehicle_number ); if( player_events[vehicle_number].memory.stuck ) Stuck_Override( world_stuff, vehicle_number ); } /* End of AI_Control */
void XrcDlg::OnSimpleButton(wxCommandEvent &inEvent) { Hide(); EndModal(inEvent.GetId()); }
//--------------------------------------------------------------------------- void __fastcall TWebF::BrowserNavigateComplete2(TObject *Sender, LPDISPATCH pDisp, Variant *URL) { Hide(); }
void ServerWindow::DispatchMessage(int32 code) { switch(code) { /********** BWindow Messages ***********/ case AS_QUIT_WINDOW: { if (created){ window->Destroy(window); window = NULL; created = false; } break; } case AS_SEND_BEHIND: { // TODO // DFBResult err = x; fSession->WriteInt32 (AS_SEND_BEHIND); fSession->WriteInt32 (SERVER_TRUE); fSession->Sync(); break; } case AS_ACTIVATE_WINDOW: { bool act; fSession->ReadBool (&act); active = act; break; } case AS_SHOW_WINDOW: { Show(); break; } case AS_HIDE_WINDOW: { Hide(); break; } case AS_WINDOW_TITLE: { char *title = fSession->ReadString(); fTitle = BString(title); if (created) UpdateTitle (title); break; } case AS_SET_LOOK: { fSession->ReadInt32 (&fType); if (!created) break; char title[fTitle.CountChars()+1]; fTitle.CopyInto(title, 0, fTitle.CountChars()); fSession->WriteInt32 (AS_SEND_BEHIND); if (UpdateTitle (title)==B_ERROR) fSession->WriteInt32 (SERVER_FALSE); else fSession->WriteInt32 (SERVER_TRUE); fSession->Sync(); break; } case B_MINIMIZE: { Hide(); break; } case B_WINDOW_MOVE_TO: { // TODO: Implement break; } /* Graphic Messages */ case AS_SET_HIGH_COLOR: { break; } case AS_SET_LOW_COLOR: { break; } case AS_SET_VIEW_COLOR: { break; } case AS_STROKE_ARC: { break; } case AS_STROKE_BEZIER: { break; } case AS_STROKE_ELLIPSE: { break; } case AS_STROKE_LINE: { break; } case AS_STROKE_LINEARRAY: { break; } case AS_STROKE_POLYGON: { break; } case AS_STROKE_RECT: { break; } case AS_STROKE_ROUNDRECT: { break; } case AS_STROKE_SHAPE: { break; } case AS_STROKE_TRIANGLE: { break; } case AS_FILL_ARC: { break; } case AS_FILL_BEZIER: { break; } case AS_FILL_ELLIPSE: { break; } case AS_FILL_POLYGON: { break; } case AS_FILL_RECT: { break; } case AS_FILL_REGION: { break; } case AS_FILL_ROUNDRECT: { break; } case AS_FILL_SHAPE: { break; } case AS_FILL_TRIANGLE: { break; } case AS_MOVEPENBY: { break; } case AS_MOVEPENTO: { break; } case AS_SETPENSIZE: { break; } case AS_DRAW_STRING: { break; } case AS_SET_FONT: { break; } case AS_SET_FONT_SIZE: { break; } default: //printf("ServerWindow %s received unexpected code - message offset %lx\n",fTitle.String(), msg->Code() - SERVER_TRUE); break; } }
void InternetRetrievalDialog::OnClose( wxCommandEvent& event ) { Hide(); }
void FindReplaceDialog::OnClick(wxCommandEvent& event) { wxObject* btnClicked = event.GetEventObject(); size_t flags = m_data.GetFlags(); m_data.SetFindString(m_findString->GetValue()); m_data.SetReplaceString(m_replaceString->GetValue()); // disable the 'Find/Replace' buttons when the 'Selection only' is enabled if(m_selectionOnly->IsChecked()) { m_find->Enable(false); m_replace->Enable(false); } else { m_find->Enable(true); m_replace->Enable(true); } if(btnClicked == m_find) { VALIDATE_FINDWHAT(); SendEvent(wxEVT_FRD_FIND_NEXT); } else if(btnClicked == m_replace) { VALIDATE_FINDWHAT(); SendEvent(wxEVT_FRD_REPLACE); } else if(btnClicked == m_replaceAll) { VALIDATE_FINDWHAT(); SendEvent(wxEVT_FRD_REPLACEALL); } else if(btnClicked == m_markAll) { VALIDATE_FINDWHAT(); SendEvent(wxEVT_FRD_BOOKMARKALL); } else if(btnClicked == m_clearBookmarks) { SendEvent(wxEVT_FRD_CLEARBOOKMARKS); } else if(btnClicked == m_cancel) { // Fire a close event SendEvent(wxEVT_FRD_CLOSE); // Hide the dialog Hide(); // Make sure the Search in Selected Text flag is clear, otherwise we can't Find Next flags &= ~(wxFRD_SELECTIONONLY); } else if(btnClicked == m_matchCase) { if(m_matchCase->IsChecked()) { flags |= wxFRD_MATCHCASE; } else { flags &= ~(wxFRD_MATCHCASE); } } else if(btnClicked == m_matchWholeWord) { if(m_matchWholeWord->IsChecked()) { flags |= wxFRD_MATCHWHOLEWORD; } else { flags &= ~(wxFRD_MATCHWHOLEWORD); } } else if(btnClicked == m_regualrExpression) { if(m_regualrExpression->IsChecked()) { flags |= wxFRD_REGULAREXPRESSION; } else { flags &= ~(wxFRD_REGULAREXPRESSION); } } else if(btnClicked == m_searchUp) { if(m_searchUp->IsChecked()) { flags |= wxFRD_SEARCHUP; } else { flags &= ~(wxFRD_SEARCHUP); } } else if(btnClicked == m_selectionOnly) { if(m_selectionOnly->IsChecked()) { flags |= wxFRD_SELECTIONONLY; } else { flags &= ~(wxFRD_SELECTIONONLY); } } // Set the updated flags, unless it was ReplaceAll which does this itself if(btnClicked != m_replaceAll) { m_data.SetFlags(flags); } // update the data of the find/replace dialog, in particular, // update the history of the Find What / replace with controls #if defined(__WXGTK__) && wxVERSION_NUMBER >= 2900 // But if it's a findNext or a Replace, do it by posting an event, // otherwise strange duplications happen (because scintilla steals the primary selection?) wxCommandEvent e(wxEVT_FRD_FIND_NEXT); // Arbitrary choice of event-type wxPostEvent(this, e); #else SetFindReplaceData(m_data, false); #endif }
void __fastcall Tikf_hqq::Image1Click(TObject *Sender) { Hide(); ikf_hqq->BringToFront(); }
DownloadWindow::DownloadWindow(BRect frame, bool visible, SettingsMessage* settings) : BWindow(frame, B_TRANSLATE("Downloads"), B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, B_AUTO_UPDATE_SIZE_LIMITS | B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE), fMinimizeOnClose(false) { SetPulseRate(1000000); settings->AddListener(BMessenger(this)); BPath downloadPath; if (find_directory(B_DESKTOP_DIRECTORY, &downloadPath) != B_OK) downloadPath.SetTo("/boot/home/Desktop"); fDownloadPath = settings->GetValue(kSettingsKeyDownloadPath, downloadPath.Path()); settings->SetValue(kSettingsKeyDownloadPath, fDownloadPath); SetLayout(new BGroupLayout(B_VERTICAL, 0.0)); DownloadsContainerView* downloadsGroupView = new DownloadsContainerView(); fDownloadViewsLayout = downloadsGroupView->GroupLayout(); BMenuBar* menuBar = new BMenuBar("Menu bar"); BMenu* menu = new BMenu(B_TRANSLATE("Downloads")); menu->AddItem(new BMenuItem(B_TRANSLATE("Open downloads folder"), new BMessage(OPEN_DOWNLOADS_FOLDER))); BMessage* newWindowMessage = new BMessage(NEW_WINDOW); newWindowMessage->AddString("url", ""); BMenuItem* newWindowItem = new BMenuItem(B_TRANSLATE("New browser window"), newWindowMessage, 'N'); menu->AddItem(newWindowItem); newWindowItem->SetTarget(be_app); menu->AddSeparatorItem(); menu->AddItem(new BMenuItem(B_TRANSLATE("Hide"), new BMessage(B_QUIT_REQUESTED), 'D')); menuBar->AddItem(menu); fDownloadsScrollView = new DownloadContainerScrollView(downloadsGroupView); fRemoveFinishedButton = new BButton(B_TRANSLATE("Remove finished"), new BMessage(REMOVE_FINISHED_DOWNLOADS)); fRemoveFinishedButton->SetEnabled(false); fRemoveMissingButton = new BButton(B_TRANSLATE("Remove missing"), new BMessage(REMOVE_MISSING_DOWNLOADS)); fRemoveMissingButton->SetEnabled(false); const float spacing = be_control_look->DefaultItemSpacing(); AddChild(BGroupLayoutBuilder(B_VERTICAL, 0.0) .Add(menuBar) .Add(fDownloadsScrollView) .Add(new BSeparatorView(B_HORIZONTAL, B_PLAIN_BORDER)) .Add(BGroupLayoutBuilder(B_HORIZONTAL, spacing) .AddGlue() .Add(fRemoveMissingButton) .Add(fRemoveFinishedButton) .SetInsets(12, 5, 12, 5) ) ); PostMessage(INIT); if (!visible) Hide(); Show(); }
void AboutWindow::OnDestroy (HWND hWnd) { Hide (); }
/* ================ idObjectiveComplete::Spawn ================ */ void idObjectiveComplete::Spawn( void ) { spawnArgs.SetBool( "objEnabled", false ); Hide(); }
bool PrefWindow::QuitRequested(){ Hide(); return false; }
/* ================ idObjective::Spawn ================ */ void idObjective::Spawn( void ) { Hide(); PostEventMS( &EV_CamShot, 250 ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CTFFreezePanel::FireGameEvent( IGameEvent * event ) { const char *pEventName = event->GetName(); if ( Q_strcmp( "player_death", pEventName ) == 0 ) { // see if the local player died int iPlayerIndexVictim = engine->GetPlayerForUserID( event->GetInt( "userid" ) ); C_TFPlayer *pLocalPlayer = C_TFPlayer::GetLocalTFPlayer(); if ( pLocalPlayer && iPlayerIndexVictim == pLocalPlayer->entindex() ) { // the local player is dead, see if this is a new nemesis or a revenge if ( event->GetInt( "dominated" ) > 0 ) { m_iShowNemesisPanel = SHOW_NEW_NEMESIS; } else if ( event->GetInt( "revenge" ) > 0 ) { m_iShowNemesisPanel = SHOW_REVENGE; } else { m_iShowNemesisPanel = SHOW_NO_NEMESIS; } } } else if ( Q_strcmp( "hide_freezepanel", pEventName ) == 0 ) { Hide(); } else if ( Q_strcmp( "freezecam_started", pEventName ) == 0 ) { ShowCalloutsIn( 1.0 ); ShowSnapshotPanelIn( 1.25 ); } else if ( Q_strcmp( "teamplay_win_panel", pEventName ) == 0 ) { Hide(); } else if ( Q_strcmp( "show_freezepanel", pEventName ) == 0 ) { C_TF_PlayerResource *tf_PR = dynamic_cast<C_TF_PlayerResource *>(g_PR); if ( !tf_PR ) { m_pNemesisSubPanel->SetDialogVariable( "nemesisname", NULL ); return; } Show(); ShowSnapshotPanel( false ); m_bHoldingAfterScreenshot = false; if ( m_iBasePanelOriginalX > -1 && m_iBasePanelOriginalY > -1 ) { m_pBasePanel->SetPos( m_iBasePanelOriginalX, m_iBasePanelOriginalY ); } // Get the entity who killed us m_iKillerIndex = event->GetInt( "killer" ); C_BaseEntity *pKiller = ClientEntityList().GetBaseEntity( m_iKillerIndex ); int xp,yp; GetPos( xp, yp ); if ( TFGameRules()->RoundHasBeenWon() ) { SetPos( xp, m_iYBase - YRES(50) ); } else { SetPos( xp, m_iYBase ); } if ( pKiller ) { CTFPlayer *pPlayer = ToTFPlayer ( pKiller ); int iMaxBuffedHealth = 0; if ( pPlayer ) { iMaxBuffedHealth = pPlayer->m_Shared.GetMaxBuffedHealth(); } int iKillerHealth = pKiller->GetHealth(); if ( !pKiller->IsAlive() ) { iKillerHealth = 0; } m_pKillerHealth->SetHealth( iKillerHealth, pKiller->GetMaxHealth(), iMaxBuffedHealth ); if ( pKiller->IsPlayer() ) { C_TFPlayer *pVictim = C_TFPlayer::GetLocalTFPlayer(); CTFPlayer *pTFKiller = ToTFPlayer( pKiller ); //If this was just a regular kill but this guy is our nemesis then just show it. if ( pVictim && pTFKiller && pTFKiller->m_Shared.IsPlayerDominated( pVictim->entindex() ) ) { if ( !pKiller->IsAlive() ) { m_pFreezeLabel->SetText( "#FreezePanel_Nemesis_Dead" ); } else { m_pFreezeLabel->SetText( "#FreezePanel_Nemesis" ); } } else { if ( !pKiller->IsAlive() ) { m_pFreezeLabel->SetText( "#FreezePanel_Killer_Dead" ); } else { m_pFreezeLabel->SetText( "#FreezePanel_Killer" ); } } m_pBasePanel->SetDialogVariable( "killername", g_PR->GetPlayerName( m_iKillerIndex ) ); if ( m_pAvatar ) { m_pAvatar->SetPlayer( (C_BasePlayer*)pKiller ); } } else if ( pKiller->IsBaseObject() ) { C_BaseObject *pObj = assert_cast<C_BaseObject *>( pKiller ); C_TFPlayer *pOwner = pObj->GetOwner(); Assert( pOwner && "Why does this object not have an owner?" ); if ( pOwner ) { m_iKillerIndex = pOwner->entindex(); m_pBasePanel->SetDialogVariable( "killername", g_PR->GetPlayerName( m_iKillerIndex ) ); if ( m_pAvatar ) { m_pAvatar->SetPlayer( pOwner ); } pKiller = pOwner; } if ( m_pFreezeLabel ) { if ( pKiller && !pKiller->IsAlive() ) { m_pFreezeLabel->SetText( "#FreezePanel_KillerObject_Dead" ); } else { m_pFreezeLabel->SetText( "#FreezePanel_KillerObject" ); } } const char *pszStatusName = pObj->GetStatusName(); wchar_t *wszLocalized = g_pVGuiLocalize->Find( pszStatusName ); if ( !wszLocalized ) { m_pBasePanel->SetDialogVariable( "objectkiller", pszStatusName ); } else { m_pBasePanel->SetDialogVariable( "objectkiller", wszLocalized ); } } else if ( m_pFreezeLabel ) { if ( !pKiller->IsAlive() ) { m_pFreezeLabel->SetText( "#FreezePanel_Killer_Dead" ); } else { m_pFreezeLabel->SetText( "#FreezePanel_Killer" ); } } } // see if we should show nemesis panel const wchar_t *pchNemesisText = NULL; switch ( m_iShowNemesisPanel ) { case SHOW_NO_NEMESIS: { C_TFPlayer *pVictim = C_TFPlayer::GetLocalTFPlayer(); CTFPlayer *pTFKiller = ToTFPlayer( pKiller ); //If this was just a regular kill but this guy is our nemesis then just show it. if ( pTFKiller && pTFKiller->m_Shared.IsPlayerDominated( pVictim->entindex() ) ) { pchNemesisText = g_pVGuiLocalize->Find( "#TF_FreezeNemesis" ); } } break; case SHOW_NEW_NEMESIS: { C_TFPlayer *pVictim = C_TFPlayer::GetLocalTFPlayer(); CTFPlayer *pTFKiller = ToTFPlayer( pKiller ); // check to see if killer is still the nemesis of victim; victim may have managed to kill him after victim's // death by grenade or some such, extracting revenge and clearing nemesis condition if ( pTFKiller && pTFKiller->m_Shared.IsPlayerDominated( pVictim->entindex() ) ) { pchNemesisText = g_pVGuiLocalize->Find( "#TF_NewNemesis" ); } } break; case SHOW_REVENGE: pchNemesisText = g_pVGuiLocalize->Find( "#TF_GotRevenge" ); break; default: Assert( false ); // invalid value break; } m_pNemesisSubPanel->SetDialogVariable( "nemesisname", pchNemesisText ); ShowNemesisPanel( NULL != pchNemesisText ); m_iShowNemesisPanel = SHOW_NO_NEMESIS; } }
extern void CreateAddSpecialDialog ( GrouP prnt, SscTablesPtr stp ) { Char buf [64]; GrouP g, h, m, p; MiscRatePtr mrp; SscSpecPtr ssp; Char str [16]; if (stp == NULL) return; mrp = stp->miscrate_table; if (mrp == NULL) return; ssp = (SscSpecPtr) MemNew (sizeof (SscSpec)); if (ssp == NULL) return; p = HiddenGroup (prnt, -1, 0, NULL); SetGroupSpacing (p, 10, 10); SetObjectExtra (p, ssp, StdCleanupExtraProc); ssp->dialog = (DialoG) p; ssp->tables = stp; ssp->whichspec = HiddenGroup (p, 5, 0, ChangeSpecType); SetObjectExtra (ssp->whichspec, ssp, NULL); RadioButton (ssp->whichspec, "Visiting"); RadioButton (ssp->whichspec, "Affiliated"); RadioButton (ssp->whichspec, "Transient"); ssp->namegroup = HiddenGroup (p, 15, 0, NULL); SetGroupSpacing (ssp->namegroup, 5, 3); StaticPrompt (ssp->namegroup, "Name", 0, dialogTextHeight, programFont, 'l'); ssp->name = DialogText (ssp->namegroup, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 0, ChangeSpecName); SetObjectExtra (ssp->name, (Pointer) ssp, NULL); SetTitle (ssp->name, ""); Hide (ssp->namegroup); h = HiddenGroup (p, 0, 0, NULL); SetGroupMargins (h, 10, 10); g = HiddenGroup (h, -1, 0, NULL); Hide (g); ssp->controls [EMPTY_PAGE] = g; g = HiddenGroup (h, -1, 0, NULL); if (PrintWholeDollar (mrp->visiting_fee, str)) { sprintf (buf, "Charge $%s Visiting Fee", str); } else { sprintf (buf, "Charge Visiting Fee"); } ssp->visitfee = CheckBox (g, buf, NULL); SetStatus (ssp->visitfee, TRUE); Hide (g); ssp->controls [ADD_VISIT_PAGE] = g; g = HiddenGroup (h, -1, 0, NULL); if (PrintWholeDollar (mrp->affiliated_fee, str)) { sprintf (buf, "Charge $%s Affiliated Fee", str); } else { sprintf (buf, "Charge Affiliated Fee"); } ssp->affilfee = CheckBox (g, buf, NULL); SetStatus (ssp->visitfee, TRUE); Hide (g); ssp->controls [ADD_AFFIL_PAGE] = g; g = HiddenGroup (h, -1, 0, NULL); SetGroupSpacing (g, 10, 10); m = HiddenGroup (g, 1, 0, NULL); SetGroupSpacing (m, 5, 3); ProrateDollarAmount (mrp->transient_fee, 1, FALSE, stp, &(ssp->proratedtrans)); if (PrintWholeDollar (&(ssp->proratedtrans), str)) { sprintf (buf, "Charge $%s Transient Dues", str); } else { sprintf (buf, "Charge Transient Dues"); } ssp->transfee = CheckBox (m, buf, NULL); SetStatus (ssp->transfee, TRUE); ProrateDollarAmount (mrp->ssa_regular, 5, TRUE, stp, &(ssp->proratedssa)); if (PrintWholeDollar (&(ssp->proratedssa), str)) { sprintf (buf, "Charge $%s SSA Dues (Prorated May-Apr)", str); } else { sprintf (buf, "Charge SSA Dues"); } ssp->transssa = CheckBox (m, buf, NULL); SetStatus (ssp->transssa, TRUE); ssp->jobs = CreateClubJobsDialog (g); AlignObjects (ALIGN_CENTER, (HANDLE) m, (HANDLE) ssp->jobs, NULL); Hide (g); ssp->controls [ADD_TRANS_FEE] = g; ssp->addspec = PushButton (p, "Add Special Member", AddSpecMember); SetObjectExtra (ssp->addspec, (Pointer) ssp, NULL); Disable (ssp->addspec); ssp->currPage = 0; AlignObjects (ALIGN_CENTER, (HANDLE) ssp->whichspec, (HANDLE) ssp->namegroup, (HANDLE) ssp->controls [EMPTY_PAGE], (HANDLE) ssp->controls [ADD_VISIT_PAGE], (HANDLE) ssp->controls [ADD_AFFIL_PAGE], (HANDLE) ssp->controls [ADD_TRANS_FEE], (HANDLE) ssp->addspec, NULL); }
GUI::EEventStatus::Enum GCovertActionsNewMissionWindow::OnMouseClick(const GEventData & in_EventData, GUI::GBaseObject *in_pCaller) { __super::OnMouseClick(in_EventData, in_pCaller); if(in_pCaller) { if(in_EventData.Mouse.Actor.Bits.Left || in_EventData.Mouse.Down.Bits.Left) { if(in_pCaller == m_pObjCancel) Hide(); else if(in_pCaller == m_pObjConfirm) { for(UINT32 i = 0; i < m_viCellsID.size(); i++) { SDK::GGameEventSPtr l_Event = CREATE_GAME_EVENT(SP2::Event::GEventCellNewMission); SP2::Event::GEventCellNewMission* l_pUpdate = (SP2::Event::GEventCellNewMission*)l_Event.get(); l_pUpdate->m_iSource = g_SP2Client->Id(); l_pUpdate->m_iTarget = SDK::Event::ESpecialTargets::Server; l_pUpdate->m_iCellID = m_viCellsID[i]; l_pUpdate->m_eComplexity = g_ClientDAL.ConvertMissionComplexityToEnum( m_pObjComplexityCbo->Selected_Content() ); l_pUpdate->m_eSector = g_ClientDAL.ConvertTargetSectorToEnum( m_pObjSectorCbo->Selected_Content() ); if( m_pObjFramedCbo->Selected_Content() == g_ClientDAL.GetString(EStrId::None) ) l_pUpdate->m_iFramedCountry = 0; else l_pUpdate->m_iFramedCountry = g_ClientDAL.Country( m_pObjFramedCbo->Selected_Content() ).Id(); l_pUpdate->m_eType = g_ClientDAL.ConvertMissionTypeToEnum( m_pObjTypeCbo->Selected_Content() ); if(m_pObjSectorCbo->Selected_Content() == g_ClientDAL.ConvertTargetSectorToString(SP2::ECovertActionsTargetSector::Military) ) { l_pUpdate->m_eUnitCategory = g_ClientDAL.ConvertUnitCategoryToEnum( m_pObjResourceCbo->Selected_Content() ); } else if(m_pObjSectorCbo->Selected_Content() == g_ClientDAL.ConvertTargetSectorToString(SP2::ECovertActionsTargetSector::Civilian)) { l_pUpdate->m_eResourceType = g_ClientDAL.ConvertResourcesToEnum( m_pObjResourceCbo->Selected_Content() ); } g_Joshua.RaiseEvent(l_Event); //Locally modify the cell GCovertActionCell* l_pCell = &g_ClientDAL.m_PlayerCountryData.CovertActionCell(m_viCellsID[i]); gassert(l_pCell,"Cell should exist"); if(l_pCell) { l_pCell->TargetSector( l_pUpdate->m_eSector ); l_pCell->MissionComplexity( l_pUpdate->m_eComplexity ); l_pCell->CountryToFrame( l_pUpdate->m_iFramedCountry ); l_pCell->MissionType( l_pUpdate->m_eType ); if( l_pUpdate->m_eSector == SP2::ECovertActionsTargetSector::Civilian ) l_pCell->ResourceType(l_pUpdate->m_eResourceType); else if( l_pUpdate->m_eSector == SP2::ECovertActionsTargetSector::Military ) l_pCell->UnitCategory(l_pUpdate->m_eUnitCategory); if(l_pCell->ActualState() == ECovertActionsCellState::Dormant) { l_pCell->ChangeState(ECovertActionsCellState::GettingReady); l_pCell->SubsequentStateAdd(ECovertActionsCellState::PreparingMission); } else if(l_pCell->ActualState() == ECovertActionsCellState::Active) { l_pCell->ChangeState(ECovertActionsCellState::PreparingMission); } } } g_ClientDDL.CovertActionsWindow()->Update(); Hide(); } } } return GUI::EEventStatus::Handled; }
void CompaniesFrame::OnExitClick(wxCommandEvent& WXUNUSED(event)) { Hide(); }
bool CWinSystemGLES::Minimize() { Hide(); return true; }
CSplashWindow::~CSplashWindow() { Hide(); }
void hhFuncEmitter::Event_Activate( idEntity *activator ) { (IsHidden() || spawnArgs.GetBool("cycleTrigger")) ? Show() : Hide(); UpdateVisuals(); }
void Gizmo3D::Position() { Vector3 center(0, 0, 0); bool containsScene = false; for (unsigned i = 0; i < editNodes_->Size(); ++i) { // Scene's transform should not be edited, so hide gizmo if it is included if (editNodes_->At(i) == scene_) { containsScene = true; break; } center += editNodes_->At(i)->GetWorldPosition(); } if (editNodes_->Empty() || containsScene) { Hide(); return; } center /= editNodes_->Size(); gizmoNode_->SetPosition(center); if (axisMode_ == AXIS_WORLD || editNodes_->Size() > 1) gizmoNode_->SetRotation(Quaternion()); else gizmoNode_->SetRotation(editNodes_->At(0)->GetWorldRotation()); ResourceCache* cache = GetSubsystem<ResourceCache>(); if (editMode_ != lastEditMode_) { switch (editMode_) { case EDIT_MOVE: gizmo_->SetModel(cache->GetResource<Model>("AtomicEditor/Models/Axes.mdl")); break; case EDIT_ROTATE: gizmo_->SetModel(cache->GetResource<Model>("AtomicEditor/Models/RotateAxes.mdl")); break; case EDIT_SCALE: gizmo_->SetModel(cache->GetResource<Model>("AtomicEditor/Models/ScaleAxes.mdl")); break; default: break; } lastEditMode_ = editMode_; } bool orbiting = false; if ((editMode_ != EDIT_SELECT && !orbiting) && !gizmo_->IsEnabled()) Show(); else if ((editMode_ == EDIT_SELECT || orbiting) && gizmo_->IsEnabled()) Hide(); if (gizmo_->IsEnabled()) { float scale = 0.1f / camera_->GetZoom(); if (camera_->IsOrthographic()) scale *= camera_->GetOrthoSize(); else scale *= (camera_->GetView() * gizmoNode_->GetPosition()).z_; gizmoNode_->SetScale(Vector3(scale, scale, scale)); } }
void PopupTooltip::onHideByLeave() { Hide(); }
bool SelectionWindow::QuitRequested() { Hide(); return false; }
void PopupTooltip::hideEvent(QHideEvent *e) { if (PopupTooltipInstance == this) { Hide(); } }
bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) { wxASSERT_MSG( page != m_page, wxT("this is useless") ); wxSizerFlags flags(1); flags.Border(wxALL, m_border).Expand(); if ( !m_started ) { if ( m_usingSizer ) { m_sizerBmpAndPage->Add(m_sizerPage, flags); // now that our layout is computed correctly, hide the pages // artificially shown in wxWizardSizer::Insert() back again m_sizerPage->HidePages(); } } // we'll use this to decide whether we have to change the label of this // button or not (initially the label is "Next") bool btnLabelWasNext = true; // remember the old bitmap (if any) to compare with the new one later wxBitmap bmpPrev; // check for previous page if ( m_page ) { // send the event to the old page wxWizardEvent event(wxEVT_WIZARD_PAGE_CHANGING, GetId(), goingForward, m_page); if ( m_page->GetEventHandler()->ProcessEvent(event) && !event.IsAllowed() ) { // vetoed by the page return false; } m_page->Hide(); btnLabelWasNext = HasNextPage(m_page); bmpPrev = m_page->GetBitmap(); if ( !m_usingSizer ) m_sizerBmpAndPage->Detach(m_page); } // set the new page m_page = page; // is this the end? if ( !m_page ) { // terminate successfully if ( IsModal() ) { EndModal(wxID_OK); } else { SetReturnCode(wxID_OK); Hide(); } // and notify the user code (this is especially useful for modeless // wizards) wxWizardEvent event(wxEVT_WIZARD_FINISHED, GetId(), false, 0); (void)GetEventHandler()->ProcessEvent(event); return true; } // position and show the new page (void)m_page->TransferDataToWindow(); if ( m_usingSizer ) { // wxWizardSizer::RecalcSizes wants to be called when m_page changes m_sizerPage->RecalcSizes(); } else // pages are not managed by the sizer { m_sizerBmpAndPage->Add(m_page, flags); m_sizerBmpAndPage->SetItemMinSize(m_page, GetPageSize()); } #if wxUSE_STATBMP // update the bitmap if:it changed if ( m_statbmp ) { wxBitmap bmp = m_page->GetBitmap(); if ( !bmp.Ok() ) bmp = m_bitmap; if ( !bmpPrev.Ok() ) bmpPrev = m_bitmap; if ( !bmp.IsSameAs(bmpPrev) ) m_statbmp->SetBitmap(bmp); } #endif // wxUSE_STATBMP // and update the buttons state m_btnPrev->Enable(HasPrevPage(m_page)); bool hasNext = HasNextPage(m_page); if ( btnLabelWasNext != hasNext ) { m_btnNext->SetLabel(hasNext ? _("&Next >") : _("&Finish")); } // nothing to do: the label was already correct m_btnNext->SetDefault(); // send the change event to the new page now wxWizardEvent event(wxEVT_WIZARD_PAGE_CHANGED, GetId(), goingForward, m_page); (void)m_page->GetEventHandler()->ProcessEvent(event); // and finally show it m_page->Show(); m_page->SetFocus(); if ( !m_usingSizer ) m_sizerBmpAndPage->Layout(); if ( !m_started ) { m_started = true; if ( wxSystemSettings::GetScreenType() > wxSYS_SCREEN_PDA ) { GetSizer()->SetSizeHints(this); if ( m_posWizard == wxDefaultPosition ) CentreOnScreen(); } } wxWizardEvent pageShownEvent(wxEVT_WIZARD_PAGE_SHOWN, GetId(), goingForward, m_page); m_page->GetEventHandler()->ProcessEvent(pageShownEvent); return true; }
/* ================ idLight::Event_Hide ================ */ void idLight::Event_Hide( void ) { Hide(); PresentModelDefChange(); Off(); }