本文整理汇总了C++中GetMode函数的典型用法代码示例。如果您正苦于以下问题:C++ GetMode函数的具体用法?C++ GetMode怎么用?C++ GetMode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetMode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetRect
void RadioButton::Draw()
{
SDL_Rect Rect = GetRect();
SDL_Rect TexPos = mPositionTex[0];
switch(GetMode())
{
case normal:
mText->setColor(mColor[0].a,mColor[0].b,mColor[0].c);
SDL_RenderCopy(CRender::GetRender()->mRender,ResourceManager::GetManagerResource()->mTexture,&mPositionTex[0],&Rect);
break;
case clicked:
mText->setColor(mColor[0].a,mColor[0].b,mColor[0].c);
SDL_RenderCopy(CRender::GetRender()->mRender,ResourceManager::GetManagerResource()->mTexture,&mPositionTex[1],&Rect);
break;
case hover_normal:
mText->setColor(mColor[1].a,mColor[1].b,mColor[1].c);
SDL_RenderCopy(CRender::GetRender()->mRender,ResourceManager::GetManagerResource()->mTexture,&mPositionTex[2],&Rect);
break;
case hover_clicked:
mText->setColor(mColor[1].a,mColor[1].b,mColor[1].c);
SDL_RenderCopy(CRender::GetRender()->mRender,ResourceManager::GetManagerResource()->mTexture,&mPositionTex[3],&Rect);
break;
}
mText->Draw();
}
开发者ID:tjel,项目名称:infpro-5,代码行数:26,代码来源:RadioButton.cpp
示例2: TRACE
void CDXVADecoderMpeg2::Init()
{
TRACE(_T("CDXVADecoderMpeg2::Init()\n"));
memset (&m_PictureParams, 0, sizeof(m_PictureParams));
memset (&m_SliceInfo, 0, sizeof(m_SliceInfo));
memset (&m_QMatrixData, 0, sizeof(m_QMatrixData));
m_PictureParams.bMacroblockWidthMinus1 = 15; // This is equal to "15" for MPEG-1, MPEG-2, H.263, and MPEG-4
m_PictureParams.bMacroblockHeightMinus1 = 15; // This is equal to "15" for MPEG-1, MPEG-2, H.261, H.263, and MPEG-4
m_PictureParams.bBlockWidthMinus1 = 7; // This is equal to "7" for MPEG-1, MPEG-2, H.261, H.263, and MPEG-4
m_PictureParams.bBlockHeightMinus1 = 7; // This is equal to "7" for MPEG-1, MPEG-2, H.261, H.263, and MPEG-4
m_PictureParams.bBPPminus1 = 7; // It is equal to "7" for MPEG-1, MPEG-2, H.261, and H.263
m_PictureParams.bChromaFormat = 0x01; // For MPEG-1, MPEG-2 "Main Profile," H.261 and H.263 bitstreams, this value shall always be set to "01", indicating "4:2:0" format
m_nMaxWaiting = 5;
m_wRefPictureIndex[0] = NO_REF_FRAME;
m_wRefPictureIndex[1] = NO_REF_FRAME;
m_nSliceCount = 0;
switch (GetMode()) {
case MPEG2_VLD :
AllocExecuteParams (4);
break;
default :
ASSERT(FALSE);
}
m_pMPEG2Buffer = NULL;
m_nMPEG2BufferSize = 0;
NewSegment();
}
开发者ID:chinajeffery,项目名称:MPC-BE--1.2.3,代码行数:35,代码来源:DXVADecoderMpeg2.cpp
示例3: CloseCaption_SeparatePhrases
void PhonemeEditor::CloseCaption_SeparatePhrases( void )
{
if ( GetMode() != MODE_CLOSECAPTION )
return;
// Three pixels
double time_epsilon = ( 1.0f / GetPixelsPerSecond() ) * 6;
for ( int i = 0; i < m_Tags.GetCloseCaptionPhraseCount( CC_ENGLISH )- 1; i++ )
{
CCloseCaptionPhrase *current = m_Tags.GetCloseCaptionPhrase( CC_ENGLISH, i );
CCloseCaptionPhrase *next = m_Tags.GetCloseCaptionPhrase( CC_ENGLISH, i + 1 );
if ( !current->GetSelected() || !next->GetSelected() )
continue;
// Close enough?
if ( fabs( current->GetEndTime() - next->GetStartTime() ) > time_epsilon )
{
Con_Printf( "Can't split %s and %s, already split apart\n",
current->GetStream(), next->GetStream() );
continue;
}
// Offset next phrase start time a bit
next->SetStartTime( next->GetStartTime() + time_epsilon );
break;
}
redraw();
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:32,代码来源:PhonemeEditor_CloseCaption.cpp
示例4: OnEditCEMExaminationListReport
int CEMExaminationListReport::OnEditCEMExaminationListReport(){
if(GetMode() != VM_VIEW)
return -1;
CHMSMainFrame *pMF = (CHMSMainFrame *) AfxGetMainWnd();
SetMode(VM_EDIT);
return 0;
}
开发者ID:smithgold53,项目名称:HMSReportForms,代码行数:7,代码来源:EMExaminationListReport.cpp
示例5: OnEditRptDanhsachBNVaoVien
int CRptDanhsachBNVaoVien::OnEditRptDanhsachBNVaoVien(){
if(GetMode() != VM_VIEW)
return -1;
CHMSMainFrame *pMF = (CHMSMainFrame *) AfxGetMainWnd();
SetMode(VM_EDIT);
return 0;
}
开发者ID:smithgold53,项目名称:HMSReportForms,代码行数:7,代码来源:EMDanhsachBNVaoVien.cpp
示例6: clock_update
void GW_Game_DKong::clock_update(int mode)
{
if (mode==-1) mode=GetMode();
// display clock
data().position_get(PS_NUMBER, 1)->show();
data().position_get(PS_NUMBER, 2)->show();
data().position_get(PS_NUMBER, 3)->show();
data().position_get(PS_NUMBER, 4)->show();
GW_Platform_Time time=platform_get()->time_get();
//GW_Device::devtime_t time;
//device_get()->GetTime(&time);
data().position_get(PS_SEMICOLON)->visible_set(time.s % 2 == 0);
if (mode==MODE_TIME)
{
// show current time
data().position_get(PS_AM)->visible_set(time.h<12);
data().position_get(PS_PM)->visible_set(time.h>=12);
setnumber((time.h>12?time.h-12:time.h), 1, 2, false);
setnumber(time.n, 3, 4);
} else if (mode==MODE_ALARM) {
// show 12:00 AM
data().position_get(PS_AM)->show();
setnumber(12, 1, 2);
setnumber(0, 3, 4);
}
}
开发者ID:biappi,项目名称:GameAndWatch,代码行数:32,代码来源:dev_dkong.cpp
示例7: CloseCaption_ExtendSelectedPhraseEndTime
void PhonemeEditor::CloseCaption_ExtendSelectedPhraseEndTime( int direction )
{
if ( GetMode() != MODE_CLOSECAPTION )
return;
CountSelected();
if ( m_nSelectedPhraseCount != 1 )
return;
RECT rc;
GetWorkspaceRect( rc );
// Determine start/stop positions
int totalsamples = (int)( m_pWaveFile->GetRunningLength() * m_pWaveFile->SampleRate() );
float starttime = m_nLeftOffset / GetPixelsPerSecond();
float endtime = w2() / GetPixelsPerSecond() + starttime;
float timeperpixel = ( endtime - starttime ) / (float)( rc.right - rc.left );
float movetime = timeperpixel * (float)direction;
SetDirty( true );
PushUndo();
TraversePhrases( ITER_ExtendSelectedPhraseEndTimes, movetime );
PushRedo();
redraw();
Con_Printf( "Extend phrase end %s\n", direction == -1 ? "left" : "right" );
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:35,代码来源:PhonemeEditor_CloseCaption.cpp
示例8: GetMode
int CPMSProductSupplyPlan::SetMode(int nMode){
int nOldMode = GetMode();
CGuiView::SetMode(nMode);
CMainFrame_E10 *pMF = (CMainFrame_E10 *) AfxGetMainWnd();
CString szSQL;
CRecord rs(&pMF->m_db);
switch(nMode){
case VM_ADD:
EnableControls(TRUE);
EnableButtons(TRUE, 3, 4, -1);
SetDefaultValues();
break;
case VM_EDIT:
EnableControls(TRUE);
EnableButtons(TRUE, 3, 4, -1);
break;
case VM_VIEW:
EnableControls(FALSE);
EnableButtons(FALSE, 3, 4, -1);
break;
case VM_NONE:
EnableControls(FALSE);
EnableButtons(TRUE, 0, 6, -1);
SetDefaultValues();
break;
};
UpdateData(FALSE);
return nOldMode;
}
开发者ID:smithgold53,项目名称:HMSReportForms,代码行数:29,代码来源:PMSProductSupplyPlan.cpp
示例9: CloseCaption_EditDelete
void PhonemeEditor::CloseCaption_EditDelete( void )
{
if ( GetMode() != MODE_CLOSECAPTION )
return;
CountSelected();
if ( m_nSelectedPhraseCount < 1 )
return;
SetDirty( true );
PushUndo();
for ( int i = m_Tags.GetCloseCaptionPhraseCount( CC_ENGLISH )- 1; i >= 0; i-- )
{
CCloseCaptionPhrase *phrase = m_Tags.GetCloseCaptionPhrase( CC_ENGLISH, i );
if ( !phrase || !phrase->GetSelected() )
continue;
m_Tags.RemoveCloseCaptionPhrase( CC_ENGLISH, i );
}
PushRedo();
redraw();
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:27,代码来源:PhonemeEditor_CloseCaption.cpp
示例10: GetMode
int
GTerm::TranslateKeyCode(int keyCode, int *len, char *data, int shift,
int ctrl, int alt)
{
int
mode = GetMode();
#ifdef GTERM_PC
unsigned short
pcKeySeq;
#endif // GTERM_PC
VTKeySeq
*keySeq;
//printf("keycode = %d, shift = %d, ctrl = %d, alt = %d\n", keyCode, shift, ctrl, alt);
//printf("GTerm::TranslateKeyCode(): mode = %x\n", mode);
#ifdef GTERM_PC
if(mode & PC)
{
pcKeySeq = translate_pc_keycode(keyCode, shift, ctrl, alt);
if(pcKeySeq)
{
//printf("keySeq = %x\n", pcKeySeq);
*(unsigned char *)data++ = pcKeySeq >> 8;
*(unsigned char *)data = pcKeySeq & 0xff;
*len = 2;
return 1;
}
return 0;
}
开发者ID:feeeermendoza,项目名称:Graphbot,代码行数:31,代码来源:keytrans.cpp
示例11: NS_ASSERTION
already_AddRefed<IDBObjectStore>
IDBTransaction::GetOrCreateObjectStore(const nsAString& aName,
ObjectStoreInfo* aObjectStoreInfo,
bool aCreating)
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
NS_ASSERTION(aObjectStoreInfo, "Null pointer!");
NS_ASSERTION(!aCreating || GetMode() == IDBTransaction::VERSION_CHANGE,
"How else can we create here?!");
nsRefPtr<IDBObjectStore> retval;
for (PRUint32 index = 0; index < mCreatedObjectStores.Length(); index++) {
nsRefPtr<IDBObjectStore>& objectStore = mCreatedObjectStores[index];
if (objectStore->Name() == aName) {
retval = objectStore;
return retval.forget();
}
}
retval = IDBObjectStore::Create(this, aObjectStoreInfo, mDatabaseInfo->id,
aCreating);
mCreatedObjectStores.AppendElement(retval);
return retval.forget();
}
开发者ID:catlee,项目名称:mozilla-central,代码行数:27,代码来源:IDBTransaction.cpp
示例12: GetMode
int CFMFoodSummaryByLevel::SetMode(int nMode){
int nOldMode = GetMode();
CGuiView::SetMode(nMode);
CHMSMainFrame *pMF = (CHMSMainFrame *) AfxGetMainWnd();
CString szSQL;
CRecord rs(&pMF->m_db);
switch(nMode){
case VM_ADD:
EnableControls(TRUE);
EnableButtons(TRUE, 3, 4, -1);
SetDefaultValues();
break;
case VM_EDIT:
EnableControls(TRUE);
EnableButtons(TRUE, 3, 4, -1);
break;
case VM_VIEW:
EnableControls(FALSE);
EnableButtons(FALSE, 3, 4, -1);
break;
case VM_NONE:
EnableControls(FALSE);
EnableButtons(TRUE, 0, 6, -1);
SetDefaultValues();
break;
};
UpdateData(FALSE);
return nOldMode;
}
开发者ID:smithgold53,项目名称:HMSReportForms,代码行数:29,代码来源:FMFoodSummaryByLevel.cpp
示例13: OnEditFMDischargedPaidPatientListByDay
int CFMDischargedPaidPatientListByDay::OnEditFMDischargedPaidPatientListByDay(){
if(GetMode() != VM_VIEW)
return -1;
CHMSMainFrame *pMF = (CHMSMainFrame *) AfxGetMainWnd();
SetMode(VM_EDIT);
return 0;
}
开发者ID:smithgold53,项目名称:HMSReportForms,代码行数:7,代码来源:FMDischargedPaidPatientListByDay.cpp
示例14: OnEditEMStatisticsGeneralPatientReport
int CEMTestnParaRatebyRoom::OnEditEMStatisticsGeneralPatientReport(){
if(GetMode() != VM_VIEW)
return -1;
CHMSMainFrame *pMF = (CHMSMainFrame *) AfxGetMainWnd();
SetMode(VM_EDIT);
return 0;
}
开发者ID:smithgold53,项目名称:HMSReportForms,代码行数:7,代码来源:EMTestnParaRatebyRoom.cpp
示例15: GetMode
bool EmuTCPConnection::SendPacket(ServerPacket* pack, uint32 iDestination) {
if (!Connected())
return false;
eTCPMode tmp = GetMode();
if (tmp != modePacket && tmp != modeTransition)
return false;
LockMutex lock(&MState);
if (RemoteID)
return RelayLink->SendPacket(pack, RemoteID);
else if (pOldFormat) {
#if TCPN_LOG_PACKETS >= 1
if (pack && pack->opcode != 0) {
struct in_addr in;
in.s_addr = GetrIP();
CoutTimestamp(true);
std::cout << ": Logging outgoing TCP OldPacket. OPCode: 0x" << hex << setw(4) << setfill('0') << pack->opcode << dec << ", size: " << setw(5) << setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
#if TCPN_LOG_PACKETS == 2
if (pack->size >= 32)
DumpPacket(pack->pBuffer, 32);
else
DumpPacket(pack);
#endif
#if TCPN_LOG_PACKETS >= 3
DumpPacket(pack);
#endif
}
#endif
SPackSendQueue* spsq = MakeOldPacket(pack);
ServerSendQueuePushEnd(spsq->buffer, spsq->size);
safe_delete_array(spsq);
}
else {
EmuTCPNetPacket_Struct* tnps = MakePacket(pack, iDestination);
if (tmp == modeTransition) {
InModeQueuePush(tnps);
}
else {
#if TCPN_LOG_PACKETS >= 1
if (pack && pack->opcode != 0) {
struct in_addr in;
in.s_addr = GetrIP();
CoutTimestamp(true);
std::cout << ": Logging outgoing TCP packet. OPCode: 0x" << hex << setw(4) << setfill('0') << pack->opcode << dec << ", size: " << setw(5) << setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
#if TCPN_LOG_PACKETS == 2
if (pack->size >= 32)
DumpPacket(pack->pBuffer, 32);
else
DumpPacket(pack);
#endif
#if TCPN_LOG_PACKETS >= 3
DumpPacket(pack);
#endif
}
#endif
ServerSendQueuePushEnd((uchar**) &tnps, tnps->size);
}
}
return true;
}
开发者ID:Derision,项目名称:Server,代码行数:59,代码来源:EmuTCPConnection.cpp
示例16: if
string PlexRemoteHelper::GetConfigString()
{
// Build a new config string.
std::string strConfig;
if (GetMode() == APPLE_REMOTE_UNIVERSAL)
strConfig = "--universal ";
else if (GetMode() == APPLE_REMOTE_MULTICODE)
strConfig = "--multicode ";
// Delay.
char strDelay[64];
sprintf(strDelay, "--timeout %d ", m_sequenceDelay);
strConfig += strDelay;
// Secure input.
char strSecure[64];
sprintf(strSecure, "--secureInput %d ", m_secureInput ? 1 : 0);
strConfig += strSecure;
// Find out where we're running from.
char given_path[2*MAXPATHLEN];
uint32_t path_size = 2*MAXPATHLEN;
int result = _NSGetExecutablePath(given_path, &path_size);
if (result == 0)
{
char real_path[2*MAXPATHLEN];
if (realpath(given_path, real_path) != NULL)
{
// Move backwards out to the application.
for (int x=0; x<4; x++)
{
for (int n=strlen(real_path)-1; real_path[n] != '/'; n--)
real_path[n] = '\0';
real_path[strlen(real_path)-1] = '\0';
}
}
strConfig += "--appLocation \"";
strConfig += real_path;
strConfig += "\"";
}
return strConfig + "\n";
}
开发者ID:aaronjb,项目名称:plex,代码行数:46,代码来源:PlexRemoteHelper.cpp
示例17: TestMode
void TestMode(char *str) {
if (GetMode() == 0) {
debug(GREY, "%s: User Mode", str);
} else {
debug(GREY, "%s: Kernel Mode", str);
}
}
开发者ID:zhshr,项目名称:CS502,代码行数:8,代码来源:Utils.c
示例18: NS_LOG_FUNCTION
uint32_t
RedQueue::GetQueueSize (void)
{
NS_LOG_FUNCTION (this);
if (GetMode () == QUEUE_MODE_BYTES)
{
return m_bytesInQueue;
}
else if (GetMode () == QUEUE_MODE_PACKETS)
{
return m_packets.size ();
}
else
{
NS_ABORT_MSG ("Unknown RED mode.");
}
}
开发者ID:shuiziliuBUPT,项目名称:HelloWorld,代码行数:17,代码来源:red-queue.cpp
示例19: switch
void CCredits::AddCredits()
{
// Sanity checks...
if (!g_pLTClient) return;
// Get the credits text buffer...
char* sName = NULL;
switch (GetMode())
{
case CM_INTRO: sName = "INTRO"; break;
case CM_CREDITS: sName = "CREDITS"; break;
case CM_DEMO_INFO: sName = "DEMOINFO"; break;
case CM_DEMO_INTRO: sName = "DEMOINTRO"; break;
case CM_DEMO_MULTI: sName = "DEMOMULTI"; break;
default: sName = "CREDITS";
}
char* sBuf = GetTextBuffer(sName);
if (!sBuf) return;
// Parse the credits text...
char sCredit[1024];
int i = 0;
while (*sBuf)
{
if (*sBuf == '#' && *(sBuf+1) == '#')
{
sCredit[i] = '\0';
if (strncmp(sCredit, ">END", 4) == 0) // end?
{
return;
}
AddCredit(sCredit);
i = 0;
sBuf+=2;
while (*sBuf != '\0' && ((*sBuf == '\n') || (*sBuf == '\r'))) sBuf++;
}
else
{
memcpy(&sCredit[i], sBuf, 1);
i++;
sBuf++;
}
}
}
开发者ID:rickyharis39,项目名称:nolf2,代码行数:58,代码来源:Credits.cpp
示例20: CloseCaption_SelectNextPhrase
void PhonemeEditor::CloseCaption_SelectNextPhrase( int direction )
{
if ( GetMode() != MODE_CLOSECAPTION )
return;
CountSelected();
if ( m_nSelectedPhraseCount != 1 )
{
// Selected first phrase then
if ( m_nSelectedPhraseCount == 0 && m_Tags.GetCloseCaptionPhraseCount( CC_ENGLISH )> 0 )
{
CCloseCaptionPhrase *phrase = m_Tags.GetCloseCaptionPhrase( CC_ENGLISH, direction ? m_Tags.GetCloseCaptionPhraseCount( CC_ENGLISH )- 1 : 0 );
phrase->SetSelected( true );
m_nSelectedPhraseCount = 1;
}
else
{
return;
}
}
Con_Printf( "Move to next phrase %s\n", direction == -1 ? "left" : "right" );
for ( int i = 0; i < m_Tags.GetCloseCaptionPhraseCount( CC_ENGLISH ); i++ )
{
CCloseCaptionPhrase *phrase = m_Tags.GetCloseCaptionPhrase( CC_ENGLISH, i );
if ( !phrase )
continue;
if ( m_nSelectedPhraseCount == 1 )
{
if ( !phrase->GetSelected() )
continue;
}
// Deselect phrase
phrase->SetSelected( false );
// Deselect this one and move
int nextphrase = i + direction;
if ( nextphrase < 0 )
{
nextphrase = m_Tags.GetCloseCaptionPhraseCount( CC_ENGLISH )- 1;
}
else if ( nextphrase >= m_Tags.GetCloseCaptionPhraseCount( CC_ENGLISH ))
{
nextphrase = 0;
}
phrase = m_Tags.GetCloseCaptionPhrase( CC_ENGLISH, nextphrase );
phrase->SetSelected( true );
redraw();
return;
}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:57,代码来源:PhonemeEditor_CloseCaption.cpp
注:本文中的GetMode函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论