multi_col_dlg.cpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:5k
- /*
- * ===========================================================================
- * PRODUCTION $Log: multi_col_dlg.cpp,v $
- * PRODUCTION Revision 1000.2 2004/06/01 20:45:12 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.6
- * PRODUCTION
- * ===========================================================================
- */
- /* $Id: multi_col_dlg.cpp,v 1000.2 2004/06/01 20:45:12 gouriano Exp $
- * ===========================================================================
- *
- * 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: Mike DiCuccio
- *
- * File Description:
- *
- */
- #include <ncbi_pch.hpp>
- #include <gui/dialogs/col/multi_col_dlg.hpp>
- #include "multi_col_table.hpp"
- BEGIN_NCBI_SCOPE
- #include "multi_col_dlg_.cpp"
- CMultiColDlg::CMultiColDlg()
- {
- m_Window.reset(x_CreateWindow());
- }
- void CMultiColDlg::Show()
- {
- m_Table->redraw();
- CDialog::Show();
- }
- void CMultiColDlg::SetWindowSize(int w, int h)
- {
- m_Window->size(w, h);
- }
- void CMultiColDlg::SetTableSize(size_t rows, size_t cols)
- {
- m_Table->SetSize(rows, cols);
- }
- void CMultiColDlg::SetTitle(const string& str)
- {
- m_TitleStr = str;
- m_Window->label(m_TitleStr.c_str());
- }
- void CMultiColDlg::SetLabel(const string& str)
- {
- m_LabelStr = str;
- m_LabelGroup->label(m_LabelStr.c_str());
- // get current font state
- int current_font = fl_font();
- int current_size = fl_size();
- // change state, measure and set widget size
- int label_w = 0;
- int label_h = 0;
- fl_font(m_LabelGroup->labelfont(), m_LabelGroup->labelsize());
- fl_measure(m_LabelGroup->label(), label_w, label_h);
- label_h += 10;
- label_h = max(label_h, 50);
- m_LabelGroup->size(m_LabelGroup->w(), label_h);
- // return to original state
- fl_font(current_font, current_size);
- }
- void CMultiColDlg::SetColumn(size_t col, const string& header,
- Fl_Align align, float rel_width)
- {
- m_Table->SetColumn(col, header, CTablePanel<int>::eString,
- align, rel_width);
- }
- void CMultiColDlg::SetColumnHeader(size_t col, const string& str)
- {
- m_Table->SetColHeader(col, str);
- }
- void CMultiColDlg::SetColumnAlign(size_t col, Fl_Align align)
- {
- m_Table->SetColAlign(col, align);
- }
- void CMultiColDlg::SetColumnWidth(size_t col, float wid)
- {
- m_Table->SetRelWidth(col, wid);
- }
- void CMultiColDlg::SetCols(size_t i)
- {
- m_Table->SetCols(i);
- }
- void CMultiColDlg::SetRows(size_t i)
- {
- m_Table->SetRows(i);
- }
- string& CMultiColDlg::SetCell(size_t row, size_t col)
- {
- return m_Table->SetCell(row, col);
- }
- void CMultiColDlg::SetCell(size_t row, size_t col, const string& str)
- {
- m_Table->SetCell(row, col, str);
- }
- const string& CMultiColDlg::GetCell(size_t row, size_t col) const
- {
- return m_Table->GetCell(row, col);
- }
- size_t CMultiColDlg::GetRows() const
- {
- return m_Table->GetRows();
- }
- size_t CMultiColDlg::GetCols() const
- {
- return m_Table->GetCols();
- }
- END_NCBI_SCOPE
- /*
- * ===========================================================================
- * $Log: multi_col_dlg.cpp,v $
- * Revision 1000.2 2004/06/01 20:45:12 gouriano
- * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.6
- *
- * Revision 1.6 2004/05/21 22:27:41 gorelenk
- * Added PCH ncbi_pch.hpp
- *
- * Revision 1.5 2004/01/20 18:15:11 dicuccio
- * Changed to match new API in CTablePanel. Enabled demo sub-project
- *
- * Revision 1.4 2003/12/04 18:10:32 dicuccio
- * Changed to match API change in CTablePanel
- *
- * Revision 1.3 2003/09/29 15:30:11 dicuccio
- * Inherit dialog from CDialog
- *
- * Revision 1.2 2003/08/05 17:03:22 dicuccio
- * Changed multicol dialog to not be modal
- *
- * Revision 1.1 2003/07/25 20:03:33 dicuccio
- * Initial revision
- *
- * ===========================================================================
- */