示例#1
0
BOOL CWizDlg::OnInitDialog()
{
	CDialog::OnInitDialog();	    
	
    
	DafaultSettings();	
	GetSettings(&Info,sizeof(Info));	
    
    SYSTEMTIME time;
    GetSystemTime(&time);
    if ( Info.date!=time.wDayOfWeek)     
    {
        if ( Info.days > 0) Info.days--;
        Info.date=time.wDayOfWeek;        
    }

    open_recent();		
    repos_all();
    
	wnd.Create(NULL," ",WS_CHILD|WS_VISIBLE|WS_POPUP,  CRect(10,5,58,52), this, 1110);	
	dlg_start=false;		
    
	wnd.change_color();		          
	wnd.change_font();	    
    wnd.BringUP();	
    
    
    // давайте читать книги
	
	SetWindowText("MadReader");
	this->SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME),true);
	this->SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME1),false);	 			  
		  
		  code.LoadMenu(IDR_MENU2);
          load_menu_ch();	  
		  
		  m_tooltip.Create(this);
		  m_tooltip.Activate(Info.tips);		  		  
		  
		  b[0] = (HBITMAP)LoadImage(AfxGetApp()->m_hInstance, (LPCTSTR)IDB_BITMAP1, IMAGE_BITMAP, 14, 15, LR_LOADMAP3DCOLORS);
          SendDlgItemMessage(ID_COLOR, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)b[0]);
		  m_tooltip.AddTool(GetDlgItem(ID_COLOR), 1);
		  m_tooltip.AddTool(GetDlgItem(IDC_hist), 2);
		  m_tooltip.AddTool(GetDlgItem(IDC_code), 3);
		  m_tooltip.AddTool(GetDlgItem(IDC_EDIT1), "enter file name + <enter> = open");
		  m_tooltip.AddTool(GetDlgItem(IDC_BUTTON1),10);
		  m_tooltip.AddTool(GetDlgItem(IDC_hist2),11);		  
		  
		  for ( int i=3; i<=5; ++i)
		  {			 
			  b[i-2]=::LoadBitmap(AfxGetApp()->m_hInstance,LPCTSTR(136+i));
			  SendDlgItemMessage(1011+i, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)b[i-2]);
			  m_tooltip.AddTool(GetDlgItem(1011+i), 4+i);
		  }
          b[6]=LoadBitmap(AfxGetApp()->m_hInstance,LPCTSTR(IDB_BITMAP6));
           SendDlgItemMessage(IDC_hist2, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)b[6]);
           SendDlgItemMessage(IDC_hist, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)b[6]);
		  
           showing=true;
		  timer=SetTimer(ID_TIMER_1,300,NULL);
		  timer2=SetTimer(ID_TIMER_2,1000,NULL);    // 1 sec
		  timer3=SetTimer(ID_TIMER_3,30000,NULL);   //  30 sec
		  //::SetCursorPos(1,1 );
		  //timer_sec=0;		 
		  //timer_sec_run=Info.runsec;		  

		  
		  
		  if ( strlen(AfxGetApp()->m_lpCmdLine)>5 )		  
			  wnd.RedFile(AfxGetApp()->m_lpCmdLine,Info.decod);		  
		  else		  
			  wnd.m_edit->SetWindowText(decode_b64("zH4GgZHIhZDJhfclhL9RcDPOjLH2PTFlebPTPRVSiaKzjvV2kv9vELHmEMdueytepbYSi87xkaY1c8m2kn73kLYSkRA6hZVthfc+eyteByOchZ43wltecCg4cBtliaYzkAtecDYShIA6cKGKjLylYa6ncCumhDdKgZHKkqUljZY1PI7LkL90cCYUka42kLYRByN="));
			  /*MadReader for Windows (www.shilonosov.da.ru)
Push Open (or press <enter>)

Help:
> Move mouse to right edge of Display and push LButton/RButton - next/prev page
> Move mouse to low edge - shows panel
> press long button to set/clear boomark
> Use <Send to> menu for read files from explorer
> Drag&Drop files to read
> Hit Shift and move mouse = change the view range
> use history (^) menu for recently opened files


 Keyboard:
<enter> - open file or choose from history
<a> - set/clear bookmark
<alt+a> - set last bookmark to current page
<z> - choose bookmark jump
<tab> - jump to next bookmark
<ctrl> - show infotip
<esc> - dlg_startize all*/
		  

		  if ( !wnd.isOpened() && Info.openSUp)
		  {	
			  if ( Recents.GetHeadPosition() )
			  {
				  OnCommand(100,0);
				  if (Info.jumpLast) from_readerwnd(7,0,0,NULL);
			  }
		  }

          //cursor1 = LoadCursor(AfxGetApp()->m_hInstance,(LPCTSTR)IDC_POINTER_COPY);
          cursor1 = AfxGetApp()->LoadCursor(IDC_POINTER_COPY);

		  return TRUE;  
}
示例#2
0
void MainWindow::createactions()
{
    open_action = new QAction(tr("open"), this);
    open_action->setShortcut(QKeySequence::New);
    open_action->setStatusTip(tr("open new pcap file"));
    connect(open_action, SIGNAL(triggered()), this, SLOT(open()));

    save_action = new QAction(tr("save"), this);
    save_action->setShortcut(QKeySequence::Open);
    save_action->setStatusTip(tr("save data to disk"));
    connect(save_action, SIGNAL(triggered()), this, SLOT(save()));

    for(int i = 0; i < max_recentfiles; ++i)
    {
        recentfiles_actions[i] = new QAction(this);
        recentfiles_actions[i]->setVisible(false);
        connect(recentfiles_actions[i], SIGNAL(triggered()),
                this, SLOT(open_recent()));
    }

    close_action = new QAction(tr("close"), this);
    close_action->setStatusTip(tr("close current file"));
    connect(close_action, SIGNAL(triggered()), this, SLOT(close_file()));

    exit_action = new QAction(tr("quit"), this);
    exit_action->setShortcut(tr("Ctrl+Q"));
    exit_action->setStatusTip(tr("quit program"));
    connect(exit_action, SIGNAL(triggered()), this, SLOT(close()));

    start_action = new QAction(tr("start"), this);
    start_action->setStatusTip(tr("start to capture package"));
    connect(start_action, SIGNAL(triggered()),
            this, SLOT(start_capture()));

    restart_action = new QAction(tr("restart"), this);
    restart_action->setStatusTip(tr("restart to capture package"));
    connect(restart_action, SIGNAL(triggered()),
            this, SLOT(restart_capture()));

    stop_action = new QAction(tr("stop"), this);
    stop_action->setStatusTip(tr("stop"));
    connect(stop_action, SIGNAL(triggered()),
            this, SLOT(stop_capture()));

    avalible_action = new QAction(tr("available packages"), this);
    avalible_action->setStatusTip(tr("show packages that program cannot analysis"));
    connect(avalible_action, SIGNAL(triggered()),
            this, SLOT(show_avalible()));

    manual_action = new QAction(tr("help"), this);
    manual_action->setStatusTip(tr("help"));
    connect(manual_action, SIGNAL(triggered()),
            this, SLOT(show_manual()));

    about_action = new QAction(tr("about"), this);
    about_action->setStatusTip(tr("about"));
    connect(about_action, SIGNAL(triggered()),
            this, SLOT(about()));

    aboutqt_action = new QAction(tr("about Qt"), this);
    aboutqt_action->setStatusTip(tr("about Qt"));
    connect(aboutqt_action, SIGNAL(triggered()),
            qApp, SLOT(aboutQt()));
}