diff --git a/Source/Main.cpp b/Source/Main.cpp index ebe7a1b52093017a0d80d852aa0b89266d305ea1..f70d622a995eaca5bbef5742a2a17e69a36bcf58 100644 --- a/Source/Main.cpp +++ b/Source/Main.cpp @@ -68,7 +68,7 @@ public: {quit();} //============================================================================== - const String getApplicationName() { return "Open Ephys Data Acquisition Software";} + const String getApplicationName() { return "Open Ephys GUI";} const String getApplicationVersion() {return ProjectInfo::versionString;} bool moreThanOneInstanceAllowed() {return true;} void anotherInstanceStarted (const String& commandLine) diff --git a/Source/UI/InfoLabel.cpp b/Source/UI/InfoLabel.cpp index c5721fdf7688a36034387851d249fd1c04766693..776fff649c7180b95f741d579a706f1f4c27726d 100644 --- a/Source/UI/InfoLabel.cpp +++ b/Source/UI/InfoLabel.cpp @@ -25,7 +25,12 @@ InfoLabel::InfoLabel() : xBuffer(10), yBuffer(10) { + layout.SetAlignment(FTGL::ALIGN_LEFT); + layout.SetFont(getFont(String("miso-regular"))); + infoString = "Welcome to the Open Ephys GUI!\n \n" + "The GUI is still in the early stages of development, so we expect there to be a lot of bugs.\n \n" + ; } InfoLabel::~InfoLabel() @@ -64,51 +69,76 @@ void InfoLabel::drawLabel() { glViewport(xBuffer, - yBuffer-getScrollAmount(), + getHeight()-getTotalHeight()-yBuffer + getScrollAmount(), getWidth()-2*xBuffer, - jmax(getHeight(),getTotalHeight())-2*yBuffer); + getTotalHeight()); + //jmax(getHeight(),getTotalHeight())-2*yBuffer); - float mult = 1/float(getWidth()); + // float mult = 1/float(getWidth()); - glColor4f(0.5,0.5,0.5,0.6); + // glColor4f(0.5,0.5,0.5,0.6); - glBegin(GL_LINE_STRIP); - glVertex2f(0.1,0); - glVertex2f(0.1,1.0); - glEnd(); + // glBegin(GL_LINE_STRIP); + // glVertex2f(0.1,0); + // glVertex2f(0.1,1.0); + // glEnd(); - glBegin(GL_LINE_STRIP); - glVertex2f(0,0.1); - glVertex2f(1.0,0.1); - glEnd(); + // glBegin(GL_LINE_STRIP); + // glVertex2f(0,0.1); + // glVertex2f(1.0,0.1); + // glEnd(); - glBegin(GL_LINE_STRIP); - glVertex2f(0.9,0); - glVertex2f(0.9,1.0); - glEnd(); + // glBegin(GL_LINE_STRIP); + // glVertex2f(0.9,0); + // glVertex2f(0.9,1.0); + // glEnd(); - glBegin(GL_LINE_STRIP); - glVertex2f(0,0.9); - glVertex2f(1.0,0.9); - glEnd(); + // glBegin(GL_LINE_STRIP); + // glVertex2f(0,0.9); + // glVertex2f(1.0,0.9); + // glEnd(); - glColor4f(0.5,0.5,0.5,0.8); + - getFont(String("miso-regular"))->FaceSize(12.0f); + // getFont(String("miso-regular"))->FaceSize(12.0f); - for (float x = 0.1f; x < 1.0f; x += 0.8f) - { - for (float y = 0.1f; y < 1.0f; y += 0.8f) - { - glRasterPos2f(x+0.005f,y+0.025f); - String s = String("(0."); - s += int(x*10); - s += String(", 0."); - s += int(y*10); - s += String(")"); - getFont(String("miso-regular"))->Render(s); - } - } + // for (float x = 0.1f; x < 1.0f; x += 0.8f) + // { + // for (float y = 0.1f; y < 1.0f; y += 0.8f) + // { + // glRasterPos2f(x+0.005f,y+0.025f); + // String s = String("(0."); + // s += int(x*10); + // s += String(", 0."); + // s += int(y*10); + // s += String(")"); + // getFont(String("miso-regular"))->Render(s); + // } + // } + + // glColor4f(0.9,0.9,0.9,1.0); + + // glRasterPos2f(7.0/float(getWidth()),0.099f); + // getFont(String("miso-bold"))->FaceSize(40.0f); + // getFont(String("miso-bold"))->Render("open ephys gui"); + + // glColor4f(0.3,0.3,0.3,1.0); + + // glRasterPos2f(5.0/float(getWidth()),0.1f); + // getFont(String("miso-bold"))->FaceSize(40.0f); + // getFont(String("miso-bold"))->Render("open ephys gui"); + + glColor4f(0.3,0.3,0.3,1.0); + + glRasterPos2f(15.0/float(getWidth()),0.1f); + getFont(String("miso-regular"))->FaceSize(18.0f); + layout.Render(infoString, -1, FTPoint(), FTGL::RENDER_FRONT); + + // + // + //getFont(String("miso-regular"))->Render("Open Ephys GUI"); + + } void InfoLabel::resized() @@ -116,6 +146,7 @@ void InfoLabel::resized() //std::cout << getWidth() << " " << getHeight() // << std::endl; + layout.SetLineLength(getWidth()-45); canvasWasResized(); diff --git a/Source/UI/InfoLabel.h b/Source/UI/InfoLabel.h index 0069858e582bbf6fff43db794b9dc7a9095200ba..eab0b3fdbd27fbf1bb2c477f8a437c073765c6c2 100644 --- a/Source/UI/InfoLabel.h +++ b/Source/UI/InfoLabel.h @@ -61,8 +61,12 @@ private: void mouseUp(const MouseEvent& e); void mouseWheelMove(const MouseEvent&, float, float); + FTSimpleLayout layout; + String infoString; + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (InfoLabel); - + + };