Esempio n. 1
0
void MainWindow::createAction()
{
	openfileAction = new QAction(tr("&Open file"),this);
        openfileAction->setIcon(QIcon(":/imgs/open.png"));
	openfileAction->setShortcut(QKeySequence::Open);
	openfileAction->setStatusTip(tr("Open a new library database file"));
	saveaction = new QAction(tr("&Save file"),this);
        saveaction->setIcon(QIcon(":/imgs/save.png"));
	saveaction->setShortcut(QKeySequence::Save);
	saveaction->setStatusTip(tr("Save your current files"));
	saveasaction = new QAction(tr("Save &As"),this);
        saveasaction->setIcon(QIcon(":/imgs/saveas.png"));
	saveaction->setShortcut(QKeySequence::SaveAs);
	saveaction->setStatusTip(tr("Save your in another files"));
	exitAction = new QAction(tr("E&xit"),this);
	exitAction->setShortcut(tr("Ctr+Q"));
	exitAction->setStatusTip(tr("Exit the applicatino"));
	connect(exitAction,SIGNAL(triggered()),this,SLOT(whenexit()));
	aboutLibraryAction = new QAction(tr("About &Library"),this);
	aboutLibraryAction->setStatusTip(tr("Show this application's about box"));
	aboutQtAction = new QAction(tr("&About Qt"),this);
	aboutQtAction->setStatusTip(tr("Show the QT library's about box"));
	connect(openfileAction,SIGNAL(triggered()),this,SLOT(open()));
	connect(saveaction,SIGNAL(triggered()),this,SLOT(save()));
	connect(saveasaction,SIGNAL(triggered()),this,SLOT(saveas()));
	connect(aboutQtAction,SIGNAL(triggered()),qApp,SLOT(aboutQt()));
	connect(aboutLibraryAction,SIGNAL(triggered()),this,SLOT(about()));
}
Esempio n. 2
0
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: newFile(); break;
        case 1: open(); break;
        case 2: { bool _r = save();
            if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; }  break;
        case 3: { bool _r = saveas();
            if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; }  break;
        case 4: find(); break;
        case 5: goToCell(); break;
        case 6: sort(); break;
        case 7: about(); break;
        case 8: openRecentFile(); break;
        case 9: updateStatusBar(); break;
        case 10: spreadsheetModified(); break;
        default: ;
        }
        _id -= 11;
    }
    return _id;
}
Esempio n. 3
0
bool MainWindow::save()
{
	if(curFile.isEmpty())
		return saveas();
	else
		return saveFile(curFile);
}
Esempio n. 4
0
void MainFrame::on_save(wxCommandEvent& WXUNUSED(event))
{
    if(editor_.get_filename().empty()) {
        saveas();
    } else {
        editor_.save();
    }
}
Esempio n. 5
0
gint save(GtkWidget *widget, gpointer data) {
  if(!doc->hasname)
    return saveas(widget, data);
  doc->file_save();
  if (doc->exiting)
    gtk_main_quit();
  
  return TRUE;
}
Esempio n. 6
0
/*
 * bSaveTextfile - save the diagram as a text file
 */
BOOL
bSaveTextfile(event_pollblock *pEvent, void *pvReference)
{
	diagram_type	*pDiag;
	size_t	tRecLen, tNbrRecs, tEstSize;

	TRACE_MSG("bSaveTextfile");

	fail(pEvent == NULL);
	fail(pvReference == NULL);

	pDiag = (diagram_type *)pvReference;

	switch (pEvent->type) {
	case event_SEND:	/* From a menu */
		fail(pEvent->data.message.header.action != message_MENUWARN);
		if (menu_currentopen != pDiag->pSaveMenu ||
		    pEvent->data.message.data.menuwarn.selection[0] !=
							SAVEMENU_SAVETEXT) {
			return FALSE;
		}
		break;
	case event_KEY:		/* From a key short cut */
		if (pEvent->data.key.caret.window != pDiag->tMainWindow) {
			return FALSE;
		}
		break;
	default:
		DBG_DEC(pEvent->type);
		return FALSE;
	}

	tRecLen = sizeof(drawfile_text) + DEFAULT_SCREEN_WIDTH * 2 / 3;
	tNbrRecs = pDiag->tInfo.length / tRecLen + 1;
	tEstSize = tNbrRecs * DEFAULT_SCREEN_WIDTH * 2 / 3;
	DBG_DEC(tEstSize);

	saveas(FILETYPE_TEXT, "WordText", tEstSize, bText2File, pDiag);
	return TRUE;
} /* end of bSaveTextfile */
Esempio n. 7
0
/*
 * bSaveDrawfile - save the diagram as a draw file
 */
BOOL
bSaveDrawfile(event_pollblock *pEvent, void *pvReference)
{
	diagram_type	*pDiag;
	size_t		tEstSize;

	TRACE_MSG("bSaveDrawfile");

	fail(pEvent == NULL);
	fail(pvReference == NULL);

	pDiag = (diagram_type *)pvReference;

	switch (pEvent->type) {
	case event_SEND:	/* From a menu */
		fail(pEvent->data.message.header.action != message_MENUWARN);
		if (menu_currentopen != pDiag->pSaveMenu ||
		    pEvent->data.message.data.menuwarn.selection[0] !=
							SAVEMENU_SAVEDRAW) {
			return FALSE;
		}
		break;
	case event_KEY:		/* From a key short cut */
		if (pEvent->data.key.caret.window != pDiag->tMainWindow) {
			return FALSE;
		}
		break;
	default:
		DBG_DEC(pEvent->type);
		return FALSE;
	}

	tEstSize = pDiag->tInfo.length;
	DBG_DEC(tEstSize);

	saveas(FILETYPE_DRAW, "WordDraw", tEstSize, bDraw2File, pDiag);
	return TRUE;
} /* end of bSaveDrawfile */
Esempio n. 8
0
void MainWindow::createActions()
{
	newAction = new QAction(tr("&New"),this);
	newAction->setIcon(QIcon(":/imags/new.png"));
	newAction->setShortcut(QKeySequence::New);
	newAction->setStatusTip(tr("Create a new spreadsheet file"));
	connect(newAction,SIGNAL(triggered()),this,SLOT(newFile()));
	openAction = new QAction(tr("&Open"),this);
	openAction->setIcon(QIcon(":/imags/open.png"));
	openAction->setShortcut(QKeySequence::Open);
	openAction->setStatusTip(tr("Open a new spreadsheet file"));
	connect(openAction,SIGNAL(triggered()),this,SLOT(open()));
	saveAction = new QAction(tr("&Save"),this);
	saveAction->setIcon(QIcon(":/imgs/save.png"));
	saveAction->setShortcut(QKeySequence::Save);
	saveAction->setStatusTip(tr("Save the file"));
	connect(saveAction,SIGNAL(triggered()),this,SLOT(save()));
	saveAsAction = new QAction(tr("Save &As"),this);
        saveAction->setStatusTip(tr("save as another file"));
	connect(saveAsAction,SIGNAL(triggered()),this,SLOT(saveas()));
	for(int i = 0; i < MaxRecentFiles;++i)
	{
		recenFileActions[i] = new QAction(this);
		recenFileActions[i]->setVisible(false);
		connect(recenFileActions[i],SIGNAL(triggered()),this,SLOT(openRecentFile()));
	}

	exitAction = new QAction(tr("E&xit"),this);
	exitAction->setShortcut(tr("Ctr+Q"));
	exitAction->setStatusTip(tr("Exit the applicatino"));
	connect(exitAction,SIGNAL(triggered()),this,SLOT(close()));

	cutAction = new QAction(tr("Cu&t"),this);
	cutAction->setShortcut(QKeySequence::Cut);
	cutAction->setStatusTip(tr("Cut"));
	connect(cutAction,SIGNAL(triggered()),spreadsheet,SLOT(cut()));
	copyAction = new QAction(tr("&Copy"),this);
	copyAction->setShortcut(QKeySequence::Copy);
	copyAction->setStatusTip(tr("Copy"));
	connect(copyAction,SIGNAL(triggered()),spreadsheet,SLOT(copy()));
	pasteAction = new QAction(tr("&Paste"),this);
	pasteAction->setShortcut(QKeySequence::Paste);
	pasteAction->setStatusTip(tr("paste"));
	connect(pasteAction,SIGNAL(triggered()),spreadsheet,SLOT(paste()));
	deleteAction = new QAction(tr("&Delete"),this);
	deleteAction->setShortcut(QKeySequence::Delete);
	deleteAction->setStatusTip(tr("delete"));
	connect(deleteAction,SIGNAL(triggered()),spreadsheet,SLOT(del()));

	selectRowAction = new QAction(tr("&Row"),this);
	selectRowAction->setStatusTip(tr("select all the cell in the current row"));
	connect(selectRowAction,SIGNAL(triggered()),spreadsheet,SLOT(selectCurrentRow()));

	selectColumnAction = new QAction(tr("&Column"),this);
	selectColumnAction->setStatusTip(tr("Select all the cell in the current column"));
	connect(selectColumnAction,SIGNAL(triggered()),spreadsheet,SLOT(selectCurrentColumn()));

	selectAllAction = new QAction(tr("&All"),this);
	selectAllAction->setStatusTip(tr("Select all the cells"));
	connect(selectAllAction,SIGNAL(triggered()),spreadsheet,SLOT(selectAll()));
	
	findAction = new QAction(tr("&Find"),this);
	findAction->setIcon(QIcon(":/imags/find.png"));
	findAction->setShortcut(QKeySequence::Find);
	findAction->setStatusTip(tr("Find a matching cell"));
	connect(findAction,SIGNAL(triggered()),this,SLOT(find()));

	goToCellAction = new QAction(tr("&Go to cell"),this);
	goToCellAction->setIcon(QIcon(":/imags/gotocell.png"));
	goToCellAction->setShortcut(tr("Ctrl+G"));
	goToCellAction->setStatusTip(tr("Go to the specified file"));
	connect(goToCellAction,SIGNAL(triggered()),this,SLOT(goToCell()));

	recalculateAction = new QAction(tr("&Recalculate"),this);
	recalculateAction->setShortcut(tr("F9"));
	recalculateAction->setStatusTip(tr("Recalculate the spreadsheet's formula"));
	connect(recalculateAction,SIGNAL(triggered()),spreadsheet,SLOT(recalculate()));

	sortAction = new QAction(tr("&Sort"),this);
	sortAction->setStatusTip(tr("Sort the selected cells or all the cells"));
	connect(sortAction,SIGNAL(triggered()),this,SLOT(sort()));

	showGridAction = new QAction(tr("&Show Grid"),this);
	showGridAction->setCheckable(true);
	showGridAction->setChecked(spreadsheet->showGrid());
	showGridAction->setStatusTip(tr("Show or hide the spreadsheet's grid"));
	connect(showGridAction,SIGNAL(toggled(bool)),spreadsheet,SLOT(setShowGrid(bool)));
#if QT_VERSION < 0x040102
    // workaround for a QTableWidget bug in Qt 4.1.1
    connect(showGridAction, SIGNAL(toggled(bool)),
            spreadsheet->viewport(), SLOT(update()));
#endif

	autoRecalculateAction = new QAction(tr("&Auto-recalculate"),this);
	autoRecalculateAction->setCheckable(true);	
	autoRecalculateAction->setChecked(spreadsheet->autoRecalculate());
	autoRecalculateAction->setStatusTip(tr("Switch auto-recalculate on or off"));
        connect(autoRecalculateAction,SIGNAL(toggled(bool)),spreadsheet,SLOT(setAutoRecalculate(bool)));
	
	aboutAction = new QAction(tr("&About"),this);
	aboutAction->setStatusTip(tr("Show this application's about box"));
	connect(aboutAction,SIGNAL(triggered()),this,SLOT(about()));

	aboutqtAction = new QAction(tr("About &Qt"),this);
	aboutqtAction->setStatusTip(tr("Show the QT library's about box"));
	connect(aboutqtAction,SIGNAL(triggered()),qApp,SLOT(aboutQt()));
}
Esempio n. 9
0
// creates all menus
void WMain::createMenus() {
	fileMenu=new QMenu(this);
	wordMenu=new QMenu(this);
	testMenu=new QMenu(this);
	helpMenu=new QMenu(this);

	newAction=new QAction(tr("&New"), this);
	newAction->setShortcuts(QKeySequence::New);
	newAction->setStatusTip(tr("Create new dictionary"));

	openAction=new QAction(tr("&Open..."), this);
	openAction->setShortcuts(QKeySequence::Open);
	openAction->setStatusTip(tr("Open dictionary"));

	saveAction=new QAction(tr("&Save"), this);
	saveAction->setShortcuts(QKeySequence::Save);
	saveAction->setStatusTip(tr("Save dictionary"));

	saveasAction=new QAction(tr("&Save as..."), this);
	saveasAction->setShortcuts(QKeySequence::SaveAs);
	saveasAction->setStatusTip(tr("Save dictionary as"));

	printAction=new QAction(tr("&Print"), this);
	printAction->setShortcuts(QKeySequence::Print);
	printAction->setStatusTip(tr("Print dictionary"));
	
	settingsAction=new QAction(tr("&Settings"), this);
	settingsAction->setShortcut(QKeySequence("Ctrl+B"));
	settingsAction->setStatusTip(tr("Settings"));

	quitAction=new QAction(tr("&Quit"), this);
	quitAction->setShortcut(QKeySequence("Ctrl+Q"));
	quitAction->setStatusTip(tr("Quit dicto"));

	addAction=new QAction(tr("&Add..."), this);
	addAction->setShortcut(Qt::Key_Insert);
	addAction->setStatusTip(tr("Add new word"));

	editAction=new QAction(tr("&Edit..."), this);
	editAction->setStatusTip(tr("Edit current word"));

	deleteAction=new QAction(tr("&Delete"), this);
	deleteAction->setShortcut(Qt::Key_Delete);
	deleteAction->setStatusTip(tr("Delete current word"));

	sortAction=new QAction(tr("&Sort"), this);
	sortAction->setShortcut(QKeySequence("Ctrl+A"));
	sortAction->setStatusTip(tr("Sort dictionary"));

	testAction=new QAction(tr("&Test..."), this);
	testAction->setShortcut(QKeySequence("Ctrl+T"));
	testAction->setStatusTip(tr("Prepare test"));

	examAction=new QAction(tr("&Exam..."), this);
	examAction->setShortcut(QKeySequence("Ctrl+E"));
	examAction->setStatusTip(tr("Prepare exam"));

	statsAction=new QAction(tr("&Statistics..."), this);
	statsAction->setShortcut(QKeySequence("Ctrl+W"));
	statsAction->setStatusTip(tr("Show statistics"));

	aboutAction=new QAction(tr("&About"), this);
	aboutAction->setStatusTip(tr("About dicto"));

	fileMenu = menuBar()->addMenu(tr("&File"));
	fileMenu->addAction(newAction);
	fileMenu->addAction(openAction);
	fileMenu->addAction(saveAction);
	fileMenu->addAction(saveasAction);
	fileMenu->addAction(printAction);
	fileMenu->addSeparator();
	

	for (int i = 0; i < 10/*maxRecentFiles*/; ++i) {
		recentFilesActions[i] = new QAction(this);
		recentFilesActions[i]->setVisible(false);
		fileMenu->addAction(recentFilesActions[i]);
		connect(recentFilesActions[i], SIGNAL(triggered()),this, SLOT(openRecentFile()));
	}
	updateRecentFileActions();

	
	fileMenu->addSeparator();
	fileMenu->addAction(settingsAction);
	fileMenu->addSeparator();
	fileMenu->addAction(quitAction);

	wordMenu = menuBar()->addMenu(tr("&Words"));
	wordMenu->addAction(addAction);
	wordMenu->addAction(editAction);
	wordMenu->addAction(deleteAction);
	wordMenu->addSeparator();
	wordMenu->addAction(sortAction);

	testMenu = menuBar()->addMenu(tr("&Test"));
	testMenu->addAction(testAction);
	testMenu->addAction(examAction);
	testMenu->addSeparator();
	testMenu->addAction(statsAction);

	helpMenu = menuBar()->addMenu(tr("&Help"));
	helpMenu->addAction(aboutAction);

	connect(newAction, SIGNAL(triggered()), this, SLOT(newfile()));
	connect(openAction, SIGNAL(triggered()), this, SLOT(openfile()));
	connect(saveAction, SIGNAL(triggered()), this, SLOT(savefile()));
	connect(saveasAction, SIGNAL(triggered()), this, SLOT(saveas()));
	connect(printAction, SIGNAL(triggered()), this, SLOT(print()));
	connect(settingsAction, SIGNAL(triggered()), this, SLOT(show_settings()));
	connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));

	connect(addAction, SIGNAL(triggered()), this, SLOT(addentry()));
	connect(editAction, SIGNAL(triggered()), this, SLOT(editentry()));
	connect(deleteAction, SIGNAL(triggered()), this, SLOT(deleteentry()));
	connect(sortAction, SIGNAL(triggered()), this, SLOT(sortall()));

	connect(testAction, SIGNAL(triggered()), this, SLOT(preparetest()));
	connect(examAction, SIGNAL(triggered()), this, SLOT(prepareexam()));
	connect(statsAction, SIGNAL(triggered()), this, SLOT(stats()));

	connect(aboutAction, SIGNAL(triggered()), this, SLOT(about()));
}
Esempio n. 10
0
void validation()
{
	msglvl[DBG] = SILENT;
	msglvl[INF] = VISUAL;
	msglvl[WRN] = VISUAL;
	msglvl[ERR] = VISUAL;
	msglvl[FAT] = VISUAL;

	TDirectory* oldDir = gDirectory; // remember old directory

	style();

	Int_t g4bin = (ng4bins/g4max+1); //==> g^4=1 ==> SSM !
	
	TString suffix = "";
	if(doTruth) suffix = "_truth";
	
	TString mctype  = (isMC11c) ? "mc11c" : "mc11a";
	
	// TString fBGname = "plots/ZP_2dtemplates_"+mctype+"_33st_overallEWkF_noInAmpSigEWkF_noHighMbins_wthOfficialZP_Xmass2000.root";
	// TString fBGname = "plots/ZP_2dtemplates_"+mctype+"_33st_noKKtmplates_overallEWkF_noInAmpSigEWkF_noTruth_wthOfficialZP_treeLevelMass_Xmass2000.root";
	// TString fBGname = "plots/ZP_2dtemplates_"+mctype+"_33st_noKKtmplates_overallEWkF_noInAmpSigEWkF_wthOfficialZP_treeLevelMass_Xmass2000.root";
	// TString fBGname = "plots/ZP_2dtemplates_mc11c_33st_noKKtmplates_overallEWkF_noInAmpSigEWkF_wthOfficialZP_fixedBWwidth_treeLevelMass_Xmass2000.root";
	// TString fBGname = "plots/ZP_2dtemplates_mc11c_33st_noKKtmplates_overallEWkF_noInAmpSigEWkF_noTruth_wthOfficialZP_treeLevelMass_Xmass2000.root";
	// TString fBGname = "plots/ZP_2dtemplates_"+mctype+"_33st_noKKtmplates_overallEWkF_noInAmpSigEWkF_noTruth_wthOfficialZP_treeLevelMass_Xmass2000.root";
	// TString fBGname = "plots/ZP_2dtemplates_"+mctype+"_33st_noKKtmplates_overallEWkF_noInAmpSigEWkF_noTruth_wthOfficialZP_fixedBWwidth_treeLevelMass_Xmass2000.root";

	TLegend* legR = new TLegend(0.15,0.75,0.35,0.85,NULL,"brNDC");
	legR->SetFillStyle(4000); //will be transparent
	legR->SetFillColor(0);
	legR->SetTextFont(42);
	TH1D* hDummy = new TH1D("","",1,0.,1.);
	hDummy->SetMarkerStyle(20);
	hDummy->SetMarkerSize(0.8);
	hDummy->SetMarkerColor(kBlack);
	if(!doResiduals) legR->AddEntry(hDummy,"#frac{template}{official}","lep");
	else             legR->AddEntry(hDummy,"#frac{template - official}{#sqrt{#delta^{2}template + #delta^{2}official}}","lep");
	
	TPaveText* ptxt = new TPaveText(0.145,0.35,0.245,0.55,"NDC");
	TText* txt;
	ptxt->SetTextSize(0.03);
	ptxt->SetBorderSize(0);
	ptxt->SetFillStyle(4000); //will be transparent
	ptxt->SetFillColor(0);
	ptxt->SetTextAlign(12);
	txt = ptxt->AddText("This range");
	txt = ptxt->AddText("is chopped");
	txt = ptxt->AddText("before the");
	txt = ptxt->AddText("template is");
	txt = ptxt->AddText("handed to");
	txt = ptxt->AddText("BAT (limit).");
	
	oldDir->cd();

	TString fBGname = "plots/validation/ZP_2dtemplates_mc11c_33st_noKKtmplates_wthOfficialZP_treeLevelMass_Xmass2000.root";
	TFile* fD = new TFile(fBGname,"READ");
	TH1D* hDY = NULL;
	if(doTruth) hDY = (TH1D*)fD->Get("hMass_DYmumu_truth")->Clone();
	else        hDY = (TH1D*)fD->Get("hMass_DYmumu")->Clone();
	hDY->SetLineColor(kMagenta-5);
	hDY->SetMarkerColor(kMagenta-5);

	oldDir->cd();

	TFile* fDYrozmin    = new TFile("plots/mass_plot_tables_3st.root","READ");
	TH1D* hDYrozmin = (TH1D*)fDYrozmin->Get("mass_log_dy")->Clone();
	hDYrozmin = (TH1D*)hGeV2TeV(hDYrozmin)->Clone();
	hDYrozmin = (TH1D*)hChopper(hDYrozmin,bins2chop)->Clone();
	oldDir->cd();
	TFile* f1dTemplates = new TFile("plots/ZpSignal_MM_MC11c_5points.root","READ");
	TObjArray* toarr1d = new TObjArray();
	toarr1d->Read("template");
	TMapTSP2TH1D h1dBrandeisTmpltMap;
	double Nflat = 399948;
	double sigmaflat = 4.3988E+07*nb2fb;
	double Lmcflat = Nflat/sigmaflat;
	double scale = luminosity/Lmcflat;
	TH1D* h1dTmp = NULL;
	h1dTmp = (TH1D*)((TObjArray*)toarr1d->At(0/*22*/))->Clone();
	h1dTmp->Scale(scale);
	h1dTmp = (TH1D*)hChopper(h1dTmp,bins2chop)->Clone();
	h1dTmp->Add(hDYrozmin);
	h1dBrandeisTmpltMap.insert( make_pair("1000",(TH1D*)resetErrors(h1dTmp)->Clone("1000")) );
	h1dTmp = NULL;
	h1dTmp = (TH1D*)((TObjArray*)toarr1d->At(1/*28*/))->Clone();
	h1dTmp->Scale(scale);
	h1dTmp = (TH1D*)hChopper(h1dTmp,bins2chop)->Clone();
	h1dTmp->Add(hDYrozmin);
	h1dBrandeisTmpltMap.insert( make_pair("1250",(TH1D*)resetErrors(h1dTmp)->Clone("1250")) );
	h1dTmp = NULL;
	h1dTmp = (TH1D*)((TObjArray*)toarr1d->At(2/*34*/))->Clone();
	h1dTmp->Scale(scale);
	h1dTmp = (TH1D*)hChopper(h1dTmp,bins2chop)->Clone();
	h1dTmp->Add(hDYrozmin);
	h1dBrandeisTmpltMap.insert( make_pair("1500",(TH1D*)resetErrors(h1dTmp)->Clone("1500")) );
	h1dTmp = NULL;
	h1dTmp = (TH1D*)((TObjArray*)toarr1d->At(3/*40*/))->Clone();
	h1dTmp->Scale(scale);
	h1dTmp = (TH1D*)hChopper(h1dTmp,bins2chop)->Clone();
	h1dTmp->Add(hDYrozmin);
	h1dBrandeisTmpltMap.insert( make_pair("1750",(TH1D*)resetErrors(h1dTmp)->Clone("1750")) );
	h1dTmp = NULL;
	h1dTmp = (TH1D*)((TObjArray*)toarr1d->At(4/*47*/))->Clone();
	h1dTmp->Scale(scale);
	h1dTmp = (TH1D*)hChopper(h1dTmp,bins2chop)->Clone();
	h1dTmp->Add(hDYrozmin);
	h1dBrandeisTmpltMap.insert( make_pair("2000",(TH1D*)resetErrors(h1dTmp)->Clone("2000")) );

	oldDir->cd();

	TMapTSP2TH1D h1Map;
	h1Map.insert( make_pair("1000o", (TH1D*)fD->Get("hMass_Zprime_SSM1000"+suffix)->Clone()) );
	h1Map.insert( make_pair("1000t", (TH1D*)fD->Get("hMass_Zprime_SSM1000_template"+suffix)->Clone()) );
	if(isMC11c)
	{
		h1Map.insert( make_pair("1250o", (TH1D*)fD->Get("hMass_Zprime_SSM1250"+suffix)->Clone()) );
		h1Map.insert( make_pair("1250t", (TH1D*)fD->Get("hMass_Zprime_SSM1250_template"+suffix)->Clone()) );
	}
	h1Map.insert( make_pair("1500o", (TH1D*)fD->Get("hMass_Zprime_SSM1500"+suffix)->Clone()) );
	h1Map.insert( make_pair("1500t", (TH1D*)fD->Get("hMass_Zprime_SSM1500_template"+suffix)->Clone()) );
	h1Map.insert( make_pair("1750o", (TH1D*)fD->Get("hMass_Zprime_SSM1750"+suffix)->Clone()) );
	h1Map.insert( make_pair("1750t", (TH1D*)fD->Get("hMass_Zprime_SSM1750_template"+suffix)->Clone()) );
	h1Map.insert( make_pair("2000o", (TH1D*)fD->Get("hMass_Zprime_SSM2000"+suffix)->Clone()) );
	h1Map.insert( make_pair("2000t", (TH1D*)fD->Get("hMass_Zprime_SSM2000_template"+suffix)->Clone()) );

	TMapTSP2TH1D h1rMap;
	h1rMap.insert( make_pair("1000", (TH1D*)fD->Get("hMass_Zprime_SSM1000"+suffix)->Clone()) );
	if(isMC11c) h1rMap.insert( make_pair("1250", (TH1D*)fD->Get("hMass_Zprime_SSM1250"+suffix)->Clone()) );
	h1rMap.insert( make_pair("1500", (TH1D*)fD->Get("hMass_Zprime_SSM1500"+suffix)->Clone()) );
	h1rMap.insert( make_pair("1750", (TH1D*)fD->Get("hMass_Zprime_SSM1750"+suffix)->Clone()) );
	h1rMap.insert( make_pair("2000", (TH1D*)fD->Get("hMass_Zprime_SSM2000"+suffix)->Clone()) );
	for(TMapTSP2TH1D::iterator it=h1rMap.begin() ; it!=h1rMap.end() ; ++it)
	{
		it->second->Reset();
		if(!doResiduals) it->second->Divide(h1Map[it->first+"o"],h1Map[it->first+"t"],1.,1.,"B");
		else             residuals(h1Map[it->first+"o"], h1Map[it->first+"t"], it->second);
		
		// for(Int_t i=0 ; i<=it->second->GetNbinsX()+1 ; i++) it->second->SetBinError(i,0);
		it->second->SetMarkerStyle(20);
		it->second->SetMarkerSize(0.5);
		it->second->GetXaxis()->SetLabelSize(0.073);
		it->second->GetYaxis()->SetLabelSize(0.073);
		it->second->GetXaxis()->SetTitleSize(0.073);
		it->second->GetYaxis()->SetTitleSize(0.073);
		it->second->SetTitleSize(0.075);
		it->second->GetYaxis()->SetTitleOffset(0.5);
		if(!doResiduals)
		{
			it->second->SetMinimum(0.2);
			it->second->SetMaximum(1.8);
		}
		else
		{
			it->second->SetMinimum(-5.);
			it->second->SetMaximum(+5.);
		}
		it->second->SetTitle("");
		if(!doResiduals) it->second->GetYaxis()->SetTitle("ratio");
		else             it->second->GetYaxis()->SetTitle("residuals");
	}

	TMapTSP2TGAE poissonGraphMap;
	TMapTSP2TLeg legMap;


	_INFO("");

	oldDir->cd();

	fD->cd();	
	TH1D* h1Template = (TH1D*)fD->Get("hMass_DYmumu"+suffix)->Clone();
	h1Template->Reset();
	TObjArray* toarr = new TObjArray();
	if(doTruth) toarr->Read("truth_template2d");
	else        toarr->Read("template2d");
	TH2D* h2SSM2000 = (TH2D*)((TObjArray*)toarr->At(0))->Clone("hMass"+suffix+"_Zprime_SSM2000_template2d");
	for(Int_t bin=1 ; bin<=h2SSM2000->GetNbinsX() ; bin++)
	{
		h1Template->SetBinContent(bin, h2SSM2000->GetBinContent(bin,g4bin));
		h1Template->SetBinError(bin, h2SSM2000->GetBinError(bin,g4bin));
	}
	h1Template->SetLineColor(kViolet);
	h1Template->SetLineWidth(1);
	h1Template->SetMarkerStyle(20);
	h1Template->SetMarkerSize(0.3);
	h1Template->SetMarkerColor(kViolet);
	// the functions
	h2Template = (TH2D*)h2SSM2000->Clone();
	vector<TF1*> vfunc;
	unsigned int nmllbins = h2Template->GetNbinsX();
	for(unsigned int mll=1 ; mll<=(nmllbins-bins2chop) ; mll++) // 1...(56-9 = 47)
	{
		TString mllname = (TString)_s(mll);
		TString mllval  = (TString)_s(h2Template->GetXaxis()->GetBinCenter(mll+bins2chop));
		
		TF1* f = new TF1("fNominal_mll"+mllname,fTH1toTF1,g4min,g4max,1);
		f->SetParameter(0,mll);
		f->SetParNames("mll");
		// f->SetLineColor(kBlue);
		// f->SetLineWidth(1);
		f->SetNpx(400);
		vfunc.push_back(f);
	}
	TGraph* graphDY = new TGraph();
	graphDY->SetMarkerStyle(25);
	graphDY->SetMarkerSize(0.6);
	graphDY->SetMarkerColor(kGreen+2);
	TGraph* graphSSM = new TGraph();
	graphSSM->SetMarkerStyle(24);
	graphSSM->SetMarkerSize(0.6);
	graphSSM->SetMarkerColor(kOrange+8);
	for(unsigned int i=0 ; i<vfunc.size() ; i++)
	{
		double DY = vfunc[i]->Eval(0.0);
		double SSM = vfunc[i]->Eval(1.0);
		graphDY->SetPoint(i,h2Template->GetXaxis()->GetBinCenter(bins2chop+i+1),DY);
		graphSSM->SetPoint(i,h2Template->GetXaxis()->GetBinCenter(bins2chop+i+1),SSM);
	}
	
	
	oldDir->cd();

	TObjArray* toarr1dTLV = new TObjArray();
	TMapTSP2TH1D h1dTlvTmpltMap;
	TFile* fT = NULL;
	TString fTname = "plots/validation/ZP_2dtemplates_mc11c_33st_noInterference_noKKtmplates_noOverallEWkF_wthOfficialZP_treeLevelMass_Xmass";
	
	fT = new TFile(fTname+"1000.root","READ");
	toarr1dTLV->Read("template");
	h1dTmp = (TH1D*)((TObjArray*)toarr1dTLV->At(0))->Clone();
	h1dTmp->Add(hDY);
	h1dTlvTmpltMap.insert( make_pair("1000",(TH1D*)resetErrors(h1dTmp)->Clone("1000")) );
	fT = new TFile(fTname+"1250.root","READ");
	toarr1dTLV->Read("template");
	h1dTmp = (TH1D*)((TObjArray*)toarr1dTLV->At(0))->Clone();
	h1dTmp->Add(hDY);
	h1dTlvTmpltMap.insert( make_pair("1250",(TH1D*)resetErrors(h1dTmp)->Clone("1250")) );
	fT = new TFile(fTname+"1500.root","READ");
	toarr1dTLV->Read("template");
	h1dTmp = (TH1D*)((TObjArray*)toarr1dTLV->At(0))->Clone();
	h1dTmp->Add(hDY);
	h1dTlvTmpltMap.insert( make_pair("1500",(TH1D*)resetErrors(h1dTmp)->Clone("1500")) );
	fT = new TFile(fTname+"1750.root","READ");
	toarr1dTLV->Read("template");
	h1dTmp = (TH1D*)((TObjArray*)toarr1dTLV->At(0))->Clone();
	h1dTmp->Add(hDY);
	h1dTlvTmpltMap.insert( make_pair("1750",(TH1D*)resetErrors(h1dTmp)->Clone("1750")) );
	fT = new TFile(fTname+"2000.root","READ");
	toarr1dTLV->Read("template");
	h1dTmp = (TH1D*)((TObjArray*)toarr1dTLV->At(0))->Clone();
	h1dTmp->Add(hDY);
	h1dTlvTmpltMap.insert( make_pair("2000",(TH1D*)resetErrors(h1dTmp)->Clone("2000")) );

	oldDir->cd();
	
	
	for(TMapTSP2TH1D::iterator it=h1Map.begin() ; it!=h1Map.end() ; ++it)
	{
		if(it->first.Contains("o"))
		{
			TString name = it->first;
			name.ReplaceAll("o","");
			it->second->SetFillColor(kAzure-9);
			if(doTruth) it->second->SetTitle("m_{Z'} = "+name+" GeV (truth)");
			else        it->second->SetTitle("m_{Z'} = "+name+" GeV");
		}
		if(it->first.Contains("t"))
		{
			//TGraphAsymmErrors* poisson(TH1D* h)
			it->second->SetLineColor(kBlue);
			it->second->SetMarkerStyle(20);
			it->second->SetMarkerSize(0.4);
			it->second->SetMarkerColor(kBlue);
			it->second->SetLineWidth(1);
			
			TString name = it->first;
			name.ReplaceAll("t","");
			poissonGraphMap.insert( make_pair(name, (TGraphAsymmErrors*)poisson(it->second)->Clone()) );
			poissonGraphMap[name]->SetMarkerStyle(20);
			poissonGraphMap[name]->SetMarkerSize(0.3);
			poissonGraphMap[name]->SetMarkerColor(kBlue);
			poissonGraphMap[name]->SetLineWidth(1);
			poissonGraphMap[name]->SetLineColor(kBlue);
		}
	}	

	Double_t yLine = (!doResiduals) ? 1. : 0.;

	TLine* line = new TLine(0.07,yLine,3.,yLine);	
	line->SetLineColor(kRed);
	line->SetLineWidth(2);
	
	TMapTSP2TCNV cnvMap;
	cnvMap.insert( make_pair("1000", new TCanvas("1000","1000",600,550)) );
	if(isMC11c) cnvMap.insert( make_pair("1250", new TCanvas("1250","1250",600,550)) );
	cnvMap.insert( make_pair("1500", new TCanvas("1500","1500",600,550)) );
	cnvMap.insert( make_pair("1750", new TCanvas("1750","1750",600,550)) );
	cnvMap.insert( make_pair("2000", new TCanvas("2000","2000",600,550)) );
	for(TMapTSP2TCNV::iterator it=cnvMap.begin() ; it!=cnvMap.end() ; ++it)
	{
		_INFO("starting "+(string)it->first);
		if(it->first=="2000") legMap.insert( make_pair(it->first, new TLegend(0.35,0.55,0.83,0.84,NULL,"brNDC")) );
		else                  legMap.insert( make_pair(it->first, new TLegend(0.35,0.60,0.83,0.84,NULL,"brNDC")) );
		legMap[it->first]->SetFillStyle(4000); //will be transparent
		legMap[it->first]->SetFillColor(0);
		legMap[it->first]->SetTextFont(42);
		legMap[it->first]->AddEntry(h1Map[it->first+"o"],"Official Z'_{SSM}","F");
		legMap[it->first]->AddEntry(hDY,"Official DY#mu#mu","lep");
		legMap[it->first]->AddEntry(h1Map[it->first+"t"],"ME^{2} method: Template w/o couplings scale","lep");
		if(it->first=="2000")
		{
			legMap[it->first]->AddEntry(h1Template,"ME^{2} method: Template histogram at  #it{g=1} (SSM)","lep");
			legMap[it->first]->AddEntry(graphSSM,  "ME^{2} method: Template function  at  #it{g=1} (SSM)","p");
			legMap[it->first]->AddEntry(graphDY,   "ME^{2} method: Template function  at  #it{g=0} (DY)","p");
		}
		if(!doTruth)
		{
			h1dTlvTmpltMap[it->first]->SetLineColor(kCyan+2);
			h1dTlvTmpltMap[it->first]->SetMarkerColor(kCyan+2);
			h1dTlvTmpltMap[it->first]->SetMarkerStyle(5);
			h1dTlvTmpltMap[it->first]->SetMarkerSize(0.5);
			legMap[it->first]->AddEntry(h1dTlvTmpltMap[it->first],"ME^{2} method: DY+Template (no interference)","p");
		
			h1dBrandeisTmpltMap[it->first]->SetLineColor(kRed);
			h1dBrandeisTmpltMap[it->first]->SetMarkerColor(kRed);
			h1dBrandeisTmpltMap[it->first]->SetMarkerStyle(27);
			h1dBrandeisTmpltMap[it->first]->SetMarkerSize(0.5);
			legMap[it->first]->AddEntry(h1dBrandeisTmpltMap[it->first],"Flat Z' method: DY+Template (no interference)","p");
		}

		it->second->Divide(1,2);
		TVirtualPad* ph = it->second->cd(1);
		TVirtualPad* pr = it->second->cd(2);	
		ph->SetPad(0.00, 0.35, 1.00, 1.00);
		pr->SetPad(0.00, 0.00, 1.00, 0.35);
		ph->SetBottomMargin(0.012);
		pr->SetBottomMargin(0.20);
		pr->SetTopMargin(0.012);
		
		ph->cd();
		ph->Draw();
		ph->SetTicks(1,1);
		ph->SetLogy();
		ph->SetLogx();
		// h1Map[it->first+"o"]->SetMaximum( h1Map[it->first+"t"]->GetMaximum()*1.5 );
		// h1Map[it->first+"o"]->Draw();
		TH1D* hTmpNoErr = (TH1D*)resetErrors(h1Map[it->first+"o"])->Clone();
		hTmpNoErr->SetMaximum( h1Map[it->first+"t"]->GetMaximum()*1.5 );
		hTmpNoErr->SetLineStyle(1);
		hTmpNoErr->SetLineColor(kBlack);
		hTmpNoErr->SetFillColor(kAzure-9);
		hTmpNoErr->Draw();
		TH1D* hTmpErr = (TH1D*)ShiftLog(h1Map[it->first+"o"],0.2)->Clone();
		hTmpErr->SetFillStyle(4000); //will be transparent
		hTmpErr->SetFillColor(0);
		hTmpErr->DrawCopy("epx0SAMES");
		hDY->Draw("SAMES");
		h1Map[it->first+"t"]->Draw("epSAMES");
		//poissonGraphMap[it->first]->Draw("pSAMES");
		if(it->first=="2000")
		{
			graphDY->Draw("SAMESp");
			graphSSM->Draw("SAMESp");
			h1Template->Draw("epSAMES");
		}
		_INFO("");
		h1dTlvTmpltMap[it->first]->Draw("SAMESp");
		h1dBrandeisTmpltMap[it->first]->Draw("SAMESp");
		
		TLine* chopline = new TLine(0.12805,getYmin(h1Map[it->first+"o"]),0.12805,7.e5);
		chopline->SetLineStyle(2);
		chopline->SetLineColor(kBlack);
		chopline->Draw("SAMES");
		ptxt->Draw("SAMES");
		
		legMap[it->first]->Draw("SAMES");
		ph->RedrawAxis();
		ph->Update();

		_INFO("");

		pr->cd();
		pr->Draw();
		pr->SetTicks(1,1);
		pr->SetGridy();
		pr->SetLogx();
		h1rMap[it->first]->Draw("ep");
		line->Draw("SAMES");
		h1rMap[it->first]->Draw("epSAMES");
		legR->Draw("SAMES");
		pr->RedrawAxis();
		pr->Update();

		unsigned int savestate = 1;
		if(it->first=="1000")      savestate = 0;
		else if(it->first=="2000") savestate = 2;
		else                       savestate = 1;
		TString testType = (doResiduals) ? "_residuals" : "_ratio";
		mutype   = (doTruth)     ? "_truth"     : "_recon";
		savemultipdf(it->second, "plots/validation/validation"+mutype+testType+"_"+mctype+"_all.pdf", savestate);
		saveas(it->second, "plots/validation/validation"+mutype+testType+"_"+mctype+"_"+it->first);
		
		TCanvas* c = new TCanvas(it->first,"",600,400);
		c->cd();
		c->Draw();
		c->SetTicks(1,1);
		c->SetLogy();
		c->SetLogx();
		hTmpNoErr->Draw();
		hTmpErr->DrawCopy("epx0SAMES");
		hDY->Draw("SAMES");
		h1Map[it->first+"t"]->Draw("epSAMES");
		//poissonGraphMap[it->first]->Draw("pSAMES");
		if(it->first=="2000")
		{
			graphDY->Draw("SAMESp");
			graphSSM->Draw("SAMESp");
			h1Template->Draw("epSAMES");
		}
		h1dTlvTmpltMap[it->first]->Draw("SAMESp");
		h1dBrandeisTmpltMap[it->first]->Draw("SAMESp");
		legMap[it->first]->Draw("SAMES");
		chopline->Draw("SAMES");
		ptxt->Draw("SAMES");
		c->RedrawAxis();
		c->Update();
		saveas(c,"plots/validation/validation_"+it->first+"_"+mutype+testType);
		
		_INFO("done "+(string)it->first);
	}
}
Esempio n. 11
0
void iKeyboard(unsigned char key)
{
	upArrow = 0;
	downArrow=0;		//set arrow flags off

	//retrieve charactre index in terms of cursor position
	j = x/ charSpace;
	i = ((height-15-lineSpace - y)/lineSpace) + s;		


	if (glutGetModifiers() == GLUT_ACTIVE_CTRL)				//ALT key operations
	{
		if (key == 1)							//select all
		{
			selectAll();
		}
		else if (key == 3 )				//copy
		{
			copy();
		}
		else if (key==15)			//file open	
		{
			fOpen =1;
			subTemp = (char *)calloc(60,sizeof(char));
			x = (width-15)/2-135;
			y = (height-19)/2+61;
			menuflag = 0;
		}
		else if (key==16)			//file save as
		{
			save();
			char tempfile[80];
			strcpy(tempfile, syspath);
			strcat(tempfile, ":\\Program Files\\Rword\\saved_files\\");
			strcat(tempfile, filename);
			ShellExecute(NULL, "print", tempfile, NULL, NULL, NULL);		//print document
			menuflag = 0;
		}
		else if (key==19)			//file save
		{
			save();
			menuflag = 0;
		}
		else if (copyFlag &&  key==22)		//paste
		{
			paste();
		}
		else if (key == 24 )			//cut
		{
			cut();
		}
	}
	else if(key >31 && key <127)		//character input
	{
		
		if (fOpen || fsave)
		{
			subCharacter(key);				//for popups
		}
		else
		{
			if (selflag)
				seldel();
			character(key);							// main character input
		}
	}
	else if (key == '\b')				//backspace
	{
		
		if (fOpen || fsave)				//popup
		{
			if (strlen(subTemp))
			{
				subTemp[strlen(subTemp)-1] = '\0';
				if (strlen(subTemp)>33)
					r--;
				else
					x -= 8;
			}
		}
		else
		{
			if (selflag)
				seldel();
			else
				backspace();				//main
		}
	}	
	else if (key == 127)			//del
	{
		if (selflag)
			seldel();
		else
			del();
	}
	else if (key == '\r')			//enter operations
	{	
		if (fOpen)					
		{
			if (selflag)
				seldel();

			open();
		}
		else if (fsave)
		{
			saveas();				//popups
		}
		else
		{
			if (selflag)
				seldel();
			else
				enter();				//main
		}
	}
	else if (key == '\t')			//incomplete
	{
		selflag = 0;
		tab();
	}
}
/*********************************************************************
功能:保存数据集到文件。
参数:无
返回:>0,成功;<0,失败
作者:叶文林	2012-08-22
*********************************************************************/
int CFixedLenRecordFile::save()
{
	//WLOutDebug("m_filename=%s",m_filename);
	return saveas(m_filename);
}
Esempio n. 13
0
void MainFrame::on_saveas(wxCommandEvent& WXUNUSED(event))
{
    saveas();
}
Esempio n. 14
0
// Action create
void MapView::createActions()
{
	openAction = new QAction(tr("&Open"),this);
	openAction->setIcon(QIcon(":/images/open.png"));
	openAction->setShortcut(QKeySequence::Open);
	openAction->setStatusTip(tr("Open a map file"));
	connect(openAction,SIGNAL(triggered()),this,SLOT(open()));

	saveAllAction = new QAction(tr("&Save All"),this);
	saveAllAction->setIcon(QIcon(":/images/save.png"));
	saveAllAction->setShortcut(QKeySequence::Save);
	saveAllAction->setStatusTip(tr("Save map and user layer to disk and database"));
	connect(saveAllAction,SIGNAL(triggered()),this,SLOT(saveall()));

	//file save
	saveFileAction = new QAction(tr("Save &File"),this);
	saveFileAction->setIcon(QIcon(":/images/save.png"));
	saveFileAction->setShortcut(tr("Ctrl+Shift+S"));
	saveFileAction->setStatusTip(tr("Save map to disk including user layer"));
	connect(saveFileAction,SIGNAL(triggered()),main,   SLOT(save()));

	//save as
	saveAsAction = new QAction(tr("Save &As"),this);
	saveAsAction->setIcon(QIcon(":/images/saveas.png"));
	saveAsAction->setShortcut(tr("Ctrl+A"));
	saveAsAction->setStatusTip(tr("Save map to disk with new file name including user layer"));
	connect(saveAsAction,SIGNAL(triggered()),this,SLOT(saveas()));

	//load ul from db
	GetUserLayerFromDbAction=new QAction(tr("Load U&L from Db"),this);
	GetUserLayerFromDbAction->setIcon(QIcon(":/images/fromdb.png"));
	GetUserLayerFromDbAction->setStatusTip(tr("Get user layer from database"));
	connect(GetUserLayerFromDbAction,SIGNAL(triggered()),main,SLOT(getulfromdb()));

	//save ul to db
	LoadUserLayerToDbAction =new QAction(tr("Save UL to &Db"),this);
	LoadUserLayerToDbAction->setIcon(QIcon(":/images/todb.png"));
	LoadUserLayerToDbAction->setStatusTip(tr("Save user layer to database"));
	connect(LoadUserLayerToDbAction,SIGNAL(triggered()),main,SLOT(saveultodb()));

	makeMapFromDBAction = new QAction(tr("Make map file from Db"), this);
	//makeMapFromDBAction->setIcon(QIcon(":/images/todb.png"));
	makeMapFromDBAction->setStatusTip(tr("Create Map file from database"));
	connect(makeMapFromDBAction,SIGNAL(triggered()),main,SLOT(makeMapFromDb()));

	//panel
	leftpanelVisibleAction = new QAction(tr("&Layer Panel Hide"),this);
	leftpanelVisibleAction->setIcon(QIcon(":/images/layer_blue.png"));
	leftpanelVisibleAction->setShortcut(tr("Ctrl+L"));
	leftpanelVisibleAction->setStatusTip(tr("hide show layer panel (Ctrl+L)"));
	connect(leftpanelVisibleAction,SIGNAL(triggered()),this,SLOT(setLeftPanelVisible()));

	objectpanelVisibleAction = new QAction(tr("&Object Panel Hide"),this);
	objectpanelVisibleAction->setIcon(QIcon(":/images/panel_blue.png"));
	objectpanelVisibleAction->setShortcut(tr("Ctrl+P"));
	objectpanelVisibleAction->setStatusTip(tr("hide or show object panel (Ctrl+P)"));
	connect(objectpanelVisibleAction,SIGNAL(triggered()),this,SLOT(setObjectPanelVisible()));

	//map control
	zoomInAction = new QAction(tr("zoom &in"),this);
	zoomInAction->setIcon(QIcon(":/images/zoomin.png"));
	zoomInAction->setStatusTip(tr("Zoom in map, short key : + "));
	connect(zoomInAction,SIGNAL(triggered()),this,SLOT(zoomIn()));

	zoomOutAction = new QAction(tr("zoom &out"),this);
	zoomOutAction->setIcon(QIcon(":/images/zoomout.png"));
	zoomOutAction->setStatusTip(tr("Zoom out map, short key : - "));
	connect(zoomOutAction,SIGNAL(triggered()),this,SLOT(zoomOut()));

	moveHomeAction = new QAction(tr("se&t Init"),this);
	moveHomeAction->setIcon(QIcon(":/images/sethome.png"));
	moveHomeAction->setStatusTip(tr("move to initiali zoom and postion"));
	connect(moveHomeAction,SIGNAL(triggered()),this,SLOT(moveHome()));

	moveLeftAction = new QAction(tr("move &Left"),this);
	moveLeftAction->setIcon(QIcon(":/images/arrow_left.png"));
	moveLeftAction->setStatusTip(tr("move map to left , short key : arrow left "));
	connect(moveLeftAction,SIGNAL(triggered()),this,SLOT(moveLeft()));

	moveRightAction = new QAction(tr("move &Right"),this);
	moveRightAction->setIcon(QIcon(":/images/arrow_right.png"));
	moveRightAction->setStatusTip(tr("move map to right, short key : arrow right"));
	connect(moveRightAction,SIGNAL(triggered()),this,SLOT(moveRight()));

	moveUpAction = new QAction(tr("move &Up"),this);
	moveUpAction->setIcon(QIcon(":/images/arrow_up.png"));
	moveUpAction->setStatusTip(tr("move map to upper , short key : arrow up"));
	connect(moveUpAction,SIGNAL(triggered()),this,SLOT(moveUp()));

	moveDownAction = new QAction(tr("move &Down"),this);
	moveDownAction->setIcon(QIcon(":/images/arrow_down.png"));
	moveDownAction->setStatusTip(tr("move map to down , short key : arrow down"));
	connect(moveDownAction,SIGNAL(triggered()),this,SLOT(moveDown()));

	//compass
	drawCrossAction = new QAction(tr("show &Compass"),this);
	drawCrossAction->setIcon(QIcon(":/images/cross.png"));
	drawCrossAction->setStatusTip(tr("show compass "));
	drawCrossAction->setCheckable(true);
	drawCrossAction->setChecked(false);
	connect(drawCrossAction,SIGNAL(triggered(bool)),main,SLOT(showBearingCircle(bool)));

	//경위도
	drawLatlonAction = new QAction(tr("show &Lat lon"),this);
	drawLatlonAction->setIcon(QIcon(":/images/latlon.png"));
	drawLatlonAction->setStatusTip(tr("show latitude and longitude"));
	drawLatlonAction->setCheckable(true);
	drawLatlonAction->setChecked(true);
	connect(drawLatlonAction,SIGNAL(triggered(bool)),main,SLOT(showLatLon(bool)));

	//id text 표시여부
	drawLayerIdAction = new QAction(tr("show Layer &Id"),this);
	drawLayerIdAction->setIcon(QIcon(":/images/idvisible.png"));
	drawLayerIdAction->setStatusTip(tr("show  id text on map"));
	drawLayerIdAction->setCheckable(true);
	drawLayerIdAction->setChecked(false);
	//connect(drawLayerIdAction,SIGNAL(triggered()),this,SLOT(drawLayerId()));
	connect(drawLayerIdAction,SIGNAL(triggered(bool)),main,SLOT(onoffLayerIdText(bool)));

	savePixmapAction = new QAction(tr("save map &image"),this);
	savePixmapAction->setStatusTip(tr("save map to file"));
	connect(savePixmapAction,SIGNAL(triggered()),this,SLOT(savePixmap()));

	exitAction = new QAction(tr("E&xit"),this);
	exitAction->setIcon(QIcon(":/images/quit.png"));
	exitAction->setShortcut(tr("Ctrl+Q"));
	exitAction->setStatusTip(tr("Exit the application"));
	connect(exitAction,SIGNAL(triggered()),this,SLOT(close()));

	//거리와 방향을 표시
	pointdistanceAction = new QAction(tr("Distance and Direction"),this);
	pointdistanceAction->setIcon(QIcon(":/images/pointdistance.png"));
	pointdistanceAction->setStatusTip(tr("display distance and direction from a point"));
	pointdistanceAction->setCheckable(true);
	connect(pointdistanceAction,SIGNAL(triggered(bool)),main,SLOT(onoffDistancBearing(bool)));

	// Track Report Menu
	trackCreateAction = new QAction(tr("Create"), this);
	trackCreateAction->setStatusTip(tr("Track Report Create"));
	connect(trackCreateAction, SIGNAL(triggered()), main, SLOT(trackCreate()));

	trackSaveAction = new QAction(tr("Save"), this);
	trackSaveAction->setStatusTip(tr("Track Report Save"));
	connect(trackSaveAction, SIGNAL(triggered()), main, SLOT(trackSave()));

	trackOpenAction = new QAction(tr("Open"), this);
	trackOpenAction->setStatusTip(tr("Track Report Open"));
	connect(trackOpenAction, SIGNAL(triggered()), main, SLOT(trackOpen()));

	trackOptionAction = new QAction(tr("Options"), this);
	trackOptionAction->setStatusTip(tr("Track Report Options select"));
	connect(trackOptionAction, SIGNAL(triggered()), main, SLOT(trackOption()));

	trackClTableAction = new QAction(tr("Clear Table"), this);
	trackClTableAction->setStatusTip(tr("Track Report Clear Table"));
	connect(trackClTableAction, SIGNAL(triggered()), main, SLOT(trackClTable()));

	trackClPanelAction = new QAction(tr("Clear Panel"), this);
	trackClPanelAction->setStatusTip(tr("Track Report Clear Panel"));
	connect(trackClPanelAction, SIGNAL(triggered()), main, SLOT(trackClPanel()));

	trackPrintAction = new QAction(tr("Print"), this);
	trackPrintAction->setStatusTip(tr("Track Report Print"));
	connect(trackPrintAction, SIGNAL(triggered()), main, SLOT(trackPrint()));
}