Changeset - r19830:115afe4d0f91
[Not reviewed]
master
0 6 0
frosch - 11 years ago 2012-12-05 19:34:25
frosch@openttd.org
(svn r24785) -Add: Various methods to open the OSK. (based on patch by Eagle_rainbow)
6 files changed with 36 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -1329,12 +1329,18 @@ STR_CONFIG_SETTING_SCROLLWHEEL_SCROLLING
 
STR_CONFIG_SETTING_SCROLLWHEEL_SCROLLING_HELPTEXT               :Enable scrolling with two-dimensional mouse-wheels
 
STR_CONFIG_SETTING_SCROLLWHEEL_ZOOM                             :Zoom map
 
STR_CONFIG_SETTING_SCROLLWHEEL_SCROLL                           :Scroll map
 
STR_CONFIG_SETTING_SCROLLWHEEL_OFF                              :Off
 
STR_CONFIG_SETTING_SCROLLWHEEL_MULTIPLIER                       :Map scrollwheel speed: {STRING2}
 
STR_CONFIG_SETTING_SCROLLWHEEL_MULTIPLIER_HELPTEXT              :Control the sensitivity of mouse-wheel scrolling
 
STR_CONFIG_SETTING_OSK_ACTIVATION                               :On screen keyboard: {STRING2}
 
STR_CONFIG_SETTING_OSK_ACTIVATION_HELPTEXT                      :Select the method to open the on screen keyboard for entering text into editboxes only using the pointing device. This is meant for small devices without actual keyboard
 
STR_CONFIG_SETTING_OSK_ACTIVATION_DISABLED                      :Disabled
 
STR_CONFIG_SETTING_OSK_ACTIVATION_DOUBLE_CLICK                  :Double click
 
STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS            :Single click (when focussed)
 
STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK                  :Single click (immediately)
 

	
 
STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU                          :Right-click emulation: {STRING2}
 
STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_HELPTEXT                 :Select the method to emulate right mouse-button clicks
 
STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_COMMAND                  :Command+Click
 
STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_CONTROL                  :Ctrl+Click
 
STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_OFF                      :Off
src/misc_gui.cpp
Show inline comments
 
@@ -27,12 +27,21 @@
 
#include "newgrf_debug.h"
 

	
 
#include "widgets/misc_widget.h"
 

	
 
#include "table/strings.h"
 

	
 
/** Method to open the OSK. */
 
enum OskActivation {
 
	OSKA_DISABLED,           ///< The OSK shall not be activated at all.
 
	OSKA_DOUBLE_CLICK,       ///< Double click on the edit box opens OSK.
 
	OSKA_SINGLE_CLICK,       ///< Single click after focus click opens OSK.
 
	OSKA_IMMEDIATELY,        ///< Focussing click already opens OSK.
 
};
 

	
 

	
 
static const NWidgetPart _nested_land_info_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_LAND_AREA_INFORMATION_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_DEBUGBOX, COLOUR_GREY),
 
	EndContainer(),
 
@@ -832,14 +841,16 @@ void QueryString::ClickEditBox(Window *w
 
			w->HandleButtonClick(wid);
 
			w->OnEditboxChanged(wid);
 
		}
 
		return;
 
	}
 

	
 
	if (!focus_changed && w->window_class != WC_OSK) {
 
		/* Open the OSK window if clicked on an edit box, while not changing focus */
 
	if (w->window_class != WC_OSK && _settings_client.gui.osk_activation != OSKA_DISABLED &&
 
		(!focus_changed || _settings_client.gui.osk_activation == OSKA_IMMEDIATELY) &&
 
		(click_count == 2 || _settings_client.gui.osk_activation != OSKA_DOUBLE_CLICK)) {
 
		/* Open the OSK window */
 
		ShowOnScreenKeyboard(w, wid);
 
	}
 
}
 

	
 
/** Class for the string query window. */
 
struct QueryStringWindow : public Window
src/settings_gui.cpp
Show inline comments
 
@@ -1725,12 +1725,13 @@ static SettingEntry _settings_ui_interac
 
	SettingEntry("gui.left_mouse_btn_scrolling"),
 
	/* While the horizontal scrollwheel scrolling is written as general code, only
 
	 *  the cocoa (OSX) driver generates input for it.
 
	 *  Since it's also able to completely disable the scrollwheel will we display it on all platforms anyway */
 
	SettingEntry("gui.scrollwheel_scrolling"),
 
	SettingEntry("gui.scrollwheel_multiplier"),
 
	SettingEntry("gui.osk_activation"),
 
#ifdef __APPLE__
 
	/* We might need to emulate a right mouse button on mac */
 
	SettingEntry("gui.right_mouse_btn_emulation"),
 
#endif
 
};
 
/** Interaction sub-page */
src/settings_type.h
Show inline comments
 
@@ -114,12 +114,13 @@ struct GUISettings {
 
	bool   station_show_coverage;            ///< whether to highlight coverage area
 
	bool   persistent_buildingtools;         ///< keep the building tools active after usage
 
	bool   expenses_layout;                  ///< layout of expenses window
 
	uint32 last_newgrf_count;                ///< the numbers of NewGRFs we found during the last scan
 
	byte   missing_strings_threshold;        ///< the number of missing strings before showing the warning
 
	uint8  graph_line_thickness;             ///< the thickness of the lines in the various graph guis
 
	uint8  osk_activation;                   ///< Mouse gesture to trigger the OSK.
 

	
 
	uint16 console_backlog_timeout;          ///< the minimum amount of time items should be in the console backlog before they will be removed in ~3 seconds granularity.
 
	uint16 console_backlog_length;           ///< the minimum amount of items in the console backlog before items will be removed.
 
#ifdef ENABLE_NETWORK
 
	uint16 network_chat_box_width;           ///< width of the chat box in pixels
 
	uint8  network_chat_box_height;          ///< height of the chat box in lines
src/table/gameopt_settings.ini
Show inline comments
 
@@ -19,12 +19,13 @@ static const char *_climates = "temperat
 
static const char *_autosave_interval = "off|monthly|quarterly|half year|yearly";
 
static const char *_roadsides = "left|right";
 
static const char *_savegame_date = "long|short|iso";
 
#ifdef ENABLE_NETWORK
 
static const char *_server_langs = "ANY|ENGLISH|GERMAN|FRENCH|BRAZILIAN|BULGARIAN|CHINESE|CZECH|DANISH|DUTCH|ESPERANTO|FINNISH|HUNGARIAN|ICELANDIC|ITALIAN|JAPANESE|KOREAN|LITHUANIAN|NORWEGIAN|POLISH|PORTUGUESE|ROMANIAN|RUSSIAN|SLOVAK|SLOVENIAN|SPANISH|SWEDISH|TURKISH|UKRAINIAN|AFRIKAANS|CROATIAN|CATALAN|ESTONIAN|GALICIAN|GREEK|LATVIAN";
 
#endif /* ENABLE_NETWORK */
 
static const char *_osk_activation = "disabled|double|single|immediately";
 

	
 
static const SettingDesc _gameopt_settings[] = {
 
	/* In version 4 a new difficulty setting has been added to the difficulty settings,
 
	 * town attitude towards demolishing. Needs special handling because some dimwit thought
 
	 * it funny to have the GameDifficulty struct be an array while it is a struct of
 
	 * same-sized members
src/table/settings.ini
Show inline comments
 
@@ -2321,12 +2321,26 @@ def      = 2
 
min      = 1
 
max      = 5
 
str      = STR_CONFIG_SETTING_HOVER_DELAY
 
strhelp  = STR_CONFIG_SETTING_HOVER_DELAY_HELPTEXT
 
strval   = STR_CONFIG_SETTING_HOVER_DELAY_VALUE
 

	
 
[SDTC_OMANY]
 
var      = gui.osk_activation
 
type     = SLE_UINT8
 
flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
 
str      = STR_CONFIG_SETTING_OSK_ACTIVATION
 
strhelp  = STR_CONFIG_SETTING_OSK_ACTIVATION_HELPTEXT
 
strval   = STR_CONFIG_SETTING_OSK_ACTIVATION_DISABLED
 
guiflags = SGF_MULTISTRING
 
full     = _osk_activation
 
def      = 1
 
min      = 0
 
max      = 3
 
cat      = SC_BASIC
 

	
 
[SDTC_VAR]
 
var      = gui.toolbar_pos
 
type     = SLE_UINT8
 
flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
 
guiflags = SGF_MULTISTRING
 
def      = 1
0 comments (0 inline, 0 general)