auth_form.hpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:4k
- /*
- * ===========================================================================
- * PRODUCTION $Log: auth_form.hpp,v $
- * PRODUCTION Revision 1000.0 2003/10/31 21:59:31 gouriano
- * PRODUCTION PRODUCTION: IMPORTED [ORIGINAL] Dev-tree R1.2
- * PRODUCTION
- * ===========================================================================
- */
- #ifndef GUI_CORE_VIEW_TEXT___AUTH_FORM__HPP
- #define GUI_CORE_VIEW_TEXT___AUTH_FORM__HPP
- /*
- * ===========================================================================
- *
- * PUBLIC DOMAIN NOTICE
- * National Center for Biotechnology Information
- *
- * This software/database is a "United States Government Work" under the
- * terms of the United States Copyright Act. It was written as part of
- * the author's official duties as a United States Government employee and
- * thus cannot be copyrighted. This software/database is freely available
- * to the public for use. The National Library of Medicine and the U.S.
- * Government have not placed any restriction on its use or reproduction.
- *
- * Although all reasonable efforts have been taken to ensure the accuracy
- * and reliability of the software and data, the NLM and the U.S.
- * Government do not and cannot warrant the performance or results that
- * may be obtained by using this software or data. The NLM and the U.S.
- * Government disclaim all warranties, express or implied, including
- * warranties of performance, merchantability or fitness for any particular
- * purpose.
- *
- * Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- * Authors: Lou Friedman
- *
- * File Description:
- * Header for a author name entry form table (CAuthEntryFormTable).
- *
- */
- #include <gui/dialogs/entry_form/table.hpp>
- #include <FL/Fl_Group.H>
- #include <FL/Fl_Button.H>
- #include <FL/Fl_Input.H>
- BEGIN_NCBI_SCOPE
- class CAuthEntryFormTable : public CEntryFormTable
- {
- public:
- enum eColumns {
- eTitleCol,
- eFirstNameCol,
- eMiddleNameCol,
- eLastNameCol,
- eDeleteButtonCol
- };
- CAuthEntryFormTable(int w, int space) :
- CEntryFormTable (w, space), m_AddButton(0){}
- ~CAuthEntryFormTable () {}
- // Add a colum row, returns row number.
- Fl_Group* AddAuthRow ();
-
- // Set Name functions
- void FirstName (Fl_Group* row, const char* name) {
- x_Name (row, name, eFirstNameCol);
- }
- void MiddleName (Fl_Group* row, const char* name)
- {x_Name (row, name, eMiddleNameCol);}
- void LastName (Fl_Group* row, const char* name)
- {x_Name (row, name, eLastNameCol);}
- // Get Name Functions
- const char* FirstName (Fl_Group* row)
- {return x_Name (row, eFirstNameCol);}
- const char* MiddleName (Fl_Group* row)
- {return x_Name (row, eMiddleNameCol);}
- const char* LastName (Fl_Group* row)
- {return x_Name (row, eLastNameCol);}
-
- // The "Add" button
- void AddButtonRow ();
- private:
- Fl_Group* m_AddButton;
- // internal ADD button callback
- static void cb_AddNewRow (Fl_Widget* w, void* u) {
- ((CAuthEntryFormTable*)u)->x_AddNewAuthRow();
- }
- // internal DELETE button callback
- static void cb_DeleteRow (Fl_Widget*, void*);
- // internal functions
- // Set a name for a row and column
- void x_Name(Fl_Group* row, const char* name, eColumns col) {
- Fl_Input* input = (Fl_Input*) (row->child(col));
- input->value(name);
- }
- // Get a name for a row and column
- const char* x_Name(Fl_Group* row, eColumns col) {
- Fl_Input* input = (Fl_Input*) (row->child(col));
- return input->value();
- }
- void x_DeleteRow(Fl_Group *row);
- void x_AddNewAuthRow();
- };
- END_NCBI_SCOPE
- #endif