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
 
@@ -1323,24 +1323,30 @@ STR_CONFIG_SETTING_LIVERIES_HELPTEXT    
 
STR_CONFIG_SETTING_LIVERIES_NONE                                :None
 
STR_CONFIG_SETTING_LIVERIES_OWN                                 :Own company
 
STR_CONFIG_SETTING_LIVERIES_ALL                                 :All companies
 
STR_CONFIG_SETTING_PREFER_TEAMCHAT                              :Prefer team chat with <ENTER>: {STRING2}
 
STR_CONFIG_SETTING_PREFER_TEAMCHAT_HELPTEXT                     :Switch the binding of company-internal and public chat to <ENTER> resp. <Ctrl+ENTER>
 
STR_CONFIG_SETTING_SCROLLWHEEL_SCROLLING                        :Function of scrollwheel: {STRING2}
 
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
 

	
 
STR_CONFIG_SETTING_LEFT_MOUSE_BTN_SCROLLING                     :Left-click scrolling: {STRING2}
 
STR_CONFIG_SETTING_LEFT_MOUSE_BTN_SCROLLING_HELPTEXT            :Enable scrolling the map by dragging it with the left mouse button. This is especially useful when using a touch-screen for scrolling
 

	
 
STR_CONFIG_SETTING_DATE_FORMAT_IN_SAVE_NAMES                    :Use the {STRING2} date format for savegame names
 
STR_CONFIG_SETTING_DATE_FORMAT_IN_SAVE_NAMES_HELPTEXT           :Format of the date in save game filenames
src/misc_gui.cpp
Show inline comments
 
@@ -21,24 +21,33 @@
 
#include "company_base.h"
 
#include "texteff.hpp"
 
#include "strings_func.h"
 
#include "window_func.h"
 
#include "querystring_gui.h"
 
#include "core/geometry_func.hpp"
 
#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(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, WID_LI_BACKGROUND), EndContainer(),
 
};
 

	
 
static const WindowDesc _land_info_desc(
 
	WDP_AUTO, 0, 0,
 
	WC_LAND_INFO, WC_NONE,
 
@@ -826,26 +835,28 @@ void QueryString::ClickEditBox(Window *w
 

	
 
	int clearbtn_left  = wi->pos_x + (rtl ? 0 : wi->current_x - clearbtn_width);
 

	
 
	if (IsInsideBS(pt.x, clearbtn_left, clearbtn_width)) {
 
		if (this->text.bytes > 1) {
 
			this->text.DeleteAll();
 
			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
 
{
 
	QueryString editbox;    ///< Editbox.
 
	QueryStringFlags flags; ///< Flags controlling behaviour of the window.
 

	
 
	QueryStringWindow(StringID str, StringID caption, uint max_bytes, uint max_chars, const WindowDesc *desc, Window *parent, CharSetFilter afilter, QueryStringFlags flags) :
 
			editbox(max_bytes, max_chars)
src/settings_gui.cpp
Show inline comments
 
@@ -1719,24 +1719,25 @@ static SettingEntry _settings_ui_interac
 
	SettingEntry("gui.window_soft_limit"),
 
	SettingEntry("gui.link_terraform_toolbar"),
 
	SettingEntry("gui.prefer_teamchat"),
 
	SettingEntry("gui.auto_scrolling"),
 
	SettingEntry("gui.reverse_scroll"),
 
	SettingEntry("gui.smooth_scroll"),
 
	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 */
 
static SettingsPage _settings_ui_interaction_page = {_settings_ui_interaction, lengthof(_settings_ui_interaction)};
 

	
 
static SettingEntry _settings_ui[] = {
 
	SettingEntry(&_settings_ui_display_page, STR_CONFIG_SETTING_DISPLAY_OPTIONS),
 
	SettingEntry(&_settings_ui_interaction_page, STR_CONFIG_SETTING_INTERACTION),
 
	SettingEntry("gui.show_finances"),
src/settings_type.h
Show inline comments
 
@@ -108,24 +108,25 @@ struct GUISettings {
 
	bool   show_track_reservation;           ///< highlight reserved tracks.
 
	uint8  default_signal_type;              ///< the signal type to build by default.
 
	uint8  cycle_signal_types;               ///< what signal types to cycle with the build signal tool.
 
	byte   station_numtracks;                ///< the number of platforms to default on for rail stations
 
	byte   station_platlength;               ///< the platform length, in tiles, for rail stations
 
	bool   station_dragdrop;                 ///< whether drag and drop is enabled for stations
 
	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
 
	uint16 network_chat_timeout;             ///< timeout of chat messages in seconds
 
#endif
 

	
 
	uint8  developer;                        ///< print non-fatal warnings in console (>= 1), copy debug output to console (== 2)
 
	bool   show_date_in_logs;                ///< whether to show dates in console logs
 
	bool   newgrf_developer_tools;           ///< activate NewGRF developer tools and allow modifying NewGRFs in an existing game
src/table/gameopt_settings.ini
Show inline comments
 
@@ -13,24 +13,25 @@ static uint16 _old_diff_custom[GAME_DIFF
 
/* Most of these strings are used both for gameopt-backward compatability
 
 * and the settings tables. The rest is here for consistency. */
 
static const char *_locale_currencies = "GBP|USD|EUR|YEN|ATS|BEF|CHF|CZK|DEM|DKK|ESP|FIM|FRF|GRD|HUF|ISK|ITL|NLG|NOK|PLN|RON|RUR|SIT|SEK|YTL|SKK|BRL|EEK|custom";
 
static const char *_locale_units = "imperial|metric|si";
 
static const char *_town_names = "english|french|german|american|latin|silly|swedish|dutch|finnish|polish|slovak|norwegian|hungarian|austrian|romanian|czech|swiss|danish|turkish|italian|catalan";
 
static const char *_climates = "temperate|arctic|tropic|toyland";
 
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
 
	 * XXX - To save file-space and since values are never bigger than about 10? only
 
	 * save the first 16 bits in the savegame. Question is why the values are still int32
 
	 * and why not byte for example?
 
	 * 'SLE_FILE_I16 | SLE_VAR_U16' in "diff_custom" is needed to get around SlArray() hack
 
	 * for savegames version 0 - though it is an array, it has to go through the byteswap process */
 
[post-amble]
src/table/settings.ini
Show inline comments
 
@@ -2315,24 +2315,38 @@ strval   = STR_CONFIG_SETTING_ERRMSG_DUR
 
[SDTC_VAR]
 
var      = gui.hover_delay
 
type     = SLE_UINT8
 
flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
 
guiflags = SGF_0ISDISABLED
 
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
 
min      = 0
 
max      = 2
 
str      = STR_CONFIG_SETTING_TOOLBAR_POS
 
strhelp  = STR_CONFIG_SETTING_TOOLBAR_POS_HELPTEXT
 
strval   = STR_CONFIG_SETTING_HORIZONTAL_POS_LEFT
 
proc     = v_PositionMainToolbar
0 comments (0 inline, 0 general)