示例#1
0
int __fastcall TQSODlgBox::ShowFind(CLogFind *fp)
{
	m_fp = fp;
	if( fp->GetCount() ){
		Log.GetData(&m_sd, fp->pFindTbl[0]);
		m_CurNo = fp->pFindTbl[0];
	}
	else {
		memset(&m_sd, 0, sizeof(SDMMLOG));
		OKBtn->Enabled = FALSE;
	}
	SetCountry();
	char bf[512];
	UpdateTextData(&m_sd, fp->pFindTbl[0]);
	Grid->RowCount = fp->GetCount() ? fp->GetCount() + 1 : 2;
	Grid->TopRow = 1;
	Grid->Row = 1;
	sprintf(bf, "[%s]", fp->GetText());
	strcat(bf, m_Country.c_str());
	Caption = bf;
	UpdateStat();
	m_EditFlag = 0;
	UpdateBtn();
	if( ShowModal() == IDOK ){
		if( m_EditFlag ){
			UpdateCurData(&m_sd);
			Log.PutData(&m_sd, m_CurNo);
		}
		return TRUE;
	}
	else {
		return FALSE;
	}
}
示例#2
0
void CSearchBar::OnMenuDropDown(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMTOOLBAR nmtb = (LPNMTOOLBAR)pNMHDR;
	RECT rc;
	SendMessage(TB_GETRECT, nmtb->iItem, (LPARAM)&rc);
	::MapWindowPoints(m_hWnd, NULL, LPPOINT(&rc), 2);
	if (nmtb->iItem == ID_WEB_SEARCH)
	{
		HMENU pop = SearchPluginCollection.CreateSearchMenu();
		if (AppConfig.search_engine >= 0)
		{
			SetMenuDefaultItem(pop, AppConfig.search_engine, MF_BYPOSITION);
			CheckMenuItem(pop, AppConfig.search_engine, MF_BYPOSITION | MF_CHECKED);
		}
		UINT cmd = TrackPopupMenu(pop, TPM_RETURNCMD | TPM_RIGHTALIGN | TPM_TOPALIGN, rc.right, rc.bottom, 0, m_hWnd, NULL);
		DestroyMenu(pop);
		if (cmd > 0)
		{
			int idx = (int)cmd - CSearchPluginCollection::ID_SEARCHPLUGIN00;
			if (AppConfig.search_engine != idx)
			{
				AppConfig.search_engine = idx;
				UpdateBtn();
			}
		}
	}

}
示例#3
0
文件: Scope.cpp 项目: mygaldre/mmsstv
//---------------------------------------------------------------------------
void __fastcall TTScope::RightBtnClick(TObject *Sender)
{
	m_XOFF += m_XW/4;
	if( (m_XOFF + m_XW) >= pScope->m_ScopeSize ){
		m_XOFF = pScope->m_ScopeSize - m_XW;
	}
	UpdateBtn();
}
示例#4
0
文件: Scope.cpp 项目: mygaldre/mmsstv
//---------------------------------------------------------------------------
void __fastcall TTScope::LeftBtnClick(TObject *Sender)
{
	if( m_XOFF ){
		m_XOFF -= m_XW/4;
		if( m_XOFF < 0 ) m_XOFF = 0;
	}
	UpdateBtn();
}
示例#5
0
文件: Scope.cpp 项目: mygaldre/mmsstv
//---------------------------------------------------------------------
void __fastcall TTScope::Execute(CSSTVDEM *pd)
{
	pDem = pd;
	pScope = pd->m_Scope;
	pScope[0].InitMem();
	pScope[1].InitMem();
	UpdateBtn();
	ShowModal();
}
示例#6
0
int CSearchBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CToolBar::OnCreate(lpCreateStruct) == -1)
		return -1;

	GetToolBarCtrl().SetBitmapSize(CSize(16, 16));

	LPCTSTR cls_name;
	if (riched20)
		cls_name = "RichEdit20A";
	else
		cls_name = "EDIT";

	hedit = CreateWindowEx(WS_EX_CLIENTEDGE, cls_name, NULL, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE,
						   0, 0, 0, 0, m_hWnd, NULL, AfxGetInstanceHandle(), NULL);

	if (riched20)
	{
		::SendMessage(hedit, EM_SETTEXTMODE, TM_PLAINTEXT | TM_MULTICODEPAGE, 0);
		::SendMessage(hedit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELPARAM(2, 2));
		::SendMessage(hedit, EM_SETUNDOLIMIT, 1, 0);
	}

	old_search_bar_proc = (WNDPROC)::GetWindowLong(hedit, GWL_WNDPROC);
	::SetWindowLong(hedit, GWL_WNDPROC, (LONG)EditProc);
	::SetWindowLong(hedit, GWL_USERDATA, (LONG)this);

	CToolBarCtrl& toolbar = GetToolBarCtrl();

	toolbar.AddButtons(1, searchbar_btns);
	toolbar.SetExtendedStyle(TBSTYLE_EX_DRAWDDARROWS);
	toolbar.SetIndent(100);
	toolbar.AutoSize();

	int n = SearchPluginCollection.GetCount();
	if (n > 0)
	{
		for (int i = 0; i < n; ++i)
		{
			HBITMAP hbmp = SearchPluginCollection.GetImage(i);
			if (hbmp)
			{
				TBADDBITMAP tbab;
				tbab.hInst = NULL;
				tbab.nID = (UINT)hbmp;
				::SendMessage(toolbar.m_hWnd, TB_ADDBITMAP, 1, (LPARAM)&tbab);
			}
		}
	}

	UpdateBtn();
	EnableToolTips();
	return 0;
}
示例#7
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    this->setWindowTitle(tr("Launcher %1").arg(QString(LAUNCER_VER)));

    m_pInstaller = new Installer(this);
    connect(m_pInstaller, SIGNAL(SoftWareAvailable(AvailableSoftWare)), this, SLOT(AvailableSoftWareUpdated(AvailableSoftWare)));
    connect(m_pInstaller, SIGNAL(StartDownload()), this, SLOT(OnDownloadStarted()));
    connect(m_pInstaller, SIGNAL(DownloadFinished()), this, SLOT(OnDownloadFinished()));
    connect(m_pInstaller, SIGNAL(DownloadProgress(int)), this, SLOT(OnDownloadProgress(int)));

    m_pUpdateTimer = new QTimer(this);
    connect(m_pUpdateTimer, SIGNAL(timeout()), this, SLOT(on_btnRefresh_clicked()));
    m_pUpdateTimer->start(Settings::GetInstance()->GetUpdateTimerInterval());

    ui->stableTable->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
    ui->developmentTable->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
    ui->dependenciesTable->horizontalHeader()->setResizeMode(QHeaderView::Stretch);

    connect(ui->stableTable, SIGNAL(itemSelectionChanged()), this, SLOT(UpdateBtn()));
    connect(ui->dependenciesTable, SIGNAL(itemSelectionChanged()), this, SLOT(UpdateBtn()));
    connect(ui->developmentTable, SIGNAL(itemSelectionChanged()), this, SLOT(UpdateBtn()));
    connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(UpdateBtn()));

    connect(ui->stableTable, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(on_btnRun_clicked()));
    connect(ui->developmentTable, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(on_btnRun_clicked()));

    connect(Logger::GetInstance(), SIGNAL(LogAdded(QString)), this, SLOT(OnLogAdded(QString)));

    ui->downloadProgress->setVisible(false);
    ui->downloadProgress->setRange(0, 100);

    m_bBusy = false;
    UpdateBtn();
    m_pInstaller->Init();
}
示例#8
0
文件: Scope.cpp 项目: mygaldre/mmsstv
//---------------------------------------------------------------------------
void __fastcall TTScope::SBUpWClick(TObject *Sender)
{
	int x = (m_CursorX - m_XOFF) * PaintBox->Width / m_XW;
	if( m_XW < 512 ){
		m_XW += 32;
		AdjXoff(x);
		PaintBoxPaint(NULL);
	}
	else if( m_XW <= (pScope->m_ScopeSize - 512) ){
		m_XW += 512;
		AdjXoff(x);
		PaintBoxPaint(NULL);
	}
	UpdateBtn();
}
示例#9
0
文件: Scope.cpp 项目: mygaldre/mmsstv
//---------------------------------------------------------------------------
void __fastcall TTScope::SBDownWClick(TObject *Sender)
{
	int x = (m_CursorX - m_XOFF) * PaintBox->Width / m_XW;
	if( m_XW >= 1024 ){
		m_XW -= 512;
		AdjXoff(x);
		PaintBoxPaint(NULL);
	}
	else if( m_XW >= 64 ){
		m_XW -= 32;
		AdjXoff(x);
		PaintBoxPaint(NULL);
	}
	UpdateBtn();
}
示例#10
0
int __fastcall TQSODlgBox::Execute(CLogFind *fp, SDMMLOG *sp, int n)
{
	m_fp = fp;
	UpdateTextData(sp, n);
	Grid->RowCount = fp->GetCount() ? fp->GetCount() + 1 : 2;
//	Grid->TopRow = 1;
	Grid->Row = 1;
	Grid->Enabled = FALSE;
	for( int i = 0; i < fp->GetCount(); i++ ){
		if( n == fp->pFindTbl[i] ){
			Grid->Enabled = TRUE;
			Grid->Row = i + 1;
			Grid->TopRow = (i > 4) ? Grid->Row - 4 : 1;
			break;
		}
	}
	SetCountry();
	char bf[512];
	strcpy(bf, MsgEng ? "Initial Data":"QSOデータ初期値");
	if( Grid->Enabled == TRUE ){
		if( sp->btime ){
			sprintf(bf, "[%s]", fp->GetText());
			strcat(bf, m_Country.c_str());
		}
		else if( *fp->GetText() ){
			sprintf(bf, "[%s]", fp->GetText());
			strcat(bf, m_Country.c_str());
		}
	}
	Caption = bf;
	UpdateStat();
	m_EditFlag = 0;
	UpdateBtn();
	m_CurNo = n;
	if( ShowModal() == IDOK ){
		if( m_EditFlag ){
			UpdateCurData(&m_sd);
			Log.PutData(&m_sd, m_CurNo);
		}
	}
	if( m_CurNo == n ){
		memcpy(sp, &m_sd, sizeof(SDMMLOG));
	}
	else {
		Log.GetData(sp, n);
	}
	return TRUE;
}
示例#11
0
//---------------------------------------------------------------------------
void __fastcall TQSODlgBox::GridSelectCell(TObject *Sender, int Col,
	  int Row, bool &CanSelect)
{
	int n = Row - 1;
	if( n < m_fp->GetCount() ){
		if( m_CurNo != m_fp->pFindTbl[n] ){
			if( m_EditFlag ){
				UpdateCurData(&m_sd);
				Log.PutData(&m_sd, m_CurNo);
				m_EditFlag = 0;
			}
			m_CurNo = m_fp->pFindTbl[n];
			Log.GetData(&m_sd, m_CurNo);
			UpdateTextData(&m_sd, m_CurNo);
			Grid->Invalidate();
			UpdateBtn();
		}
	}
}
示例#12
0
void __fastcall TQSODlgBox::UpdateTextData(SDMMLOG *sp)
{
	SDMMLOG	sd;
	memcpy(&sd, sp, sizeof(SDMMLOG));
	if( Log.m_LogSet.m_TimeZone != 'I' ){
		JSTtoUTC(&sd);
	}
	EditDate->Text = Log.GetDateString(&sd);
	EditBgn->Text = Log.GetTimeString(sd.btime);
	EditEnd->Text = Log.GetTimeString(sd.etime);
	EditCall->Text = sp->call;
	EditName->Text = sp->name;
	EditQTH->Text = sp->qth;
	EditHis->Text = sp->ur;
	EditMy->Text = sp->my;
	EditBand->Text = Log.GetFreqString(sp->band, sp->fq);
	EditMode->Text = Log.GetModeString(sp->mode);
	EditRem->Text = sp->rem;
	EditQSL->Text = sp->qsl;
	if( sp->env ){
		EditEnv->Text = sp->env;
	}
	else {
		EditEnv->Text = "";
	}
	EditOpt1->Text = Log.GetOptStr(0, sp);
	EditOpt2->Text = Log.GetOptStr(1, sp);
	EditUsr1->Text = Log.GetOptStr(2, sp);
	EditUsr2->Text = Log.GetOptStr(3, sp);
	EditS->Text = sp->send;
	EditR->Text = sp->recv;
	EditM->Text = sp->cq;
	EditPow->Text = sp->pow;
	m_EditFlag = 0;
	UpdateBtn();
}
示例#13
0
//---------------------------------------------------------------------------
void __fastcall TQSODlgBox::EditDateChange(TObject *Sender)
{
	m_EditFlag = 1;
	UpdateBtn();
}
示例#14
0
void MainWindow::OnComboBoxValueChanged(const QString& value) {
    m_SelectedAppVersion = value;
    UpdateBtn();
}
示例#15
0
void MainWindow::OnDownloadFinished() {
    m_bBusy = false;
    ui->downloadProgress->setVisible(false);
    UpdateBtn();
}
示例#16
0
void MainWindow::OnDownloadStarted() {
    m_bBusy = true;
    ui->downloadProgress->setValue(0);
    ui->downloadProgress->setVisible(true);
    UpdateBtn();
}