pnlvalue.hpp

来自「gspiceui电子CAD仿真程序.用于电路参数模拟仿真」· HPP 代码 · 共 119 行

HPP
119
字号
//*****************************************************************************//                                 PnlValue.hpp                               *//                                --------------                              *//  Description : This class derives from the wxPanel base class. It provides *//                the functionality for displaying and setting the value of   *//                floating point variables and can optionally allow the       *//                setting and processing of units.                            *//  Started     : 14/09/2004                                                  *//  Last Update : 05/06/2005                                                  *//  Copyright   : (C) 2004 by MSWaters                                        *//  Email       : M.Waters@bom.gov.au                                         *//*****************************************************************************//*****************************************************************************//                                                                            *//    This program is free software; you can redistribute it and/or modify    *//    it under the terms of the GNU General Public License as published by    *//    the Free Software Foundation; either version 2 of the License, or       *//    (at your option) any later version.                                     *//                                                                            *//*****************************************************************************#ifndef PNLVALUE_HPP#define PNLVALUE_HPP// System Includes#include <iostream>// wxWindows Library Includes#include <wx/wx.h>#include <wx/spinbutt.h>// Application Includes#include "SpinCtrl.hpp"#include "ChoUnits.hpp"#include "ConvertType.hpp"// Local Constant Declarations//*****************************************************************************class PnlValue : public wxPanel{  private:    // Display objects    wxStaticText  m_oLblName;    SpinCtrl      m_oSpnValue;    ChoUnits      m_oChoUnits;    wxStaticText  m_oLblUnits;    bool  bTempToDegC( float * pfValue );    bool  bPhaseToDeg( float * pfValue );  public:    PnlValue( void );    ~PnlValue( );    bool  bCreate( wxWindow * poWin, wxWindowID oWinID, int iWidth=-1,                   const wxPoint & roPosn=wxDefaultPosition );    bool  bIsCreated( void ) { return( GetParent( )!=NULL ? TRUE : FALSE ); }    bool  bClear( void );    bool  bSetName( const wxString & rosName );    bool  bSetVType( SpinCtrl::eVarType eVType );    bool  bSetRange( float fMinV, float fMaxV );    bool  bSetIncSz( float fMinIncSz, float fMaxIncSz=-1.0 );    bool  bSetParms( float fInitV, float fMinV, float fMaxV,                     float fMinIncSz=-1.0, float fMaxIncSz=-1.0 );    bool  bSetValue( long liValue );    bool  bSetValue( double dfValue );    bool  bSetValue( const wxString & rosValue );    bool  bSetUType( ChoUnits::eUnitsType eUType );    bool  bSetUnits( const wxString & rosUnits );    bool  bShowChoUnts( bool bEnable );    bool  bIsChoUntsShown( void ) { return( m_oChoUnits.IsShown( ) ); }    const wxString &   rosGetName( void );          long          liGetValue( void );          double        dfGetValue( void );    const wxString &   rosGetValue( void );          int            iGetSpnValue( void );          float          fGetSpnValue( void );    const wxString &   rosGetSpnValue( void );    const wxString &   rosGetUnits( void );    ChoUnits::eUnitsType eGetUType( void );    // Event handlers    void  OnSpnScroll( wxSpinEvent    & roEvtSpn );    void  OnChoUnits ( wxCommandEvent & roEvtCmd );    // In order to be able to react to a menu command, it must be given a    // unique identifier such as a const or an enum.    enum ePnlItemID    {      ID_SPN_VALUE = 0,      ID_CHO_UNITS,      ID_UNUSED,      ID_FST = ID_SPN_VALUE,      ID_LST = ID_CHO_UNITS    };    // Leave this as the last line as private access is envoked by macro    DECLARE_EVENT_TABLE( )};//*****************************************************************************#endif // PNLVALUE_HPP

⌨️ 快捷键说明

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