void do_pkbuy( CHAR_DATA *ch, char *argument ) { char sNumber[10]; char sCommand[100]; argument = one_argument(argument, sCommand); one_argument(argument, sNumber); load_pkstore(); if ( IS_NPC(ch) ) return; if ( ch->pcdata->pkpoints < 0 ) return stcf(ch,"Sorry you do not have enough pk-points to enter the store.\n\r"); if ( sCommand[0] == '\0' ) return stcf(ch, "Syntax: pkbuy <list/buy/detail> <ID>\n\r"); if ( str_cmp(sCommand,"list") && !is_number(sNumber) ) return stcf(ch, "You didn't type in list/buy/detail and an item ID.\n\r"); if ( !str_cmp(sCommand,"list" )) { save_pkstore(); Show_StoreList(ch); return; } else if ( !str_cmp(sCommand,"detail") ) { if ( !is_number(sNumber) ) return stcf(ch,"You didn't type in a number.\n\r"); ShowDetails(ch,atoi(sNumber)); return; } else if ( !str_cmp(sCommand,"buy") && is_number(sNumber) ) { Transact_StoreItem(ch,atoi(sNumber)); return; } return stcf(ch,"You didn't follow something correctly.\n\r"); }
BOOL CelSelect::OnInitDialog () { int ii, idx; CWnd *wp; char keyName [24]; CDialog::OnInitDialog (); m_KeyNameCombo.ResetContent (); for (ii = 0; CS_elEnum (ii,keyName,sizeof (keyName)) > 0; ii += 1) { idx = m_KeyNameCombo.AddString (keyName); m_KeyNameCombo.SetItemData (idx,ii); } if (!CS_elIsValid (m_KeyName)) { m_KeyName = "WGS84"; } m_KeyNameCombo.SelectString (-1,m_KeyName); ShowDetails (); // Disable the Help button if Help is not available wp = GetDlgItem (ID_ELSL_HELP); if (wp != NULL) wp->EnableWindow (CS_isHlpAvailable ()); return (TRUE); }
BOOL CdtSelect::OnInitDialog (void) { int ii, idx; CWnd *wp; TCHAR keyName [cs_KEYNM_DEF]; CDialog::OnInitDialog (); // Populate the datum key name combo box. m_KeyNameCombo.ResetContent (); for (ii = 0; CSt_dtEnum (ii,keyName,tchrCount (keyName)) > 0; ii += 1) { idx = m_KeyNameCombo.AddString (keyName); m_KeyNameCombo.SetItemData (idx,ii); } if (!CSt_dtIsValid (m_KeyName)) { m_KeyName = _T("WGS84"); } m_KeyNameCombo.SelectString (-1,m_KeyName); ShowDetails (); wp = GetDlgItem (ID_DTSL_HELP); if (wp != NULL) wp->EnableWindow (CS_isHlpAvailable ()); return (TRUE); }
void ProgFinder::details() { if (GetFocusWidget() != m_timesList) return; ProgramInfo *curPick = m_showData[m_timesList->GetCurrentPos()]; ShowDetails(curPick); }
BOOL LayerPropertiesTab::InitSection() { TRACEUSER( "Neville", _T("LayerPropertiesTab::InitSection\n")); ERROR2IF(pPropertiesDlg == NULL,FALSE,"LayerPropertiesTab::InitSection called with no dialog pointer"); ShowDetails(); return TRUE; }
void ecTemplatesDialog::OnDetails(wxCommandEvent& event) { wxWindow* win1 = FindWindow(ecID_TEMPLATES_DIALOG_PACKAGES); wxASSERT( win1 != NULL ); bool show = !win1->IsShown(); ShowDetails(show); }
BOOL CCdlTemplatesDialog::OnInitDialog() { CeCosDialog::OnInitDialog(); ShowDetails (false); // hide the details initially CConfigToolDoc * pDoc = CConfigTool::GetConfigToolDoc (); // populate the hardware combo box m_hardware = pDoc->GetCdlConfig ()->get_hardware (); const std::vector<std::string> & targets = pDoc->GetCdlPkgData ()->get_targets (); std::vector<std::string>::const_iterator target_i; for (target_i = targets.begin (); target_i != targets.end (); target_i++) { const std::vector<std::string> & aliases = pDoc->GetCdlPkgData ()->get_target_aliases (* target_i); // use the first alias (if any) as the description CString strTargetDescription = aliases.size () ? aliases [0].c_str () : target_i->c_str (); int nIndex = m_cboCdlHardware.AddString (strTargetDescription); m_cboCdlHardware.SetItemData (nIndex, (DWORD) target_i); // store the target iterator if (m_hardware == * target_i) // if current target... m_cboCdlHardware.SetCurSel (nIndex); // ...select the string } if (CB_ERR == m_cboCdlHardware.GetCurSel ()) // if no target selected... m_cboCdlHardware.SetCurSel (0); // ...select the first one // populate the template combo box m_template = pDoc->GetCdlConfig ()->get_template (); const std::vector<std::string> & templates = pDoc->GetCdlPkgData ()->get_templates (); std::vector<std::string>::const_iterator template_i; for (template_i = templates.begin (); template_i != templates.end (); template_i++) { CString strTemplateDescription = template_i->c_str (); int nIndex = m_cboCdlTemplate.AddString (strTemplateDescription); m_cboCdlTemplate.SetItemData (nIndex, (DWORD) template_i); // store the template iterator if (m_template == * template_i) // if current template... m_cboCdlTemplate.SetCurSel (nIndex); // ...select the string } if (CB_ERR == m_cboCdlTemplate.GetCurSel ()) // if no template selected... m_cboCdlTemplate.SetCurSel (0); // ...select the first one // display initial target and template descriptions OnSelchangeCdlHardware (); OnSelchangeCdlTemplate (); // populate the template version combo box UpdateVersionList (pDoc->GetTemplateVersion ()); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
LRESULT SwitcherSettingsDialog::OnSchemaListItemChanged(int, LPNMHDR p, BOOL&) { LPNMLISTVIEW lv = reinterpret_cast<LPNMLISTVIEW>(p); if (!loaded_ || !lv || lv->iItem < 0 && lv->iItem >= schema_list_.GetItemCount()) return 0; if ((lv->uNewState & LVIS_STATEIMAGEMASK) != (lv->uOldState & LVIS_STATEIMAGEMASK)) { modified_ = true; } else if ((lv->uNewState & LVIS_SELECTED) && !(lv->uOldState & LVIS_SELECTED)) { ShowDetails((RimeSchemaInfo*)(schema_list_.GetItemData(lv->iItem))); } return 0; }
void CdtSelect::OnSelchangeDtslKeyname() { int idx; TCHAR keyName [cs_KEYNM_DEF]; idx = m_KeyNameCombo.GetCurSel (); idx = static_cast<int>(m_KeyNameCombo.GetItemData (idx)); CSt_dtEnum (idx,keyName,tchrCount (keyName)); m_KeyName = keyName; ShowDetails (); return; }
void CdtSelect::OnSelchangeDtslKeyname() { int idx; char keyName [24]; idx = m_KeyNameCombo.GetCurSel (); idx = static_cast<int>(m_KeyNameCombo.GetItemData (idx)); CS_dtEnum (idx,keyName,sizeof (keyName)); m_KeyName = keyName; ShowDetails (); return; }
void ViewScheduled::details() { MythUIButtonListItem *item = m_schedulesList->GetItemCurrent(); if (!item) return; ProgramInfo *pginfo = qVariantValue<ProgramInfo*>(item->GetData()); if (pginfo) ShowDetails(pginfo); EmbedTVWindow(); }
BOOL GuidesPropertiesTab::InitSection() { TRACEUSER( "Neville", _T("GuidesPropertiesTab::InitSection\n")); ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::InitSection called with no dialog pointer"); pColourDropDown = new ColourDropDown; if (pColourDropDown != NULL) pColourDropDown->Init(pPropertiesDlg->GetReadWriteWindowID(),_R(IDC_GUIDETAB_COLOURLIST)); ShowDetails(); return TRUE; }
void cPlexSdOsd::ShowDetails(std::shared_ptr<plexclient::MediaContainer> container) { if (m_detailsActive) return; if (container->m_vDirectories.size() > 0 || container->m_vVideos.size() > 1) { // show browser m_pBrowserGrid->ShowDirectory(container); m_pBrowserGrid->Activate(); m_pBrowserGrid->Flush(); } else if (container->m_vVideos.size() > 0) { ShowDetails(&container->m_vVideos[0]); } }
BOOL LayerPropertiesTab::UpdateSection() { TRACEUSER( "Neville", _T("LayerPropertiesTab::UpdateSection\n")); ERROR2IF(pPropertiesDlg == NULL,FALSE,"LayerPropertiesTab::UpdateSection called with no dialog pointer"); BOOL ok = pPropertiesDlg->TalkToPage(GetPageID()); if (!ok) return TRUE; // page not present ShowDetails(); // We are happy with what happened return TRUE; }
BOOL CMFCCLientDlg::OnInitDialog() { m_pInv.CreateInstance(__uuidof(Trader)); ShowDetails(); CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here return TRUE; // return TRUE unless you set the focus to a control }
void cPlexSdOsd::Show(void) { if (!SkindesignerAvailable()) { return; } m_pRootView = std::shared_ptr<skindesignerapi::cOsdView>(GetOsdView((int) eViews::rootView)); if (!m_pRootView) { esyslog("[plex]: used skindesigner skin does not support plex"); return; } m_pBrowserGrid = std::shared_ptr<cBrowserGrid>(new cBrowserGrid(m_pRootView)); m_pMessage = std::shared_ptr<skindesignerapi::cViewElement>( m_pRootView->GetViewElement((int) eViewElementsRoot::message)); if(m_pDetailContainer) { ShowDetails(m_pDetailContainer); } Flush(); }
void CMFCCLientDlg::OnBnClickedBuyButton() { // TODO: Add your control notification handler code here if(UpdateData()) { try { m_pInv->Buy(quantity, rate); ShowDetails(); } catch(_com_error& e) { if(e.Error() == TRADER_E_OUTOFSTOCK) MessageBox(_T("Out of stock")); else if(e.Error() == TRADER_E_INSUFFICIENTFUNDS) MessageBox(_T("Insufficient funds")); } } }
void SjLogDialog::OnDetails(wxCommandEvent& event) { m_showingDetails = !m_showingDetails; ShowDetails(m_showingDetails); // in any case, our size changed - relayout everything and set new hints // --------------------------------------------------------------------- // we have to reset min size constraints or Fit() would never reduce the // dialog size when collapsing it and we have to reset max constraint // because it wouldn't expand it otherwise m_minHeight = m_maxHeight = -1; // wxSizer::FitSize() is private, otherwise we might use it directly... wxSize sizeTotal = GetSize(), sizeClient = GetClientSize(); wxSize size = GetSizer()->GetMinSize(); size.x += sizeTotal.x - sizeClient.x; size.y += sizeTotal.y - sizeClient.y; // we don't want to allow expanding the dialog in vertical direction as // this would show the "hidden" details but we can resize the dialog // vertically while the details are shown if ( !m_showingDetails ) { m_maxHeight = size.y; } SetSizeHints(size.x, size.y, m_maxWidth, m_maxHeight); // don't change the width when expanding/collapsing SetSize(wxDefaultCoord, size.y); #ifdef __WXGTK__ // VS: this is necessary in order to force frame redraw under // WindowMaker or fvwm2 (and probably other broken WMs). // Otherwise, detailed list wouldn't be displayed. Show(); #endif // wxGTK }
void CCdlTemplatesDialog::OnDetails() { ShowDetails (! m_edtCdlTemplatePackages.IsWindowVisible ()); }
BOOL TransfersPanel::OnInputAction(OpInputAction* action) { TransferItemContainer* item = (TransferItemContainer*)m_transfers_view->GetSelectedItem(); TransferItem* OP_MEMORY_VAR t_item = item ? item->GetAssociatedItem() : NULL; switch (action->GetAction()) { case OpInputAction::ACTION_GET_ACTION_STATE: { OpInputAction* child_action = action->GetChildAction(); switch(child_action->GetAction()) { case OpInputAction::ACTION_RESUME_TRANSFER: return EnableResumeTransfer(child_action, t_item, item); case OpInputAction::ACTION_STOP_TRANSFER: return EnableStopTransfer(child_action, item); case OpInputAction::ACTION_RESTART_TRANSFER: return EnableRestartTransfer(child_action, t_item); case OpInputAction::ACTION_DELETE: case OpInputAction::ACTION_COPY_TRANSFER_INFO: child_action->SetEnabled(item != NULL); return TRUE; case OpInputAction::ACTION_REMOVE_ALL_FINISHED_TRANSFERS: return EnableRemoveAllFinishedTransfers(child_action); case OpInputAction::ACTION_SHOW_TRANSFERPANEL_DETAILS: case OpInputAction::ACTION_HIDE_TRANSFERPANEL_DETAILS: child_action->SetSelectedByToggleAction(OpInputAction::ACTION_SHOW_TRANSFERPANEL_DETAILS, g_pcui->GetIntegerPref(PrefsCollectionUI::TransWinShowDetails)); return TRUE; case OpInputAction::ACTION_SHOW_NEW_TRANSFERS_ON_TOP: case OpInputAction::ACTION_SHOW_NEW_TRANSFERS_ON_BOTTOM: child_action->SetSelectedByToggleAction(OpInputAction::ACTION_SHOW_NEW_TRANSFERS_ON_TOP, g_pcui->GetIntegerPref(PrefsCollectionUI::TransferItemsAddedOnTop)); return TRUE; default: return FALSE; } break; } case OpInputAction::ACTION_EXECUTE_TRANSFERITEM: { ExecuteTransferItem(t_item); break; // This will return false - why? } case OpInputAction::ACTION_STOP_TRANSFER: case OpInputAction::ACTION_RESUME_TRANSFER: case OpInputAction::ACTION_RESTART_TRANSFER: case OpInputAction::ACTION_DELETE: return DoAllSelected(action->GetAction()); case OpInputAction::ACTION_REMOVE_ALL_FINISHED_TRANSFERS: return RemoveAllFinished(); case OpInputAction::ACTION_OPEN_TRANSFER: if (item) item->Open(FALSE); return TRUE; case OpInputAction::ACTION_OPEN_TRANSFER_FOLDER: if (item) item->Open(TRUE); return TRUE; case OpInputAction::ACTION_COPY_TRANSFER_INFO: return CopyTransferInfo(t_item); case OpInputAction::ACTION_SHOW_CONTEXT_MENU: ShowContextMenu(GetBounds().Center(),TRUE,TRUE); return TRUE; case OpInputAction::ACTION_SHOW_TRANSFERPANEL_DETAILS: ShowDetails(TRUE); return FALSE; //drop to application for saving of preferences case OpInputAction::ACTION_HIDE_TRANSFERPANEL_DETAILS: ShowDetails(FALSE); return FALSE; //drop to application for saving of preferences } return FALSE; }
eOSState cPlexSdOsd::ProcessKeyBrowserView(eKeys Key) { eOSState state = eOSState::osContinue; plexclient::cVideo *vid = NULL; switch (Key & ~k_Repeat) { case kUp: if (m_pBrowserGrid->NavigateUp()) Flush(); break; case kDown: if (m_pBrowserGrid->NavigateDown()) Flush(); break; case kLeft: if (m_pBrowserGrid->NavigateLeft()) Flush(); break; case kRight: if (m_pBrowserGrid->NavigateRight()) Flush(); break; case kOk: // Play movie or change dir state = m_pBrowserGrid->NavigateSelect(); if (state == eOSState::osUser1) { vid = dynamic_cast<plexclient::cVideo *>(m_pBrowserGrid->SelectedObject()); vid->m_iMyPlayOffset = vid->m_lViewoffset / 1000; } Flush(); break; case kBack: state = m_pBrowserGrid->NavigateBack(); Flush(); break; case kBlue: m_pBrowserGrid->NextViewMode(); Flush(); break; case kRed: vid = dynamic_cast<plexclient::cVideo *>(m_pBrowserGrid->SelectedObject()); if (vid) { if (vid->m_iViewCount > 0) vid->SetUnwatched(); else vid->SetWatched(); vid->UpdateFromServer(); Flush(); } break; case kGreen: // Show Details OSD vid = dynamic_cast<plexclient::cVideo *>(m_pBrowserGrid->SelectedObject()); if (vid) { vid->UpdateFromServer(); ShowDetails(vid); } break; case kYellow: m_pBrowserGrid->NextTab(); Flush(); break; default: break; } if (state == eOSState::osUser1 && vid) { cMyPlugin::PlayFile(*vid); state = eOSState::osEnd; } if (state != osEnd && m_pBrowserGrid->DrawTime()) m_pBrowserGrid->Flush(); return state; }
SjLogDialog::SjLogDialog(SjLogGui* logGui, wxWindow *parent, long style, long aIndex) : SjDialog(parent, _("Console"), parent? SJ_MODELESS : SJ_MODAL, SJ_RESIZEABLE_IF_POSSIBLE) { m_see = NULL; m_logGui = logGui; s_dlg = this; // create dialog m_listCtrl = NULL; wxSizer* sizer1 = new wxBoxSizer(wxVERTICAL); SetSizer(sizer1); m_sizerAddRemoveParent = new wxBoxSizer(wxVERTICAL); sizer1->Add(m_sizerAddRemoveParent, 1, wxALL|wxGROW, SJ_DLG_SPACE); wxSizer* sizer3 = new wxBoxSizer(wxHORIZONTAL); m_sizerAddRemoveParent->Add(sizer3, 0, 0, 0); // icon m_icon = NULL; m_iconIsInfo = false; if( (style & wxICON_MASK) ) { wxBitmap bitmap; switch ( style & wxICON_MASK ) { case wxICON_INFORMATION: bitmap = wxArtProvider::GetIcon(wxART_INFORMATION, wxART_MESSAGE_BOX); m_iconIsInfo = true; break; case wxICON_WARNING: bitmap = wxArtProvider::GetIcon(wxART_WARNING, wxART_MESSAGE_BOX); break; default: bitmap = wxArtProvider::GetIcon(wxART_ERROR, wxART_MESSAGE_BOX); break; } m_icon = new wxStaticBitmap(this, -1, bitmap); sizer3->Add(m_icon, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, SJ_DLG_SPACE); } // text wxString msg; if( aIndex < 0 || aIndex >= (long)logGui->m_aPacked.GetCount() ) { msg = wxString::Format( // TRANSLATORS: %i will be replaced by a number wxPLURAL("%i message", "%i messages", m_logGui->m_aPacked.GetCount()), (int)m_logGui->m_aPacked.GetCount()); m_showingDetails = true; } else { unsigned long severity, time; wxString scope; SjLogGui::ExplodeMessage(logGui->m_aPacked[aIndex], severity, time, msg, scope); m_showingDetails = false; } m_msg = new wxStaticText(this, -1, msg); m_msg->Wrap(SJ_MSG_BOX_WRAP); sizer3->Add(m_msg, 0, wxALL|wxALIGN_CENTER_VERTICAL, SJ_DLG_SPACE); m_sizerDetails = new wxBoxSizer(wxVERTICAL); m_sizerAddRemoveParent->Add(m_sizerDetails, 1, wxGROW|wxTOP, SJ_DLG_SPACE); m_sizerDetailsAttached = true; // list control ( added if needed ) m_listCtrl = new SjLogListCtrl(logGui, this, IDC_LIST_CTRL, aIndex); m_sizerDetails->Add(m_listCtrl, 1, wxGROW|wxTOP, SJ_DLG_SPACE); // evaluate etc. ( added if needed ) wxSizer* sizer4 = new wxBoxSizer(wxHORIZONTAL); m_sizerDetails->Add(sizer4, 0, wxGROW|wxTOP, SJ_DLG_SPACE/2); #if SJ_USE_SCRIPTS m_evalInput = new wxTextCtrl(this, IDC_EVAL_INPUT, wxT(""), wxDefaultPosition, wxSize(300, -1), wxTE_PROCESS_ENTER); sizer4->Add(m_evalInput, 1, wxRIGHT|wxALIGN_CENTER_VERTICAL, SJ_DLG_SPACE/2); m_evalButton = new wxButton(this, IDC_EVAL_BUTTON, _("Evaluate"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); sizer4->Add(m_evalButton, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, SJ_DLG_SPACE/2); #endif m_clearButton = new wxButton(this, IDC_CLEAR_BUTTON, _("Clear"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); sizer4->Add(m_clearButton, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, SJ_DLG_SPACE/2); m_saveButton = new wxButton(this, IDC_SAVE_BUTTON, _("Save"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); sizer4->Add(m_saveButton, 0, wxALIGN_CENTER_VERTICAL, SJ_DLG_SPACE); m_autoOpenCheckBox = new wxCheckBox(this, IDC_AUTO_OPEN_CHECKBOX, _("Open console on errors and warnings")); m_autoOpenCheckBox->SetValue(SjLogGui::GetAutoOpen()); m_sizerDetails->Add(m_autoOpenCheckBox, 0, wxTOP, SJ_DLG_SPACE); // buttons sizer1->Add(CreateButtons(SJ_DLG_MENU|SJ_DLG_OK, _("Close")), 0, wxGROW|wxLEFT|wxTOP|wxRIGHT|wxBOTTOM, SJ_DLG_SPACE); ShowDetails(m_showingDetails); sizer1->SetSizeHints(this); FindWindow(wxID_OK)->SetFocus(); m_listCtrl->SizeChanged(); CenterOnParent(); }
BOOL GuidesPropertiesTab::UpdateGuidelineSection() { ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::UpdateGuidelineSection() called with no dialog pointer"); return (pPropertiesDlg->TalkToPage(GetPageID()) && ShowDetails()); }
BOOL GuidesPropertiesTab::HandleMsg(DialogMsg* Msg) { TRACEUSER( "Neville", _T("GuidesPropertiesTab::HandleMsg\n")); ERROR2IF(Msg == NULL,FALSE,"GuidesPropertiesTab::Message null message received"); ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::HandleMsg called with no dialog pointer"); BOOL ok = pPropertiesDlg->TalkToPage(GetPageID()); if (!ok) return TRUE; // no page present = handled message switch(Msg->DlgMsg) { case DIM_CREATE: // Initialise controls GreyStatus = FALSE; // we are ungreyed by default ok = InitSection(); if (!ok) InformError(); break; case DIM_LFT_BN_CLICKED: //LayerPropertyTabs::SetApplyNowState(TRUE); if (FALSE) {} else if (Msg->GadgetID == _R(IDC_GUIDETAB_HORZ)) { if (GuideType != GUIDELINE_HORZ) { GuideType = GUIDELINE_HORZ; ShowDetails(); } } else if (Msg->GadgetID == _R(IDC_GUIDETAB_VERT)) { if (GuideType != GUIDELINE_VERT) { GuideType = GUIDELINE_VERT; ShowDetails(); } } else if (Msg->GadgetID == _R(IDC_GUIDETAB_PROPERTIES)) { PropertiesClicked(); ShowDetails(); } else if (Msg->GadgetID == _R(IDC_GUIDETAB_NEW)) { NewClicked(); ShowDetails(); } else if (Msg->GadgetID == _R(IDC_GUIDETAB_DELETE)) { DeleteClicked(); ShowDetails(); } break; case DIM_SELECTION_CHANGED: case DIM_TEXT_CHANGED: //LayerPropertyTabs::SetApplyNowState(TRUE); if (FALSE) {} else if (Msg->GadgetID == _R(IDC_GUIDETAB_GUIDELINELIST)) { ChangeControlStatus(!GreyStatus); } else if (Msg->GadgetID == _R(IDC_GUIDETAB_COLOURLIST)) { ColourChanged(pPropertiesDlg->GetSelectedValueIndex(Msg->GadgetID)); ShowDetails(); } break; default: break; } return TRUE; }
void CDLStateDlg::OnDetails () { ShowDetails (); }
void ViewScheduled::customEvent(QEvent *event) { if (event->type() == MythEvent::MythEventMessage) { MythEvent *me = static_cast<MythEvent *>(event); QString message = me->Message(); if (message != "SCHEDULE_CHANGE") return; m_needFill = true; if (m_inEvent) return; m_inEvent = true; LoadList(); m_inEvent = false; } else if (event->type() == DialogCompletionEvent::kEventType) { DialogCompletionEvent *dce = (DialogCompletionEvent*)(event); QString resultid = dce->GetId(); QString resulttext = dce->GetResultText(); int buttonnum = dce->GetResult(); if (resultid == "deleterule") { RecordingRule *record = dce->GetData().value<RecordingRule *>(); if (record) { if (buttonnum > 0) { if (!record->Delete()) LOG(VB_GENERAL, LOG_ERR, "Failed to delete recording rule"); } delete record; } EmbedTVWindow(); } else if (resultid == "menu") { if (resulttext == tr("Show Important")) { setShowAll(false); } else if (resulttext == tr("Show All")) { setShowAll(true); } else if (resulttext == tr("Program Details")) { ShowDetails(); } else if (resulttext == tr("Program Guide")) { ShowGuide(); } else if (resulttext == tr("Channel Search")) { ShowChannelSearch(); } else if (resulttext == tr("Upcoming by title")) { ShowUpcoming(); } else if (resulttext == tr("Upcoming scheduled")) { ShowUpcomingScheduled(); } else if (resulttext == tr("Previously Recorded")) { ShowPrevious(); } else if (resulttext == tr("Custom Edit")) { EditCustom(); } else if (resulttext == tr("Delete Rule")) { deleteRule(); } else if (resulttext == tr("Show Inputs")) { viewInputs(); } if (m_needFill) LoadList(); } else ScheduleCommon::customEvent(event); } }
bool ViewScheduled::keyPressEvent(QKeyEvent *event) { // FIXME: Blackholes keypresses, not good if (m_inEvent) return true; m_inEvent = true; if (GetFocusWidget()->keyPressEvent(event)) { m_inEvent = false; return true; } QStringList actions; bool handled = GetMythMainWindow()->TranslateKeyPress("TV Frontend", event, actions); for (int i = 0; i < actions.size() && !handled; i++) { QString action = actions[i]; handled = true; if (action == "EDIT") EditScheduled(); else if (action == "CUSTOMEDIT") EditCustom(); else if (action == "DELETE") deleteRule(); else if (action == "UPCOMING") ShowUpcoming(); else if (action == "VIEWSCHEDULED") ShowUpcomingScheduled(); else if (action == "PREVRECORDED") ShowPrevious(); else if (action == "DETAILS" || action == "INFO") ShowDetails(); else if (action == "GUIDE") ShowGuide(); else if (action == ACTION_CHANNELSEARCH) ShowChannelSearch(); else if (action == "1") setShowAll(true); else if (action == "2") setShowAll(false); else if (action == "PREVVIEW" || action == "NEXTVIEW") setShowAll(!m_showAll); else if (action == "VIEWINPUT") viewInputs(); else handled = false; } if (m_needFill) LoadList(); if (!handled && MythScreenType::keyPressEvent(event)) handled = true; m_inEvent = false; return handled; }
void CDLStateDlg::OnDoubleClick (NMHDR *pNMHDR, LRESULT *pResult) { ShowDetails (); *pResult = 0; }
BOOL CFileExplore::PreTranslateMessage(MSG* pMsg) { if(pMsg->message==WM_KEYDOWN) { switch(pMsg->wParam) { case VK_F5: Refresh(); break; case VK_DELETE: if(pMsg->hwnd==m_DirTree.GetSafeHwnd()) Delete(); else if(pMsg->hwnd==m_FileList.GetSafeHwnd()) Delete(TRUE); break; case VK_F2: if(pMsg->hwnd==m_DirTree.GetSafeHwnd()) { HTREEITEM hItem = m_DirTree.GetSelectedItem(); if(hItem) m_DirTree.EditLabel(hItem); } else if(pMsg->hwnd==m_FileList.GetSafeHwnd()) { POSITION Pos = m_FileList.GetFirstSelectedItemPosition(); if(Pos) { int iIndex = m_FileList.GetNextSelectedItem(Pos); m_FileList.EditLabel(iIndex); } } break; case VK_ESCAPE: if(m_DirTree.GetEditControl()&&pMsg->hwnd==m_DirTree.GetEditControl()->GetSafeHwnd()) { m_DirTree.SendMessage(TVM_ENDEDITLABELNOW,TRUE); } else if(m_FileList.GetEditControl() && pMsg->hwnd==m_FileList.GetEditControl()->GetSafeHwnd()) { //m_FileList.SendMessage(LVM_CANCELEDITLABEL,0,0); } else ((CDialog*)GetParent())->EndDialog(IDCANCEL); break; case VK_RETURN: if(m_DirTree.GetEditControl()&&pMsg->hwnd==m_DirTree.GetEditControl()->GetSafeHwnd()) { m_DirTree.SendMessage(TVM_ENDEDITLABELNOW,FALSE); } break; } } else if(pMsg->message==WM_SYSKEYDOWN) { switch(pMsg->wParam) { case VK_RETURN: if((GetKeyState(VK_MENU)>>1)) { if(pMsg->hwnd==m_FileList.GetSafeHwnd()) ShowDetails(TRUE); else if(pMsg->hwnd==m_DirTree.GetSafeHwnd()) ShowDetails(); } break; } } return CResizableDialog::PreTranslateMessage(pMsg); }