• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ browser函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中browser函数的典型用法代码示例。如果您正苦于以下问题:C++ browser函数的具体用法?C++ browser怎么用?C++ browser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: browser

void FileChooser::UpdateEditor() {
    int index = browser()->Selection();

    if (index >= 0) {
        _sedit->Message(browser()->Path(index));
        browser()->UnselectAll();
    } else {
        _sedit->Message(browser()->Normalize(_sedit->Text()));
    }
    SelectFile();
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:11,代码来源:filechooser.c


示例2: switch

void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
	switch (cmd) {
	case kChooseSaveDirCmd: {
		BrowserDialog browser("Select directory for savegames", true);
		if (browser.runModal() > 0) {
			// User made his choice...
			FilesystemNode dir(browser.getResult());
			_savePath->setLabel(dir.path());
			draw();
			// TODO - we should check if the directory is writeable before accepting it
		}
		break;
	}
	case kChooseThemeDirCmd: {
		BrowserDialog browser("Select directory for GUI themes", true);
		if (browser.runModal() > 0) {
			// User made his choice...
			FilesystemNode dir(browser.getResult());
			_themePath->setLabel(dir.path());
			draw();
		}
		break;
	}
	case kChooseExtraDirCmd: {
		BrowserDialog browser("Select directory for extra files", true);
		if (browser.runModal() > 0) {
			// User made his choice...
			FilesystemNode dir(browser.getResult());
			_extraPath->setLabel(dir.path());
			draw();
		}
		break;
	}
	case kChooseSoundFontCmd: {
		BrowserDialog browser("Select SoundFont", false);
		if (browser.runModal() > 0) {
			// User made his choice...
			FilesystemNode file(browser.getResult());
			_soundFont->setLabel(file.path());
			draw();
		}
		break;
	}
#ifdef SMALL_SCREEN_DEVICE
	case kChooseKeyMappingCmd:
		_keysDialog->runModal();
		break;
#endif
	default:
		OptionsDialog::handleCommand(sender, cmd, data);
	}
}
开发者ID:iPodLinux-Community,项目名称:iScummVM,代码行数:52,代码来源:options.cpp


示例3: browser

// ----------------------------------------------------------------------------
// ThingPropsPanel::onSpriteClicked
//
// Called when the thing type sprite canvas is clicked
// ----------------------------------------------------------------------------
void ThingPropsPanel::onSpriteClicked(wxMouseEvent& e)
{
	ThingTypeBrowser browser(this, type_current_);
	if (browser.ShowModal() == wxID_OK)
	{
		// Get selected type
		type_current_ = browser.getSelectedType();
		auto& tt = Game::configuration().thingType(type_current_);

		// Update sprite
		gfx_sprite_->setSprite(tt);
		label_type_->SetLabel(tt.name());

		// Update args
		if (panel_args_)
		{
			auto& as = tt.argSpec();
			panel_args_->setup(as, (MapEditor::editContext().mapDesc().format == MAP_UDMF));
		}

		// Update layout
		Layout();
		Refresh();
	}
}
开发者ID:Talon1024,项目名称:SLADE,代码行数:30,代码来源:ThingPropsPanel.cpp


示例4: if

// -----------------------------------------------------------------------------
// Called when a texture canvas is clicked
// -----------------------------------------------------------------------------
void SectorPropsPanel::onTextureClicked(wxMouseEvent& e)
{
	// Get canvas
	FlatTexCanvas* tc = nullptr;
	FlatComboBox*  cb = nullptr;
	if (e.GetEventObject() == gfx_floor_)
	{
		tc = gfx_floor_;
		cb = fcb_floor_;
	}
	else if (e.GetEventObject() == gfx_ceiling_)
	{
		tc = gfx_ceiling_;
		cb = fcb_ceiling_;
	}

	if (!tc)
	{
		e.Skip();
		return;
	}

	// Browse
	MapTextureBrowser browser(this, MapEditor::TextureType::Flat, tc->texName(), &MapEditor::editContext().map());
	if (browser.ShowModal() == wxID_OK && browser.selectedItem())
		cb->SetValue(browser.selectedItem()->name());
}
开发者ID:sirjuddington,项目名称:SLADE,代码行数:30,代码来源:SectorPropsPanel.cpp


示例5: if

/* SectorPropsPanel::onTextureClicked
 * Called when a texture canvas is clicked
 *******************************************************************/
void SectorPropsPanel::onTextureClicked(wxMouseEvent& e)
{
	// Get canvas
	FlatTexCanvas* tc = NULL;
	FlatComboBox* cb = NULL;
	if (e.GetEventObject() == gfx_floor)
	{
		tc = gfx_floor;
		cb = fcb_floor;
	}
	else if (e.GetEventObject() == gfx_ceiling)
	{
		tc = gfx_ceiling;
		cb = fcb_ceiling;
	}

	if (!tc)
	{
		e.Skip();
		return;
	}

	// Browse
	MapTextureBrowser browser(this, 1, tc->getTexName(), &(theMapEditor->mapEditor().getMap()));
	if (browser.ShowModal() == wxID_OK)
		cb->SetValue(browser.getSelectedItem()->getName());
}
开发者ID:Genghoidal,项目名称:SLADE,代码行数:30,代码来源:SectorPropsPanel.cpp


示例6: main

int main(int argc, char* argv[])
{
    Options options;
    if (!options.parse(argc, argv))
        return 1;

    printf("MiniBrowser: Use Alt + Left and Alt + Right to navigate back and forward. Use F5 to reload.\n");

    std::string url = options.url;
    if (url.empty())
        url = "http://www.google.com";
    else if (url.find("http") != 0 && url.find("file://") != 0) {
        std::ifstream localFile(url.c_str());
        url.insert(0, localFile ? "file://" : "http://");
    }

    GMainLoop* mainLoop = g_main_loop_new(0, false);
    MiniBrowser browser(mainLoop, options.desktopModeEnabled ? MiniBrowser::DesktopMode : MiniBrowser::MobileMode, options.width, options.height, options.viewportHorizontalDisplacement, options.viewportVerticalDisplacement);

    if (options.forceTouchEmulationEnabled || !options.desktopModeEnabled) {
        printf("Touch Emulation Mode enabled. Hold Control key to build and emit a multi-touch event: each mouse button should be a different touch point. Release Control Key to clear all tracking pressed touches.\n");
        browser.setTouchEmulationMode(true);
    }

    if (!options.userAgent.empty())
        WKPageSetCustomUserAgent(browser.pageRef(), WKStringCreateWithUTF8CString(options.userAgent.c_str()));

    if (!options.desktopModeEnabled)
        printf("Use Control + mouse wheel to zoom in and out.\n");

    WKPageLoadURL(browser.pageRef(), WKURLCreateWithUTF8CString(url.c_str()));

    g_main_loop_run(mainLoop);
    g_main_loop_unref(mainLoop);
}
开发者ID:rgabor-dev,项目名称:webkitnix,代码行数:35,代码来源:main.cpp


示例7: browser

// -----------------------------------------------------------------------------
// Opens the texture browser for [tex_type] textures, with [init_texture]
// initially selected. Returns the selected texture
// -----------------------------------------------------------------------------
std::string MapEditor::browseTexture(
	std::string_view init_texture,
	TextureType      tex_type,
	SLADEMap&        map,
	std::string_view title)
{
	// Unlock cursor if locked
	bool cursor_locked = edit_context->mouseLocked();
	if (cursor_locked)
		edit_context->lockMouse(false);

	// Setup texture browser
	MapTextureBrowser browser(map_window, tex_type, wxString{ init_texture.data(), init_texture.size() }, &map);
	browser.SetTitle(WxUtils::strFromView(title));

	// Get selected texture
	std::string tex;
	if (browser.ShowModal() == wxID_OK)
		tex = browser.selectedItem()->name();

	// Re-lock cursor if needed
	if (cursor_locked)
		edit_context->lockMouse(true);

	return tex;
}
开发者ID:SteelTitanium,项目名称:SLADE,代码行数:30,代码来源:MapEditor.cpp


示例8: main

int main(int argv, char** argc)
{
  QApplication app(argv, argc);

  app.setOrganizationName("commontk");
  app.setOrganizationDomain("commontk.org");
  app.setApplicationName("ctkPluginBrowser");

  ctkPluginFrameworkFactory fwFactory;
  ctkPluginFramework* framework = fwFactory.getFramework();

  try {
    framework->init();
  }
  catch (const ctkPluginException& exc)
  {
    qCritical() << "Failed to initialize the plug-in framework:" << exc;
    exit(1);
  }

  ctkPluginBrowser browser(framework);
  browser.show();

  return app.exec();

}
开发者ID:dgiunchi,项目名称:CTK,代码行数:26,代码来源:ctkPluginBrowserMain.cpp


示例9: browser

bool CServerList::NeedToRefreshCurServer	()
{
	CUIListItemServer* pItem = (CUIListItemServer*)m_list[LST_SERVER].GetSelectedItem();
	if(!pItem)
		return false;
	return browser().HasAllKeys(pItem->GetInfo()->info.Index) == false;
};
开发者ID:AntonioModer,项目名称:xray-16,代码行数:7,代码来源:ServerList.cpp


示例10: fixProblem

	virtual bool fixProblem(unsigned index, unsigned fix_type, MapEditor* editor)
	{
		if (index >= sectors.size())
			return false;

		if (fix_type == 0)
		{
			// Browse textures
			MapTextureBrowser browser(theMapEditor, 1, "", map);
			if (browser.ShowModal() == wxID_OK)
			{
				// Set texture if one selected
				string texture = browser.getSelectedItem()->getName();
				editor->beginUndoRecord("Change Texture");
				if (floor[index])
					sectors[index]->setStringProperty("texturefloor", texture);
				else
					sectors[index]->setStringProperty("textureceiling", texture);

				editor->endUndoRecord();

				// Remove problem
				sectors.erase(sectors.begin() + index);
				floor.erase(floor.begin() + index);
				return true;
			}

			return false;
		}

		return false;
	}
开发者ID:DemolisherOfSouls,项目名称:SLADE,代码行数:32,代码来源:MapChecks.cpp


示例11: strlen

void FileChooser::SelectFile() {
    const char* path = _sedit->Text();
    int left = strlen(browser()->ValidDirectories(path));
    int right = strlen(path);

    Select(left, right);
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:7,代码来源:filechooser.c


示例12: browser

/* ThingPropsPanel::onSpriteClicked
 * Called when the thing type sprite canvas is clicked
 *******************************************************************/
void ThingPropsPanel::onSpriteClicked(wxMouseEvent& e)
{
	ThingTypeBrowser browser(this, type_current);
	if (browser.ShowModal() == wxID_OK)
	{
		// Get selected type
		type_current = browser.getSelectedType();
		ThingType* tt = theGameConfiguration->thingType(type_current);

		// Update sprite
		gfx_sprite->setSprite(tt);
		label_type->SetLabel(tt->getName());

		// Update args
		if (panel_args)
		{
			argspec_t as = tt->getArgspec();
			panel_args->setup(&as, (theMapEditor->currentMapDesc().format == MAP_UDMF));
		}

		// Update layout
		Layout();
		Refresh();
	}
}
开发者ID:jmickle66666666,项目名称:SLADE,代码行数:28,代码来源:ThingPropsPanel.cpp


示例13: VBox

Interactor* FileChooser::Interior(const char* acptLbl) {
    const int space = Math::round(.5*cm);
    VBox* titleblock = new VBox(
        new HBox(title, new HGlue),
        new HBox(subtitle, new HGlue)
    );

    return new MarginFrame(
        new VBox(
            titleblock,
            new VGlue(space, 0),
            new Frame(new MarginFrame(_sedit, 2)),
            new VGlue(space, 0),
            new Frame(AddScroller(browser())),
            new VGlue(space, 0),
            new HBox(
                new VGlue(space, 0),
                new HGlue,
                new PushButton("Cancel", state, '\007'),
                new HGlue(space, 0),
                new PushButton(acptLbl, state, '\r')
            )
        ), space, space/2, 0
    );
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:25,代码来源:filechooser.c


示例14: strlen

void FacebookProto::OpenUrl(std::string url)
{
	std::string::size_type pos = url.find(FACEBOOK_SERVER_DOMAIN);
	bool isFacebookUrl = (pos != std::string::npos);
	bool isRelativeUrl = (url.substr(0, 4) != "http");

	if (isFacebookUrl || isRelativeUrl) {

		// Make realtive url
		if (!isRelativeUrl) {
			url = url.substr(pos + strlen(FACEBOOK_SERVER_DOMAIN));

			// Strip eventual port
			pos = url.find("/");
			if (pos != std::string::npos && pos != 0)
				url = url.substr(pos);
		}

		// Make absolute url
		bool useHttps = getByte(FACEBOOK_KEY_FORCE_HTTPS, 1) > 0;
		url = (useHttps ? HTTP_PROTO_SECURE : HTTP_PROTO_REGULAR) + facy.get_server_type() + url;
	}

	ptrT data( mir_utf8decodeT(url.c_str()));

	// Check if there is user defined browser for opening links
	ptrT browser(getTStringA(FACEBOOK_KEY_OPEN_URL_BROWSER));
	if (browser != NULL)
		// If so, use it to open this link
		ForkThread(&FacebookProto::OpenUrlThread, new open_url(browser, data));
	else
		// Or use Miranda's service
		CallService(MS_UTILS_OPENURL, (WPARAM)OUF_TCHAR, (LPARAM)data);
}
开发者ID:Ganster41,项目名称:miranda-ng,代码行数:34,代码来源:proto.cpp


示例15: main

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QMainWindow mainWin;
    mainWin.setWindowTitle(QObject::tr("Qt SQL Browser"));

    Browser browser(&mainWin);
    mainWin.setCentralWidget(&browser);

    QMenu *fileMenu = mainWin.menuBar()->addMenu(QObject::tr("&File"));
    fileMenu->addAction(QObject::tr("Add &Connection..."), &browser, SLOT(addConnection()));
    fileMenu->addSeparator();
    fileMenu->addAction(QObject::tr("&Quit"), &app, SLOT(quit()));

    QMenu *helpMenu = mainWin.menuBar()->addMenu(QObject::tr("&Help"));
    helpMenu->addAction(QObject::tr("About"), &browser, SLOT(about()));
    helpMenu->addAction(QObject::tr("About Qt"), qApp, SLOT(aboutQt()));

    QObject::connect(&browser, SIGNAL(statusMessage(QString)),
                     mainWin.statusBar(), SLOT(showMessage(QString)));

    addConnectionsFromCommandline(app.arguments(), &browser);
    mainWin.show();
    if (QSqlDatabase::connectionNames().isEmpty())
        QMetaObject::invokeMethod(&browser, "addConnection", Qt::QueuedConnection);

    return app.exec();
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:29,代码来源:main.cpp


示例16: main

int main(int argc, char * argv[])
{
    QApplication app(argc, argv);

    QCommandLineParser commandLineParser;
    commandLineParser.addPositionalArgument(QStringLiteral("url"),
        QStringLiteral("The url to be loaded in the browser window."));
    commandLineParser.process(app);
    QStringList positionalArguments = commandLineParser.positionalArguments();

    QUrl url;
    QString year,month,outputPath;
    int day;
    if (positionalArguments.size() > 5) {
        showHelp(commandLineParser, QStringLiteral("Too many arguments."));
        return -1;
    } else if (positionalArguments.size() == 5) {
        url = QUrl::fromUserInput(positionalArguments.at(0));
        year = positionalArguments.at(1);
        month = positionalArguments.at(2);
        day = positionalArguments.at(3).toInt();
        outputPath = positionalArguments.at(4);
    }
    else
        url = QUrl("http://query.nytimes.com/search/sitesearch/#/crude+oil/from20100502to20100602/allresults/1/allauthors/relevance/business");

    if (!url.isValid()) {
        showHelp(commandLineParser, QString("%1 is not a valid url.").arg(positionalArguments.at(0)));
        return -1;
    }

    MainWindow browser(url,year,month,day,outputPath);
    browser.show();
    return app.exec();
}
开发者ID:jasonz88,项目名称:NewsGrabber,代码行数:35,代码来源:main.cpp


示例17: run

void run(bool* const quit_game)
{
    vector<Str_and_clr> lines;

    mk_info_lines(lines);

    Menu_browser browser(6, 0);

    render_menu(browser);

    while (true)
    {
        const Menu_action action = menu_input_handling::get_action(browser);

        switch (action)
        {
        case Menu_action::esc:
        case Menu_action::space:
        case Menu_action::selected_shift: {} break;

        case Menu_action::browsed:
        {
            render_menu(browser);
        } break;

        case Menu_action::selected:
        {
            if (browser.is_at_idx(0))
            {
                run_info(lines);
                render_menu(browser);
            }
            else if (browser.is_at_idx(1))
            {
                mk_memorial_file(lines);
            }
            else if (browser.is_at_idx(2))
            {
                high_score::run_high_score_screen();
                render_menu(browser);
            }
            else if (browser.is_at_idx(3))
            {
                msg_log::display_history();
                render_menu(browser);
            }
            else if (browser.is_at_idx(4))
            {
                return;
            }
            else if (browser.is_at_idx(5))
            {
                *quit_game = true;
                return;
            }
        } break;
        }
    }
}
开发者ID:esranzarnath,项目名称:ia,代码行数:59,代码来源:postmortem.cpp


示例18: QDialog

SetupGopathDialog::SetupGopathDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::SetupGopathDialog)
{
    ui->setupUi(this);
    connect(ui->browserButton,SIGNAL(clicked()),this,SLOT(browser()));
    connect(ui->clearButton,SIGNAL(clicked()),ui->litePathTextEdit,SLOT(clear()));
}
开发者ID:CubeLite,项目名称:liteide,代码行数:8,代码来源:setupgopathdialog.cpp


示例19: browser

void CServerList::RefreshGameSpyList(bool Local)
{
	SetSortFunc			("",		false);
	SetSortFunc			("ping",	false);
	browser().RefreshList_Full(Local, m_edit_gs_filter.GetText());

	ResetCurItem		();
	RefreshList			();
}
开发者ID:2asoft,项目名称:xray,代码行数:9,代码来源:ServerList.cpp


示例20: MainMenu

void CServerList::ConnectToSelected()
{
	gamespy_gp::login_manager const * lmngr = MainMenu()->GetLoginMngr();
	R_ASSERT(lmngr);
	gamespy_gp::profile const * tmp_profile = lmngr->get_current_profile(); 
	R_ASSERT2(tmp_profile, "need first to log in");
	if (tmp_profile->online())
	{
		if (!MainMenu()->ValidateCDKey())
			return;

		if (!xr_strcmp(tmp_profile->unique_nick(), "@unregistered"))
		{
			if (m_connect_cb)
				m_connect_cb(ece_unique_nick_not_registred, "mp_gp_unique_nick_not_registred");
			return;
		}
		if (!xr_strcmp(tmp_profile->unique_nick(), "@expired"))
		{
			if (m_connect_cb)
				m_connect_cb(ece_unique_nick_expired, "mp_gp_unique_nick_has_expired");
			return;
		}
	}


	CUIListItemServer* item = smart_cast<CUIListItemServer*>(m_list[LST_SERVER].GetSelectedItem());
	if(!item)
		return;
	if (!browser().CheckDirectConnection(item->GetInfo()->info.Index))
	{
		Msg("! Direct connection to this server is not available -> its behind firewall");
		return;
	}

	if (xr_strcmp(item->GetInfo()->info.version, MainMenu()->GetGSVer()))
	{
		MainMenu()->SetErrorDialog(CMainMenu::ErrDifferentVersion);
		return;
	}


	if (item->GetInfo()->info.icons.pass || item->GetInfo()->info.icons.user_pass)
	{
		m_message_box->m_pMessageBox->SetUserPasswordMode	(item->GetInfo()->info.icons.user_pass);
		m_message_box->m_pMessageBox->SetPasswordMode		(item->GetInfo()->info.icons.pass);
		m_message_box->ShowDialog(true);
	}
	else
	{
		xr_string command;

		item->CreateConsoleCommand(command, m_playerName.c_str(), "", "" );

		Console->Execute(command.c_str());
	}
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:57,代码来源:ServerList.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ brush函数代码示例发布时间:2022-05-30
下一篇:
C++ browseHistory函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap