本文整理汇总了C++中GetMode函数的典型用法代码示例。如果您正苦于以下问题:C++ GetMode函数的具体用法?C++ GetMode怎么用?C++ GetMode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetMode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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();
}
示例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();
}
示例4: OnEditCEMExaminationListReport
int CEMExaminationListReport::OnEditCEMExaminationListReport(){
if(GetMode() != VM_VIEW)
return -1;
CHMSMainFrame *pMF = (CHMSMainFrame *) AfxGetMainWnd();
SetMode(VM_EDIT);
return 0;
}
示例5: OnEditRptDanhsachBNVaoVien
int CRptDanhsachBNVaoVien::OnEditRptDanhsachBNVaoVien(){
if(GetMode() != VM_VIEW)
return -1;
CHMSMainFrame *pMF = (CHMSMainFrame *) AfxGetMainWnd();
SetMode(VM_EDIT);
return 0;
}
示例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);
}
}
示例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" );
}
示例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;
}
示例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();
}
示例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;
}
示例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();
}
示例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;
}
示例13: OnEditFMDischargedPaidPatientListByDay
int CFMDischargedPaidPatientListByDay::OnEditFMDischargedPaidPatientListByDay(){
if(GetMode() != VM_VIEW)
return -1;
CHMSMainFrame *pMF = (CHMSMainFrame *) AfxGetMainWnd();
SetMode(VM_EDIT);
return 0;
}
示例14: OnEditEMStatisticsGeneralPatientReport
int CEMTestnParaRatebyRoom::OnEditEMStatisticsGeneralPatientReport(){
if(GetMode() != VM_VIEW)
return -1;
CHMSMainFrame *pMF = (CHMSMainFrame *) AfxGetMainWnd();
SetMode(VM_EDIT);
return 0;
}
示例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;
}