void CStockBuyUI::OnClick(TNotifyUI& msg) { if (msg.pSender->GetName() == _T("PriceAddBtn")) { OnPriceAdd(); } else if (msg.pSender->GetName() == _T("PriceSubBtn")) { OnPriceSub(); } else if (msg.pSender->GetName() == _T("RefillBtn")) { OnRefill(); } else if (msg.pSender->GetName() == _T("BuyBtn")) { OnBuy(); } else if (msg.pSender->GetName() == _T("RefreshBtn")) { OnRefresh(); } else if (msg.pSender->GetName() == _T("CancelAllBtn")) { OnCancelAll(); } else if (msg.pSender->GetName() == _T("CancelBuyBtn")) { OnCancelBuy(); } else if (msg.pSender->GetName() == _T("CancelSellBtn")) { OnCancelSell(); } }
void CAttributeLinkTableDialog::OnRefreshButton() { CString target_id; m_TargetCombo.GetWindowText(target_id); OnRefresh(m_AttributesList, target_id); //refresh pro captions list for (int a=0; a < m_CaptionsList.GetItemCount(); a++) { CString attr_name = m_CaptionsList.GetItemText(a, CAPTLIST_CL_NAME); CString query_str; query_str.Format("id(\"%s\")/attributes/element_attributes/attribute[@name=\"%s\"]/@value", target_id, attr_name); MSXML2::IXMLDOMNodePtr attr_value = m_SelXMLElm->ownerDocument->selectSingleNode((LPCTSTR) query_str); if (attr_value != NULL) { m_CaptionsList.SetItemText(a, CAPTLIST_CL_VALUE, attr_value->text); attr_value.Release(); } } }
BOOL CWzPubType::OnInitDialog() { CDialog::OnInitDialog(); OnRefresh( 0, 0L ); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL CDlgJpegSettings::OnInitDialog() { CDialog::OnInitDialog(); m_slideQuality.SetRange( 0, 255 ); OnRefresh( 0, 0L ); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
/** * Event: OnDownloadComplete */ void __stdcall CBrowserHelperObject::OnDownloadComplete() { // decrease counter to compare with DownloadBegin --m_nObjCounter; // if m_nObjCounter is Zero and we are in Refresh mode we know that the refreshed page has loaded. if (m_bIsRefresh && m_nObjCounter == 0) { OnRefresh(); m_bIsRefresh = false; } }
void CAttributeLinkDialog::OnRefreshButton() { CString s; m_TargetCombo.GetWindowText(s); POSITION pos = m_AttributesList.GetFirstSelectedItemPosition(); if (pos != NULL) { int nItem = m_AttributesList.GetNextSelectedItem(pos); CString name_str = * ((CString *) m_AttributesList.GetItemData(nItem)); OnRefresh(m_AttributesList, s); SelectItemByNameString(name_str); } else { OnRefresh(m_AttributesList, s); } }
BOOL CPgChromaKey::OnInitDialog() { CDialog::OnInitDialog(); m_slidePositive.SetRange( 0, 255 ); m_slideNegative.SetRange( 0, 255 ); OnRefresh( 0, 0L ); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL CDlgPublishHtml::OnInitDialog() { CDialog::OnInitDialog(); SetIcon( AfxGetApp()->LoadIcon( IDI_FTP ), TRUE ); SetIcon( AfxGetApp()->LoadIcon( IDI_FTP ), FALSE ); // Set the icon m_choose_dir.SetIcon( CGrDC::LoadIcon( IDI_DIR_CLOSED ) ); OnRefresh( 0, 0L ); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void CDlgEventLog::OnMessagesFilter( wxCommandEvent& WXUNUSED(event) ) { wxLogTrace(wxT("Function Start/End"), wxT("CDlgEventLog::OnMessagesFilter - Function Begin")); wxInt32 iIndex = -1; MESSAGE* message; wxASSERT(m_pList); m_iFilteredIndexes.Clear(); s_strFilteredProjectName.clear(); m_iTotalDeletedFilterRows = 0; if (s_bIsFiltered) { s_bIsFiltered = false; m_iFilteredDocCount = m_iTotalDocCount; } else { iIndex = m_pList->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (iIndex >= 0) { message = wxGetApp().GetDocument()->message(iIndex); if ((message->project).size() > 0) { s_strFilteredProjectName = message->project; s_bIsFiltered = true; for (iIndex = 0; iIndex < m_iTotalDocCount; iIndex++) { message = wxGetApp().GetDocument()->message(iIndex); if (message->project.empty() || (message->project == s_strFilteredProjectName)) { m_iFilteredIndexes.Add(iIndex); } } m_iFilteredDocCount = (int)(m_iFilteredIndexes.GetCount()); } } } s_bFilteringChanged = true; SetFilterButtonText(); // Force a complete update m_iPreviousRowCount = 0; m_pList->DeleteAllItems(); m_pList->SetItemCount(m_iFilteredDocCount); OnRefresh(); wxLogTrace(wxT("Function Start/End"), wxT("CDlgEventLog::OnMessagesFilter - Function End")); }
void CuDlgDBEventPane01::ForceRefresh() { TRACE0 ("CuDlgDBEventPane01::ForceRefresh() ...\n"); CString strNone; CView* pView = (CView*)GetParent(); ASSERT (pView); CDbeventDoc* pDoc = (CDbeventDoc*)pView->GetDocument(); ASSERT (pDoc); LPUCHAR parentstrings [MAXPLEVEL]; if (strNone.LoadString (IDS_DATABASE_NONE) == 0) strNone = "<None>"; if (pDoc->m_strDBName == "" || pDoc->m_strDBName == strNone) return; parentstrings[0] = (LPUCHAR)(LPCTSTR)pDoc->m_strDBName; // // Refresh the cach DOMDisableDisplay (pDoc->m_hNode, NULL); UpdateDOMData ( pDoc->m_hNode, OT_DBEVENT, 1, parentstrings, FALSE, FALSE); DOMUpdateDisplayData ( pDoc->m_hNode, OT_DBEVENT, 1, parentstrings, FALSE, ACT_ADD_OBJECT, 0L, 0); // // Refresh data of this Window OnRefresh (); }
// CBacnetProgramEdit message handlers LRESULT CBacnetProgramEdit::OnHotKey(WPARAM wParam,LPARAM lParam) { if(Run_once_mutex == true) //If already exist some function run,it can't show another one; return -1; if (wParam==KEY_F2) { Run_once_mutex = true; OnSend(); Run_once_mutex = false; } else if(wParam == KEY_F3) { Run_once_mutex = true; OnClear(); Run_once_mutex = false; } else if(wParam == KEY_F7) { Run_once_mutex = true; OnLoadfile(); Run_once_mutex = false; } else if(wParam == KEY_F6) { Run_once_mutex = true; OnSavefile(); Run_once_mutex = false; } else if(wParam == KEY_F8) { Run_once_mutex = true; OnRefresh(); Run_once_mutex = false; } return 0; }
void CPropTreeItemCombo::SetItemValue( LPARAM lParam ) { m_lComboData = lParam; OnRefresh(); }
bool CDlgEventLog::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) { ////@begin CDlgEventLog member initialisation CMainDocument* pDoc = wxGetApp().GetDocument(); wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); m_iPreviousRowCount = 0; m_iTotalDocCount = 0; m_iPreviousFirstMsgSeqNum = pDoc->GetFirstMsgSeqNum(); m_iPreviousLastMsgSeqNum = m_iPreviousFirstMsgSeqNum - 1; m_iNumDeletedFilteredRows = 0; m_iTotalDeletedFilterRows = 0; if (!s_bIsFiltered) { s_strFilteredProjectName.clear(); } m_iFilteredIndexes.Clear(); m_bProcessingRefreshEvent = false; m_bWasConnected = false; m_bEventLogIsOpen = true; ////@end CDlgEventLog member initialisation CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced(); wxPoint oTempPoint; wxSize oTempSize; wxASSERT(pSkinAdvanced); wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced)); if ((pos == wxDefaultPosition) && (size == wxDefaultSize)) { // Get size and position from the previous configuration GetWindowDimensions( oTempPoint, oTempSize ); #ifdef __WXMSW__ // Get the current display space for the current window int iDisplay = wxNOT_FOUND; if ( wxGetApp().GetFrame() != NULL ) iDisplay = wxDisplay::GetFromWindow(wxGetApp().GetFrame()); if ( iDisplay == wxNOT_FOUND ) iDisplay = 0; wxDisplay *display = new wxDisplay(iDisplay); wxRect rDisplay = display->GetClientArea(); // Check that the saved height and width is not larger than the displayable space. // If it is, then reduce the size. if ( oTempSize.GetWidth() > rDisplay.width ) oTempSize.SetWidth(rDisplay.width); if ( oTempSize.GetHeight() > rDisplay.height ) oTempSize.SetHeight(rDisplay.height); // Check if part of the display was going to be off the screen, if so, center the // display on that axis if ( oTempPoint.x < rDisplay.x ) { oTempPoint.x = rDisplay.x; } else if ( oTempPoint.x + oTempSize.GetWidth() > rDisplay.x + rDisplay.width ) { oTempPoint.x = rDisplay.x + rDisplay.width - oTempSize.GetWidth(); } if ( oTempPoint.y < rDisplay.y ) { oTempPoint.y = rDisplay.y; } else if ( oTempPoint.y + oTempSize.GetHeight() > rDisplay.y + rDisplay.height ) { oTempPoint.y = rDisplay.y + rDisplay.height - oTempSize.GetHeight(); } delete display; #endif #ifdef __WXMAC__ // If the user has changed the arrangement of multiple // displays, make sure the window title bar is still on-screen. if (!IsWindowOnScreen(oTempPoint.x, oTempPoint.y, oTempSize.GetWidth(), oTempSize.GetHeight())) { oTempPoint.y = oTempPoint.x = 30; } #endif // ! __WXMAC__ } else { oTempPoint = pos; oTempSize = size; } wxDialog::Create( parent, id, caption, oTempPoint, oTempSize, style ); SetSizeHints(DLGEVENTLOG_MIN_WIDTH, DLGEVENTLOG_MIN_HEIGHT); SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS); // Initialize Application Title wxString strCaption = caption; if (strCaption.IsEmpty()) { strCaption.Printf(_("%s - Event Log"), pSkinAdvanced->GetApplicationName().c_str()); } SetTitle(strCaption); // Initialize Application Icon SetIcons(*pSkinAdvanced->GetApplicationIcon()); CreateControls(); // Create List Pane Items m_pList->InsertColumn(COLUMN_PROJECT, _("Project"), wxLIST_FORMAT_LEFT, 109); m_pList->InsertColumn(COLUMN_TIME, _("Time"), wxLIST_FORMAT_LEFT, 130); m_pList->InsertColumn(COLUMN_MESSAGE, _("Message"), wxLIST_FORMAT_LEFT, 378); m_pMessageInfoAttr = new wxListItemAttr( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT), wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), wxNullFont ); m_pMessageErrorAttr = new wxListItemAttr( *wxRED, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), wxNullFont ); #if EVENT_LOG_STRIPES m_pMessageInfoGrayAttr = new wxListItemAttr( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT), wxColour(240, 240, 240), wxNullFont ); m_pMessageErrorGrayAttr = new wxListItemAttr(*wxRED, wxColour(240, 240, 240), wxNullFont); #else m_pMessageInfoGrayAttr = new wxListItemAttr(*m_pMessageInfoAttr); m_pMessageErrorGrayAttr = new wxListItemAttr(*m_pMessageErrorAttr); #endif SetTextColor(); RestoreState(); OnRefresh(); // Register that we had the Event Log open immediately SaveState(); m_Shortcuts[0].Set(wxACCEL_CTRL|wxACCEL_SHIFT, (int)'F', ID_SGDIAGNOSTICLOGFLAGS); m_pAccelTable = new wxAcceleratorTable(1, m_Shortcuts); SetAcceleratorTable(*m_pAccelTable); return true; }
void KICAD_MANAGER_FRAME::OnUnarchiveFiles( wxCommandEvent& event ) { wxFileName fn = GetProjectFileName(); fn.SetExt( ZipFileExtension ); wxFileDialog zipfiledlg( this, _( "Unzip Project" ), fn.GetPath(), fn.GetFullName(), ZipFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST ); if( zipfiledlg.ShowModal() == wxID_CANCEL ) return; wxString msg = wxString::Format( _( "\nOpen \"%s\"\n" ), GetChars( zipfiledlg.GetPath() ) ); PrintMsg( msg ); wxDirDialog dirDlg( this, _( "Target Directory" ), fn.GetPath(), wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST ); if( dirDlg.ShowModal() == wxID_CANCEL ) return; wxString unzipDir = dirDlg.GetPath() + wxT( "/" ); msg.Printf( _( "Unzipping project in \"%s\"\n" ), GetChars( unzipDir ) ); PrintMsg( msg ); wxFileSystem zipfilesys; zipfilesys.AddHandler( new wxZipFSHandler ); auto path = wxURI( zipfiledlg.GetPath() + wxT( "#zip:" ) ).BuildURI(); zipfilesys.ChangePathTo( path, true ); wxFSFile* zipfile = NULL; wxString localfilename = zipfilesys.FindFirst( wxFileSelectorDefaultWildcardStr, wxFILE ); while( !localfilename.IsEmpty() ) { zipfile = zipfilesys.OpenFile( localfilename ); if( !zipfile ) { DisplayError( this, wxT( "Zip file read error" ) ); break; } wxFileName uzfn = localfilename.AfterLast( ':' ); uzfn.MakeAbsolute( unzipDir ); wxString unzipfilename = uzfn.GetFullPath(); msg.Printf( _( "Extract file \"%s\"" ), GetChars( unzipfilename ) ); PrintMsg( msg ); wxInputStream* stream = zipfile->GetStream(); wxFFileOutputStream* ofile = new wxFFileOutputStream( unzipfilename ); if( ofile->Ok() ) { ofile->Write( *stream ); PrintMsg( _( " OK\n" ) ); } else PrintMsg( _( " *ERROR*\n" ) ); delete ofile; delete zipfile; localfilename = zipfilesys.FindNext(); } PrintMsg( wxT( "** end **\n" ) ); if( unzipDir == Prj().GetProjectPath() ) { wxCommandEvent dummy; OnRefresh( dummy ); } }
bool CDlgEventLog::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) { ////@begin CDlgEventLog member initialisation CMainDocument* pDoc = wxGetApp().GetDocument(); wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); m_iPreviousRowCount = 0; m_iTotalDocCount = 0; m_iPreviousFirstMsgSeqNum = pDoc->GetFirstMsgSeqNum(); m_iPreviousLastMsgSeqNum = m_iPreviousFirstMsgSeqNum - 1; m_iNumDeletedFilteredRows = 0; m_iTotalDeletedFilterRows = 0; if (!s_bIsFiltered) { s_strFilteredProjectName.clear(); } m_iFilteredIndexes.Clear(); m_bProcessingRefreshEvent = false; m_bWasConnected = false; m_bEventLogIsOpen = true; ////@end CDlgEventLog member initialisation CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced(); wxPoint oTempPoint; wxSize oTempSize; wxASSERT(pSkinAdvanced); wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced)); if ((pos == wxDefaultPosition) && (size == wxDefaultSize)) { // Get size and position from the previous configuration GetWindowDimensions( oTempPoint, oTempSize ); #ifdef __WXMSW__ // Windows does some crazy things if the initial position is a negative // value. oTempPoint.x = wxDefaultCoord; oTempPoint.y = wxDefaultCoord; #endif #ifdef __WXMAC__ // If the user has changed the arrangement of multiple // displays, make sure the window title bar is still on-screen. if (!IsWindowOnScreen(oTempPoint.x, oTempPoint.y, oTempSize.GetWidth(), oTempSize.GetHeight())) { oTempPoint.y = oTempPoint.x = 30; } #endif // ! __WXMAC__ } else { oTempPoint = pos; oTempSize = size; } wxDialog::Create( parent, id, caption, oTempPoint, oTempSize, style ); SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS); // Initialize Application Title wxString strCaption = caption; if (strCaption.IsEmpty()) { strCaption.Printf(_("%s - Event Log"), pSkinAdvanced->GetApplicationName().c_str()); } SetTitle(strCaption); // Initialize Application Icon wxIconBundle icons; icons.AddIcon(*pSkinAdvanced->GetApplicationIcon()); icons.AddIcon(*pSkinAdvanced->GetApplicationIcon32()); SetIcons(icons); CreateControls(); // Create List Pane Items m_pList->InsertColumn(COLUMN_PROJECT, _("Project"), wxLIST_FORMAT_LEFT, 109); m_pList->InsertColumn(COLUMN_TIME, _("Time"), wxLIST_FORMAT_LEFT, 130); m_pList->InsertColumn(COLUMN_MESSAGE, _("Message"), wxLIST_FORMAT_LEFT, 378); m_pMessageInfoAttr = new wxListItemAttr( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT), wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), wxNullFont ); m_pMessageErrorAttr = new wxListItemAttr( *wxRED, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), wxNullFont ); #if EVENT_LOG_STRIPES m_pMessageInfoGrayAttr = new wxListItemAttr( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT), wxColour(240, 240, 240), wxNullFont ); m_pMessageErrorGrayAttr = new wxListItemAttr(*wxRED, wxColour(240, 240, 240), wxNullFont); #else m_pMessageInfoGrayAttr = new wxListItemAttr(*m_pMessageInfoAttr); m_pMessageErrorGrayAttr = new wxListItemAttr(*m_pMessageErrorAttr); #endif SetTextColor(); RestoreState(); OnRefresh(); return true; }
static VOID MainWndCommand(PMAIN_WND_INFO Info, WORD CmdId, HWND hControl) { UNREFERENCED_PARAMETER(hControl); switch (CmdId) { case IDC_PROP: { HTREEITEM hSelected = TreeView_GetSelection(Info->hTreeView); OpenPropSheet(Info->hTreeView, hSelected); } break; case IDC_REFRESH: { OnRefresh(Info); } break; case IDC_PROGHELP: { DisplayString(_T("Help is not yet implemented\n")); SetFocus(Info->hTreeView); } break; case IDC_EXIT: { PostMessage(Info->hMainWnd, WM_CLOSE, 0, 0); } break; case IDC_ABOUT: { DialogBox(hInstance, MAKEINTRESOURCE(IDD_ABOUTBOX), Info->hMainWnd, AboutDialogProc); SetFocus(Info->hTreeView); } break; case IDC_DEVBYTYPE: { Info->Display = DevicesByType; UpdateViewMenu(Info); OnRefresh(Info); } break; case IDC_DEVBYCONN: { Info->Display = DevicesByConnection; UpdateViewMenu(Info); OnRefresh(Info); } break; case IDC_SHOWHIDDEN: { Info->bShowHidden = !Info->bShowHidden; UpdateViewMenu(Info); OnRefresh(Info); } break; } }