Skip to content

Commit 296d112

Browse files
author
Maxie D. Schmidt
committed
Fixed a couple of small formatting details
1 parent 109126e commit 296d112

File tree

4 files changed

+14
-22
lines changed

4 files changed

+14
-22
lines changed

src/DiagramWindow.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
#include "RNAStructure.h"
2222
#include "BranchTypeIdentification.h"
2323

24-
#define IMAGE_DIM (550)
24+
#define IMAGE_DIM (485)
2525
#define IMAGE_WIDTH (IMAGE_DIM)
2626
#define IMAGE_HEIGHT (IMAGE_DIM)
2727
#define IMAGE_DEPTH (3)
2828
#define STRAND_MARKER_IMAGE_HEIGHT (25)
2929
#define PNG_FOOTER_HEIGHT (100)
3030

3131
#define GLWIN_TRANSLATEX (35)
32-
#define GLWIN_TRANSLATEY (90)
32+
#define GLWIN_TRANSLATEY (110)
3333

3434
#define WIDGET_SPACING (35)
3535
#define EXPORT_BUTTON_WIDTH (115)

src/FolderWindow.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,10 @@ void FolderWindow::AddStructure(const char* filename, const int index)
153153
size_t fileNameBytes = strlen(filename);
154154
snprintf(filePrefix, MAX_BUFFER_SIZE, "%-.20s%s", filename,
155155
fileNameBytes > MAX_FOLDER_LABEL_CHARS ? "..." : "");
156-
snprintf(labelWithIcon, MAX_BUFFER_SIZE - 1, "@filenew %s%s@|>",
157-
filePrefix, spaceBuffer.substr(0, MAX_FOLDER_LABEL_CHARS - strlen(filePrefix)).c_str());
156+
snprintf(labelWithIcon, MAX_BUFFER_SIZE - 1, "@filenew %s%s",
157+
filePrefix, spaceBuffer.substr(0,
158+
MAX(0, MAX_FOLDER_LABEL_CHARS - ((int ) strlen(filePrefix)))).c_str());
159+
strcat(labelWithIcon, " @|>");
158160
label->copy_label(labelWithIcon);
159161

160162
Fl_Button* removeButton = new Fl_Button(pack->x() + pack->w() - 20, vertPosn + 5, 20, 20);

src/FolderWindow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include "ConfigOptions.h"
1919

20-
#define MAX_FOLDER_LABEL_CHARS (20)
20+
#define MAX_FOLDER_LABEL_CHARS (25)
2121

2222
class FolderWindow : public Fl_Group
2323
{

src/InputWindow.cpp

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,23 +83,23 @@ InputWindow::InputWindow(int w, int h, const char *label,
8383
button->set_active();
8484
input->callback(InputCallback, (void*)0);
8585
input->labelcolor(GUI_TEXT_COLOR);
86-
/*const char *cbText = " Use only default names for structure folders";
86+
const char *cbText = " Use only default names for structure folders";
8787
cbUseDefaultNames = new Fl_Check_Button(30, 100, 325, 30, cbText);
8888
cbUseDefaultNames->box(FL_ROUND_UP_BOX);
8989
cbUseDefaultNames->color(GUI_BGCOLOR);
9090
cbUseDefaultNames->labelcolor(GUI_BTEXT_COLOR);
9191
cbUseDefaultNames->down_color(GUI_WINDOW_BGCOLOR);
92-
cbUseDefaultNames->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_CENTER);*/
92+
cbUseDefaultNames->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_CENTER);
9393
callback(CloseCallback);
9494
}
9595
show();
96-
/*if(type == InputWindow::FILE_INPUT || !GUI_USE_DEFAULT_FOLDER_NAMES) {
96+
if(type == InputWindow::FILE_INPUT || !GUI_USE_DEFAULT_FOLDER_NAMES) {
9797
show();
9898
}
9999
else {
100100
show();
101101
InputCallback((Fl_Widget *) cbUseDefaultNames, (void *) NULL);
102-
}*/
102+
}
103103
}
104104

105105
InputWindow::~InputWindow() {
@@ -131,9 +131,9 @@ void InputWindow::InputCallback(Fl_Widget *widget, void *userdata)
131131
return;
132132
}
133133
window->name = window->inputText;
134-
//if(window->cbUseDefaultNames->value()) {
135-
// GUI_USE_DEFAULT_FOLDER_NAMES = true;
136-
//}
134+
if(window->cbUseDefaultNames->value()) {
135+
GUI_USE_DEFAULT_FOLDER_NAMES = true;
136+
}
137137
}
138138
free(window->string);
139139
window->hide();
@@ -151,15 +151,5 @@ std::string InputWindow::ExtractStructureNameFromCTName(const char *ctPath) {
151151
char suggestedShortName[MAX_BUFFER_SIZE];
152152
snprintf(suggestedShortName, MAX_BUFFER_SIZE, "Structure #% 2d\0", ++InputWindow::distinctStructureCount);
153153
return std::string(suggestedShortName);
154-
/*std::string structName(ctPath);
155-
int structureNameNoPrefix = structName.find_first_of('_');
156-
if(structureNameNoPrefix >= 0) {
157-
structName = structName.substr(structureNameNoPrefix + 1);;
158-
}
159-
int dotIndexPtr = structName.find_last_of('.');
160-
if(dotIndexPtr >= 0) {
161-
structName = structName.substr(0, dotIndexPtr);
162-
}
163-
return structName;*/
164154
}
165155

0 commit comments

Comments
 (0)