primera aproximacion a interfaz
This commit is contained in:
parent
c51fbcd156
commit
dbf0ebf76a
1 changed files with 89 additions and 18 deletions
109
main.cpp
109
main.cpp
|
|
@ -448,32 +448,103 @@ int main(int, char**)
|
|||
isListDirectoriesAdequate = true;
|
||||
}
|
||||
|
||||
|
||||
//DIRECTORIOS ENCONTRADOS bien pinta2
|
||||
if (ImGui::BeginListBox("fpLb", ImVec2(-FLT_MIN, 25 * ImGui::GetTextLineHeightWithSpacing()))){
|
||||
int idx = 0;
|
||||
for (; idx < numFiles; idx++) {
|
||||
//LA GRAN TABLACIÓN: ACTOR EN LAS SOMBRAS
|
||||
static ImGuiTableFlags splitterTableFlags = ImGuiTableFlags_Resizable | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV;
|
||||
if (ImGui::BeginTable("##splitterTable", 2, splitterTableFlags, ImVec2(-FLT_MIN, 0.8f * ImGui::GetTextLineHeightWithSpacing()))){
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
//VOLUMENES
|
||||
static ImGuiTableFlags volumesFlags = ImGuiTableFlags_RowBg | ImGuiTableFlags_ScrollY ;
|
||||
if (ImGui::BeginTable("##volumesTable", 1, volumesFlags, ImVec2(-FLT_MIN, 20 * ImGui::GetTextLineHeightWithSpacing()))){
|
||||
ImGui::TableSetupColumn("Volumes", ImGuiTableColumnFlags_NoHide);
|
||||
//ImGui::TableSetupColumn("Name", ImGuiTableColumnFlags_WidthFixed, TEXT_BASE_WIDTH * 12.0f);
|
||||
//ImGui::TableSetupColumn("Type", ImGuiTableColumnFlags_WidthFixed, TEXT_BASE_WIDTH * 18.0f);
|
||||
ImGui::TableHeadersRow();
|
||||
ImGui::TableNextRow();
|
||||
|
||||
//const bool isSelected = (currentItemIdx == i);
|
||||
bool isSelected = false;
|
||||
if (ImGui::Selectable(directoryContents.at(idx)->name, &isSelected)){
|
||||
//currentItemIdx = i;
|
||||
strcat(currentPath, "\\");
|
||||
strcat(currentPath, directoryContents.at(idx)->name);
|
||||
moveDirectory(¤tPathPtr);
|
||||
//currentItemIdx = -1;
|
||||
isListDirectoriesAdequate = true;
|
||||
if (numVolumes > 0) {
|
||||
for (int i = 0; i < onPresentPaths.size(); i++) {
|
||||
ImGui::TableNextColumn();
|
||||
//if (i > 0) ImGui::SameLine();
|
||||
// if (debug) std::cout << std::to_string(i) + "<- WE IN" << std::endl;
|
||||
// ImGui::PushID(i);
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor::HSV(i / 7.0f, 0.6f, 0.6f));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(i / 7.0f, 0.7f, 0.7f));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(i / 7.0f, 0.8f, 0.8f));
|
||||
if(ImGui::Button(onPresentPaths.at(i))){
|
||||
moveDirectory(&onPresentPaths.at(i));
|
||||
isListDirectoriesAdequate = true;
|
||||
}
|
||||
ImGui::PopStyleColor(3);
|
||||
if (i != onPresentPaths.size() - 1) ImGui::TableNextRow();
|
||||
// ImGui::PopID();
|
||||
}
|
||||
}
|
||||
|
||||
//ImGui::SetItemDefaultFocus();
|
||||
|
||||
ImGui::EndTable();
|
||||
}
|
||||
if (!idx) ImGui::Text("Folder is empty");
|
||||
ImGui::EndListBox();
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
|
||||
//DIRECTORIOS ENCONTRADOS bien pinta2
|
||||
static ImGuiTableFlags directoriesFlags = ImGuiTableFlags_RowBg | ImGuiTableFlags_Resizable |ImGuiTableFlags_ScrollY ;
|
||||
if (ImGui::BeginTable("##directoriesTable", 3, directoriesFlags, ImVec2(-FLT_MIN, 20 * ImGui::GetTextLineHeightWithSpacing()))){
|
||||
ImGui::TableSetupColumn("Name", ImGuiTableColumnFlags_NoHide);
|
||||
ImGui::TableSetupColumn("Type", ImGuiTableColumnFlags_NoHide);
|
||||
ImGui::TableSetupColumn("Size", ImGuiTableColumnFlags_NoHide);
|
||||
//ImGui::TableSetupColumn("Name", ImGuiTableColumnFlags_WidthFixed, TEXT_BASE_WIDTH * 12.0f);
|
||||
//ImGui::TableSetupColumn("Type", ImGuiTableColumnFlags_WidthFixed, TEXT_BASE_WIDTH * 18.0f);
|
||||
ImGui::TableHeadersRow();
|
||||
|
||||
int idx = 0;
|
||||
for (; idx < numFiles; idx++) {
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
//NAME
|
||||
bool isSelected = false;
|
||||
if (ImGui::Selectable(directoryContents.at(idx)->name, &isSelected)){
|
||||
//currentItemIdx = i;
|
||||
strcat(currentPath, "\\");
|
||||
strcat(currentPath, directoryContents.at(idx)->name);
|
||||
moveDirectory(¤tPathPtr);
|
||||
//currentItemIdx = -1;
|
||||
isListDirectoriesAdequate = true;
|
||||
}
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
//TYPE
|
||||
if (directoryContents.at(idx)->isFile) ImGui::Text("Folder"); else ImGui::Text("File");
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
//SIZE
|
||||
if (!directoryContents.at(idx)->isFile) ImGui::Text("%lld bytes", directoryContents.at(idx)->size);
|
||||
else ImGui::Text("");
|
||||
|
||||
//ImGui::SetItemDefaultFocus();
|
||||
|
||||
}
|
||||
if (!idx) { ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGui::Text("Folder is empty"); }
|
||||
ImGui::EndTable();
|
||||
}
|
||||
|
||||
ImGui::EndTable();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//ImGui::TreePop();
|
||||
|
||||
filepickerFailure:
|
||||
|
||||
ImGui::Button("AAAAAAAAAAAAAAAAAAAAAAAAAQ" );
|
||||
ImGui::End();
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue