Skip to content

Commit

Permalink
adds SetFocus feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ericoporto committed Apr 23, 2020
1 parent 46a9f83 commit 7dfe842
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions agsimgui/agsimgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,14 @@ namespace agsimgui {
" \r\n"
" /// Override capture or not capture keyboard by ImGui for next frame. Keyboard will still be captured by AGS. \r\n"
" import static void DoMouseWheel(ImGuiDir wheel_direction); \r\n"
" \r\n"
" // Activation \r\n"
" \r\n"
" ///make last item the default focused item of a window. \r\n"
" import static void SetItemDefaultFocus(); \r\n"
" \r\n"
" ///focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget. Use -1 to access previous widget.\r\n"
" import static void SetKeyboardFocusHere(int offset = 0); \r\n"
" }; \r\n"
" \r\n"
" struct AgsImGuiHelper { \r\n"
Expand Down Expand Up @@ -1066,6 +1074,14 @@ int AgsImGui_IsAnyItemFocused(){
return ToAgsBool(ImGui::IsAnyItemFocused());
}

void AgsImGui_SetKeyboardFocusHere(int offset){
ImGui::SetKeyboardFocusHere(offset);
}

void AgsImGui_SetItemDefaultFocus(){
ImGui::SetItemDefaultFocus();
}

void AgsImGui_Separator () {
ImGui::Separator();
}
Expand Down Expand Up @@ -1676,6 +1692,8 @@ int AgsImGuiHelper_GetClipboarImage() {
engine->RegisterScriptFunction("AgsImGui::IsAnyItemHovered^0", (void*)AgsImGui_IsAnyItemHovered);
engine->RegisterScriptFunction("AgsImGui::IsAnyItemActive^0", (void*)AgsImGui_IsAnyItemActive);
engine->RegisterScriptFunction("AgsImGui::IsAnyItemFocused^0", (void*)AgsImGui_IsAnyItemFocused);
engine->RegisterScriptFunction("AgsImGui::SetItemDefaultFocus^0", (void*)AgsImGui_SetItemDefaultFocus);
engine->RegisterScriptFunction("AgsImGui::SetKeyboardFocusHere^0", (void*)AgsImGui_SetKeyboardFocusHere);
engine->RegisterScriptFunction("AgsImGui::Separator^0", (void*)AgsImGui_Separator);
engine->RegisterScriptFunction("AgsImGui::SameLine^2", (void*)AgsImGui_SameLine);
engine->RegisterScriptFunction("AgsImGui::NewLine^0", (void*)AgsImGui_NewLine);
Expand Down

0 comments on commit 7dfe842

Please sign in to comment.