Merge lp:~ubuntu-branches/ubuntu/utopic/gentle/utopic-201408050405 into lp:ubuntu/utopic/gentle

Proposed by Ubuntu Package Importer
Status: Needs review
Proposed branch: lp:~ubuntu-branches/ubuntu/utopic/gentle/utopic-201408050405
Merge into: lp:ubuntu/utopic/gentle
Diff against target: 4082 lines (+37/-3941) (has conflicts)
11 files modified
.pc/forward_slashes.patch/MyFrame.cpp (+0/-2790)
.pc/remove_clustalw.patch/Makefile.am (+0/-244)
.pc/remove_tinyxml.patch/Makefile.am (+0/-250)
.pc/remove_tinyxml.patch/TXMLfile.cpp (+0/-256)
.pc/remove_tinyxml.patch/TXMLfile.h (+0/-40)
.pc/remove_tinyxml.patch/main.h (+0/-354)
Makefile.am (+34/-0)
MyFrame.cpp (+1/-1)
TXMLfile.cpp (+1/-1)
TXMLfile.h (+1/-1)
main.h (+0/-4)
Contents conflict in .pc/applied-patches
Text conflict in Makefile.am
To merge this branch: bzr merge lp:~ubuntu-branches/ubuntu/utopic/gentle/utopic-201408050405
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+229552@code.launchpad.net

Description of the change

The package importer has detected a possible inconsistency between the package history in the archive and the history in bzr. As the archive is authoritative the importer has made lp:ubuntu/utopic/gentle reflect what is in the archive and the old bzr branch has been pushed to lp:~ubuntu-branches/ubuntu/utopic/gentle/utopic-201408050405. This merge proposal was created so that an Ubuntu developer can review the situations and perform a merge/upload if necessary. There are three typical cases where this can happen.
  1. Where someone pushes a change to bzr and someone else uploads the package without that change. This is the reason that this check is done by the importer. If this appears to be the case then a merge/upload should be done if the changes that were in bzr are still desirable.
  2. The importer incorrectly detected the above situation when someone made a change in bzr and then uploaded it.
  3. The importer incorrectly detected the above situation when someone just uploaded a package and didn't touch bzr.

If this case doesn't appear to be the first situation then set the status of the merge proposal to "Rejected" and help avoid the problem in future by filing a bug at https://bugs.launchpad.net/udd linking to this merge proposal.

(this is an automatically generated message)

To post a comment you must log in.

Unmerged revisions

8. By Luke Yelavich

Merge branch lp:~noskcaj/ubuntu/utopic/gentle/wxwidgets-3.0

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== renamed file '.pc/applied-patches' => '.pc/applied-patches.THIS'
2=== removed directory '.pc/forward_slashes.patch'
3=== removed file '.pc/forward_slashes.patch/MyFrame.cpp'
4--- .pc/forward_slashes.patch/MyFrame.cpp 2011-06-03 21:12:05 +0000
5+++ .pc/forward_slashes.patch/MyFrame.cpp 1970-01-01 00:00:00 +0000
6@@ -1,2790 +0,0 @@
7-#include "MyFrame.h"
8-#include "SendHTTP.h"
9-#include <wx/sysopt.h>
10-#include "TEliteLaChromLogDialog.h"
11-
12-// ---------------------------------------------------------------------------
13-// MyFrame
14-// ---------------------------------------------------------------------------
15-
16-BEGIN_EVENT_TABLE(MyFrame, MyFrameType)
17-EVT_MENU(MDI_ABOUT, MyFrame::OnAbout)
18-EVT_MENU(MDI_HELP, MyFrame::OnHelp)
19-EVT_MENU(MDI_ENZYME_EDITOR, MyFrame::OnEnzymeEditor)
20-EVT_MENU(MDI_ALIGNMENT, MyFrame::OnAlignment)
21-EVT_MENU(MDI_IMAGE_VIEWER, MyFrame::OnImageViewer)
22-EVT_MENU(MDI_EXTERNAL_INTERFACE, MyFrame::OnExternalInterface)
23-EVT_MENU(MDI_CALCULATOR, MyFrame::OnCalculator)
24-EVT_MENU(MDI_GRAPH, MyFrame::OnGraph)
25-EVT_MENU(MDI_FILE_OPEN, MyFrame::OnFileOpen)
26-EVT_MENU(MDI_FILE_IMPORT, MyFrame::OnFileImport)
27-EVT_MENU(MDI_FILE_SAVE_ALL, MyFrame::OnStoreAll)
28-EVT_MENU(MDI_TEXT_IMPORT, MyFrame::OnTextImport)
29-EVT_MENU(MDI_PROJECT_SAVE, MyFrame::OnProjectSave)
30-EVT_MENU(MDI_PROJECT_LOAD, MyFrame::OnProjectLoad)
31-EVT_MENU(MDI_PROJECT_CLOSE, MyFrame::OnProjectClose)
32-EVT_MENU(MDI_QUIT, MyFrame::OnQuit)
33-EVT_MENU(MDI_CLOSE, MyFrame::OnMDIClose)
34-EVT_MENU(MDI_MANAGE_DATABASE, MyFrame::OnManageDatabase)
35-EVT_MENU(PROGRAM_OPTIONS, MyFrame::OnProgramOptions)
36-EVT_MENU(MDI_HOMEPAGE, MyFrame::OnHomepage)
37-EVT_MENU(MDI_LIGATION, MyFrame::OnLigation)
38-EVT_MENU(MDI_CLONING_ASSISTANT, MyFrame::OnCloningAssistant)
39-EVT_MENU(MDI_SEQUENCING_ASSISTANT, MyFrame::OnSequencingAssistant)
40-EVT_MENU(MDI_DOTPLOT, MyFrame::OnDotPlot)
41-EVT_MENU(MDI_RESTRICTION_IDENTIFIER, MyFrame::OnRestrictionIdentifier)
42-
43-EVT_MENU(Y___, MyFrame::TestMenu)
44-EVT_MENU(MDI_RESTRICTION, MyFrame::BollocksMenu)
45-EVT_MENU(MDI_PRINT_REPORT, MyFrame::BollocksMenu)
46-
47-EVT_MENU(MDI_NEXT_WINDOW, MyFrame::BollocksMenu)
48-EVT_MENU(MDI_PREV_WINDOW, MyFrame::BollocksMenu)
49-
50-EVT_MENU_RANGE(A___,Z___,MyFrame::RerouteMenu)
51-EVT_MENU_RANGE(ONLINE_TOOLS_BEGIN,ONLINE_TOOLS_END,MyFrame::OnlineTools)
52-
53-
54-EVT_SASH_DRAGGED_RANGE(FRAME_SASH_1, FRAME_SASH_TOP, MyFrame::OnSashDrag)
55-
56-EVT_CLOSE(MyFrame::OnClose)
57-
58-EVT_SIZE(MyFrame::OnSize)
59-END_EVENT_TABLE()
60-
61-/// \brief Number of wxAcceleratorEntry entries
62-#define ACC_ENT 43
63-
64-/** \brief Constructor
65-
66- * - Initializes variables
67- * - Sets the accelerator keys
68- */
69-MyFrame::MyFrame(wxWindow *parent,
70- const wxWindowID id,
71- const wxString& title,
72- const wxPoint& pos,
73- const wxSize& size,
74- const long style)
75-: MyFrameType(parent, id, title, pos, size, style)
76-{
77- dying = false ;
78- activating = false ;
79- locked = 0 ;
80- update_child_list = false ;
81-#ifdef MYTEST
82- test_suite = NULL ;
83-#endif
84-
85-#ifndef __WXMAC__
86- // Accelerators
87- wxAcceleratorEntry entries[ACC_ENT];
88- entries[ 0].Set(wxACCEL_CTRL, (int) 'X', MDI_CUT);
89- entries[ 1].Set(wxACCEL_CTRL, (int) 'C', MDI_COPY);
90- entries[ 2].Set(wxACCEL_CTRL, (int) 'V', MDI_PASTE);
91- entries[ 3].Set(wxACCEL_CTRL, (int) 'L', MDI_LIGATION);
92- entries[ 4].Set(wxACCEL_CTRL, (int) 'A', MDI_MARK_ALL);
93- entries[ 5].Set(wxACCEL_CTRL, (int) 'S', MDI_FILE_SAVE);
94- entries[ 6].Set(wxACCEL_CTRL, (int) 'E', MDI_EXPORT);
95- entries[ 7].Set(wxACCEL_NORMAL, WXK_F2, MDI_EDIT_MODE);
96- entries[ 8].Set(wxACCEL_CTRL, (int) '0', AA_NONE);
97- entries[ 9].Set(wxACCEL_CTRL, (int) '1', AA_THREE_1);
98- entries[10].Set(wxACCEL_CTRL, (int) '2', AA_THREE_2);
99- entries[11].Set(wxACCEL_CTRL, (int) '3', AA_THREE_3);
100- entries[12].Set(wxACCEL_CTRL, (int) '4', AA_THREE_M1);
101- entries[13].Set(wxACCEL_CTRL, (int) '5', AA_THREE_M2);
102- entries[14].Set(wxACCEL_CTRL, (int) '6', AA_THREE_M3);
103- entries[15].Set(wxACCEL_CTRL, (int) '7', AA_ALL);
104- entries[16].Set(wxACCEL_CTRL, (int) '8', AA_KNOWN);
105- entries[17].Set(wxACCEL_CTRL, (int) 'G', MDI_ALIGNMENT);
106- entries[18].Set(wxACCEL_CTRL, (int) 'F', MDI_FIND);
107- entries[19].Set(wxACCEL_NORMAL, WXK_F1, MDI_HELP);
108- entries[20].Set(wxACCEL_CTRL, (int) 'Y', AA_ONE);
109- entries[21].Set(wxACCEL_CTRL, (int) 'W', AA_THREE);
110- entries[22].Set(wxACCEL_NORMAL, WXK_F11, MDI_PROJECT_LOAD);
111- entries[23].Set(wxACCEL_NORMAL, WXK_F12, MDI_PROJECT_SAVE);
112- entries[24].Set(wxACCEL_NORMAL, WXK_F4, MDI_ORFS);
113- entries[25].Set(wxACCEL_NORMAL, WXK_F5, MDI_CIRCULAR_LINEAR);
114- entries[26].Set(wxACCEL_NORMAL, WXK_F3, MDI_VIEW_MODE);
115- entries[27].Set(wxACCEL_NORMAL, WXK_F6, MDI_TOGGLE_FEATURES);
116- entries[28].Set(wxACCEL_NORMAL, WXK_F7, MDI_TOGGLE_RESTRICTION);
117- entries[29].Set(wxACCEL_CTRL, (int) 'O', MDI_FILE_OPEN);
118- entries[30].Set(wxACCEL_CTRL, (int) 'I', MDI_FILE_IMPORT);
119- entries[31].Set(wxACCEL_CTRL, (int) 'Z', MDI_UNDO);
120- entries[32].Set(wxACCEL_CTRL, (int) 'N', MDI_TEXT_IMPORT);
121- entries[33].Set(wxACCEL_CTRL, (int) 'D', MDI_EXTERNAL_INTERFACE);
122- entries[34].Set(wxACCEL_CTRL, WXK_F4, MDI_CLOSE);
123- entries[35].Set(wxACCEL_CTRL, WXK_TAB, MDI_NEXT_WINDOW);
124- entries[36].Set(wxACCEL_CTRL|wxACCEL_SHIFT, WXK_TAB, MDI_PREV_WINDOW);
125- entries[37].Set(wxACCEL_NORMAL, WXK_F8, MDI_TOGGLE_IDNA);
126- entries[38].Set(wxACCEL_CTRL|wxACCEL_SHIFT, WXK_F12, Y___);
127- // entries[38].Set(wxACCEL_CTRL, WXK_F12, MDI_GRAPH);
128- entries[39].Set(wxACCEL_CTRL, WXK_F1, MDI_ABOUT);
129- entries[40].Set(wxACCEL_NORMAL, WXK_F9, MDI_AUTO_ANNOTATE);
130- entries[41].Set(wxACCEL_CTRL, (int) 'K', MDI_CLONING_ASSISTANT);
131- entries[42].Set(wxACCEL_CTRL|wxACCEL_SHIFT, (int) 'S', MDI_FILE_SAVE_ALL);
132-
133- wxAcceleratorTable accel(ACC_ENT, entries);
134- SetAcceleratorTable(accel);
135-#endif
136- html_ep = NULL ;
137- lastChild = NULL ;
138- tb_mychild = NULL ;
139- online_tools = new TOnlineTools ;
140- push_help ( _T("GENtle") ) ;
141-
142- // Load DNA markers
143- wxString marker_file = myapp()->homedir + myapp()->slash + _T("marker.txt") ;
144- wxTextFile tf ( marker_file ) ;
145- if ( tf.Open ( wxConvUTF8 ) ) wxSafeShowMessage ( marker_file , marker_file ) ;
146- for ( unsigned int a = 0 ; a < tf.GetLineCount() ; a++ )
147- {
148- wxString s = tf.GetLine ( a ) ;
149- s = s.Trim().Trim(false) ;
150- if ( s.IsEmpty() ) continue ; // Skip blank lines
151- if ( s.Left ( 1 ) == _T("#") ) continue ; // Skip comments
152- dna_marker.Add ( s ) ;
153- }
154-}
155-
156-/** \brief Destructor
157-
158- * - Stores the last project used, so it can be reopened on the next program start
159- * - Clears memory
160- */
161-MyFrame::~MyFrame ()
162-{
163- pop_help () ;
164- if ( html_ep ) delete html_ep ;
165- rememberLastProject () ;
166- CLEAR_DELETE ( dbcache ) ;
167- // delete LS ;
168-}
169-
170-/** \brief Initializes the frame
171-
172- * - Creates frame layout
173- * - Accesses local database and imports enzyme list
174- * - Sets options
175- * - Loads language file
176- * - Checks for updates online (Windows only)
177- * - Menus
178- * - Initialized drop target
179- * - Loads bitmaps for user interface
180- * - Loads last project
181- * - Parses command line paramaters
182- */
183-void MyFrame::initme ()
184-{
185-// myapp()->sw.Start() ;
186-
187-#ifdef __WXGTK__
188- SetFont ( *MYFONT ( 8 , wxSWISS , wxNORMAL , wxNORMAL ) ) ;
189-#endif
190-
191- int borders = wxNO_BORDER ;
192- wxFileSystem::AddHandler(new wxInternetFSHandler );
193-
194- wxSashLayoutWindow* win ;
195- m_leftWindow2 = m_topWindow = m_bottomWindow = NULL ;
196-
197- // A window to the left of the client window
198- // This contains the main tree
199- win = new wxSashLayoutWindow(this, FRAME_SASH_1,
200- wxDefaultPosition, wxSize(200, 30),
201- borders | wxSW_3D | wxCLIP_CHILDREN);
202- win->SetDefaultSize(wxSize(200, 1000));
203- win->SetOrientation(wxLAYOUT_VERTICAL);
204- win->SetAlignment(wxLAYOUT_LEFT);
205- win->SetSashVisible(wxSASH_RIGHT, TRUE);
206- mainTree = new TMainTree ( win , MAIN_TREE_DUMMY ) ;
207-
208-
209- m_leftWindow1 = win;
210-
211- // The client window
212- win = new wxSashLayoutWindow(this, FRAME_SASH_2,
213- wxDefaultPosition, wxSize(500, 30),
214- borders | wxSW_3D | wxCLIP_CHILDREN);
215- win->SetDefaultSize(wxSize(500, 1000));
216- win->SetOrientation(wxLAYOUT_VERTICAL);
217- win->SetAlignment(wxLAYOUT_LEFT);
218- win->SetSashVisible(wxSASH_RIGHT, TRUE);
219- m_leftWindow2 = win;
220-
221- // Database access
222- LS = new TStorage ( LOCAL_STORAGE ) ;
223- LS->createDatabase() ;
224- LS->startup () ;
225- LS->syncEnzymes () ;
226- // LS->optimizeDatabase () ; // This will VACUUM sqlite databases
227-
228- // Synchronize enzymes in known databases
229- // Turned of temporarily
230- // LS->synchronize () ;
231-
232- // Import enzymes from local database
233- LS->import() ;
234-
235-#ifndef MISER_MODE
236- bool default_update = false ;
237-#else
238- bool default_update = true ;
239-#endif
240-
241-#ifdef __WXMAC__
242- default_update = true ;
243-#endif
244-
245- // Loading program options from database
246- showVectorTitle = LS->getOption ( _T("SHOWVECTORTITLE") , true ) ;
247- showVectorLength = LS->getOption ( _T("SHOWVECTORLENGTH") , true ) ;
248- enhancedRefresh = LS->getOption ( _T("ENHANCEDREFRESH") , true ) ;
249- loadLastProject = LS->getOption ( _T("LOADLASTPROJECT") , true ) ;
250- useMetafile = LS->getOption ( _T("USEMETAFILE") , false ) ;
251- showSplashScreen = LS->getOption ( _T("SHOWSPLASHSCREEN") , true ) ;
252- checkUpdate = LS->getOption ( _T("CHECKUPDATE") , default_update ) ;
253- lang_string = LS->getOption ( _T("LANGUAGE") , _T("en") ) ;
254- doRegisterStuff = LS->getOption ( _T("REGISTERSTUFF") , true ) ;
255- editFeatureMode = LS->getOption ( _T("EDITFEATUREMODE") , 0 ) ;
256- showStopCodon = LS->getOption ( _T("SHOWSTOPCODON") , 0 ) ;
257- useCoolCanvas = LS->getOption ( _T("USECOOLCANVAS") , false ) ; // Ignored
258- useInternalHelp = LS->getOption ( _T("USEINTERNALHELP") , false ) ;
259- useOnlineHelp = LS->getOption ( _T("USEONLINEHELP") , true ) ;
260- showEnzymePos = LS->getOption ( _T("SHOWENZYMEPOS") , true ) ;
261- showToolTips = LS->getOption ( _T("SHOWTOOLTIPS") , true ) ;
262- showLowercaseDNA = LS->getOption ( _T("SHOWLOWERCASEDNA") , false ) ;
263- orfLength = LS->getOption ( _T("ORFLENGTH") , 100 ) ;
264- nonstandard_translation_table = LS->getOption ( _T("nonstandard_translation_table") , -1 ) ;
265- proxy = LS->getOption ( _T("PROXY") , _T("") ) ;
266- //#ifdef __WXMAC__
267- useTwoToolbars = LS->getOption ( _T("use_two_toolbars") , true ) ;
268- /*#else
269- useTwoToolbars = LS->getOption ( _T("use_two_toolbars") , false ) ;
270- #endif*/
271-
272-
273- int aa_red = LS->getOption ( _T("AA_RED") , wxLIGHT_GREY->Red() ) ;
274- int aa_green = LS->getOption ( _T("AA_GREEN") , wxLIGHT_GREY->Green() ) ;
275- int aa_blue = LS->getOption ( _T("AA_BLUE") , wxLIGHT_GREY->Blue() ) ;
276- aa_color.Set ( aa_red , aa_green , aa_blue ) ;
277-
278- // if ( !proxy.IsEmpty() ) wxURL::SetDefaultProxy ( proxy ) ;
279-
280- stopcodon = showStopCodon == 0 ? '|' : '*' ;
281-
282- myapp()->init_txt ( lang_string.c_str() , _T("variables.csv") ) ;
283-
284-
285- global_enzyme_rules = new TEnzymeRules ;
286- global_enzyme_rules->load_global_settings() ;
287-
288- // Set the DEBUGGING option in your local test database,
289- // so you won't be bothered with updates anymore :-)
290- if ( LS->getOption ( _T("DEBUGGING") , _T("") ) == _T("1") ) checkUpdate = false ;
291-
292-#ifndef __WXMSW__
293-#ifndef __WXMAC__
294- checkUpdate = false ;
295-#endif
296-#endif
297-
298- // Check for update online
299- if ( checkUpdate )
300- {
301-// wxMessageBox ( _T("A") , wxString::Format(_T("%d"),myapp()->sw.Time())); myapp()->sw.Start() ;
302- wxString cur_update = check4update () ;
303-// wxMessageBox ( _T("B") , wxString::Format(_T("%d"),myapp()->sw.Time())); myapp()->sw.Start() ;
304- if ( !cur_update.IsEmpty() )
305- {
306- update2version ( cur_update ) ;
307- return ;
308- }
309- }
310-
311- project.name = txt("project") ;
312- SetTitle ( txt("gentle") ) ;
313- mainTree->initme() ;
314-
315- // Give it an icon
316-#ifdef __WXMSW__
317- SetIcon(wxIcon(_T("GENtle.ico"),wxBITMAP_TYPE_ICO));
318-#elif __WXMAC__
319-#else
320- SetIcon(wxIcon( mondrian_xpm ));
321-#endif
322-
323- // Make a menubar
324- wxMenu *file_menu = new wxMenu;
325-
326- file_menu->Append(MDI_FILE_OPEN, txt("m_open") , txt("m_opentxt") );
327- file_menu->Append(MDI_FILE_IMPORT, txt("m_import") , txt("m_importtxt") );
328- file_menu->Append(MDI_TEXT_IMPORT, txt("m_text_import") , txt("m_text_importtxt") );
329- file_menu->AppendSeparator();
330- file_menu->Append(MDI_PROJECT_LOAD, txt("m_project_open") , txt("m_project_opentxt") );
331- file_menu->Append(MDI_PROJECT_SAVE, txt("m_project_save") , txt("m_project_savetxt") );
332- file_menu->Append(MDI_PROJECT_CLOSE, txt("m_project_close") , txt("m_project_closetxt") );
333- file_menu->AppendSeparator();
334- file_menu->Append(MDI_QUIT, txt("m_exit") , txt("m_exittxt") ) ;
335-
336- wxMenu *tool_menu = getToolMenu ( false ) ;
337- wxMenu *help_menu = getHelpMenu () ;
338-
339- menu_bar = new wxMenuBar;
340-
341- menu_bar->Append(file_menu, txt("m_file") );
342- menu_bar->Append(tool_menu, txt("m_tools") );
343- menu_bar->Append(help_menu, txt("m_help") );
344-
345- // Associate the menu bar with the frame
346- SetMenuBar(menu_bar);
347- CreateStatusBar();
348- GetStatusBar()->SetFieldsCount ( 2 ) ;
349-
350- // Drag'n'drop
351- MyFrameDropTarget *dt = new MyFrameDropTarget ;
352- SetDropTarget ( dt ) ;
353-
354- // Bitmap library
355- wxString icondir = myapp()->bmpdir + myapp()->slash ;
356- bitmaps.push_back ( wxBitmap (icondir + _T("document-new.png") , wxBITMAP_TYPE_PNG) ) ; // 0
357- bitmaps.push_back ( wxBitmap (icondir + _T("document-open.png") , wxBITMAP_TYPE_PNG) ) ; // 1
358- bitmaps.push_back ( wxBitmap (icondir + _T("document-save.png") , wxBITMAP_TYPE_PNG) ) ; // 2
359- bitmaps.push_back ( wxBitmap (icondir + _T("edit-undo.png") , wxBITMAP_TYPE_PNG) ) ; // 3
360- bitmaps.push_back ( wxBitmap (icondir + _T("edit-cut.png") , wxBITMAP_TYPE_PNG) ) ; // 4
361- bitmaps.push_back ( wxBitmap (icondir + _T("edit-copy.png") , wxBITMAP_TYPE_PNG) ) ; // 5
362- bitmaps.push_back ( wxBitmap (icondir + _T("edit-paste.png") , wxBITMAP_TYPE_PNG) ) ;// 6
363- bitmaps.push_back ( wxBitmap (icondir + _T("display_circular_linear.png") , wxBITMAP_TYPE_PNG) ) ; // 7
364- bitmaps.push_back ( wxBitmap (icondir + _T("display_circular_linear.png") , wxBITMAP_TYPE_PNG) ) ; // 8
365- bitmaps.push_back ( wxBitmap (icondir + _T("display_orfs.png") , wxBITMAP_TYPE_PNG) ) ; // 9
366- bitmaps.push_back ( wxBitmap (icondir + _T("display_features.png") , wxBITMAP_TYPE_PNG) ) ; // 10
367- bitmaps.push_back ( wxBitmap (icondir + _T("restriction_new.png") , wxBITMAP_TYPE_PNG) ) ; // 11
368- bitmaps.push_back ( wxBitmap (icondir + _T("view_new.png") , wxBITMAP_TYPE_PNG) ) ; // 12
369- bitmaps.push_back ( wxBitmap (icondir + _T("accessories-text-editor.png") , wxBITMAP_TYPE_PNG) ) ; // 13
370- bitmaps.push_back ( wxBitmap (icondir + _T("go-down.png") , wxBITMAP_TYPE_PNG) ) ; // 14
371- bitmaps.push_back ( wxBitmap (icondir + _T("go-up.png") , wxBITMAP_TYPE_PNG) ) ; // 15
372- bitmaps.push_back ( wxBitmap (icondir + _T("document-print.png") , wxBITMAP_TYPE_PNG) ) ; // 16
373- bitmaps.push_back ( wxBitmap (icondir + _T("alignments.png") , wxBITMAP_TYPE_PNG) ) ; // 17
374- bitmaps.push_back ( wxBitmap (icondir + _T("image_viewer.png") , wxBITMAP_TYPE_PNG) ) ; // 18
375- bitmaps.push_back ( wxBitmap (icondir + _T("applications-internet.png") , wxBITMAP_TYPE_PNG) ) ; // 19
376- bitmaps.push_back ( wxBitmap (icondir + _T("accessories-calculator.png") , wxBITMAP_TYPE_PNG) ) ; // 20
377- bitmaps.push_back ( wxBitmap (icondir + _T("preferences-desktop.png") , wxBITMAP_TYPE_PNG) ) ; // 21
378- bitmaps.push_back ( wxBitmap (icondir + _T("edit-find.png") , wxBITMAP_TYPE_PNG) ) ; // 22
379-
380- bitmaps.push_back ( to_grey ( bitmaps[ 4] ) ) ; // 23 - GREY Cut
381- bitmaps.push_back ( to_grey ( bitmaps[ 5] ) ) ; // 24 - GREY Copy
382- bitmaps.push_back ( to_grey ( bitmaps[ 6] ) ) ; // 25 - GREY Paste
383- bitmaps.push_back ( to_grey ( bitmaps[22] ) ) ; // 26 - GREY Find
384- bitmaps.push_back ( to_grey ( bitmaps[ 2] ) ) ; // 27 - GREY Save
385- bitmaps.push_back ( to_grey ( bitmaps[ 3] ) ) ; // 28 - GREY Undo
386- bitmaps.push_back ( to_grey ( bitmaps[16] ) ) ; // 29 - GREY Print sequence
387-
388-
389- if ( useTwoToolbars )
390- {
391- mainToolBar = CreateToolBar ( wxTB_HORIZONTAL ) ;
392- InitToolBar ( mainToolBar ) ;
393- addTool ( mainToolBar , MDI_TEXT_IMPORT ) ;
394- addTool ( mainToolBar , MDI_FILE_IMPORT ) ;
395- addTool ( mainToolBar , MDI_FILE_OPEN ) ;
396- addTool ( mainToolBar , MDI_FILE_SAVE ) ;
397- addTool ( mainToolBar , SEQ_PRINT ) ;
398- addTool ( mainToolBar , MDI_UNDO ) ;
399- addCCPFTools ( mainToolBar , true ) ;
400- addDefaultTools ( mainToolBar ) ;
401- mainToolBar->Realize() ;
402- updateCCP ( NULL ) ;
403- }
404- else
405- {
406- mainToolBar = NULL ;
407- }
408-
409-#ifdef __WXGTK__
410- Show(TRUE);
411- int sw , sh ;
412- wxDisplaySize ( &sw , &sh ) ;
413- // SetSize ( sw/10 , sh/10 , sw*8/10 , sh*7/10 ) ;
414- SetSize ( 0 , 0 , sw , sh*9/10 ) ;
415-#else
416- Show(TRUE);
417- Maximize() ;
418-#endif
419-
420-
421- html_ep = new wxHtmlEasyPrinting ( _T("") , this ) ;
422-
423- wxBeginBusyCursor() ;
424-#ifndef MISER_MODE
425- lockDisplay ( true ) ;
426-#endif
427-
428- // Load last project?
429- // loadLastProject = false ;
430- if ( loadLastProject )
431- {
432- wxString sql , n , d ;
433- TSQLresult r ;
434- sql = _T("SELECT s_value FROM stuff WHERE s_type='LASTPROJECT' AND s_name='NAME'") ;
435- r = LS->getObject ( sql ) ;
436- if ( r.rows() > 0 ) n = r[0][0] ;
437- sql = _T("SELECT s_value FROM stuff WHERE s_type='LASTPROJECT' AND s_name='DATABASE'") ;
438- r = LS->getObject ( sql ) ;
439- if ( r.rows() > 0 ) d = r[0][0] ;
440- if ( !n.IsEmpty() && !d.IsEmpty() )
441- {
442- TManageDatabaseDialog mdb ( this , _T("dummy") , ACTION_MODE_STARTUP ) ;
443- mdb.do_load_project ( n , d ) ;
444- mainTree->Refresh () ;
445- }
446- }
447-
448-#ifndef MISER_MODE
449- lockDisplay ( false ) ;
450-#endif
451-
452- // Command line parameters?
453- if ( myapp()->argc > 1 )
454- {
455- int a ;
456-
457- // Pre-cache key-value pairs
458- for ( a = 1 ; a < myapp()->argc ; a++ )
459- {
460- wxString path = myapp()->argv[a] ;
461- if ( path.Left(1) != _T("-") ) continue ; // No key/value pair
462- while ( path.Left(1) == _T("-") ) path = path.Mid ( 1 ) ;
463- wxString key = path.BeforeFirst('=').Lower().Trim().Trim(false) ;
464- wxString value = path.AfterFirst('=').Trim().Trim(false) ;
465- if ( value.IsEmpty() ) value = _T("1") ;
466- myapp()->clp[key] = value ;
467- }
468-
469- // Try to import images
470- wxProgressDialog pd ( txt("t_loading") , _T("") , myapp()->argc-1 , NULL , wxPD_ALL ) ;
471- for ( a = 1 ; a < myapp()->argc ; a++ )
472- {
473- wxString path = myapp()->argv[a] ;
474- if ( !pd.Update ( a-1 , path ) ) break ;
475- if ( path.Left(1) == _T("-") ) continue ; // key/value pair, did these already
476- if ( path.Left(9).Upper() == _T("GENTLE://") )
477- {
478- path = path.Mid ( 9 ) ;
479- if ( path.GetChar ( path.length()-1 ) == '/' ) // Trailing '/'
480- path = path.Mid ( 0 , path.length() - 1 ) ;
481- wxString db = path.BeforeFirst ( ':' ) ;
482- wxString name = path.AfterFirst ( ':' ) ;
483- TManageDatabaseDialog mdb ( this , _T("dummy") , ACTION_MODE_STARTUP ) ;
484- if ( !mdb.do_load_DNA ( name , db ) ) wxMessageBox ( txt("t_not_all_files_imported") ) ;
485- mainTree->Refresh () ;
486- }
487- else
488- {
489- if ( !wxFileExists ( path ) ) continue ; // No such file
490- wxString file = path.AfterLast ( '/' ) ;
491- file = file.AfterLast ( '\\' ) ;
492- importFile ( file , path , -1 ) ;
493- wxSetWorkingDirectory ( myapp()->homedir ) ;
494- }
495- }
496- }
497-
498-
499- wxEndBusyCursor() ;
500- Raise () ;
501- mainTree->Refresh () ;
502-
503- SetSizeHints ( 600 , 400 ) ;
504- Show(TRUE);
505- m_leftWindow2->SetFocus () ;
506-}
507-
508-wxBitmap MyFrame::to_grey ( wxBitmap &bmp1 )
509-{
510- /*#ifndef __WXMSW__
511- return wxNullBitmap ;
512- #endif*/
513- wxImage i = bmp1.ConvertToImage () ;
514-#ifdef __WXMSW__
515- wxImage i2 ( i.GetWidth() , i.GetHeight() ) ;
516-#endif
517- for ( int x = 0 ; x < i.GetWidth() ; x++ )
518- {
519- for ( int y = 0 ; y < i.GetHeight() ; y++ )
520- {
521- int z = ( i.GetRed(x,y) + i.GetGreen(x,y) + i.GetBlue(x,y) ) / 3 ;
522-#ifndef __WXMSW__
523- z /= 2 ;
524- i.SetRGB ( x , y , z , z , z ) ;
525-#else
526- if ( i.GetAlpha ( x , y ) < 255 ) z = 200 ;
527- else z /= 2 ;
528- i2.SetRGB ( x , y , z , z , z ) ;
529-#endif
530- }
531- }
532-#ifdef __WXMSW__
533- return wxBitmap ( i2 ) ;
534-#else
535- return wxBitmap ( i ) ;
536-#endif
537-}
538-
539-
540-/** \brief Handles close event
541-
542- Scans through all the children; if any one is changed, ask the user the
543- darn "are you sure" question, unless in debugging mode
544- */
545-void MyFrame::OnClose(wxCloseEvent& event)
546-{
547- bool canclose = true ;
548- for ( unsigned int a = 0 ; canclose && a < children.GetCount() ; a++ )
549- canclose = ! ( children[a]->vec && children[a]->vec->isChanged() ) ;
550- if ( LS->getOption ( _T("DEBUGGING") , _T("") ) == _T("1") ) canclose = true ; // For debugging
551- if ( !canclose )
552- {
553- if ( wxYES == wxMessageBox ( txt("t_some_changed") , txt("msg_box") , wxICON_QUESTION | wxYES | wxNO ) )
554- canclose = true ;
555- }
556- if ( canclose )
557- {
558- dying = true ;
559- event.Skip();
560- }
561- else event.Veto() ;
562-}
563-
564-/** \brief Handles the Quit command, closes
565- */
566-void MyFrame::OnQuit(wxCommandEvent& event)
567-{
568- Close();
569-}
570-
571-/** \brief Displays "About" text
572- */
573-void MyFrame::OnAbout(wxCommandEvent& event )
574-{
575- wxString text = txt("t_about_txt") ;
576- (void)wxMessageBox(text + _T("\n\nV ") + myapp()->get_GENtle_version(), txt("t_about") );
577-}
578-
579-/** \brief Invokes homepage
580- */
581-void MyFrame::OnHomepage(wxCommandEvent& event )
582-{
583- wxExecute ( myapp()->getHTMLCommand ( _T("http://gentle.magnusmanske.de") ) ) ;
584-}
585-
586-/** \brief Invokes help
587- */
588-void MyFrame::OnHelp(wxCommandEvent& event )
589-{
590- wxString helpfile ;
591- if ( useInternalHelp )
592- {
593- wxHtmlHelpController *hc = new wxHtmlHelpController ( wxHF_DEFAULT_STYLE|wxHF_OPEN_FILES ) ;
594- helpfile += myapp()->homedir ;
595- helpfile += _T("\\help\\") ;
596- helpfile += lang_string ;
597- helpfile += _T(".hhp") ;
598- hc->AddBook ( helpfile ) ;
599- hc->DisplayContents () ;
600- }
601- else
602- {
603- helpfile = get_help() ;
604- if ( useOnlineHelp && !helpfile.IsEmpty() )
605- {
606- helpfile = _T("http://en.wikibooks.org/wiki/") + helpfile ;
607- }
608- else helpfile.Clear() ;
609-
610- if ( helpfile.IsEmpty() )
611- {
612-#ifdef __WXMAC__
613- helpfile = _T("\"") ;
614- helpfile += myapp()->homedir ;
615- helpfile += _T("/") ;
616- helpfile += txt("f_help").AfterFirst ( '/' ) ;
617- helpfile += _T("\"") ;
618-#endif
619-
620-#ifdef __WXMSW__
621- helpfile = _T("\"") ;
622- helpfile += myapp()->homedir ;
623- helpfile += _T("\\") ;
624- helpfile += txt("f_help") ;
625- helpfile += _T("\"") ;
626-
627- for ( int a = 0 ; a < helpfile.length() ; a++ )
628- if ( helpfile.GetChar(a) == '/' ) helpfile.SetChar ( a , '\\' ) ;
629-#endif
630- }
631-
632- if ( !helpfile.IsEmpty() )
633- {
634- wxString command = myapp()->getHTMLCommand ( helpfile ) ;
635- wxExecute ( command ) ;
636- }
637- }
638-}
639-
640-/** \brief Returns pointer to last (active) child
641- */
642-ChildBase *MyFrame::GetActiveChild() //SDI
643-{
644- return lastChild ;
645-}
646-
647-/** \brief Invokes the enzyme editor
648- */
649-void MyFrame::OnEnzymeEditor(wxCommandEvent& event )
650-{
651- TVectorEditor ee ( this , txt("t_enzymeeditor") , NULL ) ;
652- ee.ShowModal () ;
653-}
654-
655-/** \brief Invokes the "open from database" dialog
656- */
657-void MyFrame::OnFileOpen(wxCommandEvent& event )
658-{
659- unsigned int i = children.GetCount() ;
660- TManageDatabaseDialog dbd ( this , txt("t_open") , ACTION_MODE_LOAD ) ;
661- dbd.ShowModal () ;
662- if ( i != children.GetCount() )
663- setActiveChild ( children[children.GetCount()-1] ) ;
664- if ( GetActiveChild() ) GetActiveChild()->SetFocus() ;
665-}
666-
667-/** \brief Invokes the "enter sequence manually" dialog and calls the appropriate creation function
668- */
669-void MyFrame::OnTextImport(wxCommandEvent& event )
670-{
671- TextImportDialog d ( this , txt("m_text_importtxt") ) ;
672-
673- ChildBase *c = (ChildBase*) GetActiveChild() ;
674- if ( c && c->def == _T("PrimerDesign") ) d.type->SetSelection ( 4 ) ;
675-
676- if ( d.ShowModal () != wxID_OK ) return ;
677-
678- int type = d.type->GetSelection () ;
679-
680- if ( type == 0 ) // DNA
681- {
682- TVector *v = new TVector ;
683- v->setName ( d.sName ) ;
684- v->setSequence ( d.sSequence ) ;
685- v->setDescription ( txt("manually_entered_sequence") + wxString ( _T("\n") + wxGetUserName() ) ) ;
686- newFromVector ( v ) ;
687- }
688- else if ( type == 1 ) // Amino Acids
689- {
690- newAminoAcids ( d.sSequence , d.sName ) ;
691- }
692- else if ( type == 2 ) // GenBank
693- {
694- TGenBank gb ;
695- gb.paste ( d.sequence->GetValue() ) ;
696- newGB ( gb , d.sName ) ;
697- }
698- else if ( type == 3 ) // XML
699- {
700- // Trying XML formats
701- TXMLfile xml ;
702- xml.parse ( d.sequence->GetValue().c_str() ) ;
703- if ( xml.success() )
704- {
705- newXML ( xml , d.sName ) ;
706- return ;
707- }
708- }
709- else if ( type == 4 ) // Primer
710- {
711- TVector *v = new TVector ;
712- v->setName ( d.sName ) ;
713- v->setSequence ( d.sSequence ) ;
714- v->setType ( TYPE_PRIMER ) ;
715- v->setDescription ( txt("manually_entered_sequence") + _T("\n") + wxGetUserName() ) ;
716- newFromVector ( v , TYPE_PRIMER ) ;
717- }
718-}
719-
720-/** \brief Saves an image (actually, a wxBitmap) to a file, with "save as" dialog
721- */
722-void MyFrame::saveImage ( wxBitmap *bmp , wxString name )
723-{
724- wxString wildcard ;
725- wildcard += _T("PNG (*.png)|*.png") ;
726- // wildcard += _T("|TIF (*.tif)|*.tif") ;
727- wildcard += _T("|Bitmap (*.bmp)|*.bmp") ;
728- wildcard += _T("|JPEG (*.jpg)|*.jpg") ;
729-
730- name.Replace ( _T("*") , _T("") , TRUE ) ;
731- name.Replace ( _T(":") , _T("_") , TRUE ) ;
732- name.Replace ( _T("/") , _T("_") , TRUE ) ;
733- name.Replace ( _T("\\") , _T("_") , TRUE ) ;
734-
735- wxString lastdir = LS->getOption ( _T("LAST_IMPORT_DIR") , _T("C:") ) ;
736- wxFileDialog d ( this , txt("t_save_image") , lastdir , name , wildcard , wxSAVE|wxOVERWRITE_PROMPT ) ;
737- if ( d.ShowModal() != wxID_OK ) return ;
738- wxString filename = d.GetPath() ;
739-
740- wxBeginBusyCursor () ;
741- wxString type = filename.AfterLast('.').Upper() ;
742- if ( type == _T("BMP") ) bmp->SaveFile ( filename , wxBITMAP_TYPE_BMP ) ;
743- if ( type == _T("PNG") ) bmp->SaveFile ( filename , wxBITMAP_TYPE_PNG ) ;
744- if ( type == _T("JPG") ) bmp->SaveFile ( filename , wxBITMAP_TYPE_JPEG ) ;
745- if ( type == _T("TIF") ) bmp->SaveFile ( filename , wxBITMAP_TYPE_TIF ) ;
746- wxEndBusyCursor () ;
747-}
748-
749-/** \brief Handles the "import from file" dialog, then calls MyFrame::importFile
750- */
751-void MyFrame::OnFileImport(wxCommandEvent& event )
752-{
753- wxString wcAutomatic = txt("format_filter_auto") ;
754- wxString wcClone = txt("format_filter_clone") ;
755- wxString wcGenBank = txt("format_filter_genbank") ;
756- wxString wcSequencing = txt("format_filter_fasta") ;
757- wxString wcPlainTextDNA = txt("format_filter_plain_dna") ;
758- wxString wcPlainTextAA = txt("format_filter_plain_aa") ;
759- wxString wcABIformat = txt("format_filter_abi") ;
760- wxString wcCSVformat = txt("format_filter_csv") ;
761- wxString wcCM5format = txt("format_filter_cm5") ;
762- wxString wildcard = wcAutomatic +
763- _T("|") + wcClone +
764- _T("|") + wcGenBank +
765- _T("|") + wcSequencing +
766- _T("|") + wcPlainTextDNA +
767- _T("|") + wcPlainTextAA +
768- _T("|") + wcABIformat +
769- _T("|") + wcCSVformat +
770- _T("|") + wcCM5format ;
771- wxString lastdir = LS->getOption ( _T("LAST_IMPORT_DIR") , _T("C:") ) ;
772- wxFileDialog d ( this , txt("import_file") , lastdir ,
773- _T("") , wildcard , wxOPEN | wxMULTIPLE ) ;
774- int x = d.ShowModal() ;
775- if ( x != wxID_OK ) return ;
776-
777- LS->setOption ( _T("LAST_IMPORT_DIR") , d.GetDirectory() ) ;
778-
779- int filter = d.GetFilterIndex () - 1 ;
780- wxArrayString files , paths ;
781- d.GetFilenames ( files ) ;
782- d.GetPaths ( paths ) ;
783- wxBeginBusyCursor();
784- wxSafeYield() ;
785- wxProgressDialog pd ( txt("t_loading") , _T("") , files.GetCount() , NULL , wxPD_ALL ) ;
786- // lockDisplay ( true ) ;
787- wxString unknown ;
788- unsigned int a ;
789- for ( a = 0 ; a < files.GetCount() ; a++ )
790- {
791- if ( !pd.Update ( a , files[a] ) ) break ;
792- if ( !importFile ( files[a] , paths[a] , filter ) )
793- {
794- if ( !unknown.IsEmpty() ) unknown += _T("\n ") ;
795- unknown += files[a] ;
796- }
797- }
798- if ( a == files.GetCount() ) pd.Update ( a ) ; // Hide progress dialog
799- if ( !unknown.IsEmpty() )
800- wxMessageBox ( unknown , txt("t_unable_to_detect_file_type") ) ;
801- // lockDisplay ( false ) ;
802- SetFocus () ;
803- wxEndBusyCursor();
804- mainTree->Refresh () ;
805- Refresh () ;
806- activateChild ( getChildIndex ( lastChild ) ) ;
807-}
808-
809-/** \brief Imports a file
810-
811- If a "filter" number is given, only the matching file type is tried.
812- If "filter" is not given (-1), it tries to detect the type
813- by opening it with all import modules until there is a match.
814- */
815-bool MyFrame::importFile ( wxString file , wxString path , int filter )
816-{
817- wxString end = path.AfterLast('.').Lower() ;
818-
819- // Trying Elite LaChrom chromatogram software
820- if ( filter == -1 && ( end == _T("apex") || end == _T("area") || end == _T("estdconc") ) )
821- {
822- TEliteLaChromLogDialog *eld = new TEliteLaChromLogDialog ( this , txt("t_eld_dialog_title") , path ) ;
823- eld->Show ( TRUE ) ;
824- //eld.ShowModal() ;
825- return true ;
826- }
827-
828-
829- // Trying XML formats
830- if ( filter == -1 )
831- {
832- TXMLfile xml ;
833- xml.load ( path ) ;
834- if ( xml.success() )
835- {
836- newXML ( xml ) ;
837- return true ;
838- }
839- }
840-
841- // Trying GenBank format
842- if ( filter == 1 || filter == -1 )
843- {
844-// wxStartTimer () ;
845- TGenBank gb ;
846- gb.load ( path ) ;
847- mylog ( "GenBank import" , "loaded" ) ;
848- if ( gb.success )
849- {
850- newGB ( gb , file ) ;
851- return true ;
852- }
853- }
854-
855- // Trying ABI format
856- if ( filter == 5 || filter == -1 )
857- {
858- ABItype dummy ;
859- dummy.parse ( path ) ;
860- if ( dummy.vf.size() > 0 ) // Success
861- {
862- newABI ( path , file ) ;
863- return true ;
864- }
865- }
866-
867- // Trying SCF format
868- if ( filter == 5 || filter == -1 )
869- {
870- SCFtype dummy ;
871- if ( dummy.parse ( path ) ) // Success
872- {
873- newABI ( path , file ) ;
874- return true ;
875- }
876- }
877-
878- // Trying Clone Manager 5 format
879- if ( filter == -1 || filter == 7 )
880- {
881- TCloneManager cm ;
882- cm.load ( path ) ;
883- if ( cm.success() )
884- {
885- for ( int a = 0 ; a < cm.countVectors() ; a++ )
886- newFromVector ( cm.getVector ( a ) ) ;
887- return true ;
888- }
889- }
890-
891- // Trying PDB format
892- if ( filter == -1 )
893- {
894- TPDB pdb ;
895- pdb.load ( path ) ;
896- if ( pdb.success )
897- {
898- newPDB ( pdb , file ) ;
899- return true ;
900- }
901- }
902-
903-
904- // Trying spectra
905- if ( filter == 6 || filter == -1 )
906- {
907- wxEndBusyCursor();
908- TGraph *g = RunGraph() ;
909- if ( filter == -1 && g->gd && g->gd->tryall ( path ) == _T("") )
910- {
911- wxBeginBusyCursor();
912- g->Close () ;
913- }
914- else if ( g->gd->SetupFromFile ( path ) )
915- {
916- wxBeginBusyCursor();
917- g->gd->AutoScale () ;
918- g->gd->UpdateDisplay () ;
919- wxEndBusyCursor();
920- /*if ( filter == 6 ) */return true ;
921- }
922- else
923- {
924- wxBeginBusyCursor();
925- g->Close () ;
926- wxEndBusyCursor();
927- if ( filter == 6 ) return false ;
928- }
929- }
930-
931- // Trying UReadSeq package
932- if ( filter == 2 || filter == 3 || filter == 4 || filter == -1 )
933- {
934- TUReadSeq u ( path ) ;
935- // if ( u.error == 0 && u.seqs.GetCount() > 0 )
936- if ( u.error == 0 )
937- {
938- TGenBank gb ;
939- u.convert ( gb ) ;
940- newGB ( gb ) ;
941- return true ;
942- }
943- }
944-
945- // Trying CLONE format
946- if ( filter == 0 || filter == -1 )
947- {
948- TClone clone ;
949- clone.LS = LS ;
950- clone.load ( path ) ;
951- if ( clone.success )
952- {
953- newCLONE ( clone ) ;
954- return true ;
955- }
956- }
957-
958- return false ;
959-}
960-
961-/** \brief Creates a new module with a phylogenetic tree
962- */
963-TPhyloTree *MyFrame::newPhyloTree ( wxString title )
964-{
965- TPhyloTree *subframe = new TPhyloTree(getCommonParent(), txt("t_phylogenetic_tree")) ;
966-
967- setChild ( subframe ) ;
968-
969- // Give it an icon
970-#ifdef __WXMSW__
971- subframe->SetIcon(wxIcon(_T("chrt_icn")));
972-#elif __WXMAC__
973-#else
974- subframe->SetIcon(wxIcon( mondrian_xpm ));
975-#endif
976-
977-
978- subframe->initme() ;
979- mainTree->addChild(subframe,TYPE_MISC) ;
980- subframe->Maximize() ;
981- return subframe ;
982-}
983-
984-/** \brief Creates a new entry from an XML file (GenBankXML; DNA or amino acids)
985- */
986-void MyFrame::newXML ( TXMLfile &xml , wxString title )
987-{
988- int n ;
989- for ( n = 0 ; n < xml.countVectors() ; n++ )
990- {
991- TVector *nv = xml.getVector ( n ) ;
992- short type = nv->getType() ;
993- if ( !title.IsEmpty() ) nv->setName ( title ) ;
994- nv->addDescription ( _T("\n") + wxGetUserName() ) ;
995- if ( type == TYPE_AMINO_ACIDS )
996- newAminoAcids ( nv , nv->getName() ) ;
997- else
998- newFromVector ( nv , type ) ;
999- }
1000-}
1001-
1002-/** \brief Creates a new entry from a CLONE import
1003- */
1004-MyChild *MyFrame::newCLONE ( TClone &clone )
1005-{
1006- MyChild *subframe = new MyChild(getCommonParent(), txt("imported_vector"),
1007- wxPoint(-1, -1), wxSize(-1, -1),
1008- wxDEFAULT_FRAME_STYLE);
1009- setChild ( subframe ) ;
1010-
1011- // Give it an icon
1012-#ifdef __WXMSW__
1013- subframe->SetIcon(wxIcon(_T("chrt_icn")));
1014-#elif __WXMAC__
1015-#else
1016- subframe->SetIcon(wxIcon( mondrian_xpm ));
1017-#endif
1018-
1019-
1020- subframe->initme() ;
1021- int type = TYPE_VECTOR ;
1022- clone.remap ( subframe->vec ) ;
1023- subframe->vec->setDescription ( subframe->vec->getDescription() + _T("\n") + wxGetUserName() ) ;
1024- subframe->vec->setWindow ( subframe ) ;
1025- subframe->initPanels() ;
1026- mainTree->addChild(subframe,type) ;
1027- subframe->Maximize() ;
1028- return subframe ;
1029-}
1030-
1031-/** \brief Creates a new entry from a PDB import
1032- */
1033-void MyFrame::newPDB ( TPDB &pdb , wxString title )
1034-{
1035- pdb.remap () ;
1036- for ( int a = 0 ; a < pdb.seqres.size() ; a++ )
1037- {
1038- newAminoAcids ( pdb.seqres[a].v , pdb.seqres[a].v->getName() ) -> Activate () ;
1039- delete pdb.seqres[a].v ;
1040- }
1041-}
1042-
1043-/** \brief Creates a new entry from a GenBank import
1044-
1045- This function can actually open multiple sequences from one and the same
1046- GenBank structure. This is used, for example, when opening alignments.
1047- */
1048-void MyFrame::newGB ( TGenBank &gb , wxString title )
1049-{
1050- int n ;
1051- TVector *nv ;
1052- wxArrayTVector vv ;
1053- wxArrayChildBase vc ;
1054- wxArrayString vs ;
1055- bool alignment = false ;
1056- // wxStartTimer () ;
1057- gb.vs.Clear () ;
1058- gb.vi.Clear () ;
1059-
1060- for ( n = 0 ; n < gb.vs_l.size() ; n++ )
1061- {
1062- nv = new TVector ;
1063- gb.remap ( nv , gb.vs_l[n] , gb.vi_l[n] ) ;
1064- gb.vs_l[n].Clear () ;
1065- gb.vi_l[n].Clear () ;
1066-
1067- mylog ( "GenBank import" , "remapped " + nv->getName() ) ;
1068- vs.Add ( nv->getSequence() ) ;
1069- vv.Add ( nv ) ;
1070- nv->setDescription ( nv->getDescription() + _T("\n") + wxGetUserName() ) ;
1071- if ( nv->getSequenceLength() != vv[0]->getSequenceLength() ) alignment = false ;
1072- else if ( nv->getSequence().find ( '-' ) != -1 ) alignment = true ;
1073- mylog ( "GenBank import" , "added " + nv->getName() ) ;
1074- }
1075- if ( gb.vs_l.size() == 1 ) alignment = false ;
1076-
1077- // Removing alignment artifacts from sequences
1078- for ( n = 0 ; n < vv.GetCount() ; n++ )
1079- vv[n]->removeAlignmentArtifacts () ;
1080- mylog ( "GenBank import" , "artifacts removed" ) ;
1081-
1082- /*
1083- // Ask if GenBank alignment should be opened as such (not using this right now)
1084- if ( alignment )
1085- {
1086- if ( wxYES != wxMessageBox ( txt("t_possible_alignment") ,
1087- title , wxYES_NO|wxICON_QUESTION ) )
1088- {
1089- alignment = false ;
1090- }
1091- }*/
1092-
1093- wxBeginBusyCursor() ;
1094- for ( n = 0 ; n < gb.vs_l.size() ; n++ )
1095- {
1096- nv = vv[n] ;
1097- if ( gb.vs_l.size() == 1 && !title.IsEmpty() && nv->getName().IsEmpty() )
1098- nv->setName ( title ) ;
1099- short type = TUReadSeq::getSeqType ( nv->getSequence() ) ;
1100- if ( type == TYPE_AMINO_ACIDS )
1101- vc.Add ( newAminoAcids ( nv , nv->getName() ) ) ;
1102- else
1103- vc.Add ( newFromVector ( nv , type ) ) ;
1104- mylog ( "GenBank import" , "child added" ) ;
1105- }
1106- vv.Clear () ;
1107-
1108- if ( alignment )
1109- {
1110- runAlignment ( vs , vc ) ;
1111- }
1112- // wxMessageBox ( wxString::Format ( "%dms" , wxGetElapsedTime() ) ) ;
1113- wxEndBusyCursor() ;
1114-}
1115-
1116-
1117-/** \brief Creates a new DNA entry from a TVector structure
1118-
1119- This is a very important function. Virtually all import/open/enter
1120- functions call this one to create the actual window containing
1121- that data.
1122- */
1123-MyChild* MyFrame::newFromVector ( TVector *nv , int type )
1124-{
1125- if ( !nv ) return NULL ;
1126- myapp()->sw.Start () ;
1127- MyChild *subframe = new MyChild(getCommonParent(), _T(""),
1128- wxPoint(-1, -1), wxSize(-1, -1),
1129- wxDEFAULT_FRAME_STYLE);
1130- myass ( subframe , "MyFrame::newFromVector" ) ;
1131- setChild ( subframe ) ;
1132-
1133- // Give it an icon
1134-#ifdef __WXMSW__
1135- subframe->SetIcon(wxIcon(_T("chrt_icn")));
1136-#elif __WXMAC__
1137-#else
1138- subframe->SetIcon(wxIcon( mondrian_xpm ));
1139-#endif
1140-
1141- subframe->initme() ;
1142- delete subframe->vec ;
1143- subframe->vec = nv ;
1144- subframe->vec->setWindow ( subframe ) ;
1145-
1146- subframe->initPanels() ;
1147- mainTree->addChild(subframe,type) ;
1148- children.Last()->Activate () ;
1149-
1150- return subframe ;
1151-}
1152-
1153-
1154-/** \brief Handles OnSize events
1155- */
1156-void MyFrame::OnSize(wxSizeEvent& event)
1157-{
1158- wxLayoutAlgorithm layout;
1159- layout.LayoutFrame(this);
1160- /*#ifdef __WXMSW__
1161- if ( lastChild )
1162- {
1163- setActiveChild ( lastChild ) ;
1164- lastChild->Refresh() ;
1165- }
1166- #endif*/
1167-}
1168-
1169-
1170-/** \brief Sets the icon size for the toolbar
1171- */
1172-void MyFrame::InitToolBar(wxToolBar* toolBar)
1173-{
1174- wxSize ns ;
1175- if ( useTwoToolbars )
1176- {
1177-#ifdef __WXMSW__
1178- ns = wxSize ( 22 , 22 ) ;
1179-#else
1180- if ( toolBar == mainToolBar ) ns = wxSize ( 48 , 48 ) ;
1181- else ns = wxSize ( 36 , 36 ) ;
1182-#endif
1183- }
1184- else
1185- {
1186-#ifdef __WXMSW__
1187- ns = wxSize ( 22 , 22 ) ;
1188-#else
1189- ns = wxSize ( 32 , 32 ) ;
1190-#endif
1191- }
1192-
1193- toolBar->SetToolBitmapSize ( ns ) ;
1194-}
1195-
1196-wxChoice *MyFrame::AddFontsizeTool ( wxToolBar* toolBar , int id )
1197-{
1198- toolBar->AddControl ( new wxStaticText ( toolBar , -1 , txt("t_fontsize") ) ) ;
1199-#ifdef __WXMSW__
1200- int width = 40 ;
1201-#else
1202- int width = 60 ;
1203-#endif
1204- wxChoice *fontsize = new wxChoice ( toolBar , id , wxDefaultPosition , wxSize ( width , -1 ) ) ;
1205- toolBar->AddControl ( fontsize ) ;
1206- fontsize->Append ( _T(" 6") ) ;
1207- fontsize->Append ( _T(" 8") ) ;
1208- fontsize->Append ( _T("10") ) ;
1209- fontsize->Append ( _T("12") ) ;
1210- fontsize->Append ( _T("14") ) ;
1211- fontsize->Append ( _T("16") ) ;
1212- fontsize->Append ( _T("18") ) ;
1213- fontsize->Append ( _T("20") ) ;
1214- fontsize->Append ( _T("22") ) ;
1215- fontsize->Append ( _T("24") ) ;
1216- fontsize->Append ( _T("26") ) ;
1217- fontsize->Append ( _T("28") ) ;
1218- fontsize->Append ( _T("36") ) ;
1219- fontsize->Append ( _T("48") ) ;
1220- fontsize->SetStringSelection ( _T("12") ) ;
1221- return fontsize ;
1222-}
1223-
1224-/** \brief Adds a tool to a given toolbar
1225- */
1226-void MyFrame::addTool ( wxToolBar* toolBar , int id )
1227-{
1228- if ( mainToolBar && toolBar != mainToolBar ) return ;
1229-
1230- if ( id == MDI_TEXT_IMPORT )
1231- toolBar->AddTool( MDI_TEXT_IMPORT ,
1232- bitmaps[0],
1233- txt("m_new_sequence") ) ;
1234- else if ( id == MDI_FILE_IMPORT )
1235- toolBar->AddTool( MDI_FILE_IMPORT,
1236- bitmaps[14],
1237- txt("m_importtxt") );
1238- else if ( id == MDI_FILE_OPEN )
1239- toolBar->AddTool( MDI_FILE_OPEN,
1240- bitmaps[1],
1241- txt("m_opentxt") );
1242- else if ( id == MDI_FILE_SAVE )
1243- toolBar->AddTool( MDI_FILE_SAVE,
1244- txt("m_txt_store_in_db"),
1245- myapp()->frame->bitmaps[2] ,
1246- myapp()->frame->bitmaps[27] ,
1247- wxITEM_NORMAL , txt("m_txt_store_in_db") ) ;
1248- else if ( id == SEQ_PRINT )
1249- toolBar->AddTool( SEQ_PRINT,
1250- txt("m_print_sequence"),
1251- myapp()->frame->bitmaps[16] ,
1252- myapp()->frame->bitmaps[29] ,
1253- wxITEM_NORMAL , txt("m_print_sequence") ) ;
1254- else if ( id == MDI_UNDO )
1255- {
1256- toolBar->AddSeparator() ;
1257- toolBar->AddTool( MDI_UNDO, txt("m_undo_text"),
1258- myapp()->frame->bitmaps[3] ,
1259- myapp()->frame->bitmaps[28] ,
1260- wxITEM_NORMAL , txt("m_undo_text") ) ;
1261- }
1262- else if ( id == MDI_COPY )
1263- toolBar->AddTool( MDI_COPY, txt("m_copy_text") ,
1264- myapp()->frame->bitmaps[5] ,
1265- myapp()->frame->bitmaps[24] ,
1266- wxITEM_NORMAL , txt("m_copy_text") ) ;
1267-}
1268-
1269-/** \brief Adds default tools to a given toolbar
1270- */
1271-void MyFrame::addDefaultTools(wxToolBar* toolBar)
1272-{
1273- if ( mainToolBar && toolBar != mainToolBar ) return ;
1274- toolBar->AddSeparator() ;
1275- toolBar->AddTool( MDI_ALIGNMENT, myapp()->frame->bitmaps[17] , txt("m_alignment_text") ) ;
1276- toolBar->AddTool( MDI_IMAGE_VIEWER, myapp()->frame->bitmaps[18] , txt("m_imageviewer_text") ) ;
1277- toolBar->AddTool( MDI_CALCULATOR, myapp()->frame->bitmaps[20] , txt("m_calculator_text") ) ;
1278- toolBar->AddTool( PROGRAM_OPTIONS, myapp()->frame->bitmaps[21] , txt("m_options_text") ) ;
1279- toolBar->AddTool( MDI_EXTERNAL_INTERFACE, myapp()->frame->bitmaps[19] , txt("m_external_text") ) ;
1280-}
1281-
1282-/** \brief Adds cut,copy,paste (and find) tools to a given toolbar
1283- */
1284-void MyFrame::addCCPFTools(wxToolBar* toolBar, bool findbutton )
1285-{
1286- if ( mainToolBar && toolBar != mainToolBar ) return ;
1287- toolBar->AddSeparator() ;
1288- toolBar->AddTool( MDI_CUT, txt("m_cut_text") ,
1289- myapp()->frame->bitmaps[4] , myapp()->frame->bitmaps[23] ,
1290- wxITEM_NORMAL , txt("m_cut_text") ) ;
1291- toolBar->AddTool( MDI_COPY, txt("m_copy_text") ,
1292- myapp()->frame->bitmaps[5] , myapp()->frame->bitmaps[24] ,
1293- wxITEM_NORMAL , txt("m_copy_text") ) ;
1294- toolBar->AddTool( MDI_PASTE, txt("m_paste_text") ,
1295- myapp()->frame->bitmaps[6] , myapp()->frame->bitmaps[25] ,
1296- wxITEM_NORMAL , txt("m_paste_text") ) ;
1297- if ( findbutton )
1298- toolBar->AddTool( MDI_FIND, txt("m_find_text") ,
1299- myapp()->frame->bitmaps[22] , myapp()->frame->bitmaps[26] ,
1300- wxITEM_NORMAL , txt("m_find_text") ) ;
1301- if ( !mainToolBar ) toolBar->AddSeparator () ;
1302-}
1303-
1304-#define UGLY_MENU_UPDATE(x,y) if(GetMenuBar()&&GetMenuBar()->FindItem(x))GetMenuBar()->FindItem(x)->Enable(y);
1305-
1306-/** \brief Updates cut, copy, paste, find icons
1307- */
1308-void MyFrame::updateCCP ( ChildBase *c )
1309-{
1310- if ( !mainToolBar && !c ) return ;
1311- wxToolBar *tb = mainToolBar ? mainToolBar : c->toolbar ;
1312- tb->EnableTool ( MDI_FILE_SAVE , c ? c->allow_save : false ) ;
1313- tb->EnableTool ( MDI_UNDO , c ? c->allow_undo : false ) ;
1314- tb->EnableTool ( SEQ_PRINT , c ? c->allow_print : false ) ;
1315- tb->EnableTool ( MDI_CUT , c ? c->allow_cut : false ) ;
1316- tb->EnableTool ( MDI_COPY , c ? c->allow_copy : false ) ;
1317- tb->EnableTool ( MDI_PASTE , c ? c->allow_paste : false ) ;
1318- tb->EnableTool ( MDI_FIND , c ? c->allow_find : false ) ;
1319-
1320- UGLY_MENU_UPDATE ( MDI_FILE_SAVE , c ? c->allow_save : false ) ;
1321- UGLY_MENU_UPDATE ( SEQ_PRINT , c ? c->allow_print : false ) ;
1322- UGLY_MENU_UPDATE ( MDI_CUT , c ? c->allow_cut : false ) ;
1323- UGLY_MENU_UPDATE ( MDI_COPY , c ? c->allow_copy : false ) ;
1324- UGLY_MENU_UPDATE ( MDI_PASTE , c ? c->allow_paste : false ) ;
1325- UGLY_MENU_UPDATE ( MDI_MARK_ALL , c ? !c->allow_paste : false ) ;
1326- UGLY_MENU_UPDATE ( MDI_COPY_TO_NEW , c ? !c->allow_paste : false ) ;
1327- UGLY_MENU_UPDATE ( MDI_AS_NEW_FEATURE , c ? !c->allow_paste : false ) ;
1328- UGLY_MENU_UPDATE ( MDI_FIND , c ? c->allow_find : false ) ;
1329-}
1330-
1331-/** \brief Generates a basic tooblar
1332- */
1333-void MyFrame::setDummyToolbar ( ChildBase *c )
1334-{
1335- wxToolBar *toolBar = c->CreateToolBar(wxNO_BORDER | wxTB_FLAT | wxTB_HORIZONTAL |wxTB_DOCKABLE);
1336- toolBar->Reparent ( c ) ;
1337- c->toolbar = toolBar ;
1338- myapp()->frame->InitToolBar(toolBar);
1339- addTool ( toolBar , MDI_TEXT_IMPORT ) ;
1340- addTool ( toolBar , MDI_FILE_OPEN ) ;
1341- c->toolbar = toolBar ;
1342-}
1343-
1344-/** \brief Creates a new alignment window
1345- */
1346-TAlignment *MyFrame::runAlignment ( wxArrayString &vs , wxArrayChildBase &vc , TVector *nv )
1347-{
1348- // Thaw () ;
1349- TAlignment *subframe = new TAlignment ( getCommonParent() , _T("Alignment") ) ;
1350- setChild ( subframe ) ;
1351-
1352- // Give it an icon
1353-#ifdef __WXMSW__
1354- subframe->SetIcon(wxIcon(_T("chrt_icn")));
1355-#elif __WXMAC__
1356-#else
1357- subframe->SetIcon(wxIcon( mondrian_xpm ));
1358-#endif
1359-
1360- subframe->initme () ;
1361- if ( locked == 0 ) subframe->Activate () ;
1362-
1363- if ( nv )
1364- {
1365- subframe->fromVector ( nv ) ;
1366- }
1367- else if ( vs.GetCount() == 0 )
1368- {
1369- wxCommandEvent ev ;
1370- subframe->OnSettings ( ev ) ;
1371- }
1372- else
1373- {
1374- subframe->prealigned ( vs , vc ) ;
1375- }
1376-
1377- if ( locked == 0 ) subframe->Show() ;
1378-
1379- mainTree->addChild ( subframe , TYPE_ALIGNMENT ) ;
1380- mainTree->Refresh () ;
1381- activateChild ( children.GetCount()-1 ) ;
1382- return subframe ;
1383-}
1384-
1385-/** \brief Handles the Alignment menu event, calls MyFrame::runAlignment
1386- */
1387-void MyFrame::OnAlignment(wxCommandEvent& event)
1388-{
1389- wxArrayString vs ; // Dummy
1390- wxArrayChildBase vc ; // Dummy
1391- runAlignment ( vs , vc ) ;
1392-}
1393-
1394-/** \brief Handles the Manage Database menu event
1395- */
1396-void MyFrame::OnManageDatabase(wxCommandEvent& event)
1397-{
1398- TManageDatabaseDialog mdd ( this , txt("m_manage_dbtxt") ) ;
1399- mdd.ShowModal () ;
1400-}
1401-
1402-/** \brief Handles the Program Options menu event, and stores the options in the local database
1403- */
1404-void MyFrame::OnProgramOptions(wxCommandEvent& event)
1405-{
1406- ProgramOptionsDialog pod ( this , txt("t_program_options" ) ) ;
1407- global_enzyme_rules->setup_options ( pod.globalEnzymesPanel ) ;
1408- int r = pod.ShowModal() ;
1409- if ( r != wxID_OK ) return ;
1410-
1411- wxBeginBusyCursor() ;
1412-
1413- bool useTwoToolbarsBefore = useTwoToolbars ;
1414-
1415- // retrieving options
1416- // TEnzymeRules oo == *global_enzyme_rules ;
1417- global_enzyme_rules->lookup_options ( pod.globalEnzymesPanel ) ;
1418- enhancedRefresh = pod.enhancedDisplay->GetValue() ;
1419- showVectorTitle = pod.vectorTitle->GetValue() ;
1420- showVectorLength = pod.vectorLength->GetValue() ;
1421- loadLastProject = pod.loadLastProject->GetValue() ;
1422- useMetafile = pod.useMetafile->GetValue() ;
1423- showSplashScreen = pod.showSplashScreen->GetValue() ;
1424- checkUpdate = pod.checkUpdate->GetValue() ;
1425- useInternalHelp = pod.useInternalHelp->GetValue() ;
1426- useOnlineHelp = pod.useOnlineHelp->GetValue() ;
1427- doRegisterStuff = pod.doRegisterStuff->GetValue() ;
1428- editFeatureMode = pod.editFeatureMode->GetSelection() ;
1429- showStopCodon = pod.showStopCodon->GetSelection() ;
1430- showEnzymePos = pod.showEnzymePos->GetValue() ;
1431- useTwoToolbars = pod.useTwoToolbars->GetValue() ;
1432- showToolTips = pod.showToolTips->GetValue() ;
1433- showLowercaseDNA = pod.showLowercaseDNA->GetValue() ;
1434-
1435- long l ;
1436- pod.orfLength->GetValue().ToLong ( &l ) ;
1437- if ( l < 10 ) l = 10 ;
1438- orfLength = l ;
1439-
1440- proxy = pod.proxyName->GetValue() + _T(":") + pod.proxyPort->GetValue() ;
1441- if ( proxy == _T(":") ) proxy = _T("") ;
1442- wxURL::SetDefaultProxy ( proxy ) ;
1443-
1444- wxToolTip::Enable ( showToolTips ) ;
1445- if ( pod.use_nonstandard_translation_table->GetValue() )
1446- nonstandard_translation_table = pod.translation_tables[pod.nonstandard_translation_table->GetSelection()] ;
1447- else nonstandard_translation_table = -1 ;
1448- aa_color = pod.aacol ;
1449- stopcodon = showStopCodon == 0 ? '|' : '*' ;
1450- wxString lang = pod.language->GetStringSelection() ;
1451- if ( lang != lang_string || useTwoToolbars != useTwoToolbarsBefore )
1452- {
1453- wxMessageDialog md ( this , txt("t_effect_after_restart" ) ) ;
1454- md.ShowModal () ;
1455- }
1456-
1457- // Storing options
1458- LS->startRecord() ;
1459- LS->setOption ( _T("USEMETAFILE") , useMetafile ) ;
1460- LS->setOption ( _T("ENHANCEDREFRESH") , enhancedRefresh ) ;
1461- LS->setOption ( _T("LANGUAGE") , lang ) ;
1462- LS->setOption ( _T("SHOWVECTORTITLE") , showVectorTitle ) ;
1463- LS->setOption ( _T("SHOWVECTORLENGTH") , showVectorLength ) ;
1464- LS->setOption ( _T("LOADLASTPROJECT") , loadLastProject ) ;
1465- LS->setOption ( _T("SHOWSPLASHSCREEN") , showSplashScreen ) ;
1466- LS->setOption ( _T("CHECKUPDATE") , checkUpdate ) ;
1467- LS->setOption ( _T("USEINTERNALHELP") , useInternalHelp ) ;
1468- LS->setOption ( _T("USEONLINEHELP") , useOnlineHelp ) ;
1469- LS->setOption ( _T("REGISTERSTUFF") , doRegisterStuff ) ;
1470- LS->setOption ( _T("EDITFEATUREMODE") , editFeatureMode ) ;
1471- LS->setOption ( _T("SHOWSTOPCODON") , showStopCodon ) ;
1472- LS->setOption ( _T("SHOWENZYMEPOS") , showEnzymePos ) ;
1473- LS->setOption ( _T("AA_RED") , aa_color.Red() ) ;
1474- LS->setOption ( _T("AA_GREEN") , aa_color.Green() ) ;
1475- LS->setOption ( _T("AA_BLUE") , aa_color.Blue() ) ;
1476- LS->setOption ( _T("nonstandard_translation_table") , nonstandard_translation_table ) ;
1477- LS->setOption ( _T("use_two_toolbars") , useTwoToolbars ) ;
1478- LS->setOption ( _T("SHOWTIP") , pod.showTips->GetValue() ) ;
1479- LS->setOption ( _T("SHOWTOOLTIPS") , pod.showToolTips->GetValue() ) ;
1480- LS->setOption ( _T("SHOWLOWERCASEDNA") , showLowercaseDNA ) ;
1481- LS->setOption ( _T("ORFLENGTH") , orfLength ) ;
1482- LS->setOption ( _T("PROXY") , proxy ) ;
1483- global_enzyme_rules->save_global_settings() ; //!!!!!!! fix this!
1484- LS->endRecord() ;
1485- for ( int a = 0 ; a < children.GetCount() ; a++ )
1486- {
1487- if ( !children[a]->vec ) continue ;
1488- children[a]->vec->recalculateCuts() ;
1489- // children[a]->vec->updateDisplay() ;
1490- children[a]->EnforceRefesh () ;
1491- }
1492- // if ( GetActiveChild() ) GetActiveChild()->EnforceRefesh () ;
1493- wxEndBusyCursor() ;
1494-}
1495-
1496-/** \brief Handles the Load Project menu event
1497- */
1498-void MyFrame::OnProjectLoad(wxCommandEvent& event)
1499-{
1500- // Are all objects stored in a database?
1501- int a ;
1502- wxString notindb ;
1503- for ( a = 0 ; a < children.GetCount() ; a++ )
1504- {
1505- if ( children[a]->def == _T("dna") )
1506- {
1507- MyChild *c = (MyChild*) children[a] ;
1508- if ( c->vec->getDatabase().IsEmpty() )
1509- notindb += _T("\n") + c->getName() ;
1510- }
1511- }
1512- if ( !notindb.IsEmpty() )
1513- {
1514- notindb = txt("t_following_not_in_db_open") +
1515- notindb + txt("t_following_end_open") ;
1516- wxMessageDialog md ( this , notindb ,
1517- txt("msg_box") , wxICON_EXCLAMATION|wxYES|wxNO ) ;
1518- if ( md.ShowModal() != wxID_YES ) return ;
1519- }
1520-
1521- // All are stored, or loading anyway
1522- TManageDatabaseDialog mdd ( this , txt("m_project_opentxt") ,
1523- ACTION_MODE_LOAD|ACTION_MODE_PROJECT ) ;
1524- mdd.ShowModal () ;
1525-}
1526-
1527-/** \brief Handles the Save Project menu event
1528- */
1529-void MyFrame::OnProjectSave(wxCommandEvent& event)
1530-{
1531- // Are all objects stored in a database?
1532- int a ;
1533- wxString notindb ;
1534- for ( a = 0 ; a < children.GetCount() ; a++ )
1535- {
1536- if ( children[a]->def == _T("dna") )
1537- {
1538- MyChild *c = (MyChild*) children[a] ;
1539- if ( c->vec->getDatabase().IsEmpty() )
1540- notindb += _T("\n") + c->getName() ;
1541- }
1542- }
1543- if ( !notindb.IsEmpty() )
1544- {
1545- notindb = txt("t_following_not_in_db") + notindb + txt("t_following_end") ;
1546- wxMessageDialog md ( this , notindb ,
1547- txt("msg_box") , wxICON_EXCLAMATION|wxYES|wxNO ) ;
1548- if ( md.ShowModal() != wxID_YES ) return ;
1549- }
1550-
1551- // All are stored, or saving anyway
1552- TManageDatabaseDialog mdd ( this , txt("m_project_savetxt") ,
1553- ACTION_MODE_SAVE|ACTION_MODE_PROJECT ) ;
1554- mdd.ShowModal () ;
1555-}
1556-
1557-/** \brief Handles the Close Project menu event
1558- */
1559-void MyFrame::OnProjectClose(wxCommandEvent& event)
1560-{
1561- int a ;
1562- if ( tb_mychild )
1563- {
1564- tb_mychild->Close ( TRUE ) ;
1565- delete tb_mychild ;
1566- tb_mychild = NULL ;
1567- }
1568- lastChild = NULL ;
1569- for ( a = 0 ; a < children.GetCount() ; a++ )
1570- {
1571- // children[a]->Close() ;
1572- delete children[a] ;
1573- }
1574- children.Clear() ;
1575- project.name = txt("project") ;
1576- project.desc = _T("") ;
1577- project.db = _T("") ;
1578- mainTree->initme() ;
1579- Refresh () ;
1580-}
1581-
1582-/** \brief Stores the last open project for reopening on program start
1583- */
1584-void MyFrame::rememberLastProject ()
1585-{
1586- wxString sql ;
1587-
1588- sql = _T("DELETE FROM stuff WHERE s_type='LASTPROJECT'") ;
1589- LS->getObject ( sql ) ;
1590- LS->getObject ( wxString::Format ( _T("INSERT INTO stuff (s_type,s_name,s_value) VALUES ('LASTPROJECT','NAME','%s')") , project.name.c_str() ) ) ;
1591- LS->getObject ( wxString::Format ( _T("INSERT INTO stuff (s_type,s_name,s_value) VALUES ('LASTPROJECT','DATABASE','%s')") , project.db.c_str() ) ) ;
1592-}
1593-
1594-/** \brief Creates a new amino acid entry from a string
1595- */
1596-TAminoAcids *MyFrame::newAminoAcids ( wxString aa , wxString title )
1597-{
1598- TVector nv ;
1599- nv.setSequence ( aa ) ;
1600- return newAminoAcids ( &nv , title ) ;
1601-}
1602-
1603-/** \brief Creates a new amino acid entry from a TVector structure
1604-
1605- This function basically does the same as MyFrame::newFromVector,
1606- but for amino acid sequences instead of DNA
1607- */
1608-TAminoAcids *MyFrame::newAminoAcids ( TVector *nv , wxString title )
1609-{
1610- int a ;
1611- if ( title.IsEmpty() ) title = _T("Surprise!") ;
1612-
1613- mylog ( "MyFrame::newAminoAcids" , "1" ) ;
1614- TAminoAcids *subframe = new TAminoAcids ( (wxWindow*) getCommonParent() , title ) ;
1615- setChild ( subframe ) ;
1616-
1617- mylog ( "MyFrame::newAminoAcids" , "2" ) ;
1618- subframe->vec->setFromVector ( *nv ) ;
1619-
1620- mylog ( "MyFrame::newAminoAcids" , "3" ) ;
1621- wxString seq = subframe->vec->getSequence() ;
1622- seq.Replace ( _T("|") , _T("") , true ) ;
1623- subframe->vec->setSequence ( seq ) ;
1624-
1625- mylog ( "MyFrame::newAminoAcids" , "4" ) ;
1626- subframe->vec->setWindow ( subframe ) ;
1627- subframe->vec->setType ( TYPE_AMINO_ACIDS ) ;
1628- subframe->vec->setName ( title ) ;
1629- subframe->vec->undo.clear() ;
1630-
1631- mylog ( "MyFrame::newAminoAcids" , "5" ) ;
1632- for ( a = 0 ; a < nv->items.size() ; a++ )
1633- {
1634- nv->items[a].setType ( VIT_MISC ) ;
1635- nv->items[a].setDirection ( 1 ) ;
1636- }
1637-
1638- // Give it an icon
1639-#ifdef __WXMSW__
1640- subframe->SetIcon(wxIcon(_T("chrt_icn")));
1641-#elif __WXMAC__
1642-#else
1643- subframe->SetIcon(wxIcon( mondrian_xpm ));
1644-#endif
1645-
1646- mylog ( "MyFrame::newAminoAcids" , "6" ) ;
1647- mainTree->addChild ( subframe , TYPE_AMINO_ACIDS ) ;
1648- mylog ( "MyFrame::newAminoAcids" , "6a" ) ;
1649- subframe->initme () ;
1650- mylog ( "MyFrame::newAminoAcids" , "7" ) ;
1651- if ( locked != 0 ) return subframe ;
1652- subframe->Show() ;
1653- subframe->Maximize() ;
1654- subframe->showName() ;
1655- subframe->Activate () ;
1656- children.Last()->Activate () ;
1657- mylog ( "MyFrame::newAminoAcids" , "8" ) ;
1658- return subframe ;
1659-}
1660-
1661-/** \brief Creates a new sequencing entry from an ABI file
1662- */
1663-TABIviewer *MyFrame::newABI ( wxString filename , wxString title )
1664-{
1665- if ( title.IsEmpty() ) title = _T("Surprise!") ;
1666- TABIviewer *subframe = new TABIviewer ( getCommonParent() , title ) ;
1667- subframe->filename = filename ;
1668- subframe->vec->setType ( TYPE_SEQUENCE ) ;
1669- subframe->vec->addDescription ( _T("\n") + wxGetUserName() ) ;
1670-
1671- // Give it an icon
1672-#ifdef __WXMSW__
1673- subframe->SetIcon(wxIcon(_T("chrt_icn")));
1674-#elif __WXMAC__
1675-#else
1676- subframe->SetIcon(wxIcon( mondrian_xpm ));
1677-#endif
1678-
1679- subframe->initme () ;
1680-
1681- subframe->Show() ;
1682- subframe->Maximize() ;
1683- subframe->showName() ;
1684-
1685- setChild ( subframe ) ;
1686- mainTree->addChild ( subframe , TYPE_SEQUENCE ) ;
1687-
1688- if ( LS->getOption ( _T("SHOWABIHORIZONTAL") , false ) )
1689- {
1690- subframe->sc->SilentRefresh () ;
1691- wxCheckBox *horiz = (wxCheckBox*) subframe->FindWindowById ( ALIGN_HORIZ ) ;
1692- myass ( horiz , _T("NULL") ) ;
1693- if ( horiz ) horiz->SetValue ( true ) ;
1694- wxCommandEvent event ;
1695- subframe->OnHorizontal(event) ;
1696- }
1697-
1698- if ( myapp()->clp[_T("view-sequencing-reverse-complement")] == _T("1") )
1699- {
1700- subframe->toggle_inv_compl () ;
1701- myapp()->clp.erase(_T("view-sequencing-reverse-complement")) ;
1702- }
1703-
1704- subframe->Activate () ;
1705- children.Last()->Activate () ;
1706-
1707- return subframe ;
1708-}
1709-
1710-/** \brief Runs a blast search by invoking MyFrame::OnExternalInterface
1711- */
1712-void MyFrame::blast ( wxString seq , wxString prg )
1713-{
1714- int a ;
1715- for ( a = 0 ; a < children.GetCount() && children[a]->getName() != _T("External Interface") ; a++ ) ;
1716- if ( a == children.GetCount() ) // Create new external interface
1717- {
1718- wxCommandEvent event ;
1719- OnExternalInterface ( event ) ;
1720- }
1721- activateChild ( a ) ;
1722- ExternalInterface *ei = (ExternalInterface*) children[a] ;
1723- ei->runBlast ( seq , prg ) ;
1724- return ;
1725-
1726- /*
1727- // Obsolete
1728- #ifdef __WXMSW__
1729- wxString unique = wxNow() ;
1730- unique.Replace ( ":" , "_" ) ;
1731- unique.Replace ( "/" , "_" ) ;
1732- unique.Replace ( " " , "_" ) ;
1733-
1734- wxString hd = myapp()->homedir ;
1735- wxString exe = hd + "\\blastcl3.exe" ; // WINDOWS-SPECIFIC!
1736- wxString ifile = hd + "\\blasts\\temp_" + unique + ".tmp" ;
1737- wxString ofile = hd + "\\blasts\\blast_results_" + unique + ".html" ;
1738- wxString bfile = hd + "\\blasts\\batch_" + unique + ".bat" ;
1739-
1740- wxString blast_dir = hd + "\\blasts" ;
1741- if ( !wxDir::Exists ( blast_dir ) )
1742- wxMkdir ( blast_dir ) ;
1743-
1744- // Writing temporary blast file
1745- wxFile out ( ifile , wxFile::write ) ;
1746- out.Write ( seq ) ;
1747- out.Close () ;
1748-
1749- wxFile batch ( bfile , wxFile::write ) ;
1750- batch.Write ( "@echo off\n" ) ;
1751-
1752- // Creating blast command line
1753- exe += " -p \"" + prg + "\"" ;
1754- exe += " -i \"" + ifile + "\"" ;
1755- exe += " -o \"" + ofile + "\"" ;
1756- exe += " -Tt" ; // Create HTML
1757- batch.Write ( exe + "\n" ) ;
1758-
1759- // Starting browser
1760- exe = "start " ;
1761- exe += myapp()->getHTMLCommand ( ofile ) ;
1762- batch.Write ( exe + "\n" ) ;
1763-
1764- // Delete temporary files
1765- batch.Write ( "del \"" + ifile + "\"\n" ) ;
1766- batch.Write ( "del \"" + bfile + "\"\n" ) ;
1767-
1768- // Run it
1769- batch.Close() ;
1770- wxExecute ( bfile ) ;
1771- #endif
1772- */
1773-}
1774-
1775-/** \brief Creates a new external interface for NCBI/BLAST searching
1776- */
1777-void MyFrame::OnExternalInterface(wxCommandEvent& event)
1778-{
1779- ExternalInterface *subframe = new ExternalInterface ( getCommonParent() , txt("t_external_interface") ) ;
1780-
1781- // Give it an icon
1782-#ifdef __WXMSW__
1783- subframe->SetIcon(wxIcon(_T("chrt_icn")));
1784-#elif __WXMAC__
1785-#else
1786- subframe->SetIcon(wxIcon( mondrian_xpm ));
1787-#endif
1788-
1789- subframe->initme () ;
1790-
1791- subframe->Show() ;
1792- subframe->Maximize() ;
1793- subframe->showName() ;
1794-
1795- mainTree->addChild ( subframe , TYPE_MISC ) ;
1796- setChild ( subframe ) ;
1797- activateChild ( children.GetCount()-1 ) ;
1798-}
1799-
1800-/** \brief Invokes the image viewer module
1801- */
1802-void MyFrame::OnImageViewer(wxCommandEvent& event)
1803-{
1804- TImageDisplay *subframe = new TImageDisplay ( getCommonParent() , txt("t_image_viewer") ) ;
1805-
1806- // Give it an icon
1807-#ifdef __WXMSW__
1808- subframe->SetIcon(wxIcon(_T("chrt_icn")));
1809-#elif __WXMAC__
1810-#else
1811- subframe->SetIcon(wxIcon( mondrian_xpm ));
1812-#endif
1813-
1814- subframe->initme () ;
1815-
1816- subframe->Show() ;
1817- subframe->Maximize() ;
1818- subframe->showName() ;
1819-
1820- mainTree->addChild ( subframe , TYPE_MISC ) ;
1821- setChild ( subframe ) ;
1822- activateChild ( children.GetCount()-1 ) ;
1823-}
1824-
1825-/** \brief Handles the Calculator menu event by calling MyFrame::RunCalculator
1826- */
1827-void MyFrame::OnCalculator(wxCommandEvent& event)
1828-{
1829- RunCalculator () ;
1830-}
1831-
1832-/** \brief Handles the Dot plot menu event
1833- */
1834-void MyFrame::OnDotPlot(wxCommandEvent& event)
1835-{
1836- TDotPlot *subframe = new TDotPlot ( getCommonParent() , txt("t_dotplot") ) ;
1837-
1838- // Give it an icon
1839-#ifdef __WXMSW__
1840- subframe->SetIcon(wxIcon(_T("chrt_icn")));
1841-#elif __WXMAC__
1842-#else
1843- subframe->SetIcon(wxIcon( mondrian_xpm ));
1844-#endif
1845-
1846- subframe->initme () ;
1847-
1848- subframe->Show() ;
1849- subframe->Maximize() ;
1850- subframe->showName() ;
1851-
1852- mainTree->addChild ( subframe , TYPE_MISC ) ;
1853- setChild ( subframe ) ;
1854- activateChild ( children.GetCount()-1 ) ;
1855-
1856- // return subframe ;
1857-}
1858-
1859-
1860-
1861-/** \brief Handles the Graph menu event by calling MyFrame::RunGraph
1862- */
1863-void MyFrame::OnGraph(wxCommandEvent& event)
1864-{
1865- wxString seq = _T("MSPILGYWKIKGLVQPTRLLLEYLEEKYEEHLYERDEGDKWRNKKFELGLEFPNLPYYIDGDVKLTQSMAIIRYIADKHNMLGGCPKERAEISMLEGAVLDIRYGVSRIAYSKDFETLKVDFLSKLPEMLKMFEDRLCHKTYLNGDHVTHPDFMLYDALDVVLYMDPMCLDAFPKLVCFKKRIEAIPQIDKYLKSSKYIAWPLQGWQATFGGGDHPPKSDLIEGRGIPGNSS") ; // GST
1866- // char *s2 = new char[seq.length()+5] ;
1867- // strcpy ( s2 , seq.mb_str() ) ;
1868-
1869- wxString ret ;
1870- wxArrayFloat af[3] ;
1871- for ( int a = 0 ; a < 3 ; a++ )
1872- {
1873- int b = a==0?14:(a==1?21:28) ;
1874- string s = ncoils_function ( seq.mb_str() , b ) ;
1875- wxString t ( s.c_str() , wxConvUTF8 ) ;
1876- wxArrayString ta ;
1877- explode ( _T("\n") , t , ta ) ;
1878- for ( b = 0 ; b < seq.length() ; b++ )
1879- {
1880- if ( b >= ta.GetCount() ) break ;
1881- t = ta[b].Mid ( 18 ) ;
1882- double prob ;
1883- t.ToDouble ( &prob ) ;
1884- af[a].Add ( (float) prob ) ;
1885- ret += wxString::Format ( _T("%1.4f, ") , (float) prob ) ;
1886- }
1887- ret += _T("\n") ;
1888- }
1889- wxMessageBox ( ret ) ;
1890-
1891- /* TGraph *g = RunGraph() ;
1892- g->gd->SetupDummy() ;
1893- g->gd->AutoScale () ;
1894- g->gd->UpdateDisplay () ;*/
1895-}
1896-
1897-/** \brief Invokes the calculator module
1898- */
1899-TCalculator *MyFrame::RunCalculator ()
1900-{
1901- TCalculator *subframe = new TCalculator ( getCommonParent() , txt("t_calculator") ) ;
1902-
1903- // Give it an icon
1904-#ifdef __WXMSW__
1905- subframe->SetIcon(wxIcon(_T("chrt_icn")));
1906-#elif __WXMAC__
1907-#else
1908- subframe->SetIcon(wxIcon( mondrian_xpm ));
1909-#endif
1910-
1911- subframe->initme () ;
1912-
1913- subframe->Show() ;
1914- subframe->Maximize() ;
1915- subframe->showName() ;
1916-
1917- mainTree->addChild ( subframe , TYPE_MISC ) ;
1918- setChild ( subframe ) ;
1919- activateChild ( children.GetCount()-1 ) ;
1920- return subframe ;
1921-}
1922-
1923-/** \brief Invokes the graph module
1924- */
1925-TGraph *MyFrame::RunGraph ()
1926-{
1927- TGraph *subframe = new TGraph ( getCommonParent() , txt("t_graph") ) ;
1928-
1929- // Give it an icon
1930-#ifdef __WXMSW__
1931- subframe->SetIcon(wxIcon(_T("chrt_icn")));
1932-#elif __WXMAC__
1933-#else
1934- subframe->SetIcon(wxIcon( mondrian_xpm ));
1935-#endif
1936-
1937- subframe->initme () ;
1938-
1939- subframe->Show() ;
1940- subframe->Maximize() ;
1941- subframe->showName() ;
1942-
1943- mainTree->addChild ( subframe , TYPE_MISC ) ;
1944- setChild ( subframe ) ;
1945- activateChild ( children.GetCount()-1 ) ;
1946- return subframe ;
1947-}
1948-
1949-/** \brief Returns the standard File menu, with variations
1950- \param _save Include "Save" menu option
1951- \param _exp Include "Export" menu option
1952- \param _print Include "Print" menu option
1953- */
1954-wxMenu *MyFrame::getFileMenu ( int options )
1955-{
1956- wxMenu *file_menu = new wxMenu;
1957- file_menu->Append(MDI_FILE_OPEN, txt("m_open") , txt("m_opentxt") );
1958- if ( 0 < ( options & FILE_MENU_SAVE ) ) file_menu->Append(MDI_FILE_SAVE, txt("m_store_in_db") , txt("m_txt_store_in_db") ) ;
1959- file_menu->Append(MDI_FILE_SAVE_ALL, txt("m_store_in_db_all") ) ;
1960- file_menu->Append(MDI_FILE_IMPORT, txt("m_import") , txt("m_importtxt") );
1961- file_menu->Append(MDI_TEXT_IMPORT, txt("m_text_import") , txt("m_text_importtxt") );
1962- if ( 0 < ( options & FILE_MENU_EXPORT ) ) file_menu->Append(MDI_EXPORT, txt("m_export") , txt("m_export_txt") );
1963- file_menu->AppendSeparator();
1964- file_menu->Append(MDI_PROJECT_LOAD, txt("m_project_open") , txt("m_project_opentxt") );
1965- file_menu->Append(MDI_PROJECT_SAVE, txt("m_project_save") , txt("m_project_savetxt") );
1966- file_menu->Append(MDI_PROJECT_CLOSE, txt("m_project_close") , txt("m_project_closetxt") );
1967- file_menu->AppendSeparator();
1968- if ( 0 < ( options & FILE_MENU_PRINT ) ) file_menu->Append(MDI_PRINT_IMAGE, txt("m_print_image") , txt("m_print_image_txt") );
1969- if ( 0 < ( options & FILE_MENU_PRINT_RESTRICTIONS ) ) file_menu->Append(MDI_PRINT_RESTRICTION_LIST, txt("m_print_restrictions") , txt("m_print_restrictions_txt") );
1970- file_menu->Append(SEQ_PRINT, txt("m_print_sequence") ) ;
1971- file_menu->Append(MDI_PRINT_REPORT, txt("m_print_report") , txt("m_print_report_txt") );
1972- file_menu->AppendSeparator();
1973- file_menu->Append(MDI_QUIT, txt("m_exit") , txt("m_exittxt") ) ;
1974- return file_menu ;
1975-}
1976-
1977-/** \brief Returns the standard Tools menu, with variations
1978- \param _pcr Include PCR menu option
1979- */
1980-wxMenu *MyFrame::getToolMenu ( bool _pcr )
1981-{
1982- wxMenu *tool_menu = new wxMenu;
1983- tool_menu->Append(MDI_ENZYME_EDITOR, txt("m_enzyme") ) ;
1984- tool_menu->Append(MDI_ALIGNMENT, txt("m_alignment") , txt("m_alignmenttxt") ) ;
1985- tool_menu->Append(MDI_RESTRICTION, txt("m_enzymeeditor") , txt("m_enzymeeditortxt") ) ;
1986- tool_menu->Append(MDI_LIGATION, txt("m_ligation") );
1987- if ( _pcr ) tool_menu->Append(MDI_RUN_PCR, txt("m_pcr") );
1988- tool_menu->Append(MDI_MANAGE_DATABASE, txt("m_manage_db") , txt("m_manage_dbtxt") ) ;
1989- tool_menu->Append(MDI_IMAGE_VIEWER, txt("m_image_viewer") , txt("m_image_viewer_txt") ) ;
1990- tool_menu->Append(MDI_EXTERNAL_INTERFACE, txt("m_external_interface") ) ;
1991- tool_menu->Append(MDI_CALCULATOR, txt("m_calculator") , txt("m_calculator_txt") ) ;
1992- tool_menu->Append(MDI_SEQUENCING_ASSISTANT, txt("m_sequencing_assistant") ) ;
1993- tool_menu->Append(MDI_DOTPLOT, txt("m_dotplot") ) ;
1994- tool_menu->Append(MDI_RESTRICTION_IDENTIFIER, txt("m_restriction_identifier") ) ;
1995- // tool_menu->Append(MDI_GRAPH, txt("m_graph") , txt("m_graph_txt") ) ; // TESTING, Deactivated in release
1996- // tool_menu->Append(MDI_CLONING_ASSISTANT, txt("m_cloning_assistant") ) ; // Deactivated in release
1997- tool_menu->Append(PROGRAM_OPTIONS, txt("m_options") , txt("m_options_txt") ) ;
1998- return tool_menu ;
1999-}
2000-
2001-/** \brief Returns the standard Help menu
2002- */
2003-wxMenu *MyFrame::getHelpMenu ()
2004-{
2005- wxMenu *help_menu = new wxMenu;
2006- help_menu->Append(MDI_HELP, txt("m_help_content") ) ;
2007- help_menu->Append(MDI_ABOUT, txt("m_about") );
2008- help_menu->Append(MDI_HOMEPAGE, txt("m_homepage") );
2009- return help_menu ;
2010-}
2011-
2012-/** \brief Adds a child, if it is not already in the children list
2013- \param ch Pointer to child
2014- */
2015-void MyFrame::setChild ( ChildBase *ch )
2016-{
2017- int a ;
2018- for ( a = 0 ; a < children.GetCount() && children[a] != ch ; a++ ) ;
2019- if ( a == children.GetCount() )
2020- {
2021- children.Add ( ch ) ;
2022- update_child_list = true ;
2023- }
2024-}
2025-
2026-/** \brief Safely removes a child from the children list
2027- \param ch Pointer to child
2028- */
2029-void MyFrame::removeChild ( ChildBase *ch )
2030-{
2031- unsigned int a ;
2032- for ( a = 0 ; a < children.GetCount() && children[a] != ch ; a++ ) ;
2033- if ( a == children.GetCount() ) return ;
2034- children[a]->Disable () ;
2035- children[a]->Hide() ;
2036- // children[a] = children[children.GetCount()-1] ;
2037- // children.pop_back () ;
2038- children.RemoveAt ( a ) ;
2039- lastChild = NULL ;
2040- activateChild ( 0 ) ;
2041-
2042- if ( children.size() == 0 )
2043- {
2044- while ( count_help () > 1 ) pop_help() ;
2045- ChildBase c ;
2046- updateCCP ( &c ) ;
2047- }
2048- notifyChildrenChanged() ;
2049-}
2050-
2051-/** \brief Activates a child (brings to front, makes visible, etc.)
2052- \param a Number of child in children list
2053- */
2054-void MyFrame::activateChild ( int a )
2055-{
2056- if ( a >= children.GetCount() ) a = 0 ;
2057- if ( children.GetCount() )
2058- {
2059- children[a]->Activate () ;
2060- mainTree->EnsureVisible ( children[a]->inMainTree ) ;
2061- mainTree->SelectItem ( children[a]->inMainTree ) ;
2062- }
2063- else setActiveChild ( NULL ) ;
2064- wxSafeYield () ;
2065-}
2066-
2067-/** \brief Locks/unlocks display, counts (un)lock requests
2068- \param lock Lock if true, unlock if not
2069- */
2070-void MyFrame::lockDisplay ( bool lock )
2071-{
2072- if ( lock )
2073- {
2074- if ( locked == 0 ) { mainTree->Freeze() ; Freeze() ; }
2075- locked++ ;
2076- }
2077- else
2078- {
2079- locked-- ;
2080- if ( locked == 0 )
2081- {
2082- mainTree->Thaw() ;
2083- Thaw() ;
2084- if ( !children.IsEmpty() )
2085- {
2086- if ( GetActiveChild() ) GetActiveChild()->Activate() ;
2087- else children.Last()->Activate () ;
2088- }
2089- }
2090- }
2091-}
2092-
2093-/** \brief Is display locked?
2094- */
2095-bool MyFrame::isLocked ()
2096-{
2097- return ( locked != 0 ) ;
2098-}
2099-
2100-/** \brief Is a child activation sequence running?
2101- */
2102-bool MyFrame::isActivating ()
2103-{
2104- return activating ;
2105-}
2106-
2107-/** \brief Is a new version available online?
2108-
2109- This function is currently a mess, due to bugs in wxWidgets,
2110- but it basically works...
2111- */
2112-wxString MyFrame::check4update ()
2113-{
2114- wxString text , file ;
2115- myExternal ex ;
2116-
2117-#ifdef __WXMSW__
2118- file = _T("currentversion.txt") ;
2119-#endif
2120-
2121-#ifdef __WXMAC__
2122- file = _T("mac_currentversion.txt") ;
2123-#endif
2124-
2125- text = check4update_sub ( ex.getText ( _T("http://gentle.magnusmanske.de/") + file ) ) ;
2126-// if ( text.IsEmpty() ) // Fallback
2127-// text = check4update_sub ( ex.getText ( _T("http://www.uni-koeln.de/math-nat-fak/biochemie/klein/gentle/") + file ) ) ;
2128-
2129- if ( text == _T("-") ) text = _T("") ;
2130- return text ;
2131-}
2132-
2133-wxString MyFrame::check4update_sub ( wxString text )
2134-{
2135- bool error = true ;
2136- if ( !text.IsEmpty() ) error = false ;
2137-
2138- if ( !error )
2139- {
2140- wxString it = text ;
2141- wxString td = text ;
2142- td = td.BeforeFirst ( '\n' ) ;
2143- td = td.BeforeFirst ( '\r' ) ;
2144-
2145- wxString lu = LS->getOption ( _T("LAST_UPDATE") , _T("") ) ;
2146- if ( lu.IsEmpty() ) // Assuming new installation of the latest version, so no update
2147- {
2148- lu = td ;
2149- LS->setOption ( _T("LAST_UPDATE") , lu ) ;
2150- }
2151-
2152- if ( td > lu )
2153- {
2154- wxString msg = it.AfterFirst ( '\n' ) ;
2155- msg += _T("\n(") + wxString ( txt("t_you_use_version") ) + myapp()->get_GENtle_version() + _T(")") ;
2156- wxMessageDialog md ( this , msg , txt("t_new_version" ) ,
2157- wxOK | wxCANCEL | wxCENTRE | wxICON_INFORMATION ) ;
2158- if ( wxID_OK != md.ShowModal() )
2159- return _T("-") ;
2160-
2161- return td ;
2162- }
2163- }
2164- else
2165- {
2166- // Cannot connect to check for update
2167- // SetStatusText ( txt("t_update_warning") , 1 ) ;
2168- // wxMessageBox ( _T("Error") , text ) ;
2169- }
2170- return _T("") ;
2171-}
2172-
2173-/** \brief Download the new version of GENtle
2174- \param ver New version
2175- */
2176-void MyFrame::update2version ( wxString ver )
2177-{
2178- wxString do_run ;
2179- wxProgressDialog pd ( _T("Updating...") , _T("Downloading installer...") , 2 , NULL , 0 ) ;
2180- myExternal ex ;
2181- ex.pd = &pd ;
2182-
2183- wxString sourcefile , sourcefile2 , localfile ;
2184-
2185-#ifdef __WXMSW__
2186- localfile = myapp()->homedir + _T("\\GENtleSetup.exe") ;
2187- sourcefile = _T("http://gentle.magnusmanske.de/GENtleSetup.exe") ;
2188- sourcefile2 = _T("http://www.uni-koeln.de/math-nat-fak/biochemie/klein/gentle/GENtleSetup.exe") ; // Fallback
2189-#endif
2190-
2191-#ifdef __WXMAC__
2192- localfile = wxString(wxGetUserHome()) + _T("/Desktop/GENtle.pkg.zip") ;
2193- sourcefile = _T("http://gentle.magnusmanske.de/GENtle.pkg.zip") ;
2194- sourcefile2 = _T("http://www.uni-koeln.de/math-nat-fak/biochemie/klein/gentle/GENtle.pkg.zip") ; // Fallback
2195-#endif
2196-
2197- if ( ex.copyFile ( sourcefile , localfile ) > 0 )
2198- {
2199- if ( ex.copyFile ( sourcefile2 , localfile ) > 0 )
2200- {
2201- wxMessageBox ( _T("Couldn't read setup file") ) ;
2202- wxExit() ; // Hard exit
2203- }
2204- }
2205-
2206-#ifdef __WXMSW__
2207- do_run = _T("\"") + localfile + _T("\" /D=\"") ;
2208- do_run += myapp()->homedir ;
2209- do_run += _T("\"") ;
2210- LS->setOption ( _T("LAST_UPDATE") , ver ) ;
2211- dying = true ;
2212- if ( 0 == wxExecute ( do_run , wxEXEC_ASYNC ) ) return ; // 0 means the process couldn't start :-(
2213- wxExit() ; // Hard exit
2214-#endif
2215-
2216-#ifdef __WXMAC__
2217- do_run = _T("unzip -o ") + localfile + _T(" -d ") + wxGetUserHome() + _T("/Desktop") ;
2218- wxExecute ( do_run , wxEXEC_SYNC ) ;
2219- wxRemoveFile ( localfile ) ;
2220- localfile = wxString(wxGetUserHome()) + _T("/Desktop/GENtle_package.pkg") ;
2221- do_run = _T("open ") + localfile ;
2222- LS->setOption ( _T("LAST_UPDATE") , ver ) ;
2223- dying = true ;
2224- wxExecute ( do_run , wxEXEC_ASYNC ) ;
2225- Destroy() ;
2226-#endif
2227-}
2228-
2229-/** \brief Handles SashDrag events (sash between the main tree and the current child
2230- */
2231-void MyFrame::OnSashDrag(wxSashEvent& event)
2232-{
2233- if (event.GetDragStatus() == wxSASH_STATUS_OUT_OF_RANGE)
2234- return;
2235-
2236- switch (event.GetId())
2237- {
2238- case FRAME_SASH_TOP:
2239- {
2240- m_topWindow->SetDefaultSize(wxSize(1000, event.GetDragRect().height));
2241- break;
2242- }
2243- case FRAME_SASH_1:
2244- {
2245- m_leftWindow1->SetDefaultSize(wxSize(event.GetDragRect().width, 1000));
2246- break;
2247- }
2248- case FRAME_SASH_2:
2249- {
2250- m_leftWindow2->SetDefaultSize(wxSize(event.GetDragRect().width, 1000));
2251- break;
2252- }
2253- case FRAME_SASH_BOTTOM:
2254- {
2255- m_bottomWindow->SetDefaultSize(wxSize(1000, event.GetDragRect().height));
2256- break;
2257- }
2258- }
2259- wxLayoutAlgorithm layout;
2260- layout.LayoutFrame(this);
2261- Refresh () ;
2262-
2263- // Leaves bits of itself behind sometimes
2264- // GetClientWindow()->Refresh();
2265-}
2266-
2267-/** \brief Creates a temporary database, or uses one from the cache
2268- \param name Name of the database to use
2269- */
2270-TStorage *MyFrame::getTempDB ( wxString name )
2271-{
2272- unsigned int a ;
2273- for ( a = 0 ; a < dbcache.GetCount() && dbcache[a]->getDBname() != name ; a++ ) ;
2274- if ( a == dbcache.GetCount() )
2275- dbcache.Add ( new TStorage ( TEMP_STORAGE , name ) ) ;
2276- return dbcache[a] ;
2277-}
2278-
2279-/** \brief Sets the active child
2280- \param c Pointer to the child
2281- */
2282-void MyFrame::setActiveChild ( ChildBase *c )
2283-{
2284- lastChild = c ;
2285- if ( !IsShown() ) return ;
2286- if ( locked != 0 ) return ;
2287- if ( activating ) return ;
2288- unsigned int a ;
2289- for ( a = 0 ; a < children.GetCount() ; a++ )
2290- {
2291- ChildBase *d = children[a] ;
2292- if ( d != c )
2293- {
2294- if ( d->IsShown() ) d->Hide () ;
2295- if ( d->IsEnabled() ) d->Disable () ;
2296- }
2297- }
2298- if ( children.GetCount() == 0 && GetMenuBar() != menu_bar ) SetMenuBar ( menu_bar ) ;
2299- if ( !c ) return ;
2300- activating = true ;
2301- // wxSafeYield() ;
2302- if ( !c->IsEnabled() ) c->Enable() ;
2303- if ( c->menubar && GetMenuBar() != c->menubar )
2304- c->SetMyMenuBar () ;
2305- //SetMenuBar ( c->menubar ) ;
2306- wxSize s = c->GetParent()->GetClientSize() ;
2307- if ( c->GetSize() != s )
2308- {
2309- if ( c->vec ) c->vec->updateDisplay() ;
2310- c->SetSize ( s ) ;
2311- }
2312- if ( mainTree && c->inMainTree.IsOk() && mainTree->GetSelection() != c->inMainTree )
2313- mainTree->SelectItem ( c->inMainTree ) ;
2314- if ( !c->IsShown() ) c->Show() ;
2315- // c->Refresh () ;
2316- wxSafeYield () ;
2317- activating = false ;
2318-}
2319-
2320-/** \brief Returns the base window for all children
2321- */
2322-wxWindow *MyFrame::getCommonParent()
2323-{
2324- return m_leftWindow2 ;
2325-}
2326-
2327-/** \brief Bug-patch function to catch illegal events
2328- */
2329-void MyFrame::BollocksMenu(wxCommandEvent& event)
2330-{
2331- if ( !lastChild ) return ;
2332- if ( event.GetId() == MDI_NEXT_WINDOW ||
2333- event.GetId() == MDI_PREV_WINDOW )
2334- {
2335- int a = getChildIndex ( lastChild ) ;
2336- if ( event.GetId() == MDI_NEXT_WINDOW ) a++ ;
2337- else a-- ;
2338- if ( a < 0 ) a = children.GetCount()-1 ;
2339- if ( a >= children.GetCount() ) a = 0 ;
2340- if ( a >= 0 && a <= children.GetCount() )
2341- {
2342- mainTree->EnsureVisible ( children[a]->inMainTree ) ;
2343- mainTree->SelectItem ( children[a]->inMainTree ) ;
2344- children[a]->EnforceRefesh () ;
2345- }
2346- return ;
2347- }
2348- if ( lastChild->def != _T("dna") ) return ;
2349- lastChild->ProcessEvent ( event ) ;
2350-}
2351-
2352-/** \brief Reroutes context menu events to online tools
2353- */
2354-void MyFrame::OnlineTools(wxCommandEvent& event)
2355-{
2356- online_tools->take_event ( event ) ;
2357-}
2358-
2359-/** \brief Reroutes menu events from the frame to the active child
2360- */
2361-void MyFrame::RerouteMenu(wxCommandEvent& event)
2362-{
2363- bool b = false ;
2364- if ( lastChild ) b = lastChild->ProcessEvent ( event ) ;
2365- // if ( !b ) ProcessEvent ( event ) ;
2366-}
2367-
2368-/** \brief Gets the number of a child in the children list
2369- \param c Pointer to child
2370- */
2371-int MyFrame::getChildIndex ( ChildBase *c )
2372-{
2373- int a ;
2374- for ( a = 0 ; a < children.GetCount() && children[a] != c ; a++ ) ;
2375- return a ;
2376-}
2377-
2378-
2379-/** \brief Closes MDI child via (Crtl-F4)
2380- */
2381-void MyFrame::OnMDIClose(wxCommandEvent& event)
2382-{
2383- if ( lastChild ) lastChild->Close ( TRUE ) ;
2384-}
2385-
2386-/** \brief Creates/reuses a virtual gel
2387- */
2388-TVirtualGel *MyFrame::useGel ( wxString type )
2389-{
2390- int a ;
2391- TVirtualGel *gel ;
2392- for ( a = 0 ; a < children.GetCount() ; a++ )
2393- {
2394- if ( children[a]->def != _T("GEL") ) continue ;
2395- gel = (TVirtualGel*) children[a] ;
2396- if ( gel->type == type ) return gel ;
2397- }
2398-
2399- gel = new TVirtualGel ( getCommonParent() , _T("GEL ") + type ) ;
2400- gel->type = type ;
2401-
2402- // Give it an icon
2403-#ifdef __WXMSW__
2404- gel->SetIcon(wxIcon(_T("chrt_icn")));
2405-#elif __WXMAC__
2406-#else
2407- gel->SetIcon(wxIcon( mondrian_xpm ));
2408-#endif
2409-
2410- gel->initme () ;
2411-
2412- gel->Show() ;
2413- gel->Maximize() ;
2414- gel->showName() ;
2415-
2416- mainTree->addChild ( gel , TYPE_MISC ) ;
2417- setChild ( gel ) ;
2418- activateChild ( children.GetCount()-1 ) ;
2419- return gel ;
2420-}
2421-
2422-/** \brief Handles the menu request for running the test suite
2423- */
2424-void MyFrame::TestMenu(wxCommandEvent& event)
2425-{
2426-#ifdef MYTEST
2427- if ( test_suite == NULL ) test_suite = new TTestSuite ;
2428- test_suite->Step () ;
2429- wxCommandEvent ev ( wxEVT_COMMAND_MENU_SELECTED , Y___ ) ;
2430- wxPostEvent ( this , ev ) ;
2431-#endif
2432-}
2433-
2434-
2435-void MyFrame::push_help ( wxString name )
2436-{
2437- help_name.push_back ( name ) ;
2438-}
2439-
2440-void MyFrame::pop_help ()
2441-{
2442- if ( help_name.size() == 0 ) return ;
2443- help_name.pop_back() ;
2444-}
2445-
2446-wxString MyFrame::get_help ()
2447-{
2448- if ( help_name.size() == 0 ) return _T("") ;
2449- return help_name[help_name.size()-1] ;
2450-}
2451-
2452-void MyFrame::OnSequencingAssistant(wxCommandEvent& event)
2453-{
2454- TSequencingAssistantDialog sa ( getCommonParent(), txt("t_sequencing_assistant") );
2455- if ( wxID_OK != sa.ShowModal() ) return ; // Cancel
2456-
2457- int sel_seq = sa.sequence->GetSelection() ;
2458- int sel_abi1 = sa.abi1->GetSelection() ;
2459- int sel_abi2 = sa.abi2->GetSelection() ;
2460-
2461- if ( sel_seq == wxNOT_FOUND || sel_seq == 0 ) return ; // No sequence selected
2462- if ( sel_abi1 <= 0 && sel_abi2 <= 0 ) return ; // No ABI selected
2463- sa.fix_rev_compl () ;
2464-
2465- // Alignment call
2466- wxArrayString vs ;
2467- wxArrayChildBase vc ;
2468- ChildBase *seq = sa.dna[sel_seq] ;
2469- ChildBase *abi1 = sel_abi1 <= 0 ? NULL : sa.abi[sa.abi1->GetSelection()] ;
2470- ChildBase *abi2 = sel_abi2 <= 0 ? NULL : sa.abi[sa.abi2->GetSelection()] ;
2471-
2472- // Put 5'->3' first
2473- if ( abi1 && abi2 && ((TABIviewer*)abi1)->get_inv_compl() && !((TABIviewer*)abi2)->get_inv_compl() )
2474- {
2475- ChildBase *abi3 = abi1 ;
2476- abi1 = abi2 ;
2477- abi2 = abi3 ;
2478- }
2479-
2480- vs.Add ( seq->getName() ) ;
2481- vc.Add ( seq ) ;
2482- if ( abi1 )
2483- {
2484- vs.Add ( abi1->getName() ) ;
2485- vc.Add ( abi1 ) ;
2486- }
2487- if ( abi2 )
2488- {
2489- vs.Add ( abi2->getName() ) ;
2490- vc.Add ( abi2 ) ;
2491- }
2492-
2493- TAlignment *ali = runAlignment ( vs , vc , NULL ) ;
2494- ali->algorithm = 1 ;
2495- ali->redoAlignments () ;
2496-}
2497-
2498-void MyFrame::OnCloningAssistant(wxCommandEvent& event)
2499-{
2500- TCloningAssistant *subframe = new TCloningAssistant(getCommonParent(), txt("t_cloning_assistant") );
2501- myass ( subframe , "MyFrame::OnCloningAssistant" ) ;
2502- setChild ( subframe ) ;
2503-
2504- // Give it an icon
2505-#ifdef __WXMSW__
2506- subframe->SetIcon(wxIcon(_T("chrt_icn")));
2507-#elif __WXMAC__
2508-#else
2509- subframe->SetIcon(wxIcon( mondrian_xpm ));
2510-#endif
2511-
2512- subframe->initme() ;
2513- mainTree->addChild(subframe,TYPE_MISC) ;
2514- children.Last()->Activate () ;
2515- // subframe->Show ( TRUE ) ;
2516- // subframe->EnforceRefesh () ;
2517- // subframe->Activate () ;
2518-}
2519-
2520-void MyFrame::OnLigation(wxCommandEvent& event)
2521-{
2522- TLigationDialog ld ( this , txt("t_ligation") ) ;
2523- long l ;
2524- for ( l = 0 ; l < myapp()->frame->children.GetCount() ; l++ )
2525- {
2526- MyChild *p = (MyChild*) myapp()->frame->children[l] ;
2527- if ( p->def == _T("dna") && !p->vec->isCircular() )
2528- {
2529- ld.vv.Add ( p->vec ) ;
2530- }
2531- }
2532-
2533- ld.init () ;
2534- ld.ShowModal() ;
2535- if ( !ld.doLigate ) return ;
2536- for ( l = 0 ; l < ld.ligates.size() ; l++ )
2537- {
2538- if ( !ld.ligates[l].getSequence().IsEmpty() )
2539- {
2540- TVector *v = new TVector ;
2541- v->setFromVector ( ld.ligates[l] ) ;
2542- for ( int a = 0 ; a < v->items.size() ; a++ )
2543- v->items[a].r1 = -1 ; // Resetting item radius to "recalc"
2544- myapp()->frame->newFromVector ( v ) ;
2545- }
2546- }
2547- myapp()->frame->lastCocktail.Clear () ;
2548-}
2549-
2550-void MyFrame::OnStoreAll(wxCommandEvent& event)
2551-{
2552- TStoreAllDialog dlg ( this , txt("t_store_all_dialog") ) ;
2553- dlg.ShowModal() ;
2554-}
2555-
2556-void MyFrame::notifyChildrenChanged()
2557-{
2558- int a ;
2559- for ( a = 0 ; a < children.GetCount() ; a++ )
2560- {
2561- children[a]->otherChildrenChanged() ;
2562- }
2563-}
2564-
2565-//******************************************************************* TTestSuite
2566-
2567-#ifdef MYTEST
2568-
2569-TTestSuite::TTestSuite ()
2570-{
2571- srand ( time(NULL) );
2572- cnt = 0 ;
2573-}
2574-
2575-void TTestSuite::pressKey ( ChildBase *ac )
2576-{
2577- if ( ac->def == _T("dna") ) vectorPressKey ( ac ) ;
2578- if ( ac->def == _T("AminoAcids") ) vectorPressKey ( ac ) ;
2579- if ( ac->def == _T("PrimerDesign") ) vectorPressKey ( ac ) ;
2580-}
2581-
2582-void TTestSuite::action ( ChildBase *ac )
2583-{
2584- if ( ac->def == _T("dna") ) vectorAction ( ac ) ;
2585- if ( ac->def == _T("AminoAcids") ) aaAction ( ac ) ;
2586-}
2587-
2588-void TTestSuite::editMode ( ChildBase *ac )
2589-{
2590- wxCommandEvent event ;
2591- mylog ( "Testsuite:Edit mode" , "" ) ;
2592- if ( ac->def == _T("dna") ) ((MyChild*)ac)->OnEditMode(event) ;
2593- if ( ac->def == _T("PrimerDesign") ) ((TPrimerDesign*)ac)->OnEditMode(event) ;
2594- if ( ac->def == _T("AminoAcids") )
2595- {
2596- ((TAminoAcids*)ac)->OnEditMode(event) ;
2597- }
2598-}
2599-
2600-void TTestSuite::vectorPressKey ( ChildBase *ac )
2601-{
2602- // if ( !ac->cSequence ) { mylog ("D'oh!",""); return ;}
2603- wxKeyEvent ev ( wxEVT_CHAR_HOOK ) ;
2604- ev.m_altDown = false ;
2605- ev.m_controlDown = rand() % 2 ;
2606- ev.m_metaDown = false ;
2607- ev.m_shiftDown = rand() % 2 ;
2608- int r = rand () % 40 ;
2609- if ( r > 14 ) r = 9 + r % 6 ;
2610- wxString msg ;
2611- ev.m_keyCode = 'A' ; // Default
2612- if ( r == 0 ) { ev.m_keyCode = 'A' ; msg = _T("A") ; }
2613- if ( r == 1 ) { ev.m_keyCode = 'C' ; msg = _T("C") ; }
2614- if ( r == 2 ) { ev.m_keyCode = 'T' ; msg = _T("G") ; }
2615- if ( r == 3 ) { ev.m_keyCode = 'G' ; msg = _T("T") ; }
2616- if ( r == 4 ) { ev.m_keyCode = WXK_BACK ; msg = _T("BACK") ; }
2617- if ( r == 5 ) { ev.m_keyCode = WXK_DELETE ; msg = _T("DEL") ; }
2618- if ( r == 6 ) { ev.m_keyCode = WXK_HOME ; msg = _T("HOME") ; }
2619- if ( r == 7 ) { ev.m_keyCode = WXK_END ; msg = _T("END") ; }
2620- if ( r == 8 ) { ev.m_keyCode = WXK_INSERT ; msg = _T("INSERT") ; }
2621- if ( r == 9 ) { ev.m_keyCode = WXK_RIGHT ; msg = _T("RIGHT") ; }
2622- if ( r == 10 ) { ev.m_keyCode = WXK_LEFT ; msg = _T("LEFT") ; }
2623- if ( r == 11 ) { ev.m_keyCode = WXK_UP ; msg = _T("UP") ; }
2624- if ( r == 12 ) { ev.m_keyCode = WXK_DOWN ; msg = _T("DOWN") ; }
2625- if ( r == 13 ) { ev.m_keyCode = WXK_PRIOR ; msg = _T("PRIOR") ; }
2626- if ( r == 14 ) { ev.m_keyCode = WXK_NEXT ; msg = _T("NEXT") ; }
2627- mylog ( "Testsuite:Key" , wxString::Format ( "%s" , msg.c_str() ) ) ;
2628- if ( ac->def == _T("PrimerDesign") ) ((TPrimerDesign*)ac)->sc->OnCharHook(ev) ;
2629- else ac->cSequence->OnCharHook(ev) ;
2630-}
2631-
2632-void TTestSuite::vectorAction ( ChildBase *ac )
2633-{
2634- MyChild *c = (MyChild*) ac ;
2635- wxCommandEvent ev ;
2636- int r = rand() % 24 ;
2637- mylog ( "Testsuite:Message" , wxString::Format ( "%d" , r ) ) ;
2638- switch ( r )
2639- {
2640- case 0 : c->OnAA_none ( ev ) ; break ;
2641- case 1 : c->OnAA_known ( ev ) ; break ;
2642- case 2 : c->OnAA_all ( ev ) ; break ;
2643- case 3 : c->OnAA_three ( ev ) ; break ;
2644- case 4 : c->OnAA_one ( ev ) ; break ;
2645- case 5 : c->OnAA_three_1 ( ev ) ; break ;
2646- case 6 : c->OnAA_three_2 ( ev ) ; break ;
2647- case 7 : c->OnAA_three_3 ( ev ) ; break ;
2648- case 8 : c->OnAA_three_M1 ( ev ) ; break ;
2649- case 9 : c->OnAA_three_M2 ( ev ) ; break ;
2650- case 10 : c->OnAA_three_M3 ( ev ) ; break ;
2651- case 11 : c->OnCircularLinear ( ev ) ; break ;
2652- case 12 : c->OnMarkAll ( ev ) ; break ;
2653- case 13 : c->OnCut ( ev ) ; break ;
2654- case 14 : c->OnCopy ( ev ) ; break ;
2655- // case 15 : c->OnPaste ( ev ) ; break ; // Might paste *real* clipboard;-)
2656- case 16 : c->OnCopyToNew ( ev ) ; break ;
2657- case 17 : c->OnViewMode ( ev ) ; break ;
2658- case 18 : c->OnORFs ( ev ) ; break ;
2659- case 19 : c->OnToggleFeatures ( ev ) ; break ;
2660- case 20 : c->OnToggleRestriction ( ev ) ; break ;
2661- case 21 : c->OnToggleIDNA ( ev ) ; break ;
2662- case 22 : c->Undo ( ev ) ; break ;
2663- case 23 : if ( c->cSequence ) c->OnRunPCR ( ev ) ; break ;
2664- }
2665-}
2666-
2667-void TTestSuite::aaAction ( ChildBase *ac )
2668-{
2669- wxCommandEvent ev ;
2670- TAminoAcids *aa = (TAminoAcids*) ac ;
2671-
2672- int r = rand() % 15 ;
2673- if ( r == 0 )
2674- {
2675- int num = aa->inlinePlot->GetCount() ;
2676- num = rand() % num ;
2677- mylog ( "TTestSuite::aaAction" , wxString::Format ( "Inline plot to %d" , num ) ) ;
2678- aa->inlinePlot->SetSelection ( num ) ;
2679- aa->OnIP ( ev ) ;
2680- }
2681- else if ( r == 1 ) { mylog ( "TTestSuite::aaAction" , "OnHorizontal" ) ; aa->OnHorizontal ( ev ) ; }
2682- else if ( r == 2 ) { mylog ( "TTestSuite::aaAction" , "MarkAll" ) ; aa->OnMarkAll ( ev ) ; }
2683- else if ( r == 3 ) { mylog ( "TTestSuite::aaAction" , "Cut" ) ; aa->OnCut ( ev ) ; }
2684- // else if ( r == 4 ) aa->OnPhotometer ( ev ) ; // Works, too many boring calculators ;-)
2685- else
2686- {
2687- int num = aa->lb->GetCount() ;
2688- num = rand() % num ;
2689- mylog ( "TTestSuite::aaAction" , wxString::Format ( "ListBox to %d" , num ) ) ;
2690- aa->lb->SetSelection ( num , true ) ;
2691- aa->OnListBox ( ev ) ;
2692- }
2693-}
2694-
2695-void TTestSuite::mouseEvent ( ChildBase *ac )
2696-{
2697- SequenceCanvas *can = ac->cSequence ;
2698- if ( !can && ac->def == _T("PrimerDesign") ) can = ((TPrimerDesign*)ac)->sc ;
2699- if ( !can ) return ;
2700-
2701- wxArrayInt vi ;
2702- vi.Add ( wxEVT_ENTER_WINDOW ) ;
2703- vi.Add ( wxEVT_LEAVE_WINDOW ) ;
2704- vi.Add ( wxEVT_LEFT_DOWN ) ;
2705- vi.Add ( wxEVT_LEFT_UP ) ;
2706- // vi.Add ( wxEVT_LEFT_DCLICK ) ;
2707- vi.Add ( wxEVT_MIDDLE_DOWN ) ;
2708- vi.Add ( wxEVT_MIDDLE_UP ) ;
2709- vi.Add ( wxEVT_MIDDLE_DCLICK ) ;
2710- // vi.Add ( wxEVT_RIGHT_DOWN ) ;
2711- vi.Add ( wxEVT_RIGHT_UP ) ;
2712- vi.Add ( wxEVT_RIGHT_DCLICK ) ;
2713- vi.Add ( wxEVT_MOTION ) ;
2714- vi.Add ( wxEVT_MOUSEWHEEL ) ;
2715-
2716- int et = vi[rand()%vi.GetCount()] ;
2717-
2718- wxMouseEvent event ( et ) ;
2719- int w , h ;
2720- can->GetClientSize ( &w , &h ) ;
2721- event.m_x = rand() % w ;
2722- event.m_y = rand() % h ;
2723- can->OnEvent ( event ) ;
2724-}
2725-
2726-void TTestSuite::Step()
2727-{
2728- if ( cnt == 0 ) start = wxGetLocalTime() ;
2729- MyFrame *f = myapp()->frame ;
2730-
2731- ChildBase *ac = f->GetActiveChild () ;
2732- if ( !ac ) return ; // No child open
2733-
2734- cnt++ ;
2735- if ( cnt > 1000000 )
2736- {
2737- wxMessageBox ( _T("1000K") ) ;
2738- wxExit() ;
2739- }
2740- int r = rand() ;
2741- r %= 10 ;
2742-
2743- wxString x ;
2744- x = ac->getName() ;
2745- x += _T(" [") + ac->def + _T("] ") ;
2746- x += wxString::Format ( _T(" [%ds, #%d]") , wxGetLocalTime()-start , cnt ) ;
2747- if ( ac->vec ) x += wxString::Format ( _T(", seq : %d") , ac->vec->getSequenceLength() ) ;
2748- if ( ac->cSequence ) x += wxString::Format ( _T(", EditMode : %d") , ac->cSequence->getEditMode() ) ;
2749- if ( ac->cSequence ) x += wxString::Format ( _T(", Overwrite : %d") , ac->cSequence->doOverwrite() ) ;
2750- if ( ac->cSequence ) x += wxString::Format ( _T(", Mark %d-%d") , ac->cSequence->markedFrom() , ac->cSequence->markedTo() ) ;
2751- x += wxString::Format ( _T(", r=%d") , r ) ;
2752- mylog ( "Testsuite:Status" , x ) ;
2753-
2754- if ( r < 6 ) pressKey ( ac ) ;
2755- // else if ( r == 6 ) mouseEvent ( ac ) ;
2756- else if ( r == 7 ) editMode ( ac ) ;
2757- else if ( r == 8 )
2758- {
2759- r = rand() % f->children.GetCount() ;
2760- mylog ( "Testsuite:Activate" , wxString::Format ( "%d" , r ) ) ;
2761- f->activateChild ( r ) ;
2762- }
2763- else if ( r == 9 ) action ( ac ) ;
2764-}
2765-
2766-#endif
2767-
2768-// DROP TARGET
2769-
2770-/** \brief Handles dropped file name(s)
2771- */
2772-bool MyFrameDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames)
2773-{
2774- int a , b ;
2775- for ( a = 0 ; a < filenames.GetCount() ; a++ )
2776- {
2777- wxString path = filenames[a] ;
2778- for ( b = path.length() - 1 ; path.GetChar(b) != '\\' && path.GetChar(b) != '/' ; b-- ) ;
2779- wxString file = path.substr ( b+1 ) ;
2780- myapp()->frame->importFile ( file , path , -1 ) ;
2781- }
2782- return true ;
2783-}
2784-
2785-// Project
2786-
2787-/** \brief Constructor
2788- */
2789-TProject::TProject ()
2790-{
2791- enzyme_rules = NULL ;
2792-}
2793-
2794-TEnzymeRules *TProject::getEnzymeRules () { return enzyme_rules ; }
2795-void TProject::setEnzymeRules ( TEnzymeRules *er ) { enzyme_rules = er ; }
2796-
2797
2798=== removed directory '.pc/remove_clustalw.patch'
2799=== removed file '.pc/remove_clustalw.patch/Makefile.am'
2800--- .pc/remove_clustalw.patch/Makefile.am 2010-06-15 16:38:33 +0000
2801+++ .pc/remove_clustalw.patch/Makefile.am 1970-01-01 00:00:00 +0000
2802@@ -1,244 +0,0 @@
2803-SUFFIXES=.cpp .rc
2804-
2805-bin_PROGRAMS = GENtle
2806-
2807-EXTRA_DIST = mondrian.xpm \
2808-variables.csv \
2809-blank.db \
2810-default.tab \
2811-marker.txt \
2812-bitmaps/align.bmp \
2813-bitmaps/cocktail.bmp \
2814-bitmaps/display_features.bmp \
2815-bitmaps/helpcs.bmp \
2816-bitmaps/new.xpm \
2817-bitmaps/plasmid_linear.bmp \
2818-bitmaps/print.xpm \
2819-bitmaps/settings_tool.bmp \
2820-bitmaps/alignment.bmp \
2821-bitmaps/copy.bmp \
2822-bitmaps/display_restriction.bmp \
2823-bitmaps/help.xpm \
2824-bitmaps/open.bmp \
2825-bitmaps/preview.bmp \
2826-bitmaps/project.bmp \
2827-bitmaps/splash.bmp \
2828-bitmaps/align_tool.bmp \
2829-bitmaps/copy.xpm \
2830-bitmaps/draft.xbm \
2831-bitmaps/image.bmp \
2832-bitmaps/open.xpm \
2833-bitmaps/preview.xpm \
2834-bitmaps/protein.bmp \
2835-bitmaps/tick.bmp \
2836-bitmaps/bitmap1.bmp \
2837-bitmaps/cut.bmp \
2838-bitmaps/drawing.xbm\
2839-bitmaps/mode_both.bmp \
2840-bitmaps/orfs.bmp \
2841-bitmaps/primer.bmp \
2842-bitmaps/redo.bmp \
2843-bitmaps/undo.bmp \
2844-bitmaps/bitmap2.bmp \
2845-bitmaps/cut.xpm \
2846-bitmaps/flowchar.xbm \
2847-bitmaps/mode_edit.bmp \
2848-bitmaps/paste.bmp \
2849-bitmaps/primer_export.bmp \
2850-bitmaps/save.bmp \
2851-bitmaps/web.bmp \
2852-bitmaps/calc.bmp \
2853-bitmaps/Helix.bmp \
2854-bitmaps/mode_view.bmp \
2855-bitmaps/paste.xpm \
2856-bitmaps/primer_import.bmp \
2857-bitmaps/save.xpm \
2858-bitmaps/write.xbm\
2859-bitmaps/calc_tool.bmp \
2860-bitmaps/dirplain.xbm \
2861-bitmaps/help.bmp \
2862-bitmaps/new.bmp \
2863-bitmaps/plasmid_circular.bmp \
2864-bitmaps/print.bmp \
2865-bitmaps/scissors.bmp
2866-
2867-
2868-GENtle_LDADD = $(WX_LIBS) -L/usr/lib -L/usr/local/lib -lsqlite -lsqlite3 -lmysqlclient -ltinyxml
2869-GENtle_LDFLAGS = -s
2870-GENtle_SOURCES = TXMLfile.cpp\
2871-TVectorTree.cpp\
2872-TVirtualGel.cpp\
2873-TVectorEditorItems.cpp\
2874-TVectorEditorEnzymes.cpp\
2875-TVectorEditor.cpp\
2876-TVector.cpp\
2877-SCFtype.cpp\
2878-TStoreAllDialog.cpp\
2879-TDotPlot.cpp\
2880-TUndo.cpp\
2881-TUReadSeq.cpp\
2882-TStorage.cpp\
2883-TSilmutDialog.cpp\
2884-TRestrictionEditor.cpp\
2885-TPrimer.cpp\
2886-TPrimerDialog.cpp\
2887-TPDB.cpp\
2888-TLigationDialog.cpp\
2889-TMainTree.cpp\
2890-todo.cpp\
2891-TItemEditDialog.cpp\
2892-TImageDisplay.cpp\
2893-TIMGreader.cpp\
2894-TextImportDialog.cpp\
2895-TClone.cpp\
2896-SequenceTypes.cpp\
2897-TCalculator.cpp\
2898-SequenceTypeRestriction.cpp\
2899-SequenceTypePlot.cpp\
2900-SequenceTypeFeature.cpp\
2901-SequenceTypeDNA.cpp\
2902-SequenceTypeAlign.cpp\
2903-SequenceTypeABI.cpp\
2904-SequenceTypeAA.cpp\
2905-SequenceCanvas.cpp\
2906-SendHTTP.cpp\
2907-RestrictionEnzymes.cpp\
2908-ProgramOptionsDialog.cpp\
2909-PlasmidCanvasLinear.cpp\
2910-PrimerDesign.cpp\
2911-PlasmidCanvasHandlers.cpp\
2912-PlasmidCanvasCircular.cpp\
2913-PlasmidCanvas.cpp\
2914-MyFrame.cpp\
2915-MyChild.cpp\
2916-MiscDialogs.cpp\
2917-ManageDatabase.cpp\
2918-main.cpp\
2919-GenBank.cpp\
2920-FindSequenceDialog.cpp\
2921-ExternalNCBI.cpp\
2922-ExternalInterface.cpp\
2923-ExternalBLAST.cpp\
2924-ChildBase.cpp\
2925-CoolCanvas.cpp\
2926-AminoAcids.cpp\
2927-Alignment.cpp\
2928-ABIviewer.cpp\
2929-ABItype.cpp\
2930-TAlignmentDialog.cpp\
2931-AutoAnnotate.cpp\
2932-TGraph.cpp\
2933-TGraphDisplay.cpp\
2934-TGraphScale.cpp\
2935-CGview.cpp\
2936-ureadseq.c\
2937-ncoils.cpp\
2938-TPhylip.cpp\
2939-TPhyloTree.cpp\
2940-PCR_Troubleshoot.cpp\
2941-TProteolysis.cpp\
2942-clustalw/alnscore.cpp\
2943-clustalw/amenu.cpp\
2944-clustalw/calcgap.cpp\
2945-clustalw/calcprf1.cpp\
2946-clustalw/calcprf2.cpp\
2947-clustalw/calctree.cpp\
2948-clustalw/clustalw.cpp\
2949-clustalw/gcgcheck.cpp\
2950-clustalw/interfac.cpp\
2951-clustalw/malign.cpp\
2952-clustalw/palign.cpp\
2953-clustalw/prfalign.cpp\
2954-clustalw/random.cpp\
2955-clustalw/readmat.cpp\
2956-clustalw/sequence.cpp\
2957-clustalw/showpair.cpp\
2958-clustalw/trees.cpp\
2959-clustalw/util.cpp\
2960-ipc/element.cpp\
2961-ipc/gp_out.cpp\
2962-ipc/ipc.cpp\
2963-ipc/pars.cpp\
2964-CloneManager.cpp\
2965-CloningAssistant.cpp\
2966-TSequencingAssistantDialog.cpp\
2967-AlignmentAppearanceDialog.cpp\
2968-SequenceTypeAAstructure.cpp\
2969-OnlineTools.cpp\
2970-TEliteLaChromLogDialog.cpp\
2971-TRestrictionIdentifier.cpp\
2972-TRestrictionIdentifier.h\
2973-CloningAssistant.h\
2974-AlignmentAppearanceDialog.h\
2975-TSequencingAssistantDialog.h\
2976-OnlineTools.h\
2977-CloneManager.h\
2978-enums.h \
2979-lin_sqlite.h \
2980-lin_sqlite3.h \
2981-TXMLfile.h\
2982-SCFtype.h\
2983-TStoreAllDialog.h\
2984-TDotPlot.h\
2985-AutoAnnotate.h\
2986-CGview.h\
2987-TAlignmentDialog.h\
2988-TGraph.h\
2989-TVectorTree.h\
2990-TVirtualGel.h\
2991-TVectorEditor.h\
2992-TVector.h\
2993-TUndo.h\
2994-TUReadSeq.h\
2995-TStorage.h\
2996-TSilmutDialog.h\
2997-TRestrictionEditor.h\
2998-TPrimer.h\
2999-TPrimerDialog.h\
3000-TPDB.h\
3001-TLigationDialog.h\
3002-TMainTree.h\
3003-TItemEditDialog.h\
3004-TImageDisplay.h\
3005-TIMGreader.h\
3006-TextImportDialog.h\
3007-TClone.h\
3008-TCalculator.h\
3009-SequenceCanvas.h\
3010-SendHTTP.h\
3011-RestrictionEnzymes.h\
3012-ProgramOptionsDialog.h\
3013-PrimerDesign.h\
3014-PlasmidCanvas.h\
3015-MyFrame.h\
3016-MyChild.h\
3017-MiscDialogs.h\
3018-ManageDatabase.h\
3019-main.h\
3020-GenBank.h\
3021-FindSequenceDialog.h\
3022-ExternalInterface.h\
3023-TProteolysis.h\
3024-PCR_Troubleshoot.h\
3025-ChildBase.h\
3026-CoolCanvas.h\
3027-AminoAcids.h\
3028-Alignment.h\
3029-ABIviewer.h\
3030-ABItype.h\
3031-ureadseq.h\
3032-TPhylip.h\
3033-TPhyloTree.h\
3034-TEliteLaChromLogDialog.h\
3035-ncoils.h\
3036-clustalw/clustalw.h\
3037-clustalw/dayhoff.h \
3038-clustalw/general.h \
3039-clustalw/matrices.h \
3040-clustalw/param.h \
3041-clustalw/xmenu.h\
3042-ipc/element.h\
3043-ipc/global.h\
3044-ipc/gp_out.h\
3045-ipc/ipc.h\
3046-ipc/parse.h
3047
3048=== removed directory '.pc/remove_tinyxml.patch'
3049=== removed file '.pc/remove_tinyxml.patch/Makefile.am'
3050--- .pc/remove_tinyxml.patch/Makefile.am 2010-06-15 16:38:33 +0000
3051+++ .pc/remove_tinyxml.patch/Makefile.am 1970-01-01 00:00:00 +0000
3052@@ -1,250 +0,0 @@
3053-SUFFIXES=.cpp .rc
3054-
3055-bin_PROGRAMS = GENtle
3056-
3057-EXTRA_DIST = mondrian.xpm \
3058-variables.csv \
3059-blank.db \
3060-default.tab \
3061-marker.txt \
3062-bitmaps/align.bmp \
3063-bitmaps/cocktail.bmp \
3064-bitmaps/display_features.bmp \
3065-bitmaps/helpcs.bmp \
3066-bitmaps/new.xpm \
3067-bitmaps/plasmid_linear.bmp \
3068-bitmaps/print.xpm \
3069-bitmaps/settings_tool.bmp \
3070-bitmaps/alignment.bmp \
3071-bitmaps/copy.bmp \
3072-bitmaps/display_restriction.bmp \
3073-bitmaps/help.xpm \
3074-bitmaps/open.bmp \
3075-bitmaps/preview.bmp \
3076-bitmaps/project.bmp \
3077-bitmaps/splash.bmp \
3078-bitmaps/align_tool.bmp \
3079-bitmaps/copy.xpm \
3080-bitmaps/draft.xbm \
3081-bitmaps/image.bmp \
3082-bitmaps/open.xpm \
3083-bitmaps/preview.xpm \
3084-bitmaps/protein.bmp \
3085-bitmaps/tick.bmp \
3086-bitmaps/bitmap1.bmp \
3087-bitmaps/cut.bmp \
3088-bitmaps/drawing.xbm\
3089-bitmaps/mode_both.bmp \
3090-bitmaps/orfs.bmp \
3091-bitmaps/primer.bmp \
3092-bitmaps/redo.bmp \
3093-bitmaps/undo.bmp \
3094-bitmaps/bitmap2.bmp \
3095-bitmaps/cut.xpm \
3096-bitmaps/flowchar.xbm \
3097-bitmaps/mode_edit.bmp \
3098-bitmaps/paste.bmp \
3099-bitmaps/primer_export.bmp \
3100-bitmaps/save.bmp \
3101-bitmaps/web.bmp \
3102-bitmaps/calc.bmp \
3103-bitmaps/Helix.bmp \
3104-bitmaps/mode_view.bmp \
3105-bitmaps/paste.xpm \
3106-bitmaps/primer_import.bmp \
3107-bitmaps/save.xpm \
3108-bitmaps/write.xbm\
3109-bitmaps/calc_tool.bmp \
3110-bitmaps/dirplain.xbm \
3111-bitmaps/help.bmp \
3112-bitmaps/new.bmp \
3113-bitmaps/plasmid_circular.bmp \
3114-bitmaps/print.bmp \
3115-bitmaps/scissors.bmp
3116-
3117-
3118-GENtle_LDADD = $(WX_LIBS) -L/usr/lib -L/usr/local/lib -lsqlite -lsqlite3 -lmysqlclient
3119-GENtle_LDFLAGS = -s
3120-GENtle_SOURCES = TXMLfile.cpp\
3121-TVectorTree.cpp\
3122-TVirtualGel.cpp\
3123-TVectorEditorItems.cpp\
3124-TVectorEditorEnzymes.cpp\
3125-TVectorEditor.cpp\
3126-TVector.cpp\
3127-SCFtype.cpp\
3128-TStoreAllDialog.cpp\
3129-TDotPlot.cpp\
3130-TUndo.cpp\
3131-TUReadSeq.cpp\
3132-TStorage.cpp\
3133-TSilmutDialog.cpp\
3134-TRestrictionEditor.cpp\
3135-TPrimer.cpp\
3136-TPrimerDialog.cpp\
3137-TPDB.cpp\
3138-TLigationDialog.cpp\
3139-TMainTree.cpp\
3140-todo.cpp\
3141-TItemEditDialog.cpp\
3142-TImageDisplay.cpp\
3143-TIMGreader.cpp\
3144-TextImportDialog.cpp\
3145-TClone.cpp\
3146-SequenceTypes.cpp\
3147-TCalculator.cpp\
3148-SequenceTypeRestriction.cpp\
3149-SequenceTypePlot.cpp\
3150-SequenceTypeFeature.cpp\
3151-SequenceTypeDNA.cpp\
3152-SequenceTypeAlign.cpp\
3153-SequenceTypeABI.cpp\
3154-SequenceTypeAA.cpp\
3155-SequenceCanvas.cpp\
3156-SendHTTP.cpp\
3157-RestrictionEnzymes.cpp\
3158-ProgramOptionsDialog.cpp\
3159-PlasmidCanvasLinear.cpp\
3160-PrimerDesign.cpp\
3161-PlasmidCanvasHandlers.cpp\
3162-PlasmidCanvasCircular.cpp\
3163-PlasmidCanvas.cpp\
3164-MyFrame.cpp\
3165-MyChild.cpp\
3166-MiscDialogs.cpp\
3167-ManageDatabase.cpp\
3168-main.cpp\
3169-GenBank.cpp\
3170-FindSequenceDialog.cpp\
3171-ExternalNCBI.cpp\
3172-ExternalInterface.cpp\
3173-ExternalBLAST.cpp\
3174-ChildBase.cpp\
3175-CoolCanvas.cpp\
3176-AminoAcids.cpp\
3177-Alignment.cpp\
3178-ABIviewer.cpp\
3179-ABItype.cpp\
3180-TAlignmentDialog.cpp\
3181-AutoAnnotate.cpp\
3182-TGraph.cpp\
3183-TGraphDisplay.cpp\
3184-TGraphScale.cpp\
3185-CGview.cpp\
3186-ureadseq.c\
3187-ncoils.cpp\
3188-TPhylip.cpp\
3189-TPhyloTree.cpp\
3190-PCR_Troubleshoot.cpp\
3191-TProteolysis.cpp\
3192-tinyxml/tinyxmlparser.cpp\
3193-tinyxml/tinyxmlerror.cpp\
3194-tinyxml/tinyxml.cpp\
3195-tinyxml/tinystr.cpp\
3196-clustalw/alnscore.cpp\
3197-clustalw/amenu.cpp\
3198-clustalw/calcgap.cpp\
3199-clustalw/calcprf1.cpp\
3200-clustalw/calcprf2.cpp\
3201-clustalw/calctree.cpp\
3202-clustalw/clustalw.cpp\
3203-clustalw/gcgcheck.cpp\
3204-clustalw/interfac.cpp\
3205-clustalw/malign.cpp\
3206-clustalw/palign.cpp\
3207-clustalw/prfalign.cpp\
3208-clustalw/random.cpp\
3209-clustalw/readmat.cpp\
3210-clustalw/sequence.cpp\
3211-clustalw/showpair.cpp\
3212-clustalw/trees.cpp\
3213-clustalw/util.cpp\
3214-ipc/element.cpp\
3215-ipc/gp_out.cpp\
3216-ipc/ipc.cpp\
3217-ipc/pars.cpp\
3218-CloneManager.cpp\
3219-CloningAssistant.cpp\
3220-TSequencingAssistantDialog.cpp\
3221-AlignmentAppearanceDialog.cpp\
3222-SequenceTypeAAstructure.cpp\
3223-OnlineTools.cpp\
3224-TEliteLaChromLogDialog.cpp\
3225-TRestrictionIdentifier.cpp\
3226-TRestrictionIdentifier.h\
3227-CloningAssistant.h\
3228-AlignmentAppearanceDialog.h\
3229-TSequencingAssistantDialog.h\
3230-OnlineTools.h\
3231-CloneManager.h\
3232-enums.h \
3233-lin_sqlite.h \
3234-lin_sqlite3.h \
3235-TXMLfile.h\
3236-SCFtype.h\
3237-TStoreAllDialog.h\
3238-TDotPlot.h\
3239-AutoAnnotate.h\
3240-CGview.h\
3241-TAlignmentDialog.h\
3242-TGraph.h\
3243-TVectorTree.h\
3244-TVirtualGel.h\
3245-TVectorEditor.h\
3246-TVector.h\
3247-TUndo.h\
3248-TUReadSeq.h\
3249-TStorage.h\
3250-TSilmutDialog.h\
3251-TRestrictionEditor.h\
3252-TPrimer.h\
3253-TPrimerDialog.h\
3254-TPDB.h\
3255-TLigationDialog.h\
3256-TMainTree.h\
3257-TItemEditDialog.h\
3258-TImageDisplay.h\
3259-TIMGreader.h\
3260-TextImportDialog.h\
3261-TClone.h\
3262-TCalculator.h\
3263-SequenceCanvas.h\
3264-SendHTTP.h\
3265-RestrictionEnzymes.h\
3266-ProgramOptionsDialog.h\
3267-PrimerDesign.h\
3268-PlasmidCanvas.h\
3269-MyFrame.h\
3270-MyChild.h\
3271-MiscDialogs.h\
3272-ManageDatabase.h\
3273-main.h\
3274-GenBank.h\
3275-FindSequenceDialog.h\
3276-ExternalInterface.h\
3277-TProteolysis.h\
3278-PCR_Troubleshoot.h\
3279-ChildBase.h\
3280-CoolCanvas.h\
3281-AminoAcids.h\
3282-Alignment.h\
3283-ABIviewer.h\
3284-ABItype.h\
3285-ureadseq.h\
3286-TPhylip.h\
3287-TPhyloTree.h\
3288-TEliteLaChromLogDialog.h\
3289-ncoils.h\
3290-tinyxml/tinyxml.h\
3291-tinyxml/tinystr.h\
3292-clustalw/clustalw.h\
3293-clustalw/dayhoff.h \
3294-clustalw/general.h \
3295-clustalw/matrices.h \
3296-clustalw/param.h \
3297-clustalw/xmenu.h\
3298-ipc/element.h\
3299-ipc/global.h\
3300-ipc/gp_out.h\
3301-ipc/ipc.h\
3302-ipc/parse.h
3303
3304=== removed file '.pc/remove_tinyxml.patch/TXMLfile.cpp'
3305--- .pc/remove_tinyxml.patch/TXMLfile.cpp 2010-06-15 16:38:33 +0000
3306+++ .pc/remove_tinyxml.patch/TXMLfile.cpp 1970-01-01 00:00:00 +0000
3307@@ -1,256 +0,0 @@
3308-/** \file
3309- \brief The TXMLfile class
3310-*/
3311-#include "TXMLfile.h"
3312-
3313-TXMLfile::TXMLfile ()
3314- {
3315- TiXmlBase::SetCondenseWhiteSpace ( true ) ;
3316- _success = false ;
3317- }
3318-
3319-void TXMLfile::parse ( wxString text )
3320- {
3321- TiXmlDocument doc ;
3322- doc.Parse ( text.mb_str() ) ;
3323- if ( doc.Error() )
3324- {
3325- _success = false ;
3326- return ;
3327- }
3328- analyze ( doc ) ;
3329- }
3330-
3331-void TXMLfile::load ( wxString file )
3332- {
3333-// wxStartTimer() ;
3334- TiXmlDocument doc ( file.mb_str() );
3335- bool ok = doc.LoadFile();
3336-/*
3337- // Alternative (faster?) opening method
3338- char *x ;
3339- wxFile f ( file ) ;
3340- if ( !f.IsOpened() ) { _success = false ; return ; }
3341- x = new char [ f.Length() + 5 ] ;
3342- f.Read ( x , f.Length() ) ;
3343- x[f.Length()] = 0 ;
3344- if ( *x != '<' ) { delete x ; _success = false ; return ; }
3345- TiXmlDocument doc ( "" );
3346- doc.Parse ( (const char*) x ) ;
3347- bool ok = !doc.Error() ;
3348- delete x ;
3349-*/
3350-// cout << "Done in " << wxGetElapsedTime() << " ms\n" ;
3351- if ( !ok || doc.Error() )
3352- {
3353- _success = false ;
3354- return ;
3355- }
3356-
3357- analyze ( doc ) ;
3358- }
3359-
3360-void TXMLfile::analyze ( const TiXmlDocument &doc )
3361- {
3362- if ( doc.FirstChild ( "GBSeq" ) )
3363- {
3364- readGBSeq ( doc.FirstChild ( "GBSeq" ) ) ;
3365- }
3366- else if ( doc.FirstChild ( "GBSet" ) )
3367- {
3368- TiXmlNode *x = doc.RootElement() ;// ( _T("GBSet") ) ;
3369- for ( x = x->FirstChild ( "GBSeq" ) ; x ; x = x->NextSibling ( "GBSeq" ) )
3370- readGBSeq ( x ) ;
3371- }
3372- _success = _v.GetCount() > 0 ;
3373- }
3374-
3375-int TXMLfile::countVectors ()
3376- {
3377- return _v.GetCount() ;
3378- }
3379-
3380-TVector *TXMLfile::getVector ( int a )
3381- {
3382- return _v[a] ;
3383- }
3384-
3385-
3386-// private
3387-
3388-wxString TXMLfile::t ( const char *txt )
3389- {
3390- return txt ? wxString ( txt , wxConvUTF8 ) : _T("") ;
3391- }
3392-
3393-wxString TXMLfile::t ( TiXmlText *txt )
3394- {
3395- return txt && txt->Value() ? wxString ( txt->Value() , wxConvUTF8 ) : wxString() ;
3396- }
3397-
3398-void TXMLfile::readGBSeq ( TiXmlNode *base )
3399- {
3400- myass ( base , _T("TXMLfile::readGBSeq") ) ;
3401- TVector *v = new TVector ;
3402- v->setType ( TYPE_VECTOR ) ; // Dummy
3403-
3404- int a ;
3405- TiXmlNode *n ;
3406- TiXmlElement *e ;
3407- wxString s ;
3408- TiXmlHandle h ( base ) ;
3409-
3410- wxString n1 = t ( h.FirstChild("GBSeq_definition").FirstChild().Text() ) ;
3411- wxString n2 = t ( h.FirstChild("GBSeq_locus").FirstChild().Text() ) ;
3412- if ( !n1.IsEmpty() && n1.Freq ( '\n' ) == 0 && n2.Freq ( ' ' ) == 0 )
3413- n2 = n1 + _T("(") + n2 + _T("))") ;
3414-
3415- v->setName ( n2 ) ;
3416- v->setSequence ( t ( h.FirstChild("GBSeq_sequence").FirstChild().Text() ) . MakeUpper() ) ;
3417-
3418- e = h.FirstChild("GBSeq_topology").Element() ;
3419- if ( e ) // topology
3420- {
3421- s = t ( e->Attribute ( "value" ) ) . MakeUpper() ;
3422- if ( s == _T("CIRCULAR") ) v->setCircular ( true ) ;
3423- }
3424-// cout << "Up to features took " << wxGetElapsedTime() << " ms\n" ;
3425-
3426- // Features
3427- for ( n = h.FirstChild("GBSeq_feature-table").FirstChild("GBFeature").Node() ; n ;
3428- n = n->NextSibling("GBFeature") )
3429- {
3430- TVectorItem i ;
3431- TiXmlHandle h2 ( n ) ;
3432- s = t ( h2.FirstChild("GBFeature_key").FirstChild().Text() ) . MakeUpper() ;
3433-
3434- // Dummy values
3435- i.name = _T("") ;
3436- i.from = 1 ;
3437- i.to = 1 ;
3438- i.setType ( 0 ) ;
3439- i.setDirection ( 1 ) ;
3440- i.setType ( s ) ;
3441- readGBqualifiers ( i , n ) ;
3442-
3443- vector <TVectorItem> vi ;
3444- readGBintervals ( vi , i , n ) ;
3445- for ( a = 0 ; a < vi.size() ; a++ )
3446- v->items.push_back ( vi[a] ) ;
3447- }
3448-// cout << "Features took " << wxGetElapsedTime() << " ms\n" ;
3449-
3450- // The rest
3451- for ( n = h.Node()->FirstChild() ; n ; n = n->NextSibling() )
3452- {
3453- wxString x = t ( n->Value() ) ;
3454- if ( x == _T("GBSeq_definition") ) continue ;
3455- if ( x == _T("GBSeq_locus") ) continue ;
3456- if ( x == _T("GBSeq_sequence") ) continue ;
3457- if ( x == _T("GBSeq_feature-table") ) continue ;
3458- x = get_sub_desc ( n ) ;
3459- v->addDescription ( x ) ;
3460- }
3461-
3462- // Sorting by size, just for fun
3463- // Only for less than 100 items
3464- for ( a = 1 ; v->items.size() < 100 && a < v->items.size() ; a++ )
3465- {
3466- if ( v->getItemLength(a-1) < v->getItemLength(a) )
3467- {
3468- TVectorItem i = v->items[a] ;
3469- v->items[a] = v->items[a-1] ;
3470- v->items[a-1] = i ;
3471- a = 0 ;
3472- }
3473- }
3474-
3475- v->updateDisplay() ;
3476- v->recalculateCuts () ;
3477- _v.Add ( v ) ;
3478-// cout << "The rest took " << wxGetElapsedTime() << " ms\n" ;
3479- }
3480-
3481-wxString TXMLfile::get_sub_desc ( TiXmlNode *base , int depth )
3482- {
3483- if ( !base ) return _T("") ; // Just fore safety...
3484- wxString name = t ( base->Value() ) ;
3485- if ( name.Left ( 6 ) == _T("GBSeq_") ) name = name.Mid(6,1).Upper() + name.Mid ( 7 ) ;
3486- wxString ret ;
3487- ret = wxString ( (wxChar)' ' , depth * 2 ) ;
3488- ret += name ;
3489- ret += _T("\n") ;
3490- TiXmlNode *n ;
3491- for ( n = base->FirstChild() ; n ; n = n->NextSibling() )
3492- ret += get_sub_desc ( n , depth + 1 ) ;
3493- return ret ;
3494- }
3495-
3496-void TXMLfile::readGBqualifiers ( TVectorItem &i , TiXmlNode *n )
3497- {
3498- TiXmlNode *n2 = n->FirstChild("GBFeature_quals") ;
3499- if ( !n2 ) return ;
3500- for ( n2 = n2->FirstChild("GBQualifier") ; n2 ; n2 = n2->NextSibling("GBQualifier") )
3501- {
3502- TiXmlHandle h ( n2 ) ;
3503- wxString name = t ( h.FirstChild("GBQualifier_name").FirstChild().Text() ) . MakeUpper() ;
3504- wxString value = t ( h.FirstChild("GBQualifier_value").FirstChild().Text() ) ;
3505- if ( name.IsEmpty() ) continue ;
3506- i.setParam ( _T("/") + name , value ) ;
3507- if ( name == _T("CODON_START") ) i.setRF ( atoi ( value.mb_str() ) ) ;
3508- if ( name == _T("GENE") || name == _T("LABEL") ) i.name = value ;
3509- if ( name == _T("PRODUCT") || name == _T("NOTE") || name == _T("REGION_NAME") )
3510- {
3511- if ( !i.desc.IsEmpty() ) i.desc += _T("\n") ;
3512- i.desc += value ;
3513- }
3514- }
3515- if ( i.name.IsEmpty() && i.desc.length() < 10 )
3516- {
3517- i.name = i.desc ;
3518- i.desc = _T("") ;
3519- }
3520- if ( i.name.IsEmpty() )
3521- {
3522- wxString try2 = i.desc ;
3523- while ( try2.Right ( 1 ) == _T("\n") ) try2 = try2.Left ( try2.length() - 1 ) ;
3524- try2 = try2.AfterLast('\n').AfterLast('\r') ;
3525- if ( !try2.IsEmpty() && try2.length() < 20 ) i.name = try2 ;
3526- }
3527- if ( i.name.IsEmpty() )
3528- {
3529- char u[100] ;
3530- sprintf ( u , "short_itemtype%d" , i.getType() ) ;
3531- i.name = wxString ( txt(u) , wxConvUTF8 ) ;
3532- wxString d2 = i.desc ;
3533- int k = d2.find ( _T("\n") ) ;
3534- if ( k > -1 ) d2.erase ( k ) ;
3535- if ( i.name.length() * 2 >= d2.length() )
3536- i.name = d2 ;
3537- }
3538- }
3539-
3540-void TXMLfile::readGBintervals ( vector <TVectorItem> &vi , const TVectorItem &i , TiXmlNode *n )
3541- {
3542- TiXmlNode *n2 = n->FirstChild("GBFeature_intervals") ;
3543- if ( !n2 ) return ;
3544- for ( n2 = n2->FirstChild("GBInterval") ; n2 ; n2 = n2->NextSibling("GBInterval") )
3545- {
3546- TiXmlHandle h ( n2 ) ;
3547- wxString from = t ( h.FirstChild("GBInterval_from").FirstChild().Text() ) ;
3548- wxString to = t ( h.FirstChild("GBInterval_to").FirstChild().Text() ) ;
3549- if ( from.IsEmpty() || to.IsEmpty() ) continue ;
3550- TVectorItem j = i ;
3551- j.from = atoi ( from.mb_str() ) ;
3552- j.to = atoi ( to.mb_str() ) ;
3553- if ( j.from > j.to )
3554- {
3555- int o = j.from ;
3556- j.from = j.to ;
3557- j.to = o ;
3558- j.setDirection ( -1 ) ;
3559- }
3560- vi.push_back ( j ) ;
3561- }
3562- }
3563-
3564
3565=== removed file '.pc/remove_tinyxml.patch/TXMLfile.h'
3566--- .pc/remove_tinyxml.patch/TXMLfile.h 2010-06-15 16:38:33 +0000
3567+++ .pc/remove_tinyxml.patch/TXMLfile.h 1970-01-01 00:00:00 +0000
3568@@ -1,40 +0,0 @@
3569-/** \file
3570- \brief The TXMLfile class
3571-*/
3572-#ifndef _TXMLFILE_H_
3573-#define _TXMLFILE_H_
3574-
3575-#include "main.h"
3576-
3577-class TVector ;
3578-class TiXmlNode ;
3579-class TVectorItem ;
3580-class TiXmlDocument ;
3581-
3582-/// This class is a wrapper around the tinyxml software, specialized for GenBankXML format
3583-class TXMLfile
3584- {
3585- public :
3586- TXMLfile () ; ///< Constructor
3587- ~TXMLfile () {} ; ///< Dummy destructor
3588-
3589- void load ( wxString file ) ; ///< Load XML from file
3590- void parse ( wxString text ) ; ///< Pass XML as string
3591- bool success () { return _success ; } ///< Errors during parsing?
3592- int countVectors () ; ///< How many vectors were made from the XML?
3593- TVector *getVector ( int a ) ; ///< Returns pointer to one of the vectors
3594-
3595- private :
3596- void analyze ( const TiXmlDocument &doc ) ; ///< Parse single/multiple sequences
3597- void readGBSeq ( TiXmlNode *base ) ; ///< The actual parser
3598- wxString t ( TiXmlText *txt ) ; ///< Safe text conversion
3599- wxString t ( const char *txt ) ; ///< Safe text conversion
3600- void readGBqualifiers ( TVectorItem &i , TiXmlNode *n ) ; ///< Part of the parser
3601- void readGBintervals ( vector <TVectorItem> &vi , const TVectorItem &i , TiXmlNode *n ) ; ///< Part of the parser
3602- wxString get_sub_desc ( TiXmlNode *base , int depth = 0 ) ;
3603- bool _success ; ///< Internal success marker
3604- wxArrayTVector _v ; ///< The generated vectors
3605- } ;
3606-
3607-#endif
3608-
3609
3610=== removed file '.pc/remove_tinyxml.patch/main.h'
3611--- .pc/remove_tinyxml.patch/main.h 2010-06-15 16:38:33 +0000
3612+++ .pc/remove_tinyxml.patch/main.h 1970-01-01 00:00:00 +0000
3613@@ -1,354 +0,0 @@
3614-/** \file
3615- \brief Contains defines, global functions, includes, and the MyApp class
3616-*/
3617-#ifndef _MAIN_H_
3618-#define _MAIN_H_
3619-
3620-//#define __DEBIAN__
3621-
3622-#define GENTLE_VERSION_MAJOR 1
3623-#define GENTLE_VERSION_MINOR 9
3624-#define GENTLE_VERSION_SUB 4
3625-
3626-typedef unsigned int uint ;
3627-
3628-/** \fn myass ( bool b , wxString msg )
3629- \brief "My assertion" - little inside joke...
3630- \param b The condition given in the call. No assertion when b is FALSE.
3631- \param msg The message string to write into errout.
3632-*/
3633-
3634-/** \def MYDEBUG
3635- \brief Turns on output of the myass function; should not be used for releases
3636-*/
3637-
3638-/** \def MYLOG
3639- \brief Turns on output of logging; should not be used for releases
3640-*/
3641-
3642-/** \def MYTEST
3643- \brief Turns on both MYDEBUG and MYLOG; should not be used for releases
3644-*/
3645-
3646-//#define MYDEBUG
3647-//#define MYLOG
3648-//#define MYTEST
3649-
3650-#ifdef MYTEST
3651- #ifndef MYLOG
3652- #define MYLOG
3653- #endif // MYLOG
3654- #ifndef MYDEBUG
3655- #define MYDEBUG
3656- #endif // MYDEBUG
3657-#endif // MYTEST
3658-
3659-/** \def MYSPINBOXSIZE
3660- \brief Width of spin box, for windows only
3661-*/
3662-#ifdef __WXMSW__
3663- #define MYSPINBOXSIZE 80
3664-#else
3665- #define MYSPINBOXSIZE -1
3666-#endif
3667-
3668-#include "wx/wxprec.h"
3669-
3670-/** \def MYFONTSIZE
3671- \brief Main tree font size
3672-*/
3673-#ifdef __WXMAC__
3674- #define MYFONTSIZE 10
3675-#else
3676- #define MYFONTSIZE 8
3677-#endif
3678-
3679-/** \def MYSPINBOXSIZE
3680- \brief List box style, for GTK only
3681-*/
3682-#ifdef __WXGTK__
3683- #define MYLISTBORDER wxSIMPLE_BORDER
3684-#else
3685- #define MYLISTBORDER 0
3686-#endif
3687-
3688-#ifdef __BORLANDC__
3689- #pragma hdrstop
3690-#endif
3691-
3692-#ifndef WX_PRECOMP
3693- #include "wx/wx.h"
3694- #include "wx/notebook.h"
3695-#endif
3696-
3697-#include <wx/toolbar.h>
3698-#include <wx/filesys.h>
3699-#include <wx/fs_inet.h>
3700-#include <wx/file.h>
3701-#include <wx/dialup.h>
3702-#include <wx/utils.h>
3703-#include <wx/numdlg.h>
3704-#include <wx/timer.h>
3705-
3706-#ifdef _UNICODE
3707- #define wxUSE_UNICODE 1
3708-#endif
3709-
3710-#if defined(__WXGTK__) || defined(__WXMOTIF__)
3711- #include "mondrian.xpm"
3712- #include "bitmaps/new.xpm"
3713- #include "bitmaps/open.xpm"
3714- #include "bitmaps/save.xpm"
3715- #include "bitmaps/copy.xpm"
3716- #include "bitmaps/cut.xpm"
3717- #include "bitmaps/paste.xpm"
3718- #include "bitmaps/print.xpm"
3719- #include "bitmaps/help.xpm"
3720-#endif
3721-
3722-#include <math.h>
3723-#include <vector>
3724-
3725-using namespace std ;
3726-
3727-/** \def MYPEN(_a)
3728- \brief Creates or reuses a solid pen with size 1. _a is of type wxColour
3729-*/
3730-
3731-/** \def MYBRUSH(_a)
3732- \brief Creates or reuses a solid brush. _a is of type wxColour
3733-*/
3734-
3735-/** \def MYFONT(_a,_b,_c,_d)
3736- \brief Creates or reuses a font. Parameters are the same as wxCreateFont
3737-*/
3738-
3739-#define MYPEN(_a) (wxThePenList->FindOrCreatePen ( _a , 1 , wxSOLID ) )
3740-#define MYBRUSH(_a) (wxTheBrushList->FindOrCreateBrush ( _a , wxSOLID ) )
3741-#define MYFONT(_a,_b,_c,_d) (wxTheFontList->FindOrCreateFont(_a,_b,_c,_d) )
3742-
3743-// Don't you *EVER* turn this on again!!!!
3744-//#define TIXML_USE_STL
3745-#include "tinyxml/tinyxml.h"
3746-
3747-#include <wx/wx.h>
3748-#include <wx/toolbar.h>
3749-#include <wx/treectrl.h>
3750-#include <wx/listctrl.h>
3751-#include <wx/snglinst.h>
3752-#include <wx/laywin.h>
3753-#include <wx/progdlg.h>
3754-#include <wx/mimetype.h>
3755-#include <wx/textfile.h>
3756-#include <wx/dir.h>
3757-#include <wx/html/helpctrl.h>
3758-#include <wx/url.h>
3759-#include <wx/protocol/http.h>
3760-WX_DECLARE_STRING_HASH_MAP( wxString, wxHashString );
3761-
3762-/** \brief Style for Process Dialog */
3763-#define wxPD_ALL (wxPD_AUTO_HIDE|wxPD_APP_MODAL|wxPD_CAN_ABORT|wxPD_ELAPSED_TIME|wxPD_ESTIMATED_TIME|wxPD_REMAINING_TIME)
3764-
3765-#define TYPE_VECTOR 0 /**< \brief Vector type */
3766-#define TYPE_FRAGMENT 1 /**< \brief Fragment type */
3767-#define TYPE_SEQUENCE 2 /**< \brief Sequence type */
3768-#define TYPE_PRIMER 3 /**< \brief Primer type */
3769-#define TYPE_ALIGNMENT 4 /**< \brief Alignment type */
3770-#define TYPE_AMINO_ACIDS 5 /**< \brief Amino acid type */
3771-#define TYPE_MISC 6 /**< \brief Misc type */
3772-
3773-#define FEAT_NONE 0 /**< \brief Do not draw feature */
3774-#define FEAT_ALPHA 1 /**< \brief Draw feature as alpha helix */
3775-#define FEAT_BETA 2 /**< \brief Draw feature as beta sheet */
3776-#define FEAT_MUT 3 /**< \brief Draw feature as mutation */
3777-#define FEAT_NOLINE 4 /**< \brief Draw feature without line */
3778-#define FEAT_VLINE 5 /**< \brief Draw feature as vertical line */
3779-
3780-#define DAM_METHYLATION 1 /**< \brief Show DAM methylation */
3781-#define DCM_METHYLATION 2 /**< \brief Show DCM methylation */
3782-#define ALL_METHYLATION_ENZYMES ( DAM_METHYLATION + DCM_METHYLATION ) /**< \brief Show all methylations */
3783-
3784-class MyFrame ;
3785-
3786-/** \class MyApp
3787- \brief Application class
3788-*/
3789-class MyApp : public wxApp
3790- {
3791- public:
3792- virtual bool OnInit();
3793- virtual int OnExit () ;
3794- virtual void init_txt ( wxString lang , wxString csv , wxHashString *target = NULL , int ln = 1 ) ;
3795- virtual void do_my_ass ( bool b , wxString msg = _T("") ) ;
3796- virtual void do_my_log ( wxString function , wxString msg = _T("") ) ;
3797- virtual wxString getHTMLCommand ( wxString command ) ; ///< Returns the command line for running a browser
3798- virtual wxString getFileFormatApplication ( wxString type ) ; ///< Returns application associated with a file type
3799- virtual wxString getFileFormatCommand ( wxString type , wxString file ) ; ///< Returns the command line for running this file
3800- virtual wxString get_GENtle_version () ; ///< Returns the GENtle version string
3801- virtual wxString getLocalDBname () ; ///< Returns the filename of the default local database
3802- virtual void launchBrowser ( wxString url ) ;
3803-
3804- MyFrame *frame; ///< The application frame
3805- wxMimeTypesManager mtm ; ///< The MIME types manager
3806- wxString homedir ; ///< Directory of the application
3807- wxString bmpdir ; ///< Directory of the bitmaps
3808- wxString slash ; ///< The platform-dependent directory separator slash
3809- int programVersion ; ///< The database access program version
3810- int dbWarningIssued ; ///< Was a database warning issued?
3811- wxHashString _text ; ///< Contains the current GUI translation.
3812- wxHashString clp ; ///< Command line parameters
3813- wxCSConv *isoconv ; ///< UTF-8 conversion helper
3814- wxStopWatch sw ;
3815-
3816- private :
3817- virtual void registerFileExtension ( wxString extension ) ; ///< Registers a file extension to GENtle (windows only).
3818- virtual void registerProtocol ( wxString extension ) ; ///< Registers a protocol to GENtle (windows only).
3819- wxFile *errout ; ///< The ERROR.txt file handler for do_my_ass
3820- wxFile *logout ; ///< The LOG.txt file handler for do_my_log
3821- int total_log_time ; ///< The log timer for do_my_log
3822- int total_log_counter ; ///< The log counter for do_my_log
3823- wxSingleInstanceChecker *m_checker ; ///< Checks if another instance is running
3824- wxString theRealLocalDb ;
3825- };
3826-
3827-class TUndo ;
3828-class ChildBase ;
3829-class TVector ;
3830-class TRestrictionEnzyme ;
3831-class TStorage ;
3832-class TProtease ;
3833-class TVectorItem ;
3834-class SeqBasic ;
3835-class TProteaseCut ;
3836-
3837-WX_DEFINE_ARRAY(ChildBase *, wxArrayChildBase);
3838-WX_DEFINE_ARRAY(TRestrictionEnzyme *, wxArrayTRestrictionEnzyme);
3839-WX_DEFINE_ARRAY(TStorage *, wxArrayTStorage);
3840-WX_DEFINE_ARRAY(TProtease *,wxArrayTProtease);
3841-WX_DEFINE_ARRAY(TVectorItem *,wxArrayTVectorItem);
3842-WX_DEFINE_ARRAY(SeqBasic *,wxArraySeqBasic);
3843-WX_DEFINE_ARRAY(TProteaseCut *,wxArrayTProteaseCut);
3844-WX_DECLARE_OBJARRAY(float, wxArrayFloat);
3845-
3846-#ifndef _wxArrayTVector
3847- #define _wxArrayTVector
3848- WX_DEFINE_ARRAY(TVector *, wxArrayTVector);
3849-#endif
3850-
3851-/** \brief Clear wxArray of pointers and delete the not-NULL-pointer objects */
3852-#define CLEAR_DELETE(__x) { while ( !__x.IsEmpty() ) { if ( __x[0] ) { delete __x[0] ; } __x.RemoveAt ( 0 ) ; } }
3853-
3854-/** \brief Create a wxString of __l times the __c char */
3855-#define FILLSTRING(__x,__c,__l) { __x = wxString ( __c , __l ) ; }
3856-
3857-
3858-#include "enums.h"
3859-#include "TVector.h"
3860-#include "TUReadSeq.h"
3861-#include "TPhylip.h"
3862-#include "ipc/ipc.h"
3863-#include "ncoils.h"
3864-#include "CGview.h"
3865-#include "AutoAnnotate.h"
3866-#include "ChildBase.h"
3867-#include "OnlineTools.h"
3868-#include "TSequencerData.h"
3869-#include "ABItype.h"
3870-#include "SCFtype.h"
3871-#include "CloningAssistant.h"
3872-#include "MiscDialogs.h"
3873-#include "TStorage.h"
3874-#include "TPrimer.h"
3875-#include "TIMGreader.h"
3876-#include "PlasmidCanvas.h"
3877-#include "SequenceCanvas.h"
3878-#include "TDotPlot.h"
3879-#include "TStoreAllDialog.h"
3880-#include "TSequencingAssistantDialog.h"
3881-#include "MyFrame.h"
3882-#include "MyChild.h"
3883-#include "TRestrictionEditor.h"
3884-#include "TClone.h"
3885-#include "GenBank.h"
3886-#include "TPDB.h"
3887-#include "CloneManager.h"
3888-#include "TXMLfile.h"
3889-#include "TVectorTree.h"
3890-#include "TMainTree.h"
3891-#include "RestrictionEnzymes.h"
3892-#include "TImageDisplay.h"
3893-#include "TVirtualGel.h"
3894-//#include "TRestrictionIdentifier.h"
3895-#include "TCalculator.h"
3896-#include "TGraph.h"
3897-#include "TPhyloTree.h"
3898-#include "Alignment.h"
3899-#include "AminoAcids.h"
3900-#include "ABIviewer.h"
3901-#include "ExternalInterface.h"
3902-#include "TItemEditDialog.h"
3903-#include "PrimerDesign.h"
3904-
3905-#define PI 3.14 /**< \brief Just PI */
3906-#define IUPAC_A 1 /**< \brief IUPAC bit for A */
3907-#define IUPAC_C 2 /**< \brief IUPAC bit for C */
3908-#define IUPAC_G 4 /**< \brief IUPAC bit for G */
3909-#define IUPAC_T 8 /**< \brief IUPAC bit for T */
3910-
3911-#define MINI_DISPLAY_ORIGINAL 0 /**< \brief Display mini-canvas at original width */
3912-#define MINI_DISPLAY_REAL 1 /**< \brief Display mini-canvas at real width */
3913-#define MINI_DISPLAY_CONDENSED 2 /**< \brief Display mini-canvas as condensed width */
3914-
3915-#include "ureadseq.h"
3916-
3917-
3918-// ---------------------------------------------------------------------------
3919-// global functions
3920-// ---------------------------------------------------------------------------
3921-
3922-#ifdef MYDEBUG
3923- #define myass(a,b) myapp()->do_my_ass(a,b)
3924-#else
3925- #define myass(a,b)
3926-#endif
3927-
3928-#ifdef MYLOG
3929- #define mylog(a,b) myapp()->do_my_log(a,b)
3930-#else
3931- #define mylog(a,b)
3932-#endif
3933-
3934-#define CHAR2WX(__c) wxString((char*)l,wxConvUTF8)
3935-
3936-/** \brief Insert wxString "t" into wxString "s" at position "from" */
3937-void wxStringInsert ( wxString &s , int from , wxString t ) ;
3938-
3939-/** \brief Chop wxString "s" into parts "r" separated by "sep" */
3940-void explode ( wxString sep , wxString s , wxArrayString &r ) ;
3941-
3942-/** \brief Join wxStrings in "r" while putting "sep"s between them */
3943-wxString implode ( wxString sep , wxArrayString &r ) ;
3944-/*
3945-/** \brief Returns the current language version of the "item" /
3946-char* txt ( wxString item ) ;
3947-
3948-/** \brief Returns the current language version of the "item" /
3949-char* txt ( char *item ) ;
3950-*/
3951-/** \brief Returns the current language version of the "item" */
3952-wxString txt ( wxString item ) ;
3953-
3954-/** \brief Returns the current language version of the "item" */
3955-wxString txt ( char *item ) ;
3956-
3957-/** \brief Returns a pointer to the application */
3958-MyApp *myapp () ;
3959-
3960-/** \brief Compares the values of two int pointers */
3961-int cmpint(int *first, int *second) ;
3962-
3963-/** \brief Compares the values of two TRestrictionEnzyme pointers */
3964-int cmpre(TRestrictionEnzyme *first, TRestrictionEnzyme *second) ;
3965-
3966-#endif
3967-// _MAIN_H__
3968
3969=== modified file 'Makefile.am'
3970--- Makefile.am 2013-03-16 14:37:00 +0000
3971+++ Makefile.am 2014-08-05 04:14:21 +0000
3972@@ -63,7 +63,11 @@
3973 bitmaps/scissors.bmp
3974
3975
3976+<<<<<<< TREE
3977 GENtle_LDADD = $(WX_LIBS) -L/usr/lib -L/usr/local/lib -lsqlite3 -lmysqlclient -ltinyxml
3978+=======
3979+GENtle_LDADD = $(WX_LIBS) -L/usr/lib -L/usr/local/lib -lsqlite -lsqlite3 -lmysqlclient
3980+>>>>>>> MERGE-SOURCE
3981 GENtle_LDFLAGS = -s
3982 GENtle_SOURCES = TXMLfile.cpp\
3983 TVectorTree.cpp\
3984@@ -137,6 +141,28 @@
3985 TPhyloTree.cpp\
3986 PCR_Troubleshoot.cpp\
3987 TProteolysis.cpp\
3988+tinyxml/tinyxmlparser.cpp\
3989+tinyxml/tinyxmlerror.cpp\
3990+tinyxml/tinyxml.cpp\
3991+tinyxml/tinystr.cpp\
3992+clustalw/alnscore.cpp\
3993+clustalw/amenu.cpp\
3994+clustalw/calcgap.cpp\
3995+clustalw/calcprf1.cpp\
3996+clustalw/calcprf2.cpp\
3997+clustalw/calctree.cpp\
3998+clustalw/clustalw.cpp\
3999+clustalw/gcgcheck.cpp\
4000+clustalw/interfac.cpp\
4001+clustalw/malign.cpp\
4002+clustalw/palign.cpp\
4003+clustalw/prfalign.cpp\
4004+clustalw/random.cpp\
4005+clustalw/readmat.cpp\
4006+clustalw/sequence.cpp\
4007+clustalw/showpair.cpp\
4008+clustalw/trees.cpp\
4009+clustalw/util.cpp\
4010 ipc/element.cpp\
4011 ipc/gp_out.cpp\
4012 ipc/ipc.cpp\
4013@@ -213,6 +239,14 @@
4014 TPhyloTree.h\
4015 TEliteLaChromLogDialog.h\
4016 ncoils.h\
4017+tinyxml/tinyxml.h\
4018+tinyxml/tinystr.h\
4019+clustalw/clustalw.h\
4020+clustalw/dayhoff.h \
4021+clustalw/general.h \
4022+clustalw/matrices.h \
4023+clustalw/param.h \
4024+clustalw/xmenu.h\
4025 ipc/element.h\
4026 ipc/global.h\
4027 ipc/gp_out.h\
4028
4029=== modified file 'MyFrame.cpp'
4030--- MyFrame.cpp 2014-06-25 13:55:53 +0000
4031+++ MyFrame.cpp 2014-08-05 04:14:21 +0000
4032@@ -586,7 +586,7 @@
4033 {
4034 wxHtmlHelpController *hc = new wxHtmlHelpController ( wxHF_DEFAULT_STYLE|wxHF_OPEN_FILES ) ;
4035 helpfile += myapp()->homedir ;
4036- helpfile += _T("/help/") ;
4037+ helpfile += _T("\\help\\") ;
4038 helpfile += lang_string ;
4039 helpfile += _T(".hhp") ;
4040 hc->AddBook ( helpfile ) ;
4041
4042=== modified file 'TXMLfile.cpp'
4043--- TXMLfile.cpp 2014-06-25 13:55:53 +0000
4044+++ TXMLfile.cpp 2014-08-05 04:14:21 +0000
4045@@ -50,7 +50,7 @@
4046 analyze ( doc ) ;
4047 }
4048
4049-void TXMLfile::analyze ( TiXmlDocument &doc )
4050+void TXMLfile::analyze ( const TiXmlDocument &doc )
4051 {
4052 if ( doc.FirstChild ( "GBSeq" ) )
4053 {
4054
4055=== modified file 'TXMLfile.h'
4056--- TXMLfile.h 2010-06-15 16:38:33 +0000
4057+++ TXMLfile.h 2014-08-05 04:14:21 +0000
4058@@ -25,7 +25,7 @@
4059 TVector *getVector ( int a ) ; ///< Returns pointer to one of the vectors
4060
4061 private :
4062- void analyze ( TiXmlDocument &doc ) ; ///< Parse single/multiple sequences
4063+ void analyze ( const TiXmlDocument &doc ) ; ///< Parse single/multiple sequences
4064 void readGBSeq ( TiXmlNode *base ) ; ///< The actual parser
4065 wxString t ( TiXmlText *txt ) ; ///< Safe text conversion
4066 wxString t ( const char *txt ) ; ///< Safe text conversion
4067
4068=== modified file 'main.h'
4069--- main.h 2010-06-15 16:38:33 +0000
4070+++ main.h 2014-08-05 04:14:21 +0000
4071@@ -129,11 +129,7 @@
4072
4073 // Don't you *EVER* turn this on again!!!!
4074 //#define TIXML_USE_STL
4075-#ifndef __DEBIAN__
4076 #include "tinyxml/tinyxml.h"
4077-#else
4078-#include "tinyxml.h"
4079-#endif
4080
4081 #include <wx/wx.h>
4082 #include <wx/toolbar.h>

Subscribers

People subscribed via source and target branches

to all changes: