template<class DataDocT>
Definition at line 41 of file DataDocumentGui.h. 00045 : 00046 Window(parent, wndWidth, wndHeight, true), 00047 AppControlDoc(controlId, dataDoc) 00048 { 00049 mDataDoc = dataDoc; 00050 AddDocListener(this); 00051 00052 int width = (wndWidth - 15) / nrOnRow; 00053 int line = 20; 00054 mInfoText1 = mInfoText2 = mInfoText3 = 0; 00055 mStringSelector1 = mStringSelector2 = mStringSelector3 = 0; 00056 00057 if (showFiles) 00058 { 00059 mInfoText1 = new OglGui::TextArea(this, width, 1*line, "set info", 00060 false); 00061 if (nrOnRow >= 2) 00062 mInfoText2 = new OglGui::TextArea(this, width, 1*line, 00063 "file info", false); 00064 } 00065 if ((showBookList) && (nrOnRow >= 3)) 00066 mInfoText3 = new OglGui::TextArea(this, width, 1*line, 00067 "bookmark info", false); 00068 00069 if (showFiles) 00070 { 00071 if (!infoOnly) 00072 { 00073 int nDir = mDataDoc->GetDataSet()->NrDirs(); 00074 int sH = line * ((nrOnRow<2&&nDir<nrLines) ? nDir+1 : nrLines); 00075 mStringSelector1 = new OglGui::StringSelector(this, width, sH); 00076 mStringSelector1->SetStringListener(this, STRING_DIR); 00077 mStringSelector1->GuiName("dataDirSelector"); 00078 //OptionsLook(mStringSelector1, "strSelect", "dataDir"); 00079 } 00080 if (nrOnRow < 2) 00081 { 00082 new OglGui::Strut(this, 4000, 1); 00083 mInfoText2 = new OglGui::TextArea(this,width,line,"file info", 00084 false); 00085 } 00086 mStringSelector2 = new OglGui::StringSelector(this, width, 00087 nrLines*line); 00088 mStringSelector2->SetStringListener(this, STRING_FILE); 00089 mStringSelector2->GuiName("dataFileSelector"); 00090 //OptionsLook(mStringSelector2, "strSelect", "dataFile"); 00091 } 00092 00093 if (showBookList) 00094 { 00095 if (nrOnRow < 3) 00096 { 00097 new OglGui::Strut(this, 4000, 1); 00098 mInfoText3 = new OglGui::TextArea(this, wndWidth, 1*line, 00099 "bookmark info"); 00100 mInfoText3->SetBorderType(0); 00101 } 00102 if (!infoOnly) 00103 { 00104 mStringSelector3 = new OglGui::StringSelector(this, width, 00105 nrLines*line); 00106 mStringSelector3->SetStringListener(this, STRING_BOOK); 00107 mStringSelector3->GuiName("dataBookmarkSelector"); 00108 //OptionsLook(mStringSelector3, "strSelect", "dataBookmark"); 00109 } 00110 } 00111 00112 OglGui::Button* but; 00113 OglGui::TextArea* tArea; 00114 mConceptField = 0; 00115 00116 if (showAnno) 00117 { 00118 //new OglGui::Strut(this, 4000, 1); 00119 but = new OglGui::MenuOnButton(this, 100, 22, "Concept"); 00120 but->SetButtonListener(this, BUT_CONCEPT); 00121 mConceptField = new OglGui::TextField(this, 160, 22, ""); 00122 but = new OglGui::Button(this, 80, 22, "Add",4,true); 00123 but->SetButtonListener(this, BUT_ADD_CONCEPT); 00124 new OglGui::Strut(this, 50, 1); 00125 tArea = new OglGui::TextArea(this, 80, 1*line, "Concepts",false); 00126 //tArea->SetBorderType(0); 00127 but = new OglGui::Button(this, 60, 22, "Load",4,true); 00128 but->SetButtonListener(this, BUT_LOAD_CONCEPTS); 00129 but = new OglGui::Button(this, 60, 22, "Save",4,true); 00130 but->SetButtonListener(this, BUT_SAVE_CONCEPTS); 00131 mConceptFileField = new OglGui::TextField(this, 190, 22, 00132 "concept.txt"); 00133 } 00134 00135 if (showBookBut) 00136 { 00137 new OglGui::Strut(this, 4000, 1); 00138 00139 tArea = new OglGui::TextArea(this, 65, line, "Cursor"); 00140 tArea->SetBorderType(0); 00141 but = new OglGui::Button(this, 105, 22, "Bookmark (b)"); 00142 but->SetButtonListener(this, BUT_BOOKMARK); 00143 but = new OglGui::Button(this, 115, 22, "Unbookmark (B)"); 00144 but->SetButtonListener(this, BUT_UNBOOKMARK); 00145 new OglGui::Strut(this, 50, 1); 00146 tArea = new OglGui::TextArea(this, 80, 1*line, "Bookmarks"); 00147 tArea->SetBorderType(0); 00148 but = new OglGui::Button(this, 60, 22, "Clear"); 00149 but->SetButtonListener(this, BUT_CLEAR_BOOKMARKED); 00150 but = new OglGui::Button(this, 60, 22, "Load"); 00151 but->SetButtonListener(this, BUT_LOAD_BOOKMARKED); 00152 but = new OglGui::Button(this, 60, 22, "Save"); 00153 but->SetButtonListener(this, BUT_SAVE_BOOKMARKED); 00154 mBookmarkedField = new OglGui::TextField(this, 190, 20, 00155 "filename.ixs"); 00156 } 00157 00158 Core::Database::RawDataSet* dataSet = mDataDoc->GetDataSet(); 00159 std::string info = std::string("Set ") + dataSet->GetSetName() + 00160 " has " + MakeString(dataSet->NrDirs()) + " dirs"; 00161 if (mInfoText1) 00162 mInfoText1->SetText(info); 00163 if (mStringSelector1) 00164 for (int i=0 ; i<dataSet->NrDirs() ; i++) 00165 mStringSelector1->AddString(dataSet->GetSection(i) + "/" + 00166 dataSet->GetDir(i)); 00167 }
|