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


C++ GuiWindow类代码示例

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


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

示例1: snprintf

int CustomPathsSM::ChangePath(char * SettingsPath, int SizeOfPath)
{
	char entered[300];
	snprintf(entered, sizeof(entered), SettingsPath);

	HaltGui();
	GuiWindow * parent = (GuiWindow *) parentElement;
	if(parent) parent->SetState(STATE_DISABLED);
	this->SetState(STATE_DEFAULT);
	this->Remove(optionBrowser);
	ResumeGui();

	int result = BrowseDevice(entered, sizeof(entered), FB_DEFAULT, noFILES);

	if(parent) parent->SetState(STATE_DEFAULT);
	this->Append(optionBrowser);

	if (result == 1)
	{
		if (entered[strlen(entered)-1] != '/')
			strcat(entered, "/");

		snprintf(SettingsPath, SizeOfPath, entered);
		WindowPrompt(tr( "Path Changed" ), 0, tr( "OK" ));
	}

	return result;
}
开发者ID:Jeremy-D-Miller,项目名称:usbloader-gui,代码行数:28,代码来源:CustomPathsSM.cpp

示例2: controller_and_keyboard_click

void OptionsMenu::controller_and_keyboard_click() {
    int vw = subsystem.get_view_width();
    int vh = subsystem.get_view_height();
    int ww = 335;
    int wh = 203;
    int bw = 140;

    GuiWindow *window = gui.push_window(vw / 2 - ww / 2, vh / 2- wh / 2, ww, wh, "Controller And Keyboard");
    window->set_cancelable(true);

    ck_up = create_field(window, 15, 15, "up:", static_capture_up_click, false);
    ck_down = create_field(window, 175, 15, "down:", static_capture_down_click, false);
    ck_left = create_field(window, 15, 35, "left:", static_capture_left_click, false);
    ck_right = create_field(window, 175, 35, "right:", static_capture_right_click, false);
    ck_jump = create_field(window, 15, 55, "jump:", static_capture_jump_click, false);
    ck_fire = create_field(window, 175, 55, "fire:", static_capture_fire_click, false);
    ck_drop1 = create_field(window, 15, 75, "grenade:", static_capture_drop1_click, false);
    ck_drop2 = create_field(window, 175, 75, "bomb:", static_capture_drop2_click, false);
    ck_drop3 = create_field(window, 15, 95, "frog:", static_capture_drop3_click, false);
    ck_chat = create_field(window, 175, 95, "chat:", static_capture_chat_click, false);
    ck_stats = create_field(window, 15, 115, "stats:", static_capture_stats_click, false);
    ck_escape = create_field(window, 175, 115, "esc:", static_capture_escape_click, false);
    ck_selected = 0;
    capture_draw();

    ck_dz_h = create_field(window, 15, 135, "dz horz.:", static_ck_erase_horz, true);
    ck_dz_h->set_text(config.get_string("deadzone_horizontal"));

    ck_dz_v = create_field(window, 175, 135, "dz vert.:", static_ck_erase_vert, true);
    ck_dz_v->set_text(config.get_string("deadzone_vertical"));

    bw = 55;
    gui.create_button(window, ww / 2 - bw / 2, wh - 43, bw, 18, "Close", static_close_capture_window_click, this);
    gui.create_button(window, Gui::Spc, wh - 43, 110, 18, "Rescan Joysticks", static_capture_rescan_click, this);
}
开发者ID:goatattack,项目名称:goatattack,代码行数:35,代码来源:OptionsMenu.cpp

示例3: graphics_and_sound_click

void OptionsMenu::graphics_and_sound_click() {
    int vw = subsystem.get_view_width();
    int vh = subsystem.get_view_height();
    int ww = 273;
    int wh = 184;
    int bw = 140;

    GuiWindow *window = gui.push_window(vw / 2 - ww / 2, vh / 2- wh / 2, ww, wh, "Graphics And Sound");
    window->set_cancelable(true);

    gui.create_checkbox(window, 15, 15, "fullscreen graphics mode", subsystem.is_fullscreen(), static_toggle_fullscreen_click, this);
    gui.create_checkbox(window, 15, 30, "draw scanlines", subsystem.has_scanlines(), static_toggle_scanlines_click, this);

    gui.create_label(window, 15, 45, "intensity:");
    gui.create_hscroll(window, 115, 46, 143, 25, 100, config.get_int("scanlines_intensity"), static_scanlines_intensity_changed, this);
    gui.create_box(window, 15, 66, ww - 30, 1);

    gui.create_label(window, 15, 75, "music volume:");
    gui.create_hscroll(window, 115, 76, 143, 0, 100, config.get_int("music_volume"), static_music_volume_changed, this);

    gui.create_label(window, 15, 90, "sfx volume:");
    gui.create_hscroll(window, 115, 91, 143, 0, 128, config.get_int("sfx_volume"), static_sfx_volume_changed, this);

    gui.create_box(window, 15, 111, ww - 30, 1);

    gui.create_label(window, 15, 120, "text fade speed:");
    gui.create_hscroll(window, 115, 121, 143, 5, 15, config.get_int("text_fade_speed"), static_text_fade_speed_changed, this);

    bw = 55;
    gui.create_button(window, ww / 2 - bw / 2, wh - 43, bw, 18, "Close", static_close_window_click, this);
}
开发者ID:goatattack,项目名称:goatattack,代码行数:31,代码来源:OptionsMenu.cpp

示例4: player_click

void OptionsMenu::player_click() {
    int vw = subsystem.get_view_width();
    int vh = subsystem.get_view_height();
    int ww = 287;
    int wh = 167;
    int bw = 140;

    subsystem.clear_input_buffer();
    GuiWindow *window = gui.push_window(vw / 2 - ww / 2, vh / 2- wh / 2, ww, wh, "Player");
    window->set_cancelable(true);

    gui.create_label(window, 15, 15, "player's name:");
    player_name = gui.create_textbox(window, 120, 15, 150, config.get_string("player_name"));
    show_player_name  = gui.create_checkbox(window, 15, 33, "show player's name", config.get_bool("show_player_name"), 0, 0);
    gui.create_label(window, 15, 53, "character:");
    player_skin = gui.create_listbox(window, 120, 56, 150, 60, "Character", static_player_skin_click, this);
    player_skin_pic = gui.create_picture(window, 15, 70, 0);

    Resources::ResourceObjects& sets = resources.get_charactersets();
    int sz = static_cast<int>(sets.size());
    for (int i = 0; i < sz; i++) {
        Characterset *cset = static_cast<Characterset *>(sets[i].object);
        player_skin->add_entry(cset->get_description());
        if (cset->get_name() == config.get_string("player_skin")) {
            player_skin->set_selected_index(i);
            player_skin_pic->set_picture(cset->get_tile(DirectionRight, CharacterAnimationStanding)->get_tilegraphic());
        }
    }

    player_name->set_focus();
    bw = 55;
    gui.create_button(window, ww / 2 - bw / 2, wh - 43, bw, 18, "Close", static_close_player_click, this);
}
开发者ID:goatattack,项目名称:goatattack,代码行数:33,代码来源:OptionsMenu.cpp

示例5: getPosition

SDL_Rect GuiWindow::getAbsolutePosition()
{
   SDL_Rect out = getPosition();

   for (GuiWindow* wnd = getParent(); wnd != NULL; wnd = wnd->getParent() )
   {
      SDL_AddRectPosition( out, wnd->getPosition() );
   }

   return out;
}
开发者ID:ghbenjamin,项目名称:NotPathfinder,代码行数:11,代码来源:GuiWindow.cpp

示例6: showSelectBrowser

void CustomPathsSM::showSelectBrowser(const char * enterPath, short Type)
{
	GuiWindow * parent = (GuiWindow *) parentElement;
	if(parent) parent->SetState(STATE_DISABLED);
	this->Remove(optionBrowser);
	
	selectBrowser(enterPath, Type);
	
	if(parent) parent->SetState(STATE_DEFAULT);
	this->Append(optionBrowser);
}
开发者ID:djskual,项目名称:savegame-manager-gx,代码行数:11,代码来源:CustomPathsSM.cpp

示例7: getAncestors

void GuiWindow::getAncestors(WindowList *captured)
{
   WindowList backward;

   for ( GuiWindow* curr = this; curr != NULL; curr = curr->getParent() )
   {
      backward.push_back(curr);
   }

   for ( auto it = backward.rbegin(); it != backward.rend(); it++ )
   {
      captured->push_back(*it);
   }
}
开发者ID:ghbenjamin,项目名称:NotPathfinder,代码行数:14,代码来源:GuiWindow.cpp

示例8: capture_key

void OptionsMenu::capture_key(GuiTextbox *ck_selected) {
    int vw = subsystem.get_view_width();
    int vh = subsystem.get_view_height();
    int ww = 200;
    int wh = 83;
    int bw = 140;

    this->ck_selected = ck_selected;

    GuiWindow *window = gui.push_window(vw / 2 - ww / 2, vh / 2- wh / 2, ww, wh, "Capturing");
    window->set_on_keydown(static_capture_keydown, this);
    window->set_on_joybuttondown(static_capture_joybuttondown, this);
    std::string text("Press key or use joystick...");
    Font *f = gui.get_font();
    int tw = f->get_text_width(text);
    int fh = f->get_font_height();
    gui.create_label(window, ww / 2 - tw / 2, window->get_client_height() / 2 - fh / 2 - 10, text);

    bw = 55;
    gui.create_button(window, ww / 2 - bw / 2, wh - 43, bw, 18, "Cancel", static_abort_capture_click, this);
}
开发者ID:goatattack,项目名称:goatattack,代码行数:21,代码来源:OptionsMenu.cpp

示例9: set_key

void Client::set_key(MappedKey::Device dev, int param) {
    set_key(dev, param, binding.left, PlayerKeyStateLeft);
    set_key(dev, param, binding.right, PlayerKeyStateRight);
    set_key(dev, param, binding.up, PlayerKeyStateUp);
    set_key(dev, param, binding.down, PlayerKeyStateDown);
    set_key(dev, param, binding.jump, PlayerKeyStateJump);
    set_key(dev, param, binding.fire, PlayerKeyStateFire);
    set_key(dev, param, binding.drop1, PlayerKeyStateDrop1);
    set_key(dev, param, binding.drop2, PlayerKeyStateDrop2);
    set_key(dev, param, binding.drop3, PlayerKeyStateDrop3);

    if (binding.chat.device == dev && binding.chat.param == param) {
        if (!get_stack_count()) {
            subsystem.clear_input_buffer();
            int vw = subsystem.get_view_width();
            int vh = subsystem.get_view_height();
            int ww = 350;
            int wh = 30;
            GuiWindow *window = push_window(1, 1, ww, wh, "Enter Message");
            window->set_on_keydown(static_window_keydown, this);
            window->set_on_joybuttondown(static_window_joybutton_down, this);
            ww = window->get_client_width();
            chat_textbox = create_textbox(window, Spc, Spc, ww - 2 * Spc, "");
            window->set_height(window->get_height() - window->get_client_height() + 2 * Spc + chat_textbox->get_height());
            window->set_x(vw / 2 - window->get_client_width() / 2);
            window->set_y(vh / 2 - window->get_client_height() / 2);
            chat_textbox->set_focus();
            if (me) {
                me->state.client_server_state.key_states = 0;
            }
        }
    }

    if (binding.stats.device == dev && binding.stats.param == param) {
        if (!get_stack_count()) {
            if (tournament) {
                tournament->show_stats(true);
            }
        }
    }

    if (binding.escape.device == dev && binding.escape.param == param) {
        show_options_menu();
    }
}
开发者ID:goatattack,项目名称:goatattack,代码行数:45,代码来源:Client.cpp

示例10: while

void Client::sevt_data(ServerEvent& evt) {
    GTransport *t = reinterpret_cast<GTransport *>(evt.data);

    while (true) {
        t->from_net();
        switch (t->cmd) {
            case GPCServerMessage:
            {
                size_t sz = 0;
                std::string msg(reinterpret_cast<char *>(t->data), t->len);
                std::vector<std::string> lines;
                while (true) {
                    sz++;
                    size_t pos = msg.find("|");
                    if (pos == std::string::npos) {
                        lines.push_back(msg);
                        break;
                    }
                    lines.push_back(msg.substr(0, pos));
                    msg = msg.substr(pos + 1);
                }
                int vw = subsystem.get_view_width();
                int vh = subsystem.get_view_height();
                int ww = 200;
                int wh = 130;
                int x = 10;
                int y = 10;
                GuiWindow *window = push_window(x, y, ww, wh, "Server Message");

                Font *f = get_font();
                int text_height = 0;
                int ly = Spc;
                int maxw = 0;
                for (size_t i = 0; i < sz; i++) {
                    create_label(window, Spc, ly, lines[i]);
                    ly += f->get_font_height();
                    text_height += f->get_font_height();
                    int tw = f->get_text_width(lines[i]) + 2 * Spc;
                    maxw = (tw > maxw ? tw : maxw);
                }
                int maxh = text_height + 2 * Spc;
                int bw = 46;
                int bh = 18;
                create_button(window, maxw / 2 - bw / 2, maxh, bw, bh, "Okay", static_window_close_click, this);
                maxh += bh + Spc;
                window->set_width(window->get_width() - window->get_client_width() + maxw);
                window->set_height(window->get_height() - window->get_client_height() + maxh);
                window->set_x(vw / 2 - window->get_width() / 2);
                window->set_y(vh / 2 - window->get_height() / 2);
                break;
            }

            case GPCMapState:
            {
                GTournament *tour = reinterpret_cast<GTournament *>(t->data);
                tour->from_net();
                if (tournament) {
                    delete tournament;
                }

                /* reload resources? */
                if (reload_resources) {
                    resources.reload_resources();
                    load_resources();
                    reload_resources = false;
                }

                /* setup tournament */
                bool warmup = ((tour->flags & TournamentFlagWarmup) != 0);
                GamePlayType type = static_cast<GamePlayType>(tour->gametype);
                MapConfiguration config(type, tour->map_name, tour->duration, tour->warmup);
                tournament = factory.create_tournament(config, false, warmup, players, 0);
                factory.set_tournament_id(tour->tournament_id);
                tournament->set_following_id(my_id);
                tournament->set_player_configuration(&player_config);
                tournament->set_team_names(team_red_name, team_blue_name);

                /* reopen, if join request window is already open */
                if (me && me->joining) {
                    tournament->reopen_join_window(me);
                }

                break;
            }

            case GPCIdentifyPlayer:
            {
                player_id_t *nid = reinterpret_cast<player_id_t *>(t->data);
                my_id = ntohs(*nid);
                if (tournament) {
                    tournament->set_following_id(my_id);
                }
                break;
            }

            case GPCReady:
            {
                if (tournament) {
                    tournament->set_ready();
                }
//.........这里部分代码省略.........
开发者ID:SuperNascher,项目名称:goatattack,代码行数:101,代码来源:ClientEvent.cpp

示例11: InitializeNativeWindowProperties

	void InitializeNativeWindowProperties()override
	{
		// remove all native windows features
		if(window->GetNativeWindow())
		{
			window->GetNativeWindow()->EnableCustomFrameMode();
		}
	}
开发者ID:qtx0213,项目名称:gac,代码行数:8,代码来源:Main.cpp

示例12: maximumButton_Clicked

	void maximumButton_Clicked(GuiGraphicsComposition* sender, GuiEventArgs& arguments)
	{
		if(window->GetNativeWindow()->GetSizeState()==INativeWindow::Restored)
		{
			window->GetNativeWindow()->ShowMaximized();
		}
		else
		{
			window->GetNativeWindow()->ShowRestored();
		}
	}
开发者ID:DaZhu,项目名称:gac,代码行数:11,代码来源:Main.cpp

示例13: closeButton_Clicked

	void closeButton_Clicked(GuiGraphicsComposition* sender, GuiEventArgs& arguments)
	{
		window->GetNativeWindow()->Hide();
	}
开发者ID:DaZhu,项目名称:gac,代码行数:4,代码来源:Main.cpp

示例14: minimumButton_Clicked

	void minimumButton_Clicked(GuiGraphicsComposition* sender, GuiEventArgs& arguments)
	{
		window->GetNativeWindow()->ShowMinimized();
	}
开发者ID:DaZhu,项目名称:gac,代码行数:4,代码来源:Main.cpp


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