bool init() { // Create window Util::kill_other_stackies(); WNDCLASS wc = { 0 }; wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = window_proc; wc.hInstance = ::GetModuleHandle(0); wc.lpszClassName = STACKY_WINDOW_NAME; if (!::RegisterClass(&wc)) { return false; } window = ::CreateWindow(STACKY_WINDOW_NAME, STACKY_WINDOW_NAME, WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, 0, 0, ::GetModuleHandle(0), 0); ::SetWindowLongPtr(window, GWLP_USERDATA, (LONG_PTR)cache); // Create window HMENU menu = ::CreatePopupMenu(); cache->fixed_items = 1; add_item(menu, 0, WM_OPEN_TARGET_FOLDER, cache->items[0]); if (cache->was_rebuilt) { cache->fixed_items = 2; add_separator(menu, L"Stack cache rebuilt!"); } add_separator(menu, L""); for (size_t i = 1; i < cache->items.size(); i++) { Cache::Item& item = cache->items[i]; add_item(menu, (int)i + cache->fixed_items, WM_MENU_ITEM, item); } show(menu); return true; }
void TrackDialog::show(const Point& p_pos,int p_track) { clear(); t = (p_track==-1)?&editor->get_song()->get_global_track():editor->get_song()->get_track(p_track); ERR_FAIL_COND(!t); t_idx=p_track; bool track_is_mute=editor->get_song()->get_track(p_track); if (p_track!=-1) { add_check_item("Mute",ITEM_MUTE,t->is_mute()); add_item(get_skin()->get_bitmap(BITMAP_ICON_SOLO),"Solo",ITEM_SOLO); add_separator(); add_item(get_skin()->get_bitmap(BITMAP_ICON_COLUMN_ADD),"Add Column",ITEM_ADD_COLUMN); add_item(get_skin()->get_bitmap(BITMAP_ICON_COLUMN_REMOVE),"Remove Column",ITEM_REMOVE_COLUMN); add_separator(); } add_item(get_skin()->get_bitmap(BITMAP_ICON_AUTOMATION),"Automations..",ITEM_AUTOMATIONS); if (p_track!=-1) { add_separator(); add_item(get_skin()->get_bitmap(BITMAP_ICON_LEFT),"Move Left",ITEM_MOVE_TRACK_LEFT); add_item(get_skin()->get_bitmap(BITMAP_ICON_RIGHT),"Move Right",ITEM_MOVE_TRACK_RIGHT); add_separator(); add_item(get_skin()->get_bitmap(BITMAP_ICON_RENAME),"Rename",ITEM_RENAME); add_separator(); add_item(get_skin()->get_bitmap(BITMAP_ICON_REMOVE),"Remove",ITEM_REMOVE); } popup(p_pos); }
/* Build the menu */ void build_menu(TilemEmulatorWindow* ewin) { GtkActionGroup *acts; GtkAccelGroup *ag; GtkWidget *menu, *submenu; ewin->actions = acts = gtk_action_group_new("Emulator"); gtk_action_group_set_translation_domain(acts, GETTEXT_PACKAGE); gtk_action_group_add_actions(ewin->actions, main_action_ents, G_N_ELEMENTS(main_action_ents), ewin); ag = gtk_accel_group_new(); gtk_window_add_accel_group(GTK_WINDOW(ewin->window), ag); ewin->popup_menu = menu = gtk_menu_new(); add_item(menu, ag, acts, "send-file"); add_item(menu, ag, acts, "receive-file"); add_item(menu, ag, acts, "link-setup"); add_separator(menu); add_item(menu, ag, acts, "open-calc"); add_item(menu, ag, acts, "save-calc"); add_item(menu, ag, acts, "revert-calc"); add_item(menu, ag, acts, "reset-calc"); add_separator(menu); add_item(menu, ag, acts, "start-debugger"); submenu = add_submenu(menu, _("_Macro")); add_item(submenu, ag, acts, "begin-macro"); add_item(submenu, ag, acts, "end-macro"); add_item(submenu, ag, acts, "play-macro"); add_separator(submenu); add_item(submenu, ag, acts, "open-macro"); add_item(submenu, ag, acts, "save-macro"); add_item(menu, ag, acts, "screenshot"); add_item(menu, ag, acts, "quick-screenshot"); add_separator(menu); add_item(menu, ag, acts, "preferences"); add_separator(menu); add_item(menu, ag, acts, "about"); add_item(menu, ag, acts, "quit"); }
void OptionBox::set_in_window() { popup = GUI_NEW( PopUpMenu( get_window() ) ); popup->selected_id_signal.connect( this, &OptionBox::item_activated ); DeferredAdd *l=deferred_add_list; while (l) { if (l->is_sep) add_separator(); else if (l->bitmap<0) add_item( l->text, l->id,l->shortcut, l->shortcut_active ); else add_item( l->bitmap, l->text, l->id,l->shortcut, l->shortcut_active ); l=l->next; } clear_deferred_list(); }
void extract_cli_parser_c::init_parser() { add_information(YT("mkvextract <mode> <source-filename> [options] <extraction-spec>")); add_section_header(YT("Usage")); add_information(YT("mkvextract tracks <inname> [options] [TID1:out1 [TID2:out2 ...]]")); add_information(YT("mkvextract tags <inname> [options]")); add_information(YT("mkvextract attachments <inname> [options] [AID1:out1 [AID2:out2 ...]]")); add_information(YT("mkvextract chapters <inname> [options]")); add_information(YT("mkvextract cuesheet <inname> [options]")); add_information(YT("mkvextract timecodes_v2 <inname> [TID1:out1 [TID2:out2 ...]]")); add_information(YT("mkvextract <-h|-V>")); add_separator(); add_information(YT("The first word tells mkvextract what to extract. The second must be the source file. " "There are few global options that can be used with all modes. " "All other options depend on the mode.")); add_section_header(YT("Global options")); OPT("f|parse-fully", set_parse_fully, YT("Parse the whole file instead of relying on the index.")); add_common_options(); add_section_header(YT("Track extraction")); add_information(YT("The first mode extracts some tracks to external files.")); OPT("c=charset", set_charset, YT("Convert text subtitles to this charset (default: UTF-8).")); OPT("cuesheet", set_cuesheet, YT("Also try to extract the CUE sheet from the chapter information and tags for this track.")); OPT("blockadd=level", set_blockadd, YT("Keep only the BlockAdditions up to this level (default: keep all levels)")); OPT("raw", set_raw, YT("Extract the data to a raw file.")); OPT("fullraw", set_fullraw, YT("Extract the data to a raw file including the CodecPrivate as a header.")); add_informational_option("TID:out", YT("Write track with the ID TID to the file 'out'.")); add_section_header(YT("Example")); add_information(YT("mkvextract tracks \"a movie.mkv\" 2:audio.ogg -c ISO8859-1 3:subs.srt")); add_separator(); add_section_header(YT("Tag extraction")); add_information(YT("The second mode extracts the tags and converts them to XML. The output is written to the standard output. The output can be used as a source for mkvmerge.")); add_section_header(YT("Example")); add_information(YT("mkvextract tags \"a movie.mkv\" > movie_tags.xml")); add_section_header(YT("Attachment extraction")); add_information(YT("The third mode extracts attachments from the source file.")); add_informational_option("AID:outname", YT("Write the attachment with the ID 'AID' to 'outname'.")); add_section_header(YT("Example")); add_information(YT("mkvextract attachments \"a movie.mkv\" 4:cover.jpg")); add_section_header(YT("Chapter extraction")); add_information(YT("The fourth mode extracts the chapters and converts them to XML. The output is written to the standard output. The output can be used as a source for mkvmerge.")); OPT("s|simple", set_simple, YT("Exports the chapter information in the simple format used in OGM tools (CHAPTER01=... CHAPTER01NAME=...).")); add_section_header(YT("Example")); add_information(YT("mkvextract chapters \"a movie.mkv\" > movie_chapters.xml")); add_section_header(YT("CUE sheet extraction")); add_information(YT("The fifth mode tries to extract chapter information and tags and outputs them as a CUE sheet. This is the reverse of using a CUE sheet with " "mkvmerge's '--chapters' option.")); add_section_header(YT("Example")); add_information(YT("mkvextract cuesheet \"audiofile.mka\" > audiofile.cue")); add_section_header(YT("Timecode extraction")); add_information(YT("The sixth mode finds the timecodes of all blocks for a track and outputs a timecode v2 file with these timecodes.")); add_section_header(YT("Example")); add_information(YT("mkvextract timecodes_v2 \"a movie.mkv\" 1:timecodes_track1.txt")); add_hook(cli_parser_c::ht_unknown_option, std::bind(&extract_cli_parser_c::set_mode_or_extraction_spec, this)); }