Flu_Combo_List.cpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:3k
- /*
- * ===========================================================================
- * PRODUCTION $Log: Flu_Combo_List.cpp,v $
- * PRODUCTION Revision 1000.1 2004/06/01 21:05:40 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.2
- * PRODUCTION
- * ===========================================================================
- */
- /*
- * These files were imported into NCBI's CVS directly from FLU version 2.9.1.
- * Modifications to the source are listed below.
- *
- * ==========================================================================
- * $Log: Flu_Combo_List.cpp,v $
- * Revision 1000.1 2004/06/01 21:05:40 gouriano
- * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.2
- *
- * Revision 1.2 2004/05/21 22:27:51 gorelenk
- * Added PCH ncbi_pch.hpp
- *
- * Revision 1.1 2004/03/11 13:51:39 dicuccio
- * Imported FLU version 2.9.1. Altered export specifiers to match NCBI layout.
- * Altered include paths to match NCBI toolkit layout.
- *
- * ==========================================================================
- */
- // $Id: Flu_Combo_List.cpp,v 1000.1 2004/06/01 21:05:40 gouriano Exp $
- /***************************************************************
- * FLU - FLTK Utility Widgets
- * Copyright (C) 2002 Ohio Supercomputer Center, Ohio State University
- *
- * This file and its content is protected by a software license.
- * You should have received a copy of this license with this file.
- * If not, please contact the Ohio Supercomputer Center immediately:
- * Attn: Jason Bryan Re: FLU 1224 Kinnear Rd, Columbus, Ohio 43212
- *
- ***************************************************************/
- #include <ncbi_pch.hpp>
- #include <stdio.h>
- #include <FL/Fl.H>
- #include <FL/fl_draw.H>
- #include <string.h>
- #include <stdlib.h>
- #include <FL/math.h>
- #include <gui/widgets/FLU/Flu_Combo_List.h>
- Flu_Combo_List :: Flu_Combo_List( int X, int Y, int W, int H, const char* l )
- : Flu_Combo_Box( X, Y, W, H, l ), list(0,0,0,0)
- {
- list.box( FL_FLAT_BOX );
- list.callback( _cb, this );
- set_combo_widget( &list );
- }
- Flu_Combo_List :: ~Flu_Combo_List()
- {
- }
- void Flu_Combo_List :: cb()
- {
- if( list.value() == 0 )
- selected( 0 );
- else
- selected( list.text( list.value() ) );
- }
- bool Flu_Combo_List :: _value( const char *v )
- {
- // see if 'v' is in the list, and if so, make it the current selection
- for( int i = 1; i <= list.size(); i++ )
- {
- if( strcmp( list.text(i), v ) == 0 )
- {
- list.value( i );
- return true;
- }
- }
- return false;
- }
- const char* Flu_Combo_List :: _next()
- {
- int v = list.value();
- if( v < list.size() )
- list.value( v+1 );
- list.middleline( list.value() );
- return list.text(list.value());
- }
- const char* Flu_Combo_List :: _previous()
- {
- int v = list.value();
- if( v > 1 )
- list.value( v-1 );
- list.middleline( list.value() );
- return list.text(list.value());
- }