当前位置: 首页>>代码示例>>C++>>正文


C++ ZSoftKey::setOptMenu方法代码示例

本文整理汇总了C++中ZSoftKey::setOptMenu方法的典型用法代码示例。如果您正苦于以下问题:C++ ZSoftKey::setOptMenu方法的具体用法?C++ ZSoftKey::setOptMenu怎么用?C++ ZSoftKey::setOptMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ZSoftKey的用法示例。


在下文中一共展示了ZSoftKey::setOptMenu方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FullScreenDialog

QOptionsDialog::QOptionsDialog(const std::string &id, const std::string &caption) :
    FullScreenDialog(caption.c_str()),
    ZLOptionsDialog(id),
    tabno(0)
{
	cap = caption;
	myTabWidget = new MyTabWidget(this);
	setContentWidget(myTabWidget);


	ZSoftKey *softKey = (ZSoftKey *)getCSTWidget(true);

	QRect rect;
	menu = new ZOptionsMenu(rect, softKey, NULL, 0, (ZSkinService::WidgetClsID)4);
	softKey->setOptMenu(ZSoftKey::LEFT, menu);
	softKey->setText(ZSoftKey::LEFT, "Menu", (ZSoftKey::TEXT_PRIORITY)0);

	QRect rect2;
	ZOptionsMenu * menu2 = new ZOptionsMenu(rect2, softKey, NULL, 0, (ZSkinService::WidgetClsID)4);
	menu2->insertItem(QString("Accept"), NULL, NULL, true, 0, 0);
	menu2->insertItem(QString("Cancel"), NULL, NULL, true, 1, 1 );
	softKey->setOptMenu(ZSoftKey::RIGHT, menu2);
	softKey->setText(ZSoftKey::RIGHT, "Done", (ZSoftKey::TEXT_PRIORITY)0);

	connect(menu, SIGNAL(activated(int)), this, SLOT(selectTab(int)));

	menu2->connectItem(0, this, SLOT(accept()));
	menu2->connectItem(1, this, SLOT(reject()));
}
开发者ID:xufooo,项目名称:fbreader-e2-test,代码行数:29,代码来源:QOptionsDialog.cpp

示例2: CreateWindow

void ZFonts::CreateWindow ( QWidget* parent )
{
	//Set title window
	setMainWidgetTitle ( "zFonts" );
	
	lbFonts = new ZListBox(this);
	
	QFont font ( qApp->font() ); 
	font.setPointSize ( 18 );
	lbFonts->setItemFont( ZListBox::LISTITEM_REGION_A, ZListBox::StStandard, font );	
	lbFonts->setItemFont( ZListBox::LISTITEM_REGION_A, ZListBox::StHighlighted, font );	
	
	connect ( lbFonts, SIGNAL( selected(int) ), this, SLOT( slot_fontSelect(int) ) );
	
	setContentWidget( lbFonts );

	fillFonts();

	//Create SoftKey and Menu
	ZSoftKey *softKey = new ZSoftKey ( NULL , this , this );
	
	QRect rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
	ZOptionsMenu* menu = new ZOptionsMenu ( rect, softKey, NULL, 0 );
	menu->setItemSpacing(12);
	
	QPixmap * pm = new QPixmap();

	pm->load(ProgDir+ "/view_font.png");
	menu->insertItem ( tr("TXT_RID_OPTION_PREVIEW", "Preview"), NULL, pm, true, 0, 0 );
	pm->load(ProgDir+ "/set_fonts.png");
	menu->insertItem ( tr("TXT_RID_SOFTKEY_INSTALL", "Install"), NULL, pm, true, 1, 1 );
	pm->load(ProgDir+ "/about.png");
	menu->insertSeparator(2, 2); 
	menu->insertItem ( tr("TXT_RID_SOFTKEY_ABOUT_JAVA", "About").replace("Java",""), NULL, pm, true, 3, 3 );
	pm->load(ProgDir+ "/exit.png");
	menu->insertItem ( tr("TXT_RID_OPTION_EXIT", "Exit"), NULL, pm, true, 4, 4 );
	
	menu->connectItem ( 0, this, SLOT ( slot_preview() ) );
	menu->connectItem ( 1, this, SLOT ( slot_install() ) );
	menu->connectItem ( 3, this, SLOT ( slot_about() ) );
	menu->connectItem ( 4, qApp, SLOT ( quit() ) );	
	
	softKey->setText ( ZSoftKey::LEFT, tr("TXT_RID_SOFTKEY_OPTIONS", "Options"), ( ZSoftKey::TEXT_PRIORITY ) 0 );
	softKey->setText ( ZSoftKey::RIGHT, tr("TXT_RID_OPTION_EXIT", "Exit"), ( ZSoftKey::TEXT_PRIORITY ) 0 );
	softKey->setOptMenu ( ZSoftKey::LEFT, menu );
	softKey->setClickedSlot ( ZSoftKey::RIGHT, qApp, SLOT ( quit() ) );
	
	setSoftKey ( softKey );
}
开发者ID:OpenMagx,项目名称:open-magx-src,代码行数:49,代码来源:ZFonts.cpp

示例3: CreateWindow


//.........这里部分代码省略.........
	
	CodeMenu = new ZOptionsMenu ( rect, softKey, NULL, 0 );
	CodeMenu->setItemSpacing(10);
	#if !(defined(EZX_Z6) || defined(EZX_V8))
	CodeMenu->insertItem ( "UTF-8", NULL, NULL, true, 0, 0, false, true, true );	
	CodeMenu->insertItem ( "Win1251", NULL, NULL, true, 1, 1, false, true );
	CodeMenu->insertItem ( "KOI8-R", NULL, NULL, true, 2, 2, false, true );	
	CodeMenu->insertItem ( "ISO8859-1", NULL, NULL, true, 3, 3, false, true );
	CodeMenu->insertItem ( "ISO8859-2", NULL, NULL, true, 4, 4, false, true );
	CodeMenu->insertItem ( "ISO8859-5", NULL, NULL, true, 5, 5, false, true );
	CodeMenu->insertItem ( "KOI8-U", NULL, NULL, true, 6, 6, false, true );	
	CodeMenu->insertItem ( "Big5", NULL, NULL, true, 7, 7, false, true );	
	CodeMenu->insertItem ( "GBK", NULL, NULL, true, 8, 8, false, true );	
	#else
	CodeMenu->insertItem ( "UTF-8", NULL, NULL, NULL, true, true, true, 0, 0 );	
	CodeMenu->insertItem ( "Win1251", NULL, NULL, NULL, true, true, false, 1, 1 );
	CodeMenu->insertItem ( "KOI8-R", NULL, NULL, NULL, true, true, false, 2, 2 );	
	CodeMenu->insertItem ( "ISO8859-1", NULL, NULL, NULL, true, true, false, 3, 3 );
	CodeMenu->insertItem ( "ISO8859-2", NULL, NULL, NULL, true, true, false, 4, 4 );
	CodeMenu->insertItem ( "ISO8859-5", NULL, NULL, NULL, true, true, false, 5, 5 );
	CodeMenu->insertItem ( "KOI8-U", NULL, NULL, NULL, true, true, false, 6, 6 );	
	CodeMenu->insertItem ( "Big5", NULL, NULL, NULL, true, true, false, 7, 7 );
	CodeMenu->insertItem ( "GBK", NULL, NULL, NULL, true, true, false, 8, 8 );
	#endif	

	#define CODEC_COUNT 9
	connect( CodeMenu, SIGNAL( activated( int ) ), this, SLOT( slot_codecChenged( int ) ) );
	
	pm->load(ProgDir+ "/img/fake.png");
	MainMenu->insertItem ( MENU_FIX+lng->getString("CODE"), CodeMenu, pm, true , 3, 3 );  
	
	#ifdef MDI
	DlgMenu = new ZOptionsMenu ( rect, softKey, NULL, 0 );
	DlgMenu->setItemSpacing(10);	
	connect( DlgMenu, SIGNAL( activated( int ) ), this, SLOT( slot_dlgChenged( int ) ) );
	pm->load(ProgDir+ "/img/document.png");
	MainMenu->insertItem ( MENU_FIX+lng->getString("DLG"), DlgMenu, pm, true , 3, 3 ); 
	buildDlgMenu();
	#endif
	
	pm->load(ProgDir+ "/img/find.png");
	MainMenu->insertItem ( MENU_FIX+lng->getString("SEARCH"), NULL, pm, true, 4, 4 );		
	pm->load(ProgDir+ "/img/options.png");
	MainMenu->insertItem ( MENU_FIX+lng->getString("OPTION"), NULL, pm, true, 5, 5 );	
	pm->load(ProgDir+ "/img/about.png");
	MainMenu->insertItem ( MENU_FIX+lng->getString("ABOUT"), NULL, pm, true, 6, 6 );	
	pm->load(ProgDir+ "/img/exit.png");
	MainMenu->insertItem ( MENU_FIX+lng->getString("EXIT"), NULL, pm, true, 7, 7 );
	
	MainMenu->connectItem ( 4, this, SLOT ( slot_fileFind() ) );
	MainMenu->connectItem ( 5, this, SLOT ( slot_settings() ) );	
	MainMenu->connectItem ( 6, this, SLOT ( slot_about() ) );
	MainMenu->connectItem ( 7, this, SLOT ( slot_exit() ) );	
	
	softKey->setTextForOptMenuHide(lng->getString("FILE"));
	softKey->setText ( ZSoftKey::LEFT, lng->getString("FILE"), ( ZSoftKey::TEXT_PRIORITY ) 0 );
	softKey->setText ( ZSoftKey::RIGHT, lng->getString("EXIT"), ( ZSoftKey::TEXT_PRIORITY ) 0 );
	softKey->setOptMenu ( ZSoftKey::LEFT, MainMenu );
	softKey->setClickedSlot ( ZSoftKey::RIGHT, this, SLOT ( slot_exit() ) );
	
	#if defined(EZX_ZN5) || defined(EZX_U9) || defined(EZX_Z6W)
	edit->setFixedHeight( SCREEN_HEIGHT - headerSize().height() - softKey->height());
	#endif
	
	setSoftKey ( softKey );
	
	///Connect std signal
	#ifndef EZX_VE66
	connect( qApp, SIGNAL(signalRaise()), this, SLOT(slot_Raise()) );
	connect( qApp, SIGNAL(askReturnToIdle(int)), this, SLOT(slot_ReturnToIdle(int)) );	
	#endif
	
	///init peremen
	textCode = 0;
	pos = NULL;
	isMarck = false;
	
	///load file if need
	if ( !cfg_autoOpen )
		sFileName = "";	
		
	QFile file;
	if ( qApp->argc() > 1  )
	{
		sFileName = "";
		if ( file.exists(QString::fromUtf8(qApp->argv()[1])) )
			sFileName = QString::fromUtf8(qApp->argv()[1]);
		else
		if ( qApp->argc() > 2  )
			if ( file.exists(QString::fromUtf8(qApp->argv()[2])) )
				sFileName = QString::fromUtf8(qApp->argv()[2]);
		sFilePath = getFilePath(sFileName);
		sFileName = getFileName(sFileName);			
	}

	if ( sFileName.isEmpty() || sFilePath.isEmpty() )
		slot_fileNew();
	else
		load(sFilePath+sFileName);
}
开发者ID:OpenMagx,项目名称:open-magx-src,代码行数:101,代码来源:zgui.cpp

示例4: CreateWindow

void ZGui::CreateWindow ( QWidget* parent )
{
  setMainWidgetTitle ( "zCleaner" );
  ZWidget *myWidget = new ZWidget ( this, NULL, 0, ( ZSkinService::WidgetClsID ) 40 );
  QFont f ( qApp->font() );
  f.setPointSize ( 10 );
  myWidget->setFont ( f );

  QVBoxLayout *myVBoxLayout = new QVBoxLayout ( myWidget, 0 );
  //*****************************
  //*** add elements here
  QLabel *myLabel = new QLabel ( QString ( "<qt><font size=\"+1\">zCleaner</font><br>"
                                 "<font size=\"-1\">Simple antivirus for Z6</font></qt>" ), myWidget );
  myVBoxLayout->addWidget ( myLabel, 0 );
  myLabel->setIndent ( 5 );
  myLabel->setAutoResize ( true );


  scrollPanel = new ZScrollPanel ( myWidget, NULL, 0, ( ZSkinService::WidgetClsID ) 0 );
  scrollPanel->resize ( 240, 320 );
   //-----------------------------------------------------------------------------------
  modo=new ZComboBox(this,"ZComboBox",true);//declaro los combobox
  lugar=new ZComboBox(this,"ZComboBox",true);
  modo->insertItem("Clean", 0 );
  modo->insertItem("AV", 1 );	
  //modo->insertItem("Picture/Video", 2 );  
  scrollPanel->addChild(modo , 100 , 5);//agrego el combobox de las apps al escritorio

  lab1 = new ZLabel("Mode" , this, "ZLabel", 0, (ZSkinService::WidgetClsID)4);
  lab1->setPreferredWidth(240);
  lab1->setAutoResize(true );
  
  scrollPanel->addChild(lab1 , 10 , 8);//agrego el label al menu
  
  lugar->insertItem("SD",0);
  lugar->insertItem("Phone",1);
  lugar->insertItem("SD/Phone",2);

  scrollPanel->addChild(lugar , 100 , 55);//agrego el propiestario al escritorio
  lab2  = new ZLabel("Location" , this, "ZLabel", 0, (ZSkinService::WidgetClsID)4);
  lab2->setPreferredWidth(240);
  lab2->setAutoResize(true );
  
  scrollPanel->addChild(lab2 , 10 , 58);//agrego el label al menu
  myVBoxLayout->addWidget ( scrollPanel, 0 );


  //*****************************
  setContentWidget ( myWidget );
  //************** softkeys and menus **************************
  ZSoftKey *softKey = new ZSoftKey ( NULL , this , this );
  QPixmap* pm  = new QPixmap();
  
  QRect rect, rect2, rect3, rect4;

  ZOptionsMenu* agre = new ZOptionsMenu ( rect3, softKey, NULL, 0, ( ZSkinService::WidgetClsID ) 2 );
  //pm->load(getProgramDir() + "img/about.png");
  agre->insertItem ( QString ( " ASK" ), NULL, NULL, true, 0, 0 );
  agre->insertItem ( QString ( " DELETE" ), NULL, NULL, true, 1, 1 );
  agre->connectItem ( 0, this, SLOT ( agregarTipoASK() ) );
  agre->connectItem ( 1, this, SLOT ( agregarTipoDELETE() ) );

  ZOptionsMenu* borr = new ZOptionsMenu ( rect4, softKey, NULL, 0, ( ZSkinService::WidgetClsID ) 2 );
  borr->insertItem ( QString ( " ASK" ), NULL, NULL, true, 0, 0 );
  borr->insertItem ( QString ( " DELETE" ), NULL, NULL, true, 1, 1 );
  borr->connectItem ( 0, this, SLOT ( eliminarTipoASK() ) );

  ZOptionsMenu* data = new ZOptionsMenu ( rect2, softKey, NULL, 0, ( ZSkinService::WidgetClsID ) 2 );
  pm->load(getProgramDir() + "img/add.png");
  data->insertItem ( QString ( " Add type" ), agre, pm, true, 0, 0 );
  pm->load(getProgramDir() + "img/remove.png");
  data->insertItem ( QString ( " Remove type" ), borr, pm, true, 1, 1 );

  
  ZOptionsMenu* menu = new ZOptionsMenu ( rect, softKey, NULL, 0, ( ZSkinService::WidgetClsID ) 2 );
  pm->load(getProgramDir() + "img/about.png");
  menu->insertItem ( QString ( " About" ), NULL, pm, true, 0, 0 );
  menu->insertSeparator(1, 1); 
  pm->load(getProgramDir() + "img/white.png");
  menu->insertItem ( QString ( " Clean" ), NULL, pm, true, 2, 2 );
  pm->load(getProgramDir() + "img/properties.png");
  menu->insertItem ( QString ( " Database" ), data, pm, true, 3, 3 );
  pm->load(getProgramDir() + "img/edit.png");
  menu->insertItem ( QString ( " Save delete files list" ), NULL, pm, true, 4, 4 );
  menu->insertSeparator(5, 5); 
  pm->load(getProgramDir() + "img/exit.png");
  menu->insertItem ( QString ( " Exit" ), NULL, pm, true, 6, 6 );

  menu->connectItem ( 6, qApp, SLOT ( quit() ) );
  menu->connectItem ( 2, this, SLOT ( ejecutar() ) );
  menu->connectItem ( 0, this, SLOT ( about() ) );
  menu->connectItem ( 4, this, SLOT ( verEliminados() ) );

  softKey->setOptMenu ( ZSoftKey::LEFT, menu );
  softKey->setText ( ZSoftKey::LEFT, "Menu", ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setText ( ZSoftKey::RIGHT, "Exit", ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setClickedSlot ( ZSoftKey::RIGHT, qApp, SLOT ( quit() ) ); 
  setSoftKey ( softKey );


//.........这里部分代码省略.........
开发者ID:BGCX262,项目名称:zsoft-svn-to-git,代码行数:101,代码来源:zgui.cpp


注:本文中的ZSoftKey::setOptMenu方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。