summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/ui/sliders.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Initial touch input support: Vas Crabb14 days1-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Feed mouse/pen/touch pointer events through UI input manager with Win32 and SDL. * Started migrating UI code to use new API and reworking mouse/touch interaction. * emu/render.cpp: Support pressing multiple clickable layout items simultaneously. * emu/render.cpp: Allow UI elements to be drawn in any window. * emu/rendlay.cpp, luaengine_render.cpp: Added layout view events for pointer input. * ui/ui.cpp: Allow the UI handler to control pointer display. * ui/analogipt.cpp: Added mouse/touch and more keys for navigating field state list. * ui/menu.cpp: Use vertical swipe to scroll and horizontal swipe to adjust. * ui/menu.cpp: Draw after processing input - greatly improves responsiveness. * ui/menu.cpp: Ignore keyboard/gamepad input during pointer actions. * ui/selmenu.cpp: Made left/right info pane arrows repeat when held. * ui/selmenu.cpp: Use middle click to move keyboard focus. * ui/selmenu.cpp: Let filter list scroll if it's too tall, and use a bit of horizontal padding. * ui/selmenu.cpp: Improved divider sizing. * ui/state.cpp: Don't allow clicks to pass through the confirm deletion prompt to the menu. * ui/simpleselgame.cpp: Fixed error message display and graphics/sound status not showing. * ui/simpleselgame.cpp: Allow tap/click to dismiss error message. * ui/utils.cpp: Show UI for choice filters when there are no choices - it's less confusing. * modules/input/input_sdl.cpp: Made scaling for mouse scroll better match RawInput and DirectInput. * modules/input/input_rawinput.cpp: Added support for horizontal scroll axis. * modules/input/input_win32.cpp: Added support for scroll axes and more buttons to mouse/lightgun. * modules/debugger/debugimgui.cpp: Don't fight over events with the UI manager - it breaks menus. * osd/windows/window.cpp: Translate mouse position to window cooridinates for scroll wheel events. * osd/sdl/window.cpp: Supply last mouse position for scroll wheel events if possible. * scripts/build/complay.py: Made zero input mask an error - it was only being used to block clicks.
* Update accumulating relative inputs exactly once per frame. Vas Crabb2023-02-241-93/+109
| | | | | | | | | | | | | This fixes "amplification" effects that would happen if the frame rate rose above 100 Hz (whether by unthrottling or otherwise). Synchronise with wall clock any time inputs are read. Not doing this has weird effects on relative inputs with frame skipping and contributes to unresponsiveness of menus. Reduce visual latency for mouse movement on menus when paused or skipping frames. The rest of the code changes to menus won't provide benefits until draw can happen after event handling.
* Input refactoring: Vas Crabb2023-02-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | osd/modules/input, emu/inpttype.cpp: Made most default joystick assignments supplied by input modules. Input modules take available controls into consideration when generating default assignments. emu/inpttype.ipp: Added a separate "Back" UI input separate from Cancel. You may want an easier to hit combination for moving to the previous menu than for exiting or cancelling input. They both default to Escape. emu/inpttype.ipp: Added a UI Help control. Currently only used by analog inputs menu emu/inpttype.h: Moved I/O port field type enum to its own header and sorted UI controls so they appear in a more logical order. ui: Don't use UI Select to restore defaults - people should be getting used to the UI Clear input by now. UI Select cycles multi-value items instead. ui/inputmap.cpp: Don't use immediate cancel to cycle between clearing and restoring default assignment (use UI Clear instead). osd: Reduced the number of files needing to include the dreaded emu.h. Got some implementation out of headers.
* -osd: Better XInput and SDL game controller input enhancements: Vas Crabb2023-01-121-2/+12
| | | | | | | | | | | | | | | * Added initial support for XInput controller subtypes, starting with driving, arcade and flight controllers. * Check XInput capabilities to ignore buttons and hats that aren't present. * Added preliminary SDL Game Controller joystick provider. Reconnection and mixed Game Controller/Joystick devices are unsupported. * Show the input token for the highlighted control on input device menus. -ui: Allow menus to set required space above and below menu when metrics change. Fixes the initial bad layout on the system selecton menu, or bad layout after resizing windows.
* ui: Give menus an opportunity to recompute metrics on window resize. Vas Crabb2023-01-041-16/+15
| | | | | | | | | | | | | | | Also reworked calculation of menu geometry in general, and limited width of left panel on system/software selection menus. Fixes images in the right panel and icons on the system/software selection menus not being scaled correctly when the window is resized (MT08539 is an example of this). Fixes bad font size selection at low resolutions when using bitmap fonts like uismall.bdf (GitHub #7105). Fixes collapse/expand arrows on left/right panels of system/softwre selection menus getting bigger if the window is made narrower.
* ui, docs: Added menus to fill a couple of gaps, improved consistency. (#9915) Vas Crabb2022-06-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added menus for controlling toggle inputs, and showing recognised input devices and control state. Moved input menu options off main menu to a submenu, as there are a lot of them now. Moved menu heading drawing into base class, added headings to more menus, and made headings more consistent with the menu items used to reach them. Also made terminology more consistent. Changed the default names for buttons and hat switches/D-pads to use 1-based numbering. DirectInput still returns 0-based button numbers for some devices. Removed local copy of MinGW xaudio2.h as it’s now included in the MSYS2 package. Also fixed building the DirectSound sound output module with the SDL OSD on Windows - the Windows headers are sensitive to include order. Started adding documentation for menus, to hopefully help people find menus they remember seeing but can't recall how to access. For translators, this makes terminology more consistent. In particular: * "Settings" is preferred over "configuration" in a number of places, as the latter can be construed as referring specifically to settings stored in .cfg files in the cfg_directory folder. Also, references to saving machine configuration could be interpreted as relating to the settings on the "Machine Configuration" menu. * The controls on host input devices (e.g. keys, buttons, joystick axes) are referred to as "controls", while emulated inputs are referred to as "inputs". * The menus for assigning host controls to emulated inputs are called "input assignments" menus to distinguish them from other input settings menus. * Combinations of controls that can be assigned to emulated inputs are referred to as "combinations" rather than "sequences". * The potentially confusing term "ROM set" has been removed altogether. Use "short name" to refer to a device or system's identifier. * "System" is used in almost places to refer to a complete, runnable system rather than "Machine". * "Driver" is now only used to refer to source files where systems or devices are defined - it is no longer used to refer to individual systems. * A few more menus have message context for the messages. This makes it a bit easier to guess where the messages are used. It also means you can use different translations in different places if necessary (e.g. if the same English text should be translated differently as an item in one menu and as a heading in another).
* frontend: Various minor improvements. Vas Crabb2021-11-141-4/+43
| | | | | | | | | | | | | | | | | | | Made a few more menus reset values to the default in response to the UI clear input. Made the minimum info text size less unreasonable, and fixed a locale issue in the font/size selection menu when parsing option strings. Made the keyboard mode menu toggle items on double click or UI select. Made the menuless sliders menu remember the last slider shown (this probably broke when sliders were moved out of the UI manager itself). Made a few menus just update the highlighted options when it's adjusted rather than unnecessarily rebuilding the menu. Made a few more menus reset on being reactivated to cope with scripts or other things changing stuff out from under them.
* -osd/windows: Fixed stupid potential deadlock on exit. Vas Crabb2021-11-131-4/+4
| | | | | -frontend: Some changes to menu item class that will make it possbile to reduce the number of menu rebuilds.
* Fix various usability issues: Vas Crabb2021-11-021-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | frontend: Made it so you can press UI On Screen Display to hide the Analog Controls menu and see the response to your inputs without the risk of changing settings, and see more axes at once and scroll them for systems with very large number of axes. Also ensure the axis being configured is visible when the menu is visible, and made the menu behave a bit more like the system input assignments menu (including previous/next group navigation). frontend: Allow Lua to draw to the UI container - this addresses the main complaint in #7475. Note that drawing to the UI container will draw over any UI elements, including menus. Plugins can check menu_active to avoid drawing over menus. Also removed some unnecessary use of sol::overload. frontend: Improved info/image box navigation on the system/softwre selection menus, and cleaned up some leftover code that came from the copy/pasted event handling functions. frontend: Fixed sliders menu not handling Alt+Shift as intended (thanks Coverity). Fixed a couple of harmless Coverity errors, too. emu/inpttype.ipp: Made the default assignment for Save State recognise right shift. plugins: Added next/previous group navigation to input macro edit menu. docs: Added basic description of the system and software selection menus, and corrected a couple of errors in the Lua reference.
* -frontend: Refactored menu event handling and fixed a number of issues. (#8777) Vas Crabb2021-10-311-42/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Moved common code for drawing about box, info viewer, and other text box menus to a base class; removed the last of the info viewer logic and the multi-line item hack from the base menu class. * Added previous/next group navigation for general inputs and plugin input selection menus. * Moved message catalog logic to lib/util, allowing osd and emu to use localised messages. * Made the base menu class use the UI manager’s feature for holding session state rather than a static map and mutex. * Improved menu event handling model, and fixed many issues, particularly with menus behaving badly when hidden/shown. * Added better support for menus that don’t participate in the usual menu stack, like the menuless sliders and the save/load state menus. * Made a number of menus refresh state when being shown after being hidden (fixes MT08121 among other issues). * Fixed indication of mounted slot option in the slot option details menu. * Improved appearance of background menus when emulation isn't running - draw all menus in the stack, and darken the background menus to make the edges of the active menu clearer. * Fixed locale issues in -listxml. -debugger: Made GUI debuggers more uniform. * Added new memory view features to Win32 debugger. * Fixed spelling of hexadecimal in Cocoa debugger and added decimal address option. * Fixed duplicate keyboard shortcut in Cocoa debugger (Shift-Cmd-D was both new device window and 64-bit float format). * Made keyboard shortcuts slightly more consistent across debuggers. -plugins: Moved input selection menu and sequence polling code to a common library. Fixed the issue that prevented keyboard inputs being mapped with -steadykey on. -docs: Started adding some documentation for MAME's internal UI, and updated the list of example front-ends. -Regenerated message catalog sources. For translators, the new strings are mostly: * The names of the inputs provided by the OS-dependent layer for things like fullscreen and video features. These show up in the user interface inputs menu. * The names for automatically generated views. These show up in the video options menu - test with a system with a lot of screens to see more variants. * The input macro plugin UI. * A few format strings for analog input assignments. * A few strings for the about box header.
* frontend: Cleaned up rendering of info views. Vas Crabb2021-10-171-7/+17
| | | | | | | | | | | | | | | | | | | | | | Put the description for systems in the info box - it's useful for the fruit machines with very long names that are truncated in the list. Also stopped truncating manufactuer and parent name in the info box. Made the text layout class capable of handling lines containing combinatations of left/centre/right-justified text and got rid of the legacy UI manager text wrapping function. Made the system/software selection menus and the info viewer share the same code for formatting info text. This means the multi-column layout works properly in the info viewer now, and the code is a lot simpler. Also the system/software selection menus don't have to redo the text layout every frame now. Made the info viewer update the text layout if the output aspect ratio changes, and cleaned up more legacy code. The lines in the info viewer are no longer bogus "menu items", and there's a lot less special-case code to support it in the base menu class. This commit includes an update to the Chinese translations from YuiFAN.
* ui: Clean up slider callbacks AJR2021-01-271-5/+8
|
* C++17 string handling updates (without charconv so as not to break GCC 7) AJR2020-12-081-2/+2
| | | | | | - render.cpp, rendlay.cpp, ui/ui.cpp, ui/menu.cpp: Change argument types for text processing functions from const char * to std::string_view - ui/menu.cpp: Add overloads of item_append omitting the frequently empty subtext argument - cheat.cpp: Remove some c_str() calls that became unnecessary a while ago
* fixed some clang-tidy warnings (nw) (#6197) Oliver Stöneberg2020-01-221-2/+2
| | | | | | | | | | | | | | * fixed some bugprone-throw-keyword-missing clang-tidy warnings (nw) * fixed some modernize-use-nullptr clang-tidy warnings (nw) * fixed some readability-delete-null-pointer clang-tidy warnings (nw) * fixed some performance-faster-string-find clang-tidy warnings (nw) * fixed some performance-for-range-copy clang-tidy warnings (nw) * fixed some readability-redundant-string-cstr clang-tidy warnings (nw)
* UI updates: Vas Crabb2019-11-221-6/+7
| | | | | | | * Re-wrote localisation loader: sanitise input, check for buffer overruns, fix endianness handling, keep data in a single allocated block, do a single hash lookup when fetching a string, print diagnostic output when things go wrong * Sort UI language menu so it's not in whatever random order the filesystem yields * Fixed most menu code to adjust L/R border for UI aspect ratio and pass container to render manager when getting UI aspect ratio * Converted a couple more things to use smart pointers
* sliders.cpp: Support PORT_CONDITION for PORT_ADJUSTER [Couriersud] couriersud2019-11-201-7/+13
| | | | | | | | PORT_CONDITION can now enabled/disabled the display of PORT_ADJUSTER sliders in the UI, i.e. PORT_START("SOMEPORT") PORT_ADJUSTER(...) PORT_CONDITION("OTHERPORT", ...)
* srcclean (nw) Vas Crabb2019-07-281-1/+1
|
* Refactored UI font metrics (#5291) npwoods2019-06-301-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Changed the various usages of UI_*COLOR to be calls to src/frontend/mame/ui/moptions.h The various UI_*COLOR macros were implemented as calls to decode_ui_color, which cached the values for the various options in a static array, which was obviously a gross hack. This refactoring is strategic because I am trying to confine awareness of mame_ui_manager to code in src/frontend/mame/ui, and the implementation of decode_ui_color() relied on the ability to access mame_ui_manager as a singleton from outside this code. * Created a ui_colors object, so that queries for UI RGB values would not always require parsing strings * Replaced UI_TARGET_FONT_[ROWS|HEIGHT] and UI_BOX_[LR|TD]_BORDER macros with property calls These macros were implemented with a call to a function (get_font_rows()) that opportunistically stashed the results of option accesses in static variables; in other words, a gross hack Because get_font_rows() attempted to access mame_ui_manager as a singleton, it was an obstactle to providing an alternative implementation of ui_manager * Remove stray debugging cruft that found a way into the other PR
* Changed the various usages of UI_*COLOR to be calls to ↵ npwoods2019-06-281-7/+7
| | | | | | | | | | | | | | | | | | | | | | | src/frontend/mame/ui/moptions.h (#5282) * Changed the various usages of UI_*COLOR to be calls to src/frontend/mame/ui/moptions.h The various UI_*COLOR macros were implemented as calls to decode_ui_color, which cached the values for the various options in a static array, which was obviously a gross hack. This refactoring is strategic because I am trying to confine awareness of mame_ui_manager to code in src/frontend/mame/ui, and the implementation of decode_ui_color() relied on the ability to access mame_ui_manager as a singleton from outside this code. * Created a ui_colors object, so that queries for UI RGB values would not always require parsing strings * Converted a few more options().zyx_color() to colors().zyx_color() * A few more misses from earlier
* ui/menu.cpp: Provide more helpers (nw) AJR2019-05-221-4/+14
|
* ui/menu.cpp: Privatize a few variables (nw) AJR2019-05-221-2/+2
|
* Encapsulate a bit more of the menu base class to control when layout changes ↵ Vas Crabb2016-11-231-1/+1
| | | | can happen
* Improvements to rgb_t (nw) AJR2016-10-221-1/+1
| | | | | | | - Make most class methods constexpr - Make color constants (white, black, etc.) into constexpr factory methods, in order to fix a static initialization problem discussed on the MAMEWorld forums. (Note that while C++14 allows constexpr member variables to be initialized outside classes, current compilers' support for C++14 constexpr rules has proven to be lamentably deficient.) - Create bitmap_rgb32::erase to simplify syntax in update handlers
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-10/+10
| | | | | Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
* UI refactoring: [Vas Crabb] Vas Crabb2016-07-101-10/+10
| | | | | | | | | * std::bind - accept no substitutes * pointer -> reference conversion * make more menu members private or protected * don't play so fast and loose with integer types * reduce some vector copying * make more static constants const
* UI code refactoring: [Vas Crabb] Vas Crabb2016-07-101-3/+3
| | | | | | * Split out main menu and dat box drawing from base class * Make a bunch of class statics proper per-machine persistent objects * Object lifecycle fixes
* Reduced usage of c_str() when used with menu::item_append() Nathan Woods2016-06-301-2/+2
|
* Cleanup and version bumpmame0175 Miodrag Milanovic2016-06-291-9/+8
|
* Use ui::text_layout::text_layout and ui::text_layout::word_wrapping enums Nathan Woods2016-06-181-2/+2
|
* Changed to C++ comments Nathan Woods2016-06-061-42/+42
|
* Fixed issue with volume slider likely introduced with ui handler lambda changes Nathan Woods2016-06-061-5/+5
|
* Added template implementations of mame_ui_manager::set_handler(), and ↵ Nathan Woods2016-06-041-2/+2
| | | | changed call sites
* More slider cleanup, nw therealmogminer@gmail.com2016-05-281-5/+5
|
* ui refactoring [Vas Crabb] Vas Crabb2016-05-271-30/+34
| | | | | | | * move menu classes into ::ui namesapce * reduce scope of many symbols (first step in making UI code less rage-inducing so I can fix text input)
* Move slider_state and ui_menu_item into src/frontend/mame, nw therealmogminer@gmail.com2016-05-161-1/+1
|
* Merge remote-tracking branch 'upstream/master' into mui AJR2016-04-271-30/+30
|\
| * Cleanups and version bumpmame0173 Miodrag Milanovic2016-04-271-30/+30
| |
* | Relieve UI menus and such from having to constantly fetch UI object from ↵ AJR2016-04-261-12/+12
|/ | | | global state (nw)
* Various cleanups suggested by static analyzer (nw) Miodrag Milanovic2016-04-241-1/+0
|
* Split UI and frontend part from core [Miodrag Milanovic] Miodrag Milanovic2016-04-231-0/+283