numericcontrol.cpp.svn-base
来自「这是和p2p相关的一份源码」· SVN-BASE 代码 · 共 44 行
SVN-BASE
44 行
/* * numericcontrol.cpp * PeerCast * * Created by mode7 on Mon Apr 05 2004. * Copyright (c) 2002-2004 peercast.org. All rights reserved. * */#include "numericcontrol.h"void NumericControl::setIntValue( WindowRef window, const int value ){ CFStringRef controlText = CFStringCreateWithFormat( NULL, NULL, CFSTR("%d"), value ); setText( window, controlText ); CFRelease( controlText );}void NumericControl::setFloatValue( WindowRef window, const float value ){ CFStringRef controlText = CFStringCreateWithFormat( NULL, NULL, CFSTR("%f"), value ); setText( window, controlText ); CFRelease( controlText );}int NumericControl::getIntValue( WindowRef window ){ return static_cast<int>( getFloatValue( window ) );}float NumericControl::getFloatValue( WindowRef window ){ CFStringRef stringRef = getStringRef( window ); if( stringRef ) { mValue = CFStringGetDoubleValue( stringRef ); return mValue; } return 0.0f;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?