void ConfigDisplay(TXT_UNCAST_ARG(widget), void *user_data) { txt_window_t *window; txt_table_t *sizes_table; txt_window_action_t *advanced_button; // Open the window window = TXT_NewWindow("Display Configuration"); TXT_SetWindowHelpURL(window, WINDOW_HELP_URL); // Build window: TXT_AddWidgets(window, TXT_NewCheckBox("Full screen", &fullscreen), TXT_NewConditional(&fullscreen, 0, sizes_table = TXT_NewTable(3)), NULL); TXT_SetColumnWidths(window, 42); // The window is set at a fixed vertical position. This keeps // the top of the window stationary when switching between // fullscreen and windowed mode (which causes the window's // height to change). TXT_SetWindowPosition(window, TXT_HORIZ_CENTER, TXT_VERT_TOP, TXT_SCREEN_W / 2, 6); GenerateSizesTable(NULL, sizes_table); // Button to open "advanced" window. // Need to pass a pointer to the window sizes table, as some of the options // in there trigger a rebuild of it. advanced_button = TXT_NewWindowAction('a', "Advanced"); TXT_SetWindowAction(window, TXT_HORIZ_CENTER, advanced_button); TXT_SignalConnect(advanced_button, "pressed", AdvancedDisplayConfig, sizes_table); }
void ConfigSound(TXT_UNCAST_ARG(widget), void *user_data) { txt_window_t *window; txt_window_action_t *music_action; // Build the window window = TXT_NewWindow("Sound configuration"); TXT_SetWindowHelpURL(window, WINDOW_HELP_URL); TXT_SetColumnWidths(window, 40); TXT_SetWindowPosition(window, TXT_HORIZ_CENTER, TXT_VERT_TOP, TXT_SCREEN_W / 2, 3); music_action = TXT_NewWindowAction('m', "Music Packs"); TXT_SetWindowAction(window, TXT_HORIZ_CENTER, music_action); TXT_SignalConnect(music_action, "pressed", OpenMusicPackDir, NULL); TXT_AddWidgets(window, TXT_NewSeparator("Sound effects"), TXT_NewRadioButton("Disabled", &snd_sfxdevice, SNDDEVICE_NONE), TXT_If(gamemission == doom, TXT_NewRadioButton("PC speaker effects", &snd_sfxdevice, SNDDEVICE_PCSPEAKER)), TXT_NewRadioButton("Digital sound effects", &snd_sfxdevice, SNDDEVICE_SB), TXT_If(gamemission == doom || gamemission == heretic || gamemission == hexen, TXT_NewConditional(&snd_sfxdevice, SNDDEVICE_SB, TXT_NewHorizBox( TXT_NewStrut(4, 0), TXT_NewCheckBox("Pitch-shifted sounds", &snd_pitchshift), NULL))), TXT_If(gamemission == strife, TXT_NewConditional(&snd_sfxdevice, SNDDEVICE_SB, TXT_NewHorizBox( TXT_NewStrut(4, 0), TXT_NewCheckBox("Show text with voices", &show_talk), NULL))), TXT_NewSeparator("Music"), TXT_NewRadioButton("Disabled", &snd_musicdevice, SNDDEVICE_NONE), TXT_NewRadioButton("OPL (Adlib/Soundblaster)", &snd_musicdevice, SNDDEVICE_SB), TXT_NewConditional(&snd_musicdevice, SNDDEVICE_SB, TXT_NewHorizBox( TXT_NewStrut(4, 0), TXT_NewLabel("Chip type: "), OPLTypeSelector(), NULL)), TXT_NewRadioButton("GUS (emulated)", &snd_musicdevice, SNDDEVICE_GUS), TXT_NewConditional(&snd_musicdevice, SNDDEVICE_GUS, TXT_MakeTable(2, TXT_NewStrut(4, 0), TXT_NewLabel("Path to patch files: "), TXT_NewStrut(4, 0), TXT_NewFileSelector(&gus_patch_path, 34, "Select directory containing GUS patches", TXT_DIRECTORY), NULL)), TXT_NewRadioButton("Native MIDI", &snd_musicdevice, SNDDEVICE_GENMIDI), TXT_NewConditional(&snd_musicdevice, SNDDEVICE_GENMIDI, TXT_MakeTable(2, TXT_NewStrut(4, 0), TXT_NewLabel("Timidity configuration file: "), TXT_NewStrut(4, 0), TXT_NewFileSelector(&timidity_cfg_path, 34, "Select Timidity config file", cfg_extension), NULL)), NULL); }