示例#1
0
文件: zoo.c 项目: hannenz/zoomania
void show_highscores(void){
	char i,j;
	
	screen_off();
	init_msx(0);
	fill();
	txt_mode();

	print2x2_centered("highscores",1,15,0);
	for (i=0;i<10;++i){
		sprintf(str_dummy,"%-10s %06lu-%02d",highscore[i].name,highscore[i].score,highscore[i].level);
		print2x2_centered(str_dummy,hs_coltab1[i],hs_coltab2[i],3+(i<<1));
	}
	revers(1);textcolor(15);
	cputsxy(9,24,"[s] to save highscores");
	screen_on();

	while(*(char*)0xdc00 == 127){
		wait(0x33+24*8-2);
		setgfx(0x0428);
		wait(0);
		setgfx(0x0438);
		
		++j;
		if ((j & 3) == 0){
			++i;
			memset((char*)0xdbc9,hs_coltab3[i&7],22);
		}

		if (getkey() == 's'){
			screen_off();
			save_hs();
			screen_on();
		}
	}
	screen_off();
	fill();
	delay(35);
	screen_on();
}
示例#2
0
文件: main.c 项目: Metalab/metafridge
void shift_pixel_data()
{
	uint8_t i;

	screen_off();

	for ( i = 0 ; i < PANEL_DATA_SIZE ; i++ ) {
		SPDR = panel_data[i];
		while (!(SPSR & (1 << SPIF))) /* wait */;
	}

	screen_on();
}
示例#3
0
void FileManager::create_menu()
{
  layout_->addWidget(menuBar() );
  file_ = new QPopupMenu( this );  
  menuBar()->insertItem( tr( "File" ), file_ );

  INIT_FO_POPUP(file_, this);


  view_ = new QPopupMenu( this );  

  menuBar()->insertItem( tr( "View" ), view_ );

  dirtree_idx_=view_->insertItem(tr("list"),this, SLOT(show_dirtree()));
  cout << "id : " << dirtree_idx_ << endl;
  image_idx_=view_->insertItem(tr("image"),this, SLOT(show_image()));
  status_idx_ = view_->insertItem(tr("status bar"),this, SLOT(show_status_bar()));
  view_->setItemChecked(status_idx_, true);

  options_ = new QPopupMenu( this );  
  menuBar()->insertItem( tr( "Options" ), options_ );
  options_->insertItem(tr("Font"),this, SLOT(select_font()));
  options_->insertItem(tr("encode"),this, SLOT(show_encode_dialog()));

  up_ = new QToolButton(menuBar(),"up");
  left_ = new QToolButton(0,"left");  
  right_ = new QToolButton(0,"right"); 

  init_tool_button(menuBar(),up_,"up.png");
  init_tool_button(menuBar(),left_,"left.png");
  init_tool_button(menuBar(),right_,"right.png");
   
  connect(up_, SIGNAL(clicked() ) , this, SLOT(cd_up()));
  connect(left_, SIGNAL(clicked() ) , this, SLOT(screen_off()));
  connect(right_, SIGNAL(clicked() ) , this, SLOT(screen_on()));
}
void setup() {
    DDRC |= (1<<DATA_LOW)|(1<<DATA_HIGH)|(1<<OE)|(1<<SRCK)|(1<<RCK);
    screen_on();
}
示例#5
0
FileManager::FileManager(QWidget * parent , const char * name , WFlags f ):QMainWindow(parent,name,f)
{

  QVBoxLayout *layout = new QVBoxLayout( this );
  layout->setSpacing(2);
  layout->setMargin(2);

  h_box_ = new QHBox(this);
  dirtree_view_ = new DirTreeView(h_box_);
  //dirtree_view_->hide();
  dir_content_ = new DirContent(h_box_);
  //dir_content_->hide();
  //image_widget_ = new ImageWidget(h_box_);
  //setCentralWidget(h_box_);
  font_selector_ = new FontSelector();

  dirtree_view_->setGeometry(0,0,width(),height()*2);
  dir_content_->setGeometry(width(),0,width(),height()*2);
  //image_widget_->setGeometry(0,0,width(),height()*3);

  le_on_dirtree_ = new RenameLineEdit(dirtree_view_);
  le_on_dirtree_ -> hide();

  le_on_dir_content_ = new RenameLineEdit(dir_content_);
  le_on_dir_content_ -> hide();

  connect(le_on_dirtree_, SIGNAL( lost_focus() ), SLOT( rename() ) );
  connect(le_on_dirtree_, SIGNAL(returnPressed()), this, SLOT(rename()));

  connect(le_on_dir_content_, SIGNAL( lost_focus() ), SLOT( rename() ) );
  connect(le_on_dir_content_, SIGNAL(returnPressed()), this, SLOT(rename()));




  QObject::connect(dirtree_view_, SIGNAL(clicked ( QListViewItem *) ), dir_content_, SLOT(get_content(QListViewItem *) ));

  connect(dirtree_view_,SIGNAL(currentChanged ( QListViewItem *)), dir_content_, SLOT(get_content(QListViewItem *) ) );

  QObject::connect(dir_content_, SIGNAL(cur_dir ( const std::string &) ), this, SLOT(modify_caption(const std::string &) ));

  QMenuBar *menubar = new QMenuBar(this);
  //QPEToolBar* toolBar = new QPEToolBar( this );
  //toolBar->setHorizontalStretchable( TRUE );


  //QPEMenuBar* menuBar = new QPEMenuBar( toolBar );

  //layout->addWidget(toolBar);
  layout->addWidget(menubar);


  file_ = new QPopupMenu( this );  
  menubar->insertItem( tr( "File" ), file_ );

  INIT_FO_POPUP(file_, this);


  view_ = new QPopupMenu( this );  

  menubar->insertItem( tr( "View" ), view_ );

  view_->insertItem(tr("status bar"),this, SLOT(show_status_bar()));
  //view_->setCheckable(true);
  view_->setItemChecked(view_->idAt(0),false);

  options_ = new QPopupMenu( this );  
  menubar->insertItem( tr( "Options" ), options_ );
  options_->insertItem("Font",this, SLOT(select_font()));

  up_ = new QToolButton(0,"up");
  left_ = new QToolButton(0,"left");  
  right_ = new QToolButton(0,"right"); 

  init_tool_button(menubar,up_,"up.png");
  init_tool_button(menubar,left_,"left.png");
  init_tool_button(menubar,right_,"right.png");
   
  connect(up_, SIGNAL(clicked() ) , this, SLOT(cd_up()));
  connect(left_, SIGNAL(clicked() ) , this, SLOT(screen_off()));
  connect(right_, SIGNAL(clicked() ) , this, SLOT(screen_on()));

  QHBox *line_box = new QHBox( this );
  layout->addWidget(line_box);

  layout->addWidget(h_box_);

  select_dir_ = new QComboBox(line_box);
  select_dir_->insertItem("/");
  select_dir_->insertItem("/home/");
  select_dir_->insertItem("/etc/");
  select_dir_->insertItem("/mnt");
  select_dir_->insertItem("/root");
  select_dir_->insertItem("/home/descent/12/");
  select_dir_->insertItem("/home/descent/aaa/");

  connect(select_dir_, SIGNAL(activated ( const QString &) ), this, SLOT(change_dirtreeview_item(const QString & )) );

  connect(dir_content_, SIGNAL( opendir ( const std::string &) ), this, SLOT(change_dirtreeview_item(const std::string & )) );

  status_bar_ = statusBar ();


  if (status_bar_!=0)
  {
    qDebug("have status bar");
    layout->addWidget(status_bar_);
  }
  else
    qDebug("don't have status bar");
  //status_bar = new QStatusBar(this);
//#endif
}