Skip to content

Commit

Permalink
Fixed a couple of small formatting details
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxie D. Schmidt committed Mar 2, 2019
1 parent 109126e commit 296d112
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/DiagramWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
#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)
#define STRAND_MARKER_IMAGE_HEIGHT (25)
#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)
Expand Down
6 changes: 4 additions & 2 deletions src/FolderWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/FolderWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include "ConfigOptions.h"

#define MAX_FOLDER_LABEL_CHARS (20)
#define MAX_FOLDER_LABEL_CHARS (25)

class FolderWindow : public Fl_Group
{
Expand Down
24 changes: 7 additions & 17 deletions src/InputWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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();
Expand All @@ -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;*/
}

0 comments on commit 296d112

Please sign in to comment.