-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
31 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* Nana GUI Programming Interface Implementation | ||
* Nana C++ Library(http://www.nanapro.org) | ||
* Copyright(C) 2003-2023 Jinhao([email protected]) | ||
* Copyright(C) 2003-2024 Jinhao([email protected]) | ||
* | ||
* Distributed under the Boost Software License, Version 1.0. | ||
* (See accompanying file LICENSE_1_0.txt or copy at | ||
|
@@ -133,7 +133,10 @@ namespace api | |
|
||
std::optional<upoint> caret_position(window); | ||
|
||
upoint im_input(window, const upoint& insert_pos, const std::wstring&, bool candidate); | ||
upoint im_input(window, const upoint& insert_pos, const std::wstring&, bool candidate); | ||
|
||
/// Cancel the candidate mode | ||
void im_cancel(window); | ||
}//end namespace dev | ||
|
||
|
||
|
@@ -515,6 +518,8 @@ namespace api | |
std::size_t window_dpi(window); | ||
dragdrop_status window_dragdrop_status(::nana::window); | ||
|
||
void keyboard_default_language(const std::string& lang); | ||
|
||
/// Configures the qwerty keyboard for a text editor | ||
/** | ||
* @param wd The handle to a text editor window. Such as textbox and combox. | ||
|
@@ -527,7 +532,7 @@ namespace api | |
|
||
/// Configures the numeric keyboard. It returns true if virtual keyboard is enabled and | ||
/// the specified window is a text editor window, false otherwise. | ||
bool keyboard_numeric(window); | ||
bool keyboard_numeric(window, bool padding); | ||
}//end namespace api | ||
|
||
namespace API = api; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* Nana GUI Programming Interface Implementation | ||
* Nana C++ Library(http://www.nanapro.org) | ||
* Copyright(C) 2003-2023 Jinhao([email protected]) | ||
* Copyright(C) 2003-2024 Jinhao([email protected]) | ||
* | ||
* Distributed under the Boost Software License, Version 1.0. | ||
* (See accompanying file LICENSE_1_0.txt or copy at | ||
|
@@ -460,11 +460,21 @@ namespace api | |
{ | ||
internal_scope_guard lock; | ||
if (is_window(wd) && wd->annex.text_editor) | ||
|
||
return wd->annex.text_editor->im_input(insert_pos, str, candidate); | ||
return {}; | ||
} | ||
|
||
/// Cancels the candiate mode | ||
/** | ||
* Cancels the candidate mode when the virtual keyboard window is closed. | ||
*/ | ||
void im_cancel(window wd) | ||
{ | ||
internal_scope_guard lock; | ||
if (is_window(wd) && wd->annex.text_editor) | ||
wd->annex.text_editor->im_cancel(); | ||
} | ||
|
||
|
||
}//end namespace dev | ||
|
||
|
@@ -1707,6 +1717,12 @@ namespace api | |
return dragdrop_status::not_ready; | ||
} | ||
|
||
void keyboard_default_language(const std::string& lang) | ||
{ | ||
internal_scope_guard lock; | ||
restrict::bedrock.vkeyboard().default_im_value() = lang; | ||
} | ||
|
||
/// Configures the qwerty keyboard for a text editor | ||
bool keyboard_qwerty(window wd, std::vector<std::string> langs, keyboard_behaves behave, keyboard_modes mode) | ||
{ | ||
|
@@ -1723,11 +1739,11 @@ namespace api | |
} | ||
|
||
/// Configures the numeric keyboard. | ||
bool keyboard_numeric(window wd) | ||
bool keyboard_numeric(window wd, bool padding) | ||
{ | ||
internal_scope_guard lock; | ||
#ifdef NANA_ENABLE_VIRTUAL_KEYBOARD | ||
return restrict::bedrock.vkeyboard().numeric(wd); | ||
return restrict::bedrock.vkeyboard().numeric(wd, padding); | ||
#else | ||
(void)wd; | ||
return false; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters