auth_form.hpp

来自「ncbi源码」· HPP 代码 · 共 122 行

HPP
122
字号
/* * =========================================================================== * 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_SCOPEclass 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

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?