-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #262 from carboncopies/261-standardize-font-select…
…or-window 261 standardize font selector window
- Loading branch information
Showing
11 changed files
with
175 additions
and
11 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
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
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
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
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
30 changes: 30 additions & 0 deletions
30
Source/Core/Editor/Windows/GUI_Window_FontSelector/CMakeLists.txt
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
######################################################################## | ||
# This file is part of the BrainGenix-ERS Environment Rendering System # | ||
######################################################################## | ||
|
||
|
||
|
||
# Create Library (Name Should Be Parent Dir Name) | ||
add_library(GUI_Window_FontSelector | ||
|
||
# Add Source Files (.cpp) | ||
"GUI_Window_FontSelector.cpp" | ||
|
||
# Add Header Files (.h) | ||
"GUI_Window_FontSelector.h" | ||
|
||
|
||
${BACKWARD_ENABLE} | ||
) | ||
|
||
# Link 3rd Party Libs | ||
target_link_libraries(GUI_Window_FontSelector | ||
IMGUI | ||
) | ||
|
||
# Link Internal Libs | ||
target_link_libraries(GUI_Window_FontSelector | ||
ERS_Editor_FontManager | ||
) | ||
|
||
target_include_directories(GUI_Window_FontSelector PUBLIC ./) |
61 changes: 61 additions & 0 deletions
61
Source/Core/Editor/Windows/GUI_Window_FontSelector/GUI_Window_FontSelector.cpp
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
//======================================================================// | ||
// This file is part of the BrainGenix-ERS Environment Rendering System // | ||
//======================================================================// | ||
|
||
|
||
#include <GUI_Window_FontSelector.h> | ||
|
||
|
||
GUI_Window_FontSelector::GUI_Window_FontSelector(ERS_CLASS_FontManager* FontManager) { | ||
|
||
FontManager_ = FontManager; | ||
|
||
} | ||
|
||
GUI_Window_FontSelector::~GUI_Window_FontSelector() { | ||
|
||
} | ||
|
||
|
||
void GUI_Window_FontSelector::Draw() { | ||
|
||
if (Enabled_) { | ||
|
||
ImGuiWindowFlags Flags = ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse; | ||
if (ImGui::Begin("Font Selector", &Enabled_, Flags)) { | ||
ImGui::SetWindowSize(ImVec2(0,0)); | ||
|
||
ImGui::BeginChild("Font Radio Buttons", ImVec2(300, 400), true); | ||
|
||
for (int i = 0; (long)i < (long)FontManager_->FontNameList_.size(); i++) { | ||
ImGui::RadioButton(FontManager_->FontNameList_[i].c_str(), &FontManager_->FontSelector_, i); | ||
} | ||
|
||
ImGui::EndChild(); | ||
|
||
ImGui::Separator(); | ||
|
||
ImGui::SliderFloat("Font Size", &FontManager_->FontSize_, 5.0f, 30.0f); | ||
|
||
ImGui::Separator(); | ||
|
||
if (ImGui::Button("Reload")) { | ||
FontManager_->IndexFonts(); | ||
} | ||
ImGui::SameLine(); | ||
|
||
if (ImGui::Button("Apply")) { | ||
FontManager_->UpdateFont_ = true; | ||
} | ||
ImGui::SameLine(); | ||
|
||
if (ImGui::Button("Close")) { | ||
Enabled_ = false; | ||
} | ||
|
||
|
||
ImGui::End(); | ||
} | ||
|
||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
Source/Core/Editor/Windows/GUI_Window_FontSelector/GUI_Window_FontSelector.h
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
//======================================================================// | ||
// This file is part of the BrainGenix-ERS Environment Rendering System // | ||
//======================================================================// | ||
|
||
#pragma once | ||
|
||
|
||
// Standard Libraries (BG convention: use <> instead of "") | ||
|
||
// Third-Party Libraries (BG convention: use <> instead of "") | ||
#include <imgui.h> | ||
|
||
// Internal Libraries (BG convention: use <> instead of "") | ||
#include <ERS_Editor_FontManager.h> | ||
|
||
|
||
/** | ||
* @brief This Class Provides The Font Selector Window. | ||
* | ||
*/ | ||
class GUI_Window_FontSelector { | ||
|
||
private: | ||
|
||
ERS_CLASS_FontManager* FontManager_; /**<Font Manager Instance*/ | ||
|
||
|
||
public: | ||
|
||
bool Enabled_ = false; /**<Show/Hide Window*/ | ||
|
||
|
||
public: | ||
|
||
/** | ||
* @brief Construct a new Window_FontSelector object | ||
* | ||
* @param FontManager | ||
*/ | ||
GUI_Window_FontSelector(ERS_CLASS_FontManager* FontManager); | ||
|
||
/** | ||
* @brief Destroy the Window_FontSelector object | ||
* | ||
*/ | ||
~GUI_Window_FontSelector(); | ||
|
||
/** | ||
* @brief Update the window contents, Call This Every Frame. | ||
* | ||
*/ | ||
void Draw(); | ||
|
||
|
||
|
||
}; |