Ejemplo n.º 1
0
FolderWindow::FolderWindow(int x, int y, int wid, int hgt, const char *label, int folderIndex): Fl_Group(x, y, wid, hgt, label)
{
    
    Fl_Button* diagramButton = new Fl_Button(x+20,y+10,90,30,"Diagram");
    diagramButton->callback(DiagramCallback);
    Fl_Button* statsButton = new Fl_Button(x+120,y+10,90,30,"Statistics");
    statsButton->callback(StatsCallback);
    
    Fl_Button* closeButton = new Fl_Button(x+wid-25,y+5,20,20,"");
    closeButton->callback(FolderWindow::CloseFolderCallback);
    closeButton->label("@1+");
    
    Fl_Box* fileLabel = new Fl_Box(x+20,y+40,120,30,"Files");
    fileLabel->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_LEFT);
    
    folderScroll = new Fl_Scroll(x+10, y+70, 280, 310);
    folderScroll->type(Fl_Scroll::VERTICAL_ALWAYS);
    folderPack = new Fl_Pack(x+10, y+70, 260, 310);
    folderPack->type(Fl_Pack::VERTICAL);
    
    folderScroll->color(FL_WHITE);
    folderPack->color(FL_WHITE);
    
    this->resizable(folderScroll);
    this->color(FL_WHITE);
    this->selection_color(FL_WHITE);
    //size_range(300, 400, 300);
    
    //title = (char*)malloc(sizeof(char) * 64);
    SetStructures(folderIndex);
}
Ejemplo n.º 2
0
void DiagramWindow::Construct(int w, int h, const std::vector<int>& structures)
{
    m_offscreenImage[0] = fl_create_offscreen(2048, 2048);
    m_imageData[0] = new uchar[2048 * 2048 * 3];
    memset(m_imageData[0], 0, 2048 * 2048 * 3);
    m_offscreenImage[1] = fl_create_offscreen(1024, 1024);
    m_imageData[1] = new uchar[1024 * 1024 * 3];
    memset(m_imageData[1], 0, 1024 * 1024 * 3);

    m_glWindow = new GLWindow(0, 120, w, h - 120);
    m_glWindow->SetTextureData(m_imageData[0], 2048);
    m_glWindow->SetTextureData(m_imageData[1], 1024);

    m_menus[0] = m_menus[1] = m_menus[2] = 0;
    m_menuItems = 0;
    m_menuItemsSize = 0;

    color(FL_BLACK);
    size_range(600, 720);
    box(FL_NO_BOX);

    Fl_Box* resizeBox = new Fl_Box(0, 120, w, h - 120);
    resizable(resizeBox);

    SetStructures(structures);
}
Ejemplo n.º 3
0
FolderWindow::FolderWindow(int x, int y, int wid, int hgt, 
		           const char *label, int folderIndex) : 
	      Fl_Group(x, y, wid, hgt, label), 
	      folderScroll(NULL), folderPack(NULL), 
	      fileOpsLabel(NULL), fileLabel(NULL)
{

    // label configuration:  
    //labelcolor(GUI_TEXT_COLOR);
    labelfont(LOCAL_BFFONT);
    labelsize(LOCAL_TEXT_SIZE);    

    // icon configuration:
    structureIcon = new Fl_RGB_Image(StructureOperationIcon.pixel_data, 
		    StructureOperationIcon.width, StructureOperationIcon.height, 
		    StructureOperationIcon.bytes_per_pixel);
    Fl_Box *structIconBox = new Fl_Box(x, y - 39, structureIcon->w(), structureIcon->h());
    structIconBox->image(structureIcon);
    
    int dividerTextHeight = 0, spacingHeight = NAVBUTTONS_SPACING;
    int fileOpsLabelHeight = 2 * NAVBUTTONS_BHEIGHT; 
    int fileOpsLabelWidth = 2 * NAVBUTTONS_BWIDTH + 2 * NAVBUTTONS_SPACING;
    int initYOffset = NAVBUTTONS_OFFSETY + RNAStructVizLogo.height + 5; // y + 36 + dividerTextHeight
    const char *fileOpsLabelText = "@reload Structure Operations.\nEach operation opens a new window.";
    fileOpsLabel = new Fl_Box(x + NAVBUTTONS_SPACING, initYOffset, 
		              fileOpsLabelWidth, fileOpsLabelHeight, 
			      fileOpsLabelText);
    fileOpsLabel->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_LEFT);  
    fileOpsLabel->color(GUI_BGCOLOR);
    fileOpsLabel->labelcolor(GUI_BTEXT_COLOR);
    fileOpsLabel->labelfont(LOCAL_BFFONT);
    fileOpsLabel->labelsize(LOCAL_TEXT_SIZE);
    fileOpsLabel->box(FL_RSHADOW_BOX);

    int opButtonWidth = 110;
    int yOffset = initYOffset + fileOpsLabelHeight;
    Fl_Button* diagramButton = new Fl_Button(x + 20, yOffset + spacingHeight,
		                             opButtonWidth, 30,
		                             "Diagram @>|");
    diagramButton->callback(DiagramCallback);
    diagramButton->labelcolor(GUI_BTEXT_COLOR);

    Fl_Button* statsButton = new Fl_Button(x + 20 + opButtonWidth + 
		             spacingHeight, yOffset + spacingHeight, 
	                     opButtonWidth, 30,
		             "Statistics @>|");
    statsButton->callback(StatsCallback);
    statsButton->labelcolor(GUI_BTEXT_COLOR);

    const char *fileInstText = "@filenew Files.\nClick on the file buttons to view\nCT file contents in new window.";
    fileLabel = new Fl_Box(x + NAVBUTTONS_SPACING, y + yOffset + spacingHeight, 
			   fileOpsLabelWidth, fileOpsLabelHeight, fileInstText);
    fileLabel->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_LEFT);
    fileLabel->color(GUI_BGCOLOR);
    fileLabel->labelcolor(GUI_BTEXT_COLOR);
    fileLabel->labelfont(LOCAL_BFFONT);
    fileLabel->labelsize(LOCAL_TEXT_SIZE);
    fileLabel->box(FL_RSHADOW_BOX);

    folderScroll = new Fl_Scroll(x+10, y + yOffset + fileOpsLabelHeight + 
		                 dividerTextHeight + 3 * spacingHeight, 
			         280, 310 - 2 * fileOpsLabelHeight - dividerTextHeight - 
				 2 * spacingHeight - NAVBUTTONS_BHEIGHT);
    folderScroll->type(Fl_Scroll::VERTICAL_ALWAYS);

    folderPack = new Fl_Pack(x+10, y + yOffset + fileOpsLabelHeight + 
		             dividerTextHeight + 3 * spacingHeight, 260, 
			     290 - 2 * fileOpsLabelHeight - dividerTextHeight - 
			     2 * spacingHeight - NAVBUTTONS_BHEIGHT);
    folderPack->type(Fl_Pack::VERTICAL);

    folderScroll->color((Fl_Color) GUI_WINDOW_BGCOLOR);
    folderScroll->labelcolor((Fl_Color) GUI_BTEXT_COLOR);

    this->resizable(folderScroll);
    this->color(GUI_WINDOW_BGCOLOR);
    
    SetStructures(folderIndex);

}