diff --git a/src/DiagramWindow.h b/src/DiagramWindow.h index 379f749..d4fe479 100755 --- a/src/DiagramWindow.h +++ b/src/DiagramWindow.h @@ -21,7 +21,7 @@ #include "RNAStructure.h" #include "BranchTypeIdentification.h" -#define IMAGE_DIM (550) +#define IMAGE_DIM (485) #define IMAGE_WIDTH (IMAGE_DIM) #define IMAGE_HEIGHT (IMAGE_DIM) #define IMAGE_DEPTH (3) @@ -29,7 +29,7 @@ #define PNG_FOOTER_HEIGHT (100) #define GLWIN_TRANSLATEX (35) -#define GLWIN_TRANSLATEY (90) +#define GLWIN_TRANSLATEY (110) #define WIDGET_SPACING (35) #define EXPORT_BUTTON_WIDTH (115) diff --git a/src/FolderWindow.cpp b/src/FolderWindow.cpp index 9377fb6..a288b4c 100755 --- a/src/FolderWindow.cpp +++ b/src/FolderWindow.cpp @@ -153,8 +153,10 @@ void FolderWindow::AddStructure(const char* filename, const int index) size_t fileNameBytes = strlen(filename); snprintf(filePrefix, MAX_BUFFER_SIZE, "%-.20s%s", filename, fileNameBytes > MAX_FOLDER_LABEL_CHARS ? "..." : ""); - snprintf(labelWithIcon, MAX_BUFFER_SIZE - 1, "@filenew %s%s@|>", - filePrefix, spaceBuffer.substr(0, MAX_FOLDER_LABEL_CHARS - strlen(filePrefix)).c_str()); + snprintf(labelWithIcon, MAX_BUFFER_SIZE - 1, "@filenew %s%s", + filePrefix, spaceBuffer.substr(0, + MAX(0, MAX_FOLDER_LABEL_CHARS - ((int ) strlen(filePrefix)))).c_str()); + strcat(labelWithIcon, " @|>"); label->copy_label(labelWithIcon); Fl_Button* removeButton = new Fl_Button(pack->x() + pack->w() - 20, vertPosn + 5, 20, 20); diff --git a/src/FolderWindow.h b/src/FolderWindow.h index 1993c36..ad273b1 100755 --- a/src/FolderWindow.h +++ b/src/FolderWindow.h @@ -17,7 +17,7 @@ #include "ConfigOptions.h" -#define MAX_FOLDER_LABEL_CHARS (20) +#define MAX_FOLDER_LABEL_CHARS (25) class FolderWindow : public Fl_Group { diff --git a/src/InputWindow.cpp b/src/InputWindow.cpp index 168e09a..8784c84 100755 --- a/src/InputWindow.cpp +++ b/src/InputWindow.cpp @@ -83,23 +83,23 @@ InputWindow::InputWindow(int w, int h, const char *label, button->set_active(); input->callback(InputCallback, (void*)0); input->labelcolor(GUI_TEXT_COLOR); - /*const char *cbText = " Use only default names for structure folders"; + const char *cbText = " Use only default names for structure folders"; cbUseDefaultNames = new Fl_Check_Button(30, 100, 325, 30, cbText); cbUseDefaultNames->box(FL_ROUND_UP_BOX); cbUseDefaultNames->color(GUI_BGCOLOR); cbUseDefaultNames->labelcolor(GUI_BTEXT_COLOR); cbUseDefaultNames->down_color(GUI_WINDOW_BGCOLOR); - cbUseDefaultNames->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_CENTER);*/ + cbUseDefaultNames->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_CENTER); callback(CloseCallback); } show(); - /*if(type == InputWindow::FILE_INPUT || !GUI_USE_DEFAULT_FOLDER_NAMES) { + if(type == InputWindow::FILE_INPUT || !GUI_USE_DEFAULT_FOLDER_NAMES) { show(); } else { show(); InputCallback((Fl_Widget *) cbUseDefaultNames, (void *) NULL); - }*/ + } } InputWindow::~InputWindow() { @@ -131,9 +131,9 @@ void InputWindow::InputCallback(Fl_Widget *widget, void *userdata) return; } window->name = window->inputText; - //if(window->cbUseDefaultNames->value()) { - // GUI_USE_DEFAULT_FOLDER_NAMES = true; - //} + if(window->cbUseDefaultNames->value()) { + GUI_USE_DEFAULT_FOLDER_NAMES = true; + } } free(window->string); window->hide(); @@ -151,15 +151,5 @@ std::string InputWindow::ExtractStructureNameFromCTName(const char *ctPath) { char suggestedShortName[MAX_BUFFER_SIZE]; snprintf(suggestedShortName, MAX_BUFFER_SIZE, "Structure #% 2d\0", ++InputWindow::distinctStructureCount); return std::string(suggestedShortName); - /*std::string structName(ctPath); - int structureNameNoPrefix = structName.find_first_of('_'); - if(structureNameNoPrefix >= 0) { - structName = structName.substr(structureNameNoPrefix + 1);; - } - int dotIndexPtr = structName.find_last_of('.'); - if(dotIndexPtr >= 0) { - structName = structName.substr(0, dotIndexPtr); - } - return structName;*/ }