GUI: I am done

look I need to sleep
This commit is contained in:
tildearrow 2022-09-22 04:10:12 -05:00
parent cec31b23de
commit b9d8d91ca7
5 changed files with 8 additions and 9 deletions

View file

@ -1042,7 +1042,7 @@ enum ImGuiInputTextFlags_
ImGuiInputTextFlags_AlwaysOverwrite = 1 << 13, // Overwrite mode ImGuiInputTextFlags_AlwaysOverwrite = 1 << 13, // Overwrite mode
ImGuiInputTextFlags_ReadOnly = 1 << 14, // Read-only mode ImGuiInputTextFlags_ReadOnly = 1 << 14, // Read-only mode
ImGuiInputTextFlags_Password = 1 << 15, // Password mode, display all characters as '*' ImGuiInputTextFlags_Password = 1 << 15, // Password mode, display all characters as '*'
ImGuiInputTextFlags_NoUndoRedo = 1 << 16, // Disable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID(). ImGuiInputTextFlags_UndoRedo = 1 << 16, // Enable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID().
ImGuiInputTextFlags_CharsScientific = 1 << 17, // Allow 0123456789.+-*/eE (Scientific notation input) ImGuiInputTextFlags_CharsScientific = 1 << 17, // Allow 0123456789.+-*/eE (Scientific notation input)
ImGuiInputTextFlags_CallbackResize = 1 << 18, // Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow. Notify when the string wants to be resized (for string types which hold a cache of their Size). You will be provided a new BufSize in the callback and NEED to honor it. (see misc/cpp/imgui_stdlib.h for an example of using this) ImGuiInputTextFlags_CallbackResize = 1 << 18, // Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow. Notify when the string wants to be resized (for string types which hold a cache of their Size). You will be provided a new BufSize in the callback and NEED to honor it. (see misc/cpp/imgui_stdlib.h for an example of using this)
ImGuiInputTextFlags_CallbackEdit = 1 << 19 // Callback on any edit (note that InputText() already returns true on edit, the callback is useful mainly to manipulate the underlying buffer while focus is active) ImGuiInputTextFlags_CallbackEdit = 1 << 19 // Callback on any edit (note that InputText() already returns true on edit, the callback is useful mainly to manipulate the underlying buffer while focus is active)

View file

@ -3970,8 +3970,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
const bool is_multiline = (flags & ImGuiInputTextFlags_Multiline) != 0; const bool is_multiline = (flags & ImGuiInputTextFlags_Multiline) != 0;
const bool is_readonly = (flags & ImGuiInputTextFlags_ReadOnly) != 0; const bool is_readonly = (flags & ImGuiInputTextFlags_ReadOnly) != 0;
const bool is_password = (flags & ImGuiInputTextFlags_Password) != 0; const bool is_password = (flags & ImGuiInputTextFlags_Password) != 0;
// https://github.com/tildearrow/furnace/issues/624 const bool is_undoable = (flags & ImGuiInputTextFlags_UndoRedo) != 0;
const bool is_undoable = 0; //(flags & ImGuiInputTextFlags_NoUndoRedo) == 0;
const bool is_resizable = (flags & ImGuiInputTextFlags_CallbackResize) != 0; const bool is_resizable = (flags & ImGuiInputTextFlags_CallbackResize) != 0;
if (is_resizable) if (is_resizable)
IM_ASSERT(callback != NULL); // Must provide a callback if you set the ImGuiInputTextFlags_CallbackResize flag! IM_ASSERT(callback != NULL); // Must provide a callback if you set the ImGuiInputTextFlags_CallbackResize flag!

View file

@ -39,7 +39,7 @@ void FurnaceGUI::drawSongInfo() {
ImGui::TableNextColumn(); ImGui::TableNextColumn();
float avail=ImGui::GetContentRegionAvail().x; float avail=ImGui::GetContentRegionAvail().x;
ImGui::SetNextItemWidth(avail); ImGui::SetNextItemWidth(avail);
if (ImGui::InputText("##Name",&e->song.name)) { MARK_MODIFIED if (ImGui::InputText("##Name",&e->song.name,ImGuiInputTextFlags_UndoRedo)) { MARK_MODIFIED
updateWindowTitle(); updateWindowTitle();
} }
if (e->song.insLen==2) { if (e->song.insLen==2) {
@ -61,7 +61,7 @@ void FurnaceGUI::drawSongInfo() {
ImGui::Text("Author"); ImGui::Text("Author");
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::SetNextItemWidth(avail); ImGui::SetNextItemWidth(avail);
if (ImGui::InputText("##Author",&e->song.author)) { if (ImGui::InputText("##Author",&e->song.author,ImGuiInputTextFlags_UndoRedo)) {
MARK_MODIFIED; MARK_MODIFIED;
} }
@ -70,7 +70,7 @@ void FurnaceGUI::drawSongInfo() {
ImGui::Text("Album"); ImGui::Text("Album");
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::SetNextItemWidth(avail); ImGui::SetNextItemWidth(avail);
if (ImGui::InputText("##Category",&e->song.category)) { if (ImGui::InputText("##Category",&e->song.category,ImGuiInputTextFlags_UndoRedo)) {
MARK_MODIFIED; MARK_MODIFIED;
} }
ImGui::TableNextRow(); ImGui::TableNextRow();
@ -78,7 +78,7 @@ void FurnaceGUI::drawSongInfo() {
ImGui::Text("System"); ImGui::Text("System");
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::SetNextItemWidth(MAX(16.0f*dpiScale,avail-autoButtonSize-ImGui::GetStyle().ItemSpacing.x)); ImGui::SetNextItemWidth(MAX(16.0f*dpiScale,avail-autoButtonSize-ImGui::GetStyle().ItemSpacing.x));
if (ImGui::InputText("##SystemName",&e->song.systemName)) { if (ImGui::InputText("##SystemName",&e->song.systemName,ImGuiInputTextFlags_UndoRedo)) {
MARK_MODIFIED; MARK_MODIFIED;
updateWindowTitle(); updateWindowTitle();
e->song.autoSystem=false; e->song.autoSystem=false;

View file

@ -30,7 +30,7 @@ void FurnaceGUI::drawNotes() {
} }
if (!notesOpen) return; if (!notesOpen) return;
if (ImGui::Begin("Song Comments",&notesOpen,globalWinFlags)) { if (ImGui::Begin("Song Comments",&notesOpen,globalWinFlags)) {
ImGui::InputTextMultiline("##SongNotes",&e->song.notes,ImGui::GetContentRegionAvail()); ImGui::InputTextMultiline("##SongNotes",&e->song.notes,ImGui::GetContentRegionAvail(),ImGuiInputTextFlags_UndoRedo);
} }
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_NOTES; if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_NOTES;
ImGui::End(); ImGui::End();

View file

@ -91,7 +91,7 @@ void FurnaceGUI::drawSubSongs() {
ImGui::Text("Name"); ImGui::Text("Name");
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
if (ImGui::InputText("##SubSongName",&e->curSubSong->name)) { if (ImGui::InputText("##SubSongName",&e->curSubSong->name,ImGuiInputTextFlags_UndoRedo)) {
MARK_MODIFIED; MARK_MODIFIED;
} }
} }