void MultiViewerMain::RefreshData(bool a_bLastInsertRowOnly) { VecArray2D<wxString> o2DtableData; vector<wxString> vecDBRowId; vector<wxString> vecDBColName; if(a_bLastInsertRowOnly) { TableData oTableData(&o2DtableData, &vecDBRowId, &vecDBColName); if(m_pSQLReader->GetLastInsertRow( m_nSelectedTable, &oTableData).IsFail() ) return; m_2DtableData.AppendRows(&o2DtableData); m_vecDBRowId.insert(m_vecDBRowId.end(), vecDBRowId.begin(), vecDBRowId.end()); m_DBDisplay.AddRow(); } else { Reload( m_DBDisplay.GetCurrentPage() ); } int nTotalRow = m_2DtableData.GetRowSize(); wxString wxstrTotal; wxstrTotal.Printf(_T("/ %d"), nTotalRow); m_pTotalStaticText->SetLabel(wxstrTotal); SetCurPage(m_DBDisplay.GetTotalPage()); MoveEndGridRow(m_pTableDBDataGrid); }
bool CPageUI::OnBtnGoPageClick( void *param ) { bool bRet = false; TNotifyUI *pMsg = (TNotifyUI*)param; do { if (pMsg->sType == _T("click")) { m_nGoPage = _ttoi(m_pEditGoPage->GetText().GetData()); if (m_nGoPage <= 0 || m_nGoPage > m_nTotalPage) { bRet = false; break; } SetCurPage(m_nGoPage); m_pManager->SendNotify(this, DUI_MSGTYPE_PAGE_CHANGED, NULL, m_nCurPage); bRet = true; } } while (false); return bRet; }
void MultiViewerMain::OnTableDBEndButtonClick( wxCommandEvent& ) { if( m_DBDisplay.GetCurrentPage() == m_DBDisplay.GetTotalPage()) return; SetCurPage(m_DBDisplay.GetTotalPage()); }
bool MultiViewerMain::Refresh() { InitSQLTableInfo(); //mTableDBSlider->SetValue(m_DBDisplay.GetCurrentPage()); SetCurPage(m_DBDisplay.GetCurrentPage()); return true; }
bool MultiViewerMain::Reload(int a_nPage) { m_eProgramState = eStateTableSelected; m_2DtableData.ClearAll(); TableData oTableData(&m_2DtableData, &m_vecDBRowId, &m_vecDBColName); m_pSQLReader->GetAllRow(m_nSelectedTable, &oTableData); m_pTableDBDataGrid->AppendCols(oTableData.GetCol()); int nTotalRow = oTableData.GetRow(); wxString wxstrTotal; wxstrTotal.Printf(_T("/ %d"), nTotalRow); m_pTotalStaticText->SetLabel(wxstrTotal); wxString wxstrCurrentRow; wxstrCurrentRow.Printf(_T("%d"), 1); m_pCurrentRowTextCtrl->SetValue(wxstrCurrentRow); m_DBDisplay.SetTotal(nTotalRow); mTableDBSlider->SetPageSize(1); mTableDBSlider->SetRange(1, m_DBDisplay.GetTotalPage()); mTableDBSlider->SetValue(a_nPage); SetCurPage(1); return true; }
void MultiViewerMain::OnTableDBSliderUp( wxScrollEvent& ) { if( m_DBDisplay.GetPagePerRow() <= 1 ) return; SetCurPage(m_DBDisplay.PageMove(-1)); }
void MultiViewerMain::OnTableDBStartButtonClick( wxCommandEvent& ) { if( m_DBDisplay.GetCurrentPage() == 1 ) return; SetCurPage(1); }
void CPatchBar::ChaseMidiTarget(int PageIdx, int TargetIdx) { if (!IsWindowVisible()) // if bar hidden GetParentFrame()->ShowControlBar(this, TRUE, 0); // show bar SetCurPage(PageIdx); // chase to target's page if (PageIdx == PAGE_MidiTarget) // if page is MIDI target dialog m_MidiTargetDlg.EnsureVisible(TargetIdx); // chase to target's row }
void MultiViewerMain::OnTableDBSliderDown( wxScrollEvent& ) { if( m_DBDisplay.GetTotalPage() <= m_DBDisplay.GetCurrentPage()) return; SetCurPage(m_DBDisplay.PageMove(+1)); }
bool CPageUI::OnBtnRightPageClick( void *param ) { bool bRet = false; TNotifyUI *pMsg = (TNotifyUI*)param; do { if (pMsg->sType == _T("click")) { m_nCurPage++; SetCurPage(m_nCurPage); m_pManager->SendNotify(this, DUI_MSGTYPE_PAGE_CHANGED, NULL, m_nCurPage); bRet = true; } } while (false); return bRet; }
void MultiViewerMain::OnTableSelectButtonClick(wxCommandEvent& ) { if(m_eProgramState == eStateInit) return; int nSelect = m_pTableNameChoice->GetSelection(); if( nSelect == -1) return; m_nSelectedTable = nSelect; m_eProgramState = eStateTableSelected; m_2DtableData.ClearAll(); TableData oTableData(&m_2DtableData, &m_vecDBRowId, &m_vecDBColName); m_pSQLReader->GetAllRow(nSelect, &oTableData); m_pTableDBDataGrid->AppendCols(oTableData.GetCol()); int nTotalRow = oTableData.GetRow(); wxString wxstrTotal; wxstrTotal.Printf(_T("/ %d"), nTotalRow); m_pTotalStaticText->SetLabel(wxstrTotal); wxString wxstrCurrentRow; wxstrCurrentRow.Printf(_T("%d"), 1); m_pCurrentRowTextCtrl->SetValue(wxstrCurrentRow); m_DBDisplay.SetTotal(nTotalRow); mTableDBSlider->SetPageSize(1); mTableDBSlider->SetRange(1, m_DBDisplay.GetTotalPage()); mTableDBSlider->SetValue(1); SetCurPage(1); }
CPageUI::CPageUI() { SetFixedHeight(20); SetFixedWidth(186); m_nGoPage = 0; m_nCurPage = 0; m_nTotalPage = 0; m_pEditGoPage = new CEditUI; m_pEditGoPage->SetFixedWidth(40); m_pEditGoPage->SetAttribute(_T("textpadding"), _T("2,1,2,1")); m_pEditGoPage->SetAttribute(_T("bordersize"), _T("1")); m_pEditGoPage->SetAttribute(_T("bordercolor"), _T("#FFBFBFBF")); m_pEditGoPage->SetAttribute(_T("textcolor"), _T("#ff333333")); m_pEditGoPage->SetAttribute(_T("tipvalue"), _T("转至...")); m_pEditGoPage->SetAttribute(_T("tipvaluecolor"), _T("#ff888888")); m_pEditGoPage->OnNotify += MakeDelegate(this, &CPageUI::OnEditGoPageEnter); m_pBtnGoPage = new CButtonUI; m_pBtnGoPage->SetFixedWidth(20); m_pBtnGoPage->SetText(_T("go")); m_pBtnGoPage->SetAttribute(_T("textpadding"), _T("2,0,2,1")); m_pBtnGoPage->SetAttribute(_T("bordersize"), _T("1")); m_pBtnGoPage->SetAttribute(_T("bordercolor"), _T("#FFBFBFBF")); m_pBtnGoPage->SetTextColor(0xff333333); m_pBtnGoPage->SetHotTextColor(0xff0099cc); m_pBtnGoPage->OnNotify += MakeDelegate(this, &CPageUI::OnBtnGoPageClick); m_pBtnLeftPage = new CButtonUI; m_pBtnLeftPage->SetFixedWidth(16); m_pBtnLeftPage->SetAttribute(_T("padding"), _T("10,2,0,2")); m_pBtnLeftPage->OnNotify += MakeDelegate(this, &CPageUI::OnBtnLeftPageClick); m_pLabCurPage = new CLabelUI; //m_pLabCurPage->SetFixedWidth(16); m_pLabCurPage->SetAutoCalcWidth(true); m_pLabCurPage->SetTextColor(0xff333333); m_pBtnRightPage = new CButtonUI; m_pBtnRightPage->SetFixedWidth(16); m_pBtnRightPage->SetAttribute(_T("padding"), _T("0,2,0,2")); m_pBtnRightPage->OnNotify += MakeDelegate(this, &CPageUI::OnBtnRightPageClick); m_pBtnRefresh = new CButtonUI; m_pBtnRefresh->SetFixedWidth(16); m_pBtnRefresh->SetEnabled(false); m_pBtnRefresh->SetToolTip("刷新当前页"); m_pBtnRefresh->SetAttribute(_T("padding"), _T("4,2,0,2")); m_pBtnRefresh->OnNotify += MakeDelegate(this, &CPageUI::OnBtnRefreshClick); Add(m_pEditGoPage); Add(m_pBtnGoPage); Add(m_pBtnLeftPage); Add(m_pLabCurPage); Add(m_pBtnRightPage); Add(m_pBtnRefresh); SetTotalPage(m_nTotalPage); SetCurPage(m_nCurPage); }
void MultiViewerMain::OnTableDBSliderRelease( wxScrollEvent& event ) { SetCurPage(mTableDBSlider->GetValue()); event.Skip(); }