/***************************************************************************** # Copyright (C) 1994-2008 by David Gordon. # All rights reserved. # # This software is part of a beta-test version of the Consed/Autofinish # package. It should not be redistributed or # used for any commercial purpose, including commercially funded # sequencing, without written permission from the author and the # University of Washington. # # This software is provided ``AS IS'' and any express or implied # warranties, including, but not limited to, the implied warranties of # merchantability and fitness for a particular purpose, are disclaimed. # In no event shall the authors or the University of Washington be # liable for any direct, indirect, incidental, special, exemplary, or # consequential damages (including, but not limited to, procurement of # substitute goods or services; loss of use, data, or profits; or # business interruption) however caused and on any theory of liability, # whether in contract, strict liability, or tort (including negligence # or otherwise) arising in any way out of the use of this software, even # if advised of the possibility of such damage. # # Building Consed from source is error prone and not simple which is # why I provide executables. Due to time limitations I cannot # provide any assistance in building Consed. Even if you do not # modify the source, you may introduce errors due to using a # different version of the compiler, a different version of motif, # different versions of other libraries than I used, etc. For this # reason, if you discover Consed bugs, I can only offer help with # those bugs if you first reproduce those bugs with an executable # provided by me--not an executable you have built. # # Modifying Consed is also difficult. Although Consed is modular, # some modules are used by many other modules. Thus making a change # in one place can have unforeseen effects on many other features. # It may takes months for you to notice these other side-effects # which may not seen connected at all. It is not feasable for me to # provide help with modifying Consed sources because of the # potentially huge amount of time involved. # #*****************************************************************************/ // // guiteditor.h // // Like ContigWin and GuiContigWin, the code for the trace // display and editing dialog box component of consed is // divided into two objects: Teditor and GuiTeditor. // The GuiTeditor object is the Gui (X) specific component // and the Teditor handles as much as possible of the // higher level code for handling user actions, manipulating // the data structures for Contigs, Fragments, etc. // // On one dialog box there are (presently) two trace windows, // each representing one GuiTedWin/TedWin object. Having // split them up this way makes it relatively trivial to // have as many as will fit on the screen. Until such time // as the base calling software provides precise measures of // trace quality, the user will need to 'flip' through all the // fragments aligned to a particular region of the consensus // and visually compare them. having two on the dibox, each // of which can display any of the trace files in the region // of interest, allows the user to arrange two aligned traces // and chose between them. // // gordon 17-April-1995 // #ifndef GUITEDITOR_INCLUDED #define GUITEDITOR_INCLUDED #ifdef SCCS_ID static const char* guiteditorSccsId = "@(#)guiteditor.h 1.53 01/21/99 02:00:51"; #endif #include "rwtptrorderedvector.h" #include #include "infobutton.h" #include "guiapp.h" class Teditor; class TedWin; class GuiTedWin; class ContigWin; class GuiTeditor { public: // unused? GuiTeditor(); GuiTeditor(Teditor* pTeditor, const int nStartWithThisManyTraces, const bool bShowTracesInScrollingWindow ); ~GuiTeditor(); // child GuiTedWin's need widget of form to place themselves on Widget widGuiTedWinFormGet() { return widForm_; } Teditor* pTeditorGet() { return pTeditor_; } // for callbacks // TedWin's are added dynamically, and their ctor tells the // parent GuiTeditor that they exist and causes it to position // the new one on its widGuiTedWinForm_ void addGuiTedWinToTop(GuiTedWin* pGuiTedWin ); void addGuiTedWinToSpecificLocation(GuiTedWin* pGuiTedWin, const int nPosition ); void removeGuiTedWin(GuiTedWin* pGuiTedWin); void removeGuiTedWinByUser( GuiTedWin* pGuiTedWin ); int nNumberOfGuiTedWins(); GuiTedWin* pGetGuiTedWin( const int nTedWinIndex ); Widget widGetGuiTeditorShell() { return widShell_; } void moveDownExistingTraces( const int nAmountToMoveDown ); void fixArrangementOfGuiTedWins(); void enlargeTeditor( const int nHowManyMoreTedWins ); void repartitionTraceWindow( const int nHowManyMoreTraces ); void raiseTracesWindow(); void createScrollingWindowForTraces(); void resizeScrollingTraces(); void prepareToDie(); void scrollScrollingWindow( const int nReadIndex, const int nNumberOfReadsDisplayed ); void displayStatusMessage( const RWCString& soMessage ); void userPushedShowSomeAllTracesButton(); void setShowAllTracesJustShowGoodTracesButton(); void setVerticalScrollBarIncrement( const int nNumberOfTraces ); private: /* //////////////////////////////////////////////////////////////////// */ /* // */ /* // these private member data are used to position within */ /* // the base numbers widget */ /* // */ /* //////////////////////////////////////////////////////////////////// */ /* inline int nScaleNumbersBaseline() const { */ /* return( nPixelMarginAboveConsensusScaleNumbers + */ /* GuiApp::pGetGuiApp()->nGetFontAscent() ); */ /* } */ /* inline int nScaleLinePixelY() const { */ /* return (int) (nScaleNumbersBaseline() + nPixelMarginBelowConsensusScaleNumbers ); */ /* } */ /* inline int nScaleMarksHeight() const { */ /* return (int) (.5 * GuiApp::pGetGuiApp()->nGetFontHeight() ); */ /* } */ /* inline int nGetScaleWidgetHeight() { */ /* return (nScaleLinePixelY() + */ /* nScaleMarksHeight() + */ /* nPixelMarginBelowScaleMarks ); */ /* } */ /* inline int nGetConsensusBasesWindowHeight() { */ /* int nHeight = GuiApp::pGetGuiApp()->nGetFontHeight() + */ /* nPixelMarginBelowConsensusBases + nPixelMarginAboveConsensusBases; */ /* return( nHeight ); */ /* } */ public: Widget widShell_; // the application shell widget Widget widMainWin_; // main window Widget widForm_; // form containing the GuiTedWins Teditor* pTeditor_; // pointer to companion Teditor object // you can pick up the ContigWin pointer from Teditor // not inlined to avoid circular include ContigWin* pContigWinGet(); Widget widHelpInsertButton_; Widget widHelpDeleteButton_; Widget widDismissTop_; Widget widDismissBottom_; Widget widPrev_; Widget widNext_; Widget widPrevTraces_; Widget widNextTraces_; Widget widShowAllSomeTracesButton_; Widget widStatusText_; bool bShowTracesInScrollingWindow_; // the following are only used if there is a // scrolling window with all the traces in it Widget widScrolledWindow_; Widget widRowCol_; Widget widConsensusScale_; Widget widConsensus_; Widget widHorizontalScrollBar_; Widget widClipWindow_; Dimension dimClipWindowWidth_; }; // class GuiTeditor #endif // GUITEDITOR_INCLUDED